2016-01-30 07:48:16 -05:00
/ * !
2017-10-08 11:54:18 -04:00
* Paper . js v0 . 11.5 - develop - The Swiss Army Knife of Vector Graphics Scripting .
2016-01-30 07:48:16 -05:00
* http : //paperjs.org/
*
* Copyright ( c ) 2011 - 2016 , Juerg Lehni & Jonathan Puckey
* http : //scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license . See LICENSE file for details .
*
* All rights reserved .
*
2018-10-03 10:52:34 -04:00
* Date : Wed Oct 3 16 : 45 : 38 2018 + 0200
2016-01-30 07:48:16 -05:00
*
* * *
*
* Straps . js - Class inheritance library with support for bean - style accessors
*
* Copyright ( c ) 2006 - 2016 Juerg Lehni
* http : //scratchdisk.com/
*
* Distributed under the MIT license .
*
* * *
*
* Acorn . js
* http : //marijnhaverbeke.nl/acorn/
*
* Acorn is a tiny , fast JavaScript parser written in JavaScript ,
* created by Marijn Haverbeke and released under an MIT license .
*
* /
2018-10-03 10:52:34 -04:00
var paper = function ( t , e ) { t = t || require ( "./node/self.js" ) ; var i = t . window , n = t . document , r = new function ( ) { function t ( t , e , r , s , a ) { function u ( n , u ) { u = u || ( u = o ( e , n ) ) && ( u . get ? u : u . value ) , "string" == typeof u && "#" === u [ 0 ] && ( u = t [ u . substring ( 1 ) ] || u ) ; var c , f = "function" == typeof u , d = u , _ = a || f && ! u . base ? u && u . get ? n in t : t [ n ] : null ; a && _ || ( f && _ && ( u . base = _ ) , f && s !== ! 1 && ( c = n . match ( /^([gs]et|is)(([A-Z])(.*))$/ ) ) && ( l [ c [ 3 ] . toLowerCase ( ) + c [ 4 ] ] = c [ 2 ] ) , d && ! f && d . get && "function" == typeof d . get && i . isPlainObject ( d ) || ( d = { value : d , writable : ! 0 } ) , ( o ( t , n ) || { configurable : ! 0 } ) . configurable && ( d . configurable = ! 0 , d . enumerable = null != r ? r : ! c ) , h ( t , n , d ) ) } var l = { } ; if ( e ) { for ( var c in e ) e . hasOwnProperty ( c ) && ! n . test ( c ) && u ( c ) ; for ( var c in l ) { var f = l [ c ] , d = t [ "set" + f ] , _ = t [ "get" + f ] || d && t [ "is" + f ] ; ! _ || s !== ! 0 && 0 !== _ . length || u ( c , { get : _ , set : d } ) } } return t } function i ( ) { for ( var t = 0 , e = arguments . length ; t < e ; t ++ ) { var i = arguments [ t ] ; i && c ( this , i ) } return this } var n = /^(statics|enumerable|beans|preserve)$/ , r = [ ] , s = r . slice , a = Object . create , o = Object . getOwnPropertyDescriptor , h = Object . defineProperty , u = r . forEach || function ( t , e ) { for ( var i = 0 , n = this . length ; i < n ; i ++ ) t . call ( e , this [ i ] , i , this ) } , l = function ( t , e ) { for ( var i in this ) this . hasOwnProperty ( i ) && t . call ( e , this [ i ] , i , this ) } , c = Object . assign || function ( t ) { for ( var e = 1 , i = arguments . length ; e < i ; e ++ ) { var n = arguments [ e ] ; for ( var r in n ) n . hasOwnProperty ( r ) && ( t [ r ] = n [ r ] ) } return t } , f = function ( t , e , i ) { if ( t ) { var n = o ( t , "length" ) ; ( n && "number" == typeof n . value ? u : l ) . call ( t , e , i = i || t ) } return i } ; return t ( i , { inject : function ( e ) { if ( e ) { var i = e . statics === ! 0 ? e : e . statics , n = e . beans , r = e . preserve ; i !== e && t ( this . prototype , e , e . enumerable , n , r ) , t ( this , i , null , n , r ) } for ( var s = 1 , a = arguments . length ; s < a ; s ++ ) this . inject ( arguments [ s ] ) ; return this } , extend : function ( ) { for ( var e , i , n , r = this , s = 0 , o = arguments . length ; s < o && ( ! e || ! i ) ; s ++ ) n = arguments [ s ] , e = e || n . initialize , i = i || n . prototype ; return e = e || function ( ) { r . apply ( this , arguments ) } , i = e . prototype = i || a ( this . prototype ) , h ( i , "constructor" , { value : e , writable : ! 0 , configurable : ! 0 } ) , t ( e , this ) , arguments . length && this . inject . apply ( e , arguments ) , e . base = r , e } } ) . inject ( { enumerable : ! 1 , initialize : i , set : i , inject : function ( ) { for ( var e = 0 , i = arguments . length ; e < i ; e ++ ) { var n = arguments [ e ] ; n && t ( this , n , n . enumerable , n . beans , n . preserve ) } return this } , extend : function ( ) { var t = a ( this ) ; return t . inject . apply ( t , arguments ) } , each : function ( t , e ) { return f ( this , t , e ) } , clone : function ( ) { return new this . constructor ( this ) } , statics : { set : c , each : f , create : a , define : h , describe : o , clone : function ( t ) { return c ( new t . constructor , t ) } , isPlainObject : function ( t ) { var e = null != t && t . constructor ; return e && ( e === Object || e === i || "Object" === e . name ) } , pick : function ( t , i ) { return t !== e ? t : i } , slice : function ( t , e , i ) { return s . call ( t , e , i ) } } } ) } ; "undefined" != typeof module && ( module . exports = r ) , r . inject ( { enumerable : ! 1 , toString : function ( ) { return null != this . _id ? ( this . _class || "Object" ) + ( this . _name ? " '" + this . _name + "'" : " @" + this . _id ) : "{ " + r . each ( this , function ( t , e ) { if ( ! /^_/ . test ( e ) ) { var i = typeof t ; this . push ( e + ": " + ( "number" === i ? h . instance . number ( t ) : "string" === i ? "'" + t + "'" : t ) ) } } , [ ] ) . join ( ", " ) + " }" } , getClassName : function ( ) { return this . _class || "" } , importJSON : function ( t ) { return r . importJSON ( t , this ) } , exportJSON : function ( t ) { return r . exportJSON ( this , t ) } , toJSON : function ( ) { return r . serialize ( this ) } , set : function ( t , e ) { return t && r . filter ( this , t , e , this . _prioritize ) , this } } , { beans : ! 1 , statics : { exports : { } , extend : function nt ( ) { var t = nt . base . apply ( this , arguments ) , e = t . prototype . _class ; return e && ! r . exports [ e ] && ( r . exports [ e ] = t ) , t } , equals : function ( t , e ) { if ( t === e ) return ! 0 ; if ( t && t . equals ) return t . equals ( e ) ; if ( e && e . equals ) return e . equals ( t ) ; if ( t && e && "object" == typeof t && "object" == typeof e ) { if ( Array . isArray ( t ) && Array . isArray ( e ) ) { var i = t . length ; if ( i !== e . length ) return ! 1 ; for ( ; i -- ; ) if ( ! r . equals ( t [ i ] , e [ i ] ) ) return ! 1 } else { var n = Object . keys ( t ) , i = n . length ; if ( i !== Object . keys ( e ) . length ) return ! 1 ; for ( ; i -- ; ) { var s = n [ i ] ; if ( ! e . hasOwnProperty ( s ) || ! r . equals ( t [ s ] , e [ s ] ) ) return ! 1 } } return ! 0 } return ! 1 } , read : function ( t , i , n , s ) { if ( this === r ) { var a = this . peek ( t , i ) ; return t . _ _index ++ , a } var o = this . prototype , h = o . _readIndex , u = i || h && t . _ _index || 0 , l = t . length , c = t [ u ] ; if ( s = s || l - u , c instanceof this || n && n . readNull && null == c && s <= 1 ) return h && ( t . _ _
this . _c *= t . y , this . _d *= t . y , e && this . translate ( e . negate ( ) ) , this . _changed ( ) , this } , rotate : function ( t ) { t *= Math . PI / 180 ; var e = c . read ( arguments , 1 ) , i = e . x , n = e . y , r = Math . cos ( t ) , s = Math . sin ( t ) , a = i - i * r + n * s , o = n - i * s - n * r , h = this . _a , u = this . _b , l = this . _c , f = this . _d ; return this . _a = r * h + s * l , this . _b = r * u + s * f , this . _c = - s * h + r * l , this . _d = - s * u + r * f , this . _tx += a * h + o * l , this . _ty += a * u + o * f , this . _changed ( ) , this } , shear : function ( ) { var t = c . read ( arguments ) , e = c . read ( arguments , 0 , { readNull : ! 0 } ) ; e && this . translate ( e ) ; var i = this . _a , n = this . _b ; return this . _a += t . y * this . _c , this . _b += t . y * this . _d , this . _c += t . x * i , this . _d += t . x * n , e && this . translate ( e . negate ( ) ) , this . _changed ( ) , this } , skew : function ( ) { var t = c . read ( arguments ) , e = c . read ( arguments , 0 , { readNull : ! 0 } ) , i = Math . PI / 180 , n = new c ( Math . tan ( t . x * i ) , Math . tan ( t . y * i ) ) ; return this . shear ( n , e ) } , append : function ( t , e ) { if ( t ) { var i = this . _a , n = this . _b , r = this . _c , s = this . _d , a = t . _a , o = t . _c , h = t . _b , u = t . _d , l = t . _tx , c = t . _ty ; this . _a = a * i + h * r , this . _c = o * i + u * r , this . _b = a * n + h * s , this . _d = o * n + u * s , this . _tx += l * i + c * r , this . _ty += l * n + c * s , e || this . _changed ( ) } return this } , prepend : function ( t , e ) { if ( t ) { var i = this . _a , n = this . _b , r = this . _c , s = this . _d , a = this . _tx , o = this . _ty , h = t . _a , u = t . _c , l = t . _b , c = t . _d , f = t . _tx , d = t . _ty ; this . _a = h * i + u * n , this . _c = h * r + u * s , this . _b = l * i + c * n , this . _d = l * r + c * s , this . _tx = h * a + u * o + f , this . _ty = l * a + c * o + d , e || this . _changed ( ) } return this } , appended : function ( t ) { return this . clone ( ) . append ( t ) } , prepended : function ( t ) { return this . clone ( ) . prepend ( t ) } , invert : function ( ) { var t = this . _a , e = this . _b , i = this . _c , n = this . _d , r = this . _tx , s = this . _ty , a = t * n - e * i , o = null ; return a && ! isNaN ( a ) && isFinite ( r ) && isFinite ( s ) && ( this . _a = n / a , this . _b = - e / a , this . _c = - i / a , this . _d = t / a , this . _tx = ( i * s - n * r ) / a , this . _ty = ( e * r - t * s ) / a , o = this ) , o } , inverted : function ( ) { return this . clone ( ) . invert ( ) } , concatenate : "#append" , preConcatenate : "#prepend" , chain : "#appended" , _shiftless : function ( ) { return new p ( this . _a , this . _b , this . _c , this . _d , 0 , 0 ) } , _orNullIfIdentity : function ( ) { return this . isIdentity ( ) ? null : this } , isIdentity : function ( ) { return 1 === this . _a && 0 === this . _b && 0 === this . _c && 1 === this . _d && 0 === this . _tx && 0 === this . _ty } , isInvertible : function ( ) { var t = this . _a * this . _d - this . _c * this . _b ; return t && ! isNaN ( t ) && isFinite ( this . _tx ) && isFinite ( this . _ty ) } , isSingular : function ( ) { return ! this . isInvertible ( ) } , transform : function ( t , e , i ) { return arguments . length < 3 ? this . _transformPoint ( c . read ( arguments ) ) : this . _transformCoordinates ( t , e , i ) } , _transformPoint : function ( t , e , i ) { var n = t . x , r = t . y ; return e || ( e = new c ) , e . _set ( n * this . _a + r * this . _c + this . _tx , n * this . _b + r * this . _d + this . _ty , i ) } , _transformCoordinates : function ( t , e , i ) { for ( var n = 0 , r = 2 * i ; n < r ; n += 2 ) { var s = t [ n ] , a = t [ n + 1 ] ; e [ n ] = s * this . _a + a * this . _c + this . _tx , e [ n + 1 ] = s * this . _b + a * this . _d + this . _ty } return e } , _transformCorners : function ( t ) { var e = t . x , i = t . y , n = e + t . width , r = i + t . height , s = [ e , i , n , i , n , r , e , r ] ; return this . _transformCoordinates ( s , s , 4 ) } , _transformBounds : function ( t , e , i ) { for ( var n = this . _transformCorners ( t ) , r = n . slice ( 0 , 2 ) , s = r . slice ( ) , a = 2 ; a < 8 ; a ++ ) { var o = n [ a ] , h = 1 & a ; o < r [ h ] ? r [ h ] = o : o > s [ h ] && ( s [ h ] = o ) } return e || ( e = new g ) , e . _set ( r [ 0 ] , r [ 1 ] , s [ 0 ] - r [ 0 ] , s [ 1 ] - r [ 1 ] , i ) } , inverseTransform : function ( ) { return this . _inverseTransform ( c . read ( arguments ) ) } , _inverseTransform : function ( t , e , i ) { var n = this . _a , r = this . _b , s = this . _c , a = this . _d , o = this . _tx , h = this . _ty , u = n * a - r * s , l = null ; if ( u && ! isNaN ( u ) && isFinite ( o ) && isFinite ( h ) ) { var f = t . x - this . _tx , d = t . y - this . _ty ; e || ( e = new c ) , l = e . _set ( ( f * a - d * s ) / u , ( d * n - f * r ) / u , i ) } return l } , decompose : function ( ) { var t , e , i , n = this . _a , r = this . _b , s = this . _c , a = this . _d , o = n * a - r * s , h = Math . sqrt , u = Math . atan2 , l = 180 / Math . PI ; if ( 0 !== n || 0 !== r ) { var f = h ( n * n + r * r ) ; t = Math . acos ( n / f ) * ( r > 0 ? 1 : - 1 ) , e = [ f , o / f ] , i = [ u ( n * s + r * a , f * f ) , 0 ] } else if ( 0 !== s || 0 !== a ) { var d = h ( s * s + a * a ) ; t = Math . asin ( s / d ) * ( a > 0 ? 1 : - 1 ) , e = [ o / d , d ] , i = [ 0 , u ( n * s + r * a , d * d ) ] } else t = 0 , i = e = [ 0 , 0 ] ; return { translation : this . getTranslation ( ) , rotation : t * l , scaling : new c ( e ) , skewing : new c ( i [ 0 ] * l , i [ 1 ] * l ) } } , getValues : function ( ) { return [ this . _a , this . _b , this . _c , this . _d , this . _tx , this . _ty ] } , getTranslation : function ( ) { return new c ( this . _tx , this . _ty ) } , getScaling : function ( ) { return ( this . decompose ( ) || { } ) . scaling } , getRotation : function ( ) { return ( this . decompose ( ) || { } ) . rotation } , applyToContext : function ( t ) { this . isIdentity ( ) || t . transform ( this . _a , this . _b , this . _c , this . _d , this . _
w && ( g ? a : s ) . applyToContext ( t ) , y && e . clipItem . draw ( t , e . extend ( { clip : ! 0 } ) ) , m ) { t . setTransform ( v , 0 , 0 , v , 0 , 0 ) ; var x = e . offset ; x && t . translate ( - x . x , - x . y ) } this . _draw ( t , e , s , m ) , t . restore ( ) , r . pop ( ) , e . clip && ! e . dontFinish && t . clip ( ) , g || ( tt . process ( c , t , h , f , u . subtract ( l ) . multiply ( v ) ) , Q . release ( t ) , e . offset = l ) } } } , _isUpdated : function ( t ) { var e = this . _parent ; if ( e instanceof N ) return e . _isUpdated ( t ) ; var i = this . _updateVersion === t ; return ! i && e && e . _visible && e . _isUpdated ( t ) && ( this . _updateVersion = t , i = ! 0 ) , i } , _drawSelection : function ( t , e , i , n , r ) { var s = this . _selection , a = 1 & s , o = 2 & s || a && this . _selectBounds , h = 4 & s ; if ( this . _drawSelected || ( a = ! 1 ) , ( a || o || h ) && this . _isUpdated ( r ) ) { var u , l = this . getSelectedColor ( ! 0 ) || ( u = this . getLayer ( ) ) && u . getSelectedColor ( ! 0 ) , c = e . appended ( this . getGlobalMatrix ( ! 0 ) ) , f = i / 2 ; if ( t . strokeStyle = t . fillStyle = l ? l . toCanvasStyle ( t ) : "#009dec" , a && this . _drawSelected ( t , c , n ) , h ) { var d = c . _transformPoint ( this . getPosition ( ! 0 ) ) , _ = d . x , g = d . y ; t . beginPath ( ) , t . arc ( _ , g , f , 0 , 2 * Math . PI , ! 0 ) , t . stroke ( ) ; for ( var v = [ [ 0 , - 1 ] , [ 1 , 0 ] , [ 0 , 1 ] , [ - 1 , 0 ] ] , p = f , m = i + 1 , y = 0 ; y < 4 ; y ++ ) { var w = v [ y ] , x = w [ 0 ] , b = w [ 1 ] ; t . moveTo ( _ + x * p , g + b * p ) , t . lineTo ( _ + x * m , g + b * m ) , t . stroke ( ) } } if ( o ) { var C = c . _transformCorners ( this . getInternalBounds ( ) ) ; t . beginPath ( ) ; for ( var y = 0 ; y < 8 ; y ++ ) t [ y ? "lineTo" : "moveTo" ] ( C [ y ] , C [ ++ y ] ) ; t . closePath ( ) , t . stroke ( ) ; for ( var y = 0 ; y < 8 ; y ++ ) t . fillRect ( C [ y ] - f , C [ ++ y ] - f , i , i ) } } } , _canComposite : function ( ) { return ! 1 } } , r . each ( [ "down" , "drag" , "up" , "move" ] , function ( t ) { this [ "removeOn" + r . capitalize ( t ) ] = function ( ) { var e = { } ; return e [ t ] = ! 0 , this . removeOn ( e ) } } , { removeOn : function ( t ) { for ( var e in t ) if ( t [ e ] ) { var i = "mouse" + e , n = this . _project , r = n . _removeSets = n . _removeSets || { } ; r [ i ] = r [ i ] || { } , r [ i ] [ this . _id ] = this } return this } } ) ) , x = w . extend ( { _class : "Group" , _selectBounds : ! 1 , _selectChildren : ! 0 , _serializeFields : { children : [ ] } , initialize : function ( t ) { this . _children = [ ] , this . _namedChildren = { } , this . _initialize ( t ) || this . addChildren ( Array . isArray ( t ) ? t : arguments ) } , _changed : function ct ( t ) { ct . base . call ( this , t ) , 1026 & t && ( this . _clipItem = e ) } , _getClipItem : function ( ) { var t = this . _clipItem ; if ( t === e ) { t = null ; for ( var i = this . _children , n = 0 , r = i . length ; n < r ; n ++ ) if ( i [ n ] . _clipMask ) { t = i [ n ] ; break } this . _clipItem = t } return t } , isClipped : function ( ) { return ! ! this . _getClipItem ( ) } , setClipped : function ( t ) { var e = this . getFirstChild ( ) ; e && e . setClipMask ( t ) } , _getBounds : function ft ( t , e ) { var i = this . _getClipItem ( ) ; return i ? i . _getCachedBounds ( t && t . appended ( i . _matrix ) , r . set ( { } , e , { stroke : ! 1 } ) ) : ft . base . call ( this , t , e ) } , _hitTestChildren : function dt ( t , e , i ) { var n = this . _getClipItem ( ) ; return ( ! n || n . contains ( t ) ) && dt . base . call ( this , t , e , i , n ) } , _draw : function ( t , e ) { var i = e . clip , n = ! i && this . _getClipItem ( ) ; e = e . extend ( { clipItem : n , clip : ! 1 } ) , i ? ( t . beginPath ( ) , e . dontStart = e . dontFinish = ! 0 ) : n && n . draw ( t , e . extend ( { clip : ! 0 } ) ) ; for ( var r = this . _children , s = 0 , a = r . length ; s < a ; s ++ ) { var o = r [ s ] ; o !== n && o . draw ( t , e ) } } } ) , b = x . extend ( { _class : "Layer" , initialize : function ( ) { x . apply ( this , arguments ) } , _getOwner : function ( ) { return this . _parent || null != this . _index && this . _project } , isInserted : function _t ( ) { return this . _parent ? _t . base . call ( this ) : null != this . _index } , activate : function ( ) { this . _project . _activeLayer = this } , _hitTestSelf : function ( ) { } } ) , C = w . extend ( { _class : "Shape" , _applyMatrix : ! 1 , _canApplyMatrix : ! 1 , _canScaleStroke : ! 0 , _serializeFields : { type : null , size : null , radius : null } , initialize : function ( t , e ) { this . _initialize ( t , e ) } , _equals : function ( t ) { return this . _type === t . _type && this . _size . equals ( t . _size ) && r . equals ( this . _radius , t . _radius ) } , copyContent : function ( t ) { this . setType ( t . _type ) , this . setSize ( t . _size ) , this . setRadius ( t . _radius ) } , getType : function ( ) { return this . _type } , setType : function ( t ) { this . _type = t } , getShape : "#getType" , setShape : "#setType" , getSize : function ( ) { var t = this . _size ; return new _ ( t . width , t . height , this , "setSize" ) } , setSize : function ( ) { var t = d . read ( arguments ) ; if ( this . _size ) { if ( ! this . _size . equals ( t ) ) { var e = this . _type , i = t . width , n = t . height ; "rectangle" === e ? this . _radius . set ( d . min ( this . _radius , t . divide ( 2 ) ) ) : "circle" === e ? ( i = n = ( i + n ) / 2 , this . _radius = i / 2 ) : "ellipse" === e && this . _radius . _set ( i / 2 , n / 2 ) , this . _size . _set ( i , n ) , this . _changed ( 9 ) } } else this . _size = t . clone ( ) } , getRadius : function ( ) { var t = this . _radius ; return "circle" === this . _type ? t : new _ ( t . width , t . height , th
g = 0 !== I ? ( g * l - v * h ) / I : 0 , v = 0 } } return 2 === i ? new c ( v , ( - g ) ) : new c ( g , v ) } return { statics : { classify : function ( t ) { function i ( t , i , n ) { var r = i !== e , s = r && i > 0 && i < 1 , a = r && n > 0 && n < 1 ; return ! r || ( s || a ) && ( "loop" !== t || s && a ) || ( t = "arch" , s = a = ! 1 ) , { type : t , roots : s || a ? s && a ? i < n ? [ i , n ] : [ n , i ] : [ s ? i : n ] : null } } var n = t [ 0 ] , r = t [ 1 ] , s = t [ 2 ] , a = t [ 3 ] , o = t [ 4 ] , h = t [ 5 ] , l = t [ 6 ] , c = t [ 7 ] , f = n * ( c - h ) + r * ( o - l ) + l * h - c * o , d = s * ( r - c ) + a * ( l - n ) + n * c - r * l , _ = o * ( a - r ) + h * ( n - s ) + s * r - a * n , g = 3 * _ , v = g - d , p = v - d + f , m = Math . sqrt ( p * p + v * v + g * g ) , y = 0 !== m ? 1 / m : 0 , w = u . isZero , x = "serpentine" ; if ( p *= y , v *= y , g *= y , w ( p ) ) return w ( v ) ? i ( w ( g ) ? "line" : "quadratic" ) : i ( x , g / ( 3 * v ) ) ; var b = 3 * v * v - 4 * p * g ; if ( w ( b ) ) return i ( "cusp" , v / ( 2 * p ) ) ; var C = b > 0 ? Math . sqrt ( b / 3 ) : Math . sqrt ( - b ) , S = 2 * p ; return i ( b > 0 ? x : "loop" , ( v + C ) / S , ( v - C ) / S ) } , getLength : function ( n , r , s , a ) { if ( r === e && ( r = 0 ) , s === e && ( s = 1 ) , k . isStraight ( n ) ) { var o = n ; s < 1 && ( o = k . subdivide ( o , s ) [ 0 ] , r /= s ) , r > 0 && ( o = k . subdivide ( o , r ) [ 1 ] ) ; var h = o [ 6 ] - o [ 0 ] , l = o [ 7 ] - o [ 1 ] ; return Math . sqrt ( h * h + l * l ) } return u . integrate ( a || t ( n ) , r , s , i ( r , s ) ) } , getTimeAt : function ( n , r , s ) { function a ( t ) { return p += u . integrate ( d , s , t , i ( s , t ) ) , s = t , p - r } if ( s === e && ( s = r < 0 ? 1 : 0 ) , 0 === r ) return s ; var o = Math . abs , h = 1e-12 , l = r > 0 , c = l ? s : 0 , f = l ? 1 : s , d = t ( n ) , _ = k . getLength ( n , c , f , d ) , g = o ( r ) - _ ; if ( o ( g ) < h ) return l ? f : c ; if ( g > h ) return null ; var v = r / _ , p = 0 ; return u . findRoot ( a , d , s + v , c , f , 32 , 1e-12 ) } , getPoint : function ( t , e ) { return n ( t , e , 0 , ! 1 ) } , getTangent : function ( t , e ) { return n ( t , e , 1 , ! 0 ) } , getWeightedTangent : function ( t , e ) { return n ( t , e , 1 , ! 1 ) } , getNormal : function ( t , e ) { return n ( t , e , 2 , ! 0 ) } , getWeightedNormal : function ( t , e ) { return n ( t , e , 2 , ! 1 ) } , getCurvature : function ( t , e ) { return n ( t , e , 3 , ! 1 ) . x } , getPeaks : function ( t ) { var e = t [ 0 ] , i = t [ 1 ] , n = t [ 2 ] , r = t [ 3 ] , s = t [ 4 ] , a = t [ 5 ] , o = t [ 6 ] , h = t [ 7 ] , l = - e + 3 * n - 3 * s + o , c = 3 * e - 6 * n + 3 * s , f = - 3 * e + 3 * n , d = - i + 3 * r - 3 * a + h , _ = 3 * i - 6 * r + 3 * a , g = - 3 * i + 3 * r , v = 1e-8 , p = 1 - v , m = [ ] ; return u . solveCubic ( 9 * ( l * l + d * d ) , 9 * ( l * c + _ * d ) , 2 * ( c * c + _ * _ ) + 3 * ( f * l + g * d ) , f * c + _ * g , m , v , p ) , m . sort ( ) } } } } , new function ( ) { function t ( t , e , i , n , r , s , a ) { var o = ! a && i . getPrevious ( ) === r , h = ! a && i !== r && i . getNext ( ) === r , u = 1e-8 , l = 1 - u ; if ( null !== n && n >= ( o ? u : 0 ) && n <= ( h ? l : 1 ) && null !== s && s >= ( h ? u : 0 ) && s <= ( o ? l : 1 ) ) { var c = new O ( i , n , null , a ) , f = new O ( r , s , null , a ) ; c . _intersection = f , f . _intersection = c , e && ! e ( c ) || O . insert ( t , c , ! 0 ) } } function e ( r , s , a , o , h , u , l , c , f , d , _ , g , v ) { if ( ++ f >= 4096 || ++ c >= 40 ) return f ; var p , y , w = 1e-9 , x = s [ 0 ] , b = s [ 1 ] , C = s [ 6 ] , S = s [ 7 ] , P = m . getSignedDistance , I = P ( x , b , C , S , s [ 2 ] , s [ 3 ] ) , M = P ( x , b , C , S , s [ 4 ] , s [ 5 ] ) , T = I * M > 0 ? . 75 : 4 / 9 , z = T * Math . min ( 0 , I , M ) , O = T * Math . max ( 0 , I , M ) , A = P ( x , b , C , S , r [ 0 ] , r [ 1 ] ) , L = P ( x , b , C , S , r [ 2 ] , r [ 3 ] ) , N = P ( x , b , C , S , r [ 4 ] , r [ 5 ] ) , B = P ( x , b , C , S , r [ 6 ] , r [ 7 ] ) , D = i ( A , L , N , B ) , j = D [ 0 ] , E = D [ 1 ] ; if ( 0 === I && 0 === M && 0 === A && 0 === L && 0 === N && 0 === B || null == ( p = n ( j , E , z , O ) ) || null == ( y = n ( j . reverse ( ) , E . reverse ( ) , z , O ) ) ) return f ; var F = d + ( _ - d ) * p , R = d + ( _ - d ) * y ; if ( Math . max ( v - g , R - F ) < w ) { var q = ( F + R ) / 2 , V = ( g + v ) / 2 ; t ( h , u , l ? o : a , l ? V : q , l ? a : o , l ? q : V ) } else if ( r = k . getPart ( r , p , y ) , y - p > . 8 ) if ( R - F > v - g ) { var H = k . subdivide ( r , . 5 ) , q = ( F + R ) / 2 ; f = e ( s , H [ 0 ] , o , a , h , u , ! l , c , f , g , v , F , q ) , f = e ( s , H [ 1 ] , o , a , h , u , ! l , c , f , g , v , q , R ) } else { var H = k . subdivide ( s , . 5 ) , V = ( g + v ) / 2 ; f = e ( H [ 0 ] , r , o , a , h , u , ! l , c , f , g , V , F , R ) , f = e ( H [ 1 ] , r , o , a , h , u , ! l , c , f , V , v , F , R ) } else f = v - g >= w ? e ( s , r , o , a , h , u , ! l , c , f , g , v , F , R ) : e ( r , s , a , o , h , u , l , c , f , F , R , g , v ) ; return f } function i ( t , e , i , n ) { var r , s = [ 0 , t ] , a = [ 1 / 3 , e ] , o = [ 2 / 3 , i ] , h = [ 1 , n ] , u = e - ( 2 * t + n ) / 3 , l = i - ( t + 2 * n ) / 3 ; if ( u * l < 0 ) r = [ [ s , a , h ] , [ s , o , h ] ] ; else { var c = u / l ; r = [ c >= 2 ? [ s , a , h ] : c <= . 5 ? [ s , o , h ] : [ s , a , o , h ] , [ s , h ] ] } return ( u || l ) < 0 ? r . reverse ( ) : r } function n ( t , e , i , n ) { return t [ 0 ] [ 1 ] < i ? s ( t , ! 0 , i ) : e [ 0 ] [ 1 ] > n ? s ( e , ! 1 , n ) : t [ 0 ] [ 0 ] } function s ( t , e , i ) { for ( var n = t [ 0 ] [ 0 ] , r = t [ 0 ] [ 1 ] , s = 1 , a = t . length ; s < a ; s ++ ) { var o = t [ s ] [ 0 ] , h = t [ s ] [ 1 ] ; if ( e ? h >= i : h <= i ) return h === i ? o : n + ( i - r ) * ( o - n ) / ( h - r ) ; n = o , r = h } return null } function a ( t , e , i , n , r ) { var s = u . isZero ; if ( s ( n ) && s ( r ) ) { var a = k . getTimeOf ( t , new c ( e , i ) ) ; return null === a ? [ ] : [ a ] } for ( var o = Math . atan2 ( - r , n ) , h = Math . sin ( o ) , l = Math . cos ( o ) , f = [ ] , d = [ ] , _ = 0 ; _ < 8 ; _ += 2 ) { var g = t [ _ ] - e , v = t [ _ + 1 ] - i ; f . push ( g * l - v * h , g * h + v * l ) } return k . solveCubic ( f , 1 , 0 , d , 0 , 1 ) , d } function o ( e , i , n , r , s , o , h ) { for ( var u = i [ 0 ] , l = i [ 1 ] , c = i [ 6 ] , f = i [ 7 ] , d = a ( e , u , l , c - u , f - l ) , _ = 0 , g = d . length ; _ < g ; _ ++ ) { var v = d [ _ ] , p = k . getPoint ( e , v ) , m = k . getTimeOf ( i , p ) ; null !== m && t ( s , o , h ? r : n , h ? m : v , h ? n : r , h ? v : m ) } } function h ( e , i , n , r , s , a ) { var o = m . intersect ( e [ 0 ] , e [ 1 ] , e [ 6 ] , e [ 7 ] , i [ 0 ] , i [ 1 ] , i [ 6 ] , i [ 7 ] ) ; o && t ( s , a , n , k . getTimeOf ( e , o ) , r , k . getTimeOf ( i , o ) ) } function l ( i , n , r , s , a , u ) { var l = 1 e -
a ? ( S = a . _transformPoint ( s ) , J = a . _transformPoint ( s . add ( J ) ) . subtract ( S ) ) : S = i . add ( s ) ) , G ) { var $ = s . rotate ( - 90 ) . multiply ( U ) ; a && ( $ = a . _transformPoint ( s . add ( $ ) ) . subtract ( S ) ) , W . push ( new T ( S , $ , J ) ) } else l . setHandleOut ( J ) ; s = s . rotate ( H ) } this . _add ( W ) } , lineBy : function ( ) { var e = c . read ( arguments ) , i = t ( this ) . _point ; this . lineTo ( i . add ( e ) ) } , curveBy : function ( ) { var e = c . read ( arguments ) , i = c . read ( arguments ) , n = r . read ( arguments ) , s = t ( this ) . _point ; this . curveTo ( s . add ( e ) , s . add ( i ) , n ) } , cubicCurveBy : function ( ) { var e = c . read ( arguments ) , i = c . read ( arguments ) , n = c . read ( arguments ) , r = t ( this ) . _point ; this . cubicCurveTo ( r . add ( e ) , r . add ( i ) , r . add ( n ) ) } , quadraticCurveBy : function ( ) { var e = c . read ( arguments ) , i = c . read ( arguments ) , n = t ( this ) . _point ; this . quadraticCurveTo ( n . add ( e ) , n . add ( i ) ) } , arcBy : function ( ) { var e = t ( this ) . _point , i = e . add ( c . read ( arguments ) ) , n = r . pick ( r . peek ( arguments ) , ! 0 ) ; "boolean" == typeof n ? this . arcTo ( i , n ) : this . arcTo ( i , e . add ( c . read ( arguments ) ) ) } , closePath : function ( t ) { this . setClosed ( ! 0 ) , this . join ( this , t ) } } } , { _getBounds : function ( t , e ) { var i = e . handle ? "getHandleBounds" : e . stroke ? "getStrokeBounds" : "getBounds" ; return L [ i ] ( this . _segments , this . _closed , this , t , e ) } , statics : { getBounds : function ( t , e , i , n , r , s ) { function a ( t ) { t . _transformCoordinates ( n , h ) ; for ( var e = 0 ; e < 2 ; e ++ ) k . _addBounds ( u [ e ] , u [ e + 4 ] , h [ e + 2 ] , h [ e ] , e , s ? s [ e ] : 0 , l , c , f ) ; var i = u ; u = h , h = i } var o = t [ 0 ] ; if ( ! o ) return new g ; for ( var h = new Array ( 6 ) , u = o . _transformCoordinates ( n , new Array ( 6 ) ) , l = u . slice ( 0 , 2 ) , c = l . slice ( ) , f = new Array ( 2 ) , d = 1 , _ = t . length ; d < _ ; d ++ ) a ( t [ d ] ) ; return e && a ( o ) , new g ( l [ 0 ] , l [ 1 ] , c [ 0 ] - l [ 0 ] , c [ 1 ] - l [ 1 ] ) } , getStrokeBounds : function ( t , e , i , n , r ) { function s ( t ) { v = v . include ( t ) } function a ( t ) { v = v . unite ( x . setCenter ( t . _point . transform ( n ) ) ) } function o ( t , e ) { "round" === e || t . isSmooth ( ) ? a ( t ) : L . _addBevelJoin ( t , e , p , w , n , f , s ) } function h ( t , e ) { "round" === e ? a ( t ) : L . _addSquareCap ( t , e , p , n , f , s ) } var u = i . getStyle ( ) , l = u . hasStroke ( ) , c = u . getStrokeWidth ( ) , f = l && i . _getStrokeMatrix ( n , r ) , _ = l && L . _getStrokePadding ( c , f ) , v = L . getBounds ( t , e , i , n , r , _ ) ; if ( ! l ) return v ; for ( var p = c / 2 , m = u . getStrokeJoin ( ) , y = u . getStrokeCap ( ) , w = u . getMiterLimit ( ) , x = new g ( new d ( _ ) ) , b = t . length - ( e ? 0 : 1 ) , C = 1 ; C < b ; C ++ ) o ( t [ C ] , m ) ; return e ? o ( t [ 0 ] , m ) : b > 0 && ( h ( t [ 0 ] , y ) , h ( t [ t . length - 1 ] , y ) ) , v } , _getStrokePadding : function ( t , e ) { if ( ! e ) return [ t , t ] ; var i = new c ( t , 0 ) . transform ( e ) , n = new c ( 0 , t ) . transform ( e ) , r = i . getAngleInRadians ( ) , s = i . getLength ( ) , a = n . getLength ( ) , o = Math . sin ( r ) , h = Math . cos ( r ) , u = Math . tan ( r ) , l = Math . atan2 ( a * u , s ) , f = Math . atan2 ( a , u * s ) ; return [ Math . abs ( s * Math . cos ( l ) * h + a * Math . sin ( l ) * o ) , Math . abs ( a * Math . sin ( f ) * h + s * Math . cos ( f ) * o ) ] } , _addBevelJoin : function ( t , e , i , n , r , s , a , o ) { var h = t . getCurve ( ) , u = h . getPrevious ( ) , l = h . getPoint1 ( ) . transform ( r ) , f = u . getNormalAtTime ( 1 ) . multiply ( i ) . transform ( s ) , d = h . getNormalAtTime ( 0 ) . multiply ( i ) . transform ( s ) ; if ( f . getDirectedAngle ( d ) < 0 && ( f = f . negate ( ) , d = d . negate ( ) ) , o && a ( l ) , a ( l . add ( f ) ) , "miter" === e ) { var _ = new m ( l . add ( f ) , new c ( ( - f . y ) , f . x ) , ( ! 0 ) ) . intersect ( new m ( l . add ( d ) , new c ( ( - d . y ) , d . x ) , ( ! 0 ) ) , ! 0 ) ; _ && l . getDistance ( _ ) <= n * i && a ( _ ) } a ( l . add ( d ) ) } , _addSquareCap : function ( t , e , i , n , r , s , a ) { var o = t . _point . transform ( n ) , h = t . getLocation ( ) , u = h . getNormal ( ) . multiply ( 0 === h . getTime ( ) ? i : - i ) . transform ( r ) ; "square" === e && ( a && ( s ( o . subtract ( u ) ) , s ( o . add ( u ) ) ) , o = o . add ( u . rotate ( - 90 ) ) ) , s ( o . add ( u ) ) , s ( o . subtract ( u ) ) } , getHandleBounds : function ( t , e , i , n , r ) { var s , a , o = i . getStyle ( ) , h = r . stroke && o . hasStroke ( ) ; if ( h ) { var u = i . _getStrokeMatrix ( n , r ) , l = o . getStrokeWidth ( ) / 2 , c = l ; "miter" === o . getStrokeJoin ( ) && ( c = l * o . getMiterLimit ( ) ) , "square" === o . getStrokeCap ( ) && ( c = Math . max ( c , l * Math . SQRT2 ) ) , s = L . _getStrokePadding ( l , u ) , a = L . _getStrokePadding ( c , u ) } for ( var f = new Array ( 6 ) , d = 1 / 0 , _ = - d , v = d , p = _ , m = 0 , y = t . length ; m < y ; m ++ ) { var w = t [ m ] ; w . _transformCoordinates ( n , f ) ; for ( var x = 0 ; x < 6 ; x += 2 ) { var b = x ? s : a , C = b ? b [ 0 ] : 0 , S = b ? b [ 1 ] : 0 , P = f [ x ] , I = f [ x + 1 ] , M = P - C , T = P + C , z = I - S , k = I + S ; M < d && ( d = M ) , T > _ && ( _ = T ) , z < v && ( v = z ) , k > p && ( p = k ) } } return new g ( d , v , _ - d , p - v ) } } } ) ; L . inject ( { statics : new function ( ) { function t ( t , e , i ) { var n = r . getNamed ( i ) , s = new L ( n && 0 == n . insert && w . NO _INSERT ) ; return s . _add ( t ) , s . _closed = e , s . set ( n , { insert : ! 0 } ) } function e ( e , i , r ) { for ( var s = new Array ( 4 ) , a = 0 ; a < 4 ; a ++ ) { var o = n [ a ] ; s [ a ] = new T ( o . _point . multiply ( i ) . add ( e ) , o . _handleIn . multiply ( i ) , o . _handleOut . multiply ( i ) ) } return t ( s , ! 0 , r ) } var i = . 5522847498307936 , n = [ new T (
return new R ( t , this . _radial ) } , getStops : function ( ) { return this . _stops } , setStops : function ( t ) { if ( t . length < 2 ) throw new Error ( "Gradient stop list needs to contain at least two stops." ) ; var i = this . _stops ; if ( i ) for ( var n = 0 , r = i . length ; n < r ; n ++ ) i [ n ] . _owner = e ; i = this . _stops = q . readList ( t , 0 , { clone : ! 0 } ) ; for ( var n = 0 , r = i . length ; n < r ; n ++ ) i [ n ] . _owner = this ; this . _changed ( ) } , getRadial : function ( ) { return this . _radial } , setRadial : function ( t ) { this . _radial = t , this . _changed ( ) } , equals : function ( t ) { if ( t === this ) return ! 0 ; if ( t && this . _class === t . _class ) { var e = this . _stops , i = t . _stops , n = e . length ; if ( n === i . length ) { for ( var r = 0 ; r < n ; r ++ ) if ( ! e [ r ] . equals ( i [ r ] ) ) return ! 1 ; return ! 0 } } return ! 1 } } ) , q = r . extend ( { _class : "GradientStop" , initialize : function ( t , i ) { var n = t , r = i ; "object" == typeof t && i === e && ( Array . isArray ( t ) && "number" != typeof t [ 0 ] ? ( n = t [ 0 ] , r = t [ 1 ] ) : ( "color" in t || "offset" in t || "rampPoint" in t ) && ( n = t . color , r = t . offset || t . rampPoint || 0 ) ) , this . setColor ( n ) , this . setOffset ( r ) } , clone : function ( ) { return new q ( this . _color . clone ( ) , this . _offset ) } , _serialize : function ( t , e ) { var i = this . _color , n = this . _offset ; return r . serialize ( null == n ? [ i ] : [ i , n ] , t , ! 0 , e ) } , _changed : function ( ) { this . _owner && this . _owner . _changed ( 65 ) } , getOffset : function ( ) { return this . _offset } , setOffset : function ( t ) { this . _offset = t , this . _changed ( ) } , getRampPoint : "#getOffset" , setRampPoint : "#setOffset" , getColor : function ( ) { return this . _color } , setColor : function ( ) { var t = F . read ( arguments , 0 , { clone : ! 0 } ) ; t && ( t . _owner = this ) , this . _color = t , this . _changed ( ) } , equals : function ( t ) { return t === this || t && this . _class === t . _class && this . _color . equals ( t . _color ) && this . _offset == t . _offset || ! 1 } } ) , V = r . extend ( new function ( ) { var t = { fillColor : null , fillRule : "nonzero" , strokeColor : null , strokeWidth : 1 , strokeCap : "butt" , strokeJoin : "miter" , strokeScaling : ! 0 , miterLimit : 10 , dashOffset : 0 , dashArray : [ ] , shadowColor : null , shadowBlur : 0 , shadowOffset : new c , selectedColor : null } , i = r . set ( { } , t , { fontFamily : "sans-serif" , fontWeight : "normal" , fontSize : 12 , leading : null , justification : "left" } ) , n = r . set ( { } , i , { fillColor : new F } ) , s = { strokeWidth : 97 , strokeCap : 97 , strokeJoin : 97 , strokeScaling : 105 , miterLimit : 97 , fontFamily : 9 , fontWeight : 9 , fontSize : 9 , font : 9 , leading : 9 , justification : 9 } , a = { beans : ! 0 } , o = { _class : "Style" , beans : ! 0 , initialize : function ( e , r , s ) { this . _values = { } , this . _owner = r , this . _project = r && r . _project || s || paper . project , this . _defaults = ! r || r instanceof x ? i : r instanceof j ? n : t , e && this . set ( e ) } } ; return r . each ( i , function ( t , i ) { var n = /Color$/ . test ( i ) , h = "shadowOffset" === i , u = r . capitalize ( i ) , l = s [ i ] , f = "set" + u , d = "get" + u ; o [ f ] = function ( t ) { var r = this . _owner , s = r && r . _children ; if ( s && s . length > 0 && ! ( r instanceof N ) ) for ( var a = 0 , o = s . length ; a < o ; a ++ ) s [ a ] . _style [ f ] ( t ) ; else if ( i in this . _defaults ) { var h = this . _values [ i ] ; h !== t && ( n && ( h && h . _owner !== e && ( h . _owner = e , h . _canvasStyle = null ) , t && t . constructor === F && ( t . _owner && ( t = t . clone ( ) ) , t . _owner = r ) ) , this . _values [ i ] = t , r && r . _changed ( l || 65 ) ) } } , o [ d ] = function ( t ) { var s , a = this . _owner , o = a && a . _children ; if ( i in this . _defaults && ( ! o || ! o . length || t || a instanceof N ) ) { var s = this . _values [ i ] ; if ( s === e ) s = this . _defaults [ i ] , s && s . clone && ( s = s . clone ( ) ) ; else { var u = n ? F : h ? c : null ; ! u || s && s . constructor === u || ( this . _values [ i ] = s = u . read ( [ s ] , 0 , { readNull : ! 0 , clone : ! 0 } ) , s && n && ( s . _owner = a ) ) } } else if ( o ) for ( var l = 0 , f = o . length ; l < f ; l ++ ) { var _ = o [ l ] . _style [ d ] ( ) ; if ( l ) { if ( ! r . equals ( s , _ ) ) return e } else s = _ } return s } , a [ d ] = function ( t ) { return this . _style [ d ] ( t ) } , a [ f ] = function ( t ) { this . _style [ f ] ( t ) } } ) , r . each ( { Font : "FontFamily" , WindingRule : "FillRule" } , function ( t , e ) { var i = "get" + e , n = "set" + e ; o [ i ] = a [ i ] = "#get" + t , o [ n ] = a [ n ] = "#set" + t } ) , w . inject ( a ) , o } , { set : function ( t ) { var e = t instanceof V , i = e ? t . _values : t ; if ( i ) for ( var n in i ) if ( n in this . _defaults ) { var r = i [ n ] ; this [ n ] = r && e && r . clone ? r . clone ( ) : r } } , equals : function ( t ) { function i ( t , i , n ) { var s = t . _values , a = i . _values , o = i . _defaults ; for ( var h in s ) { var u = s [ h ] , l = a [ h ] ; if ( ! ( n && h in a || r . equals ( u , l === e ? o [ h ] : l ) ) ) return ! 1 } return ! 0 } return t === this || t && this . _class === t . _class && i ( this , t ) && i ( t , this , ! 0 ) || ! 1 } , _dispose : function ( ) { var t ; t = this . getFillColor ( ) , t && ( t . _canvasStyle = null ) , t = this . getStrokeColor ( ) , t && ( t . _canvasStyle = null ) , t = this . getShadowColor ( ) , t && ( t . _canvasStyle = null ) } , hasFill : function ( ) { var t = this . getFillColor ( ) ; return ! ! t && t . alpha > 0 } ,
} } ) , a . length && ( n . style = a . join ( ";" ) ) , 1 === n . opacity && delete n . opacity , t . _visible || ( n . visibility = "hidden" ) , et . set ( e , n , S ) } function v ( t , e ) { return P || ( P = { ids : { } , svgs : { } } ) , t && P . svgs [ e + "-" + ( t . _id || t . _ _id || ( t . _ _id = l . get ( "svg" ) ) ) ] } function m ( t , e , i ) { P || v ( ) ; var n = P . ids [ i ] = ( P . ids [ i ] || 0 ) + 1 ; e . id = i + "-" + n , P . svgs [ i + "-" + ( t . _id || t . _ _id ) ] = e } function x ( e , i ) { var n = e , r = null ; if ( P ) { n = "svg" === e . nodeName . toLowerCase ( ) && e ; for ( var s in P . svgs ) r || ( n || ( n = et . create ( "svg" ) , n . appendChild ( e ) ) , r = n . insertBefore ( et . create ( "defs" ) , n . firstChild ) ) , r . appendChild ( P . svgs [ s ] ) ; P = null } return i . asString ? ( new t . XMLSerializer ) . serializeToString ( n ) : n } function b ( t , e , i ) { var n = I [ t . _class ] , r = n && n ( t , e ) ; if ( r ) { var s = e . onExport ; s && ( r = s ( t , r , e ) || r ) ; var a = JSON . stringify ( t . _data ) ; a && "{}" !== a && "null" !== a && r . setAttribute ( "data-paper-data" , a ) } return r && _ ( t , r , i ) } function C ( t ) { return t || ( t = { } ) , S = new h ( t . precision ) , t } var S , P , I = { Group : i , Layer : i , Raster : n , Path : s , Shape : a , CompoundPath : o , SymbolItem : c , PointText : d } ; w . inject ( { exportSVG : function ( t ) { return t = C ( t ) , x ( b ( this , t , ! 0 ) , t ) } } ) , y . inject ( { exportSVG : function ( t ) { t = C ( t ) ; var i = this . _children , n = this . getView ( ) , s = r . pick ( t . bounds , "view" ) , a = t . matrix || "view" === s && n . _matrix , o = a && p . read ( [ a ] ) , h = "view" === s ? new g ( [ 0 , 0 ] , n . getViewSize ( ) ) : "content" === s ? w . _getBounds ( i , o , { stroke : ! 0 } ) . rect : g . read ( [ s ] , 0 , { readNull : ! 0 } ) , u = { version : "1.1" , xmlns : et . svg , "xmlns:xlink" : et . xlink } ; h && ( u . width = h . width , u . height = h . height , ( h . x || h . y ) && ( u . viewBox = S . rectangle ( h ) ) ) ; var l = et . create ( "svg" , u , S ) , c = l ; o && ! o . isIdentity ( ) && ( c = l . appendChild ( et . create ( "g" , e ( o ) , S ) ) ) ; for ( var f = 0 , d = i . length ; f < d ; f ++ ) c . appendChild ( b ( i [ f ] , t , ! 0 ) ) ; return x ( l , t ) } } ) } , new function ( ) { function s ( t , e , i , n , r ) { var s = et . get ( t , e ) , a = null == s ? n ? null : i ? "" : 0 : i ? s : parseFloat ( s ) ; return /%\s*$/ . test ( s ) ? a / 100 * ( r ? 1 : k [ /x|^width/ . test ( e ) ? "width" : "height" ] ) : a } function a ( t , e , i , n , r ) { return e = s ( t , e || "x" , ! 1 , n , r ) , i = s ( t , i || "y" , ! 1 , n , r ) , ! n || null != e && null != i ? new c ( e , i ) : null } function o ( t , e , i , n , r ) { return e = s ( t , e || "width" , ! 1 , n , r ) , i = s ( t , i || "height" , ! 1 , n , r ) , ! n || null != e && null != i ? new d ( e , i ) : null } function h ( t , e , i ) { return "none" === t ? null : "number" === e ? parseFloat ( t ) : "array" === e ? t ? t . split ( /[\s,]+/g ) . map ( parseFloat ) : [ ] : "color" === e ? M ( t ) || t : "lookup" === e ? i [ t ] : t } function u ( t , e , i , n ) { var r = t . childNodes , s = "clippath" === e , a = "defs" === e , o = new x , h = o . _project , u = h . _currentStyle , l = [ ] ; if ( s || a || ( o = P ( o , t , n ) , h . _currentStyle = o . _style . clone ( ) ) , n ) for ( var c = t . querySelectorAll ( "defs" ) , f = 0 , d = c . length ; f < d ; f ++ ) T ( c [ f ] , i , ! 1 ) ; for ( var f = 0 , d = r . length ; f < d ; f ++ ) { var _ , g = r [ f ] ; 1 !== g . nodeType || /^defs$/i . test ( g . nodeName ) || ! ( _ = T ( g , i , ! 1 ) ) || _ instanceof I || l . push ( _ ) } return o . addChildren ( l ) , s && ( o = P ( o . reduce ( ) , t , n ) ) , h . _currentStyle = u , ( s || a ) && ( o . remove ( ) , o = null ) , o } function l ( t , e ) { for ( var i = t . getAttribute ( "points" ) . match ( /[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g ) , n = [ ] , r = 0 , s = i . length ; r < s ; r += 2 ) n . push ( new c ( parseFloat ( i [ r ] ) , parseFloat ( i [ r + 1 ] ) ) ) ; var a = new L ( n ) ; return "polygon" === e && a . closePath ( ) , a } function f ( t ) { return A . create ( t . getAttribute ( "d" ) ) } function _ ( t , e ) { var i , n = ( s ( t , "href" , ! 0 ) || "" ) . substring ( 1 ) , r = "radialgradient" === e ; if ( n ) i = O [ n ] . getGradient ( ) , i . _radial ^ r && ( i = i . clone ( ) , i . _radial = r ) ; else { for ( var o = t . childNodes , h = [ ] , u = 0 , l = o . length ; u < l ; u ++ ) { var c = o [ u ] ; 1 === c . nodeType && h . push ( P ( new q , c ) ) } i = new R ( h , r ) } var f , d , _ , g = "userSpaceOnUse" !== s ( t , "gradientUnits" , ! 0 ) ; r ? ( f = a ( t , "cx" , "cy" , ! 1 , g ) , d = f . add ( s ( t , "r" , ! 1 , ! 1 , g ) , 0 ) , _ = a ( t , "fx" , "fy" , ! 0 , g ) ) : ( f = a ( t , "x1" , "y1" , ! 1 , g ) , d = a ( t , "x2" , "y2" , ! 1 , g ) ) ; var v = P ( new F ( i , f , d , _ ) , t ) ; return v . _scaleToBounds = g , null } function v ( t , e , i , n ) { if ( t . transform ) { for ( var r = ( n . getAttribute ( i ) || "" ) . split ( /\)\s*/g ) , s = new p , a = 0 , o = r . length ; a < o ; a ++ ) { var h = r [ a ] ; if ( ! h ) break ; for ( var u = h . split ( /\(\s*/ ) , l = u [ 0 ] , c = u [ 1 ] . split ( /[\s,]+/g ) , f = 0 , d = c . length ; f < d ; f ++ ) c [ f ] = parseFloat ( c [ f ] ) ; switch ( l ) { case "matrix" : s . append ( new p ( c [ 0 ] , c [ 1 ] , c [ 2 ] , c [ 3 ] , c [ 4 ] , c [ 5 ] ) ) ; break ; case "rotate" : s . rotate ( c [ 0 ] , c [ 1 ] || 0 , c [ 2 ] || 0 ) ; break ; case "translate" : s . translate ( c [ 0 ] , c [ 1 ] || 0 ) ; break ; case "scale" : s . scale ( c ) ; break ; case "skewX" : s . skew ( c [ 0 ] , 0 ) ; break ; case "skewY" : s . skew ( 0 , c [ 0 ] ) } } t . transform ( s ) } } function m ( t , e , i ) { var n = "fill-opacity" === i ? "getFillColor" : "getStrokeColor" , r = t [ n ] && t [ n ] ( ) ; r && r . setAlpha ( parseFloat ( e ) ) } function b ( t , i , n ) { var s = t . attributes [ i ] , a = s && s . va