From c479ec92723b964f58e7f73cbca7473ed3fa2942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 11:41:49 +0100 Subject: [PATCH 01/11] Start with transition to unified version. Relates to #739 --- examples/Node.js/AnimatedStar.js | 2 +- examples/Node.js/BooleanOperations.js | 4 +- examples/Node.js/JSONtoPDF.js | 4 +- examples/Node.js/Raster.js | 10 +- examples/Node.js/RemoteRaster.js | 4 +- examples/Node.js/SVGExport.js | 2 +- examples/Node.js/SVGImport.js | 13 +-- examples/Node.js/in.json | 2 +- package.json | 5 +- src/canvas/CanvasProvider.js | 6 +- src/core/PaperScope.js | 60 ++++++------ src/core/PaperScript.js | 135 ++++++++++++-------------- src/event/Key.js | 16 +-- src/export.js | 36 +++---- src/item/Raster.js | 73 +------------- src/net/Http.js | 2 +- src/{dom => }/node.js | 52 ++++++++-- src/paper.js | 30 +++--- src/svg/SVGImport.js | 4 - src/view/CanvasView.js | 20 ++-- src/view/View.js | 42 +++----- 21 files changed, 220 insertions(+), 302 deletions(-) rename src/{dom => }/node.js (50%) diff --git a/examples/Node.js/AnimatedStar.js b/examples/Node.js/AnimatedStar.js index cec26a6c..d4cbb943 100644 --- a/examples/Node.js/AnimatedStar.js +++ b/examples/Node.js/AnimatedStar.js @@ -1,5 +1,5 @@ var paper = require('paper'); -paper.setup(new paper.Canvas(1024, 768)); +paper.setup(new paper.Size(1024, 768)); var layer = paper.project.activeLayer; diff --git a/examples/Node.js/BooleanOperations.js b/examples/Node.js/BooleanOperations.js index b6b02fdb..237bcb6b 100644 --- a/examples/Node.js/BooleanOperations.js +++ b/examples/Node.js/BooleanOperations.js @@ -2,7 +2,7 @@ var http = require('http'); var paper = require('paper'); http.createServer(function(request, response) { - var canvas = new paper.Canvas(800, 800); + var canvas = paper.createCanvas(800, 800); paper.setup(canvas); with(paper) { var style = { @@ -30,4 +30,4 @@ http.createServer(function(request, response) { }); }).listen(3000); -console.log('Server running at http://127.0.0.1:3000/'); \ No newline at end of file +console.log('Server running at http://127.0.0.1:3000/'); diff --git a/examples/Node.js/JSONtoPDF.js b/examples/Node.js/JSONtoPDF.js index de2ee8b0..468775d6 100644 --- a/examples/Node.js/JSONtoPDF.js +++ b/examples/Node.js/JSONtoPDF.js @@ -2,12 +2,12 @@ var paper = require('paper'), path = require('path'), fs = require('fs'); -var canvas = new paper.Canvas(612, 792, 'pdf'); +var canvas = paper.createCanvas(612, 792, 'pdf'); paper.setup(canvas); with (paper) { fs.readFile('./in.json', { encoding: 'utf8' }, function (err, data) { if (err) - throw err; + throw err; project.importJSON(data); view.update(); fs.writeFile(path.resolve(__dirname, 'out.pdf'), canvas.toBuffer(), function (err) { diff --git a/examples/Node.js/Raster.js b/examples/Node.js/Raster.js index 975bb656..91242d10 100644 --- a/examples/Node.js/Raster.js +++ b/examples/Node.js/Raster.js @@ -1,11 +1,11 @@ var paper = require('paper'); var data = "data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAXAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGF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Qg49YJDq8wEUZKlWERiwVG+3om8m7aWWdZYScpyEkknP3qBGUiwy6muJJwrtVAEfFFuFazNf/Z"; -paper.setup(new paper.Canvas(600, 600)); +paper.setup(new paper.Size(600, 600)); -with (paper) { - var raster = new paper.Raster(data); - raster.position = view.center; +var raster = new paper.Raster(data); +raster.onLoad = function() { + raster.position = paper.view.center; paper.view.exportFrames({ amount: 1, directory: __dirname, @@ -26,4 +26,4 @@ with (paper) { console.log('Saved!'); }); */ -} +}; diff --git a/examples/Node.js/RemoteRaster.js b/examples/Node.js/RemoteRaster.js index b34b9a74..934c6080 100644 --- a/examples/Node.js/RemoteRaster.js +++ b/examples/Node.js/RemoteRaster.js @@ -1,7 +1,7 @@ var paper = require('paper'); var fs = require('fs'); -var canvas = new paper.Canvas(800, 600); +var canvas = paper.createCanvas(800, 600); paper.setup(canvas); var url = 'http://assets.paperjs.org/images/marilyn.jpg'; @@ -13,7 +13,7 @@ raster.onLoad = function() { // Saving the canvas to a file. out = fs.createWriteStream(__dirname + '/canvas.png'); - stream = canvas.pngStream(); + stream = canvas.createPNGStream(); stream.on('data', function(chunk) { out.write(chunk); diff --git a/examples/Node.js/SVGExport.js b/examples/Node.js/SVGExport.js index 0fa6c022..50bd45ab 100644 --- a/examples/Node.js/SVGExport.js +++ b/examples/Node.js/SVGExport.js @@ -2,8 +2,8 @@ var paper = require('paper'), path = require('path'), fs = require('fs'); -paper.setup(new paper.Canvas(300, 600)); with (paper) { + paper.setup(new Size(300, 600)); var stops = [new Color(1, 1, 0, 0), 'red', 'black']; var radius = view.bounds.width * 0.4, diff --git a/examples/Node.js/SVGImport.js b/examples/Node.js/SVGImport.js index 99bd58ca..2bd9c4b1 100644 --- a/examples/Node.js/SVGImport.js +++ b/examples/Node.js/SVGImport.js @@ -2,12 +2,9 @@ var paper = require('paper'), path = require('path'), fs = require('fs'); -paper.setup(new paper.Canvas(300, 600)); -with (paper) { - fs.readFile('./in.svg', { encoding: 'utf8' }, function (err, data) { - if (err) - throw err; - project.importSVG(data); +paper.setup(new paper.Size(300, 600)); +paper.project.importSVG('file://' + path.resolve(__dirname, 'in.svg'), { + onLoad: function(item) { paper.view.exportFrames({ amount: 1, directory: __dirname, @@ -18,5 +15,5 @@ with (paper) { console.log(event.percentage + '% complete, frame took: ' + event.delta); } }); - }); -} + } +}); diff --git a/examples/Node.js/in.json b/examples/Node.js/in.json index 5cfbdef0..91c93750 100644 --- a/examples/Node.js/in.json +++ b/examples/Node.js/in.json @@ -1 +1 @@ -[["Layer",{"children":[["Group",{"name":"svg","children":[["Group",{"matrix":[1,0,0,1,200,200],"children":[["Group",{"children":[["Path",{"pathData":"M-122.304,84.285c0,0 0.101,1.894 -0.723,1.875c-0.824,-0.019 -17.278,-48.094 -37.806,-45.851c0,0 17.783,-7.353 38.529,43.976z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-118.774,81.262c0,0 -0.549,1.816 -1.318,1.517c-0.768,-0.298 0.115,-51.104 -19.951,-55.978c0,0 19.223,-0.864 21.269,54.461z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-91.284,123.59c0,0 1.636,0.96 1.166,1.637c-0.471,0.677 -49.645,-12.125 -59.1,6.232c0,0 3.679,-18.887 57.934,-7.869z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-94.093,133.801c0,0 1.856,0.396 1.622,1.187c-0.233,0.791 -50.936,4.133 -54.126,24.534c0,0 -2.458,-19.085 52.504,-25.721z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-98.304,128.276c0,0 1.778,0.663 1.432,1.411c-0.346,0.748 -50.994,-3.341 -57.126,16.377c0,0 0.352,-19.239 55.694,-17.788z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-109.009,110.072c0,0 1.308,1.374 0.669,1.895c-0.639,0.521 -44.382,-25.333 -58.529,-10.291c0,0 8.741,-17.143 57.86,8.396z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-116.554,114.263c0,0 1.456,1.217 0.88,1.808c-0.576,0.59 -46.964,-20.149 -59.318,-3.602c0,0 6.745,-18.022 58.438,1.794z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-119.154,118.335c0,0 1.608,1.008 1.118,1.671c-0.49,0.663 -49.272,-13.56 -59.255,4.516c0,0 4.225,-18.773 58.137,-6.187z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-108.42,118.949c0,0 1.122,1.531 0.421,1.966c-0.701,0.435 -40.77,-30.813 -56.728,-17.708c0,0 10.865,-15.881 56.307,15.742z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-128.2,90c0,0 0.6,1.8 -0.2,2c-0.8,0.2 -29.4,-41.8 -48.601,-34.2c0,0 15.201,-11.8 48.801,32.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-127.505,96.979c0,0 0.975,1.629 0.236,1.996c-0.738,0.368 -37.723,-34.476 -54.832,-22.914c0,0 12.297,-14.8 54.596,20.918z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-127.62,101.349c0,0 1.122,1.531 0.421,1.966c-0.701,0.434 -40.77,-30.813 -56.728,-17.708c0,0 10.865,-15.881 56.307,15.742z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-129.83,103.065c0.503,6.048 1.491,12.617 3.23,15.736c0,0 -3.6,12.4 5.2,25.6c0,0 -0.4,7.2 1.2,10.4c0,0 4,8.4 8.8,9.2c3.884,0.647 12.607,3.716 22.468,5.12c0,0 17.132,14.08 13.932,26.88c0,0 -0.4,16.4 -4,18c0,0 11.6,-11.2 2,5.6L-81.4,238.401c0,0 25.6,-21.6 10,-3.2L-81.4,261.201c0,0 19.6,-18.4 12.4,-10L-72.2,260.001c0,0 43.2,-27.2 12.4,2.4c0,0 8,-3.6 12.4,-0.8c0,0 6.8,-1.2 6,0.4c0,0 -20.8,10.4 -24.4,28.8c0,0 8.4,-10 5.2,0.8L-60.2,303.201c0,0 4,-21.6 3.6,16c0,0 19.2,-18 7.6,2.8L-49,338.801c0,0 15.2,-16.4 8.8,-3.6c0,0 10,-8.8 6,6.4c0,0 -0.8,10.4 3.6,-0.8c0,0 16,-30.6 10,-4.4c0,0 -0.8,19.2 4,4.4c0,0 0.4,10.4 9.6,17.6c0,0 -1.2,-50.8 11.6,-14.8L8.6,360.001c0,0 2.8,-9.2 2.4,-14.4c0,0 14.8,-16.4 8,8c0,0 15.2,-22.8 12,-9.6c0,0 -7.6,16 -6,20.8c0,0 16.8,-34.8 18,-36.4c0,0 -2,42.401 8.8,6.4c0,0 5.6,12 2.8,16.4c0,0 8,-8 7.2,-11.2c0,0 4.6,-8.2 7.4,5.4c0,0 1.8,9.4 3.4,6.2c0,0 4,24.001 5.2,1.2c0,0 1.6,-13.6 -5.6,-25.2c0,0 0.8,-3.2 -2,-7.2c0,0 13.6,21.6 6.4,-7.2c0,0 11.201,8 12.401,8c0,0 -13.601,-23.2 -4.801,-18.4c0,0 -5.2,-10.4 12.801,1.6c0,0 -16.001,-16 1.6,-6.4c0,0 8,6.4 0.4,-3.6c0,0 -14.401,-16 7.6,2c0,0 11.6,16.4 12.4,19.2c0,0 -10,-29.2 -14.4,-32c0,0 8.4,-36.4 49.6,-20.8c0,0 6.8,17.2 11.2,-1.2c0,0 12.8,-6.4 24,21.2c0,0 4,-13.6 3.2,-16.4c0,0 6.8,1.2 6,0c0,0 13.2,4.4 14.4,3.6c0,0 6.8,6.8 7.2,3.2c0,0 9.2,2.8 7.2,-0.8c0,0 8.8,15.6 9.2,19.2L239.001,277.601L241.001,280.401c0,0 1.6,-7.6 0.8,-8.8c-0.8,-1.2 20,6.8 24.8,27.6L268.601,307.601c0,0 6,-14.8 4.4,-18.8c0,0 5.2,0.8 5.6,5.2c0,0 4,-23.2 -0.8,-29.2c0,0 4.4,-0.8 5.6,2.8L283.401,260.401c0,0 7.2,0.8 7.2,-1.6c0,0 4.4,-4 6.4,0.8c0,0 -12.4,-35.2 6,-16c0,0 7.2,10.8 3.6,-8c-3.6,-18.8 -7.6,-20.4 -2.8,-20.8c0,0 0.8,-3.6 -1.2,-5.2c-2,-1.6 1.2,0 1.2,0c0,0 4.8,4 -0.4,-18c0,0 6.4,1.6 -5.6,-27.6c0,0 2.8,-2.4 -1.2,-10.8c0,0 8,4.4 10.8,2.8c0,0 -0.4,-1.6 -3.6,-5.6c0,0 -21.6,-54.801 -1.2,-32.8c0,0 11.85,13.55 5.45,-9.25c0,0 -9.111,-24.01 -8.334,-28.306L-129.83,103.065z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M299.717,80.245c0.628,0.181 2.834,1.305 4.084,2.955c0,0 6.8,10.8 1.6,-7.6c0,0 -9.2,-28.8 -0.4,-17.6c0,0 6,7.2 2.8,-6.4c-3.865,-16.427 -6.4,-22.8 -6.4,-22.8c0,0 11.6,4.8 -15.2,-34.8L295.001,-2.4c0,0 -19.6,-39.6 -41.2,-44.8L245.801,-53.2c0,0 38.4,-38 25.6,-74.8c0,0 -6.8,-5.2 -16.4,4c0,0 -6.4,4.8 -12.4,3.2c0,0 -30.8,1.2 -32.8,1.2c-2,0 -36.8,-37.2 -102.4,-19.6c0,0 -5.2,2 -9.6,0.8c0,0 -18.401,-16 -67.201,6.8c0,0 -10,2 -11.6,2c-1.6,0 -4.4,0 -12.4,6.4c-8,6.4 -8.4,7.2 -10.4,8.8c0,0 -16.4,11.2 -21.2,12c0,0 -11.6,6.4 -16,16.4L-44.6,-84.8c0,0 -1.6,7.2 -2,8.4c0,0 -4.8,3.6 -5.6,9.2c0,0 -8.8,6 -8.4,10.4c0,0 -1.6,5.2 -2.4,10c0,0 -7.2,4.8 -6.4,7.6c0,0 -7.6,14 -6.4,20.8c0,0 -6.4,-0.4 -9.2,2c0,0 -0.8,4.8 -2.4,5.2c0,0 -2.8,1.2 -0.4,5.2c0,0 -1.6,2.8 -2,4.4c0,0 0.8,2.8 -3.6,8.4c0,0 -6.4,18.8 -4.4,24c0,0 0.4,4.8 -2.4,6.4c0,0 -3.6,-0.4 4.8,11.6c0,0 0.8,1.2 -2.4,3.6c0,0 -17.2,3.6 -19.6,20c0,0 -13.6,14.8 -13.6,20c0,2.305 0.271,5.452 0.97,10.065c0,0 -0.57,8.336 27.03,9.136c27.6,0.8 402.717,-31.356 402.717,-31.356z","fillColor":["rgb",0.8,0.44706,0.14902],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-115.6,102.6c-25,-39.4 -10.6,17.001 -10.6,17.001c8.8,34.4 138.4,-3.2 138.4,-3.2c0,0 168.801,-30.401 180.001,-34.401c11.2,-4 106.4,2.4 106.4,2.4L293.001,67.6c-64.8,-46.4 -84,-23.2 -97.6,-27.2c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2c-6.4,0.8 -31.742,-22.951 -16.8,8.8c16,34 -58.401,39.2 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -8.31,-23.101 -40,3.2c-20,16.601 -33.8,-5.4 -33.8,-5.4L-115.6,102.6z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M133.51,25.346c-6.4,0.8 -31.767,-22.939 -16.8,8.8c16.6,35.2 -58.4,39.2 -75.2,28c-16.801,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16.001,3.2 -16.001,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -8.179,-22.934 -40,3.2c-21.236,17.346 -34.727,-4.109 -34.727,-4.109L-115.618,104.146c-25,-39.8 -9.928,18.509 -9.928,18.509c8.801,34.401 139.055,-4.509 139.055,-4.509c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 105.528,2.327 105.528,2.327L293.51,68.764c-64.8,-46.4 -83.2,-22.618 -96.8,-26.618c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.9098,0.49804,0.22745]}]]}],["Group",{"children":[["Path",{"pathData":"M134.819,27.091c-6.4,0.8 -31.134,-23.229 -16.8,8.8c16.2,36.201 -58.4,39.201 -75.2,28.001c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.401,12.8 -61.601,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -8.048,-22.767 -40,3.2c-22.473,18.091 -35.654,-2.818 -35.654,-2.818L-115.636,105.692c-23.8,-39 -9.255,20.018 -9.255,20.018c8.8,34.4 139.71,-5.818 139.71,-5.818c0,0 168.8,-30.4 180,-34.4c11.2,-4 104.655,2.254 104.655,2.254L294.02,69.928c-64.801,-46.4 -82.401,-22.037 -96.001,-26.037c-13.6,-4 -11.2,5.6 -14.4,6.401c-3.2,0.8 -42.4,-24.001 -48.8,-23.201z","fillColor":["rgb",0.91765,0.54902,0.30196]}]]}],["Group",{"children":[["Path",{"pathData":"M136.128,28.837c-6.4,0.8 -31.129,-23.232 -16.8,8.8c16.8,37.556 -58.934,38.845 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.917,-22.598 -40.001,3.2c-23.709,18.837 -36.582,-1.527 -36.582,-1.527L-115.655,107.237c-21.8,-36.8 -8.581,21.528 -8.581,21.528c8.8,34.4 140.364,-7.128 140.364,-7.128c0,0 168.8,-30.4 180.001,-34.4c11.2,-4 103.782,2.182 103.782,2.182L294.529,71.092c-64.8,-46.401 -81.6,-21.455 -95.2,-25.455c-13.601,-4 -11.201,5.6 -14.401,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.92549,0.6,0.38039]}]]}],["Group",{"children":[["Path",{"pathData":"M137.438,30.583c-6.401,0.8 -30.624,-23.454 -16.801,8.8c16.801,39.2 -58.4,39.2 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.785,-22.431 -40,3.2c-24.946,19.582 -37.51,-0.237 -37.51,-0.237L-115.673,108.783c-19.8,-34.801 -7.909,23.036 -7.909,23.036c8.8,34.401 141.019,-8.436 141.019,-8.436c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 102.909,2.109 102.909,2.109L295.038,72.255c-64.8,-46.4 -80.8,-20.872 -94.4,-24.872c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.93333,0.64706,0.45882]}]]}],["Group",{"children":[["Path",{"pathData":"M138.747,32.328c-6.4,0.8 -32.364,-22.651 -16.8,8.8c19.2,38.8 -58.401,39.2 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.654,-22.263 -40,3.2c-26.182,20.328 -38.437,1.055 -38.437,1.055L-115.691,110.328c-18,-33.2 -7.236,24.546 -7.236,24.546c8.8,34.4 141.673,-9.746 141.673,-9.746c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 102.036,2.036 102.036,2.036L295.547,73.419c-64.8,-46.4 -80,-20.291 -93.6,-24.291c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.9451,0.69804,0.53333]}]]}],["Group",{"children":[["Path",{"pathData":"M140.056,34.073c-6.401,0.8 -32.743,-22.46 -16.801,8.8c20.401,40.001 -58.4,39.201 -75.2,28.001c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.523,-22.096 -40,3.2c-27.419,21.073 -39.364,2.345 -39.364,2.345L-115.709,111.874c-16,-30.2 -6.564,26.055 -6.564,26.055c8.8,34.4 142.328,-11.055 142.328,-11.055c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 101.164,1.963 101.164,1.963L296.056,74.583c-64.8,-46.4 -79.2,-19.709 -92.8,-23.709c-13.6,-4.001 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24.001 -48.8,-23.201z","fillColor":["rgb",0.95294,0.74902,0.61176]}]]}],["Group",{"children":[["Path",{"pathData":"M141.365,35.819c-6.4,0.8 -33.842,-21.875 -16.8,8.8c22,39.6 -58.401,39.2 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.391,-21.927 -40,3.2c-28.655,21.819 -40.291,3.637 -40.291,3.637L-115.727,113.419c-14.401,-28.4 -5.891,27.564 -5.891,27.564c8.8,34.401 142.982,-12.364 142.982,-12.364c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 100.291,1.891 100.291,1.891L296.565,75.746c-64.8,-46.4 -78.4,-19.127 -92,-23.127c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.96078,0.8,0.6902]}]]}],["Group",{"children":[["Path",{"pathData":"M142.674,37.565c-6.4,0.8 -33.842,-21.876 -16.8,8.8c22,39.6 -58.4,39.2 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.401,-12.8 -58.401,12.8 -61.601,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.259,-21.76 -40,3.2c-29.891,22.564 -41.218,4.928 -41.218,4.928L-115.745,114.965c-13.601,-26.401 -5.218,29.073 -5.218,29.073c8.8,34.4 143.636,-13.673 143.636,-13.673c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 99.419,1.818 99.419,1.818L297.075,76.91c-64.801,-46.4 -77.601,-18.545 -91.201,-22.545c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.97255,0.84706,0.76863]}]]}],["Group",{"children":[["Path",{"pathData":"M143.983,39.31c-6.4,0.8 -33.454,-22.087 -16.8,8.8c22,40.8 -58.4,39.2 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.201,0.8 -8.001,4 -8.801,-2.4c-0.8,-6.4 -7.128,-21.592 -40,3.2c-31.127,23.31 -42.145,6.219 -42.145,6.219L-115.764,116.51c-13,-24 -4.545,30.583 -4.545,30.583c8.8,34.4 144.292,-14.983 144.292,-14.983c0,0 168.8,-30.4 180,-34.4c11.2,-4 98.546,1.746 98.546,1.746L297.583,78.074c-64.8,-46.401 -76.8,-17.964 -90.4,-21.964c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.98039,0.89804,0.84314]}]]}],["Group",{"children":[["Path",{"pathData":"M145.292,41.055c-6.4,0.8 -32.375,-22.644 -16.8,8.8c21.2,42.801 -58.4,39.201 -75.2,28.001c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -6.997,-21.424 -40,3.2c-32.365,24.055 -43.074,7.509 -43.074,7.509L-115.782,118.056c-12.8,-23.2 -3.872,32.091 -3.872,32.091c8.8,34.4 144.946,-16.291 144.946,-16.291c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 97.672,1.672 97.672,1.672L298.093,79.237c-64.801,-46.4 -76,-17.381 -89.6,-21.381c-13.6,-4.001 -11.2,5.6 -14.4,6.4c-3.201,0.8 -42.401,-24.001 -48.801,-23.201z","fillColor":["rgb",0.98824,0.94902,0.92157]}]]}],["Group",{"children":[["Path",{"pathData":"M-115.8,119.601c-12.8,-22.001 -3.2,33.6 -3.2,33.6c8.8,34.4 145.6,-17.6 145.6,-17.6c0,0 168.801,-30.401 180.001,-34.401c11.2,-4 96.8,1.6 96.8,1.6L298.601,80.4c-64.8,-46.4 -75.2,-16.8 -88.8,-20.8c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2c-6.4,0.8 -31.62,-23.007 -16.8,8.8c22.227,47.707 -60.76,37.627 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20.001 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.801 -61.6,13.601c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.401 -6.865,-21.257 -40,3.2c-33.6,24.8 -44,8.8 -44,8.8L-115.8,119.601z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-74.2,149.601c0,0 -7.2,11.6 13.6,24.8c0,0 1.4,1.4 -16.6,-2.8c0,0 -6.2,-2 -7.8,-12.4c0,0 -4.8,-4.4 -9.6,-10c-4.8,-5.6 20.4,0.4 20.4,0.4z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M65.8,102c0,0 17.698,26.821 17.1,31.601c-1.3,10.4 -1.5,20 1.7,24c3.201,4 12.001,37.2 12.001,37.2c0,0 -0.4,1.2 12,-36.8c0,0 11.6,-16 -8.4,-34.4c0,0 -35.201,-28.801 -34.401,-21.601z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-54.2,176.401c0,0 11.2,7.2 -3.2,38.4L-51,212.401c0,0 -0.8,11.2 -4,13.6L-47.8,222.801c0,0 4.8,8 0.8,12.8c0,0 16.8,8 16,14.4c0,0 6.4,-8 2.4,-14.4c-4,-6.4 -11.2,-2.4 -10.4,-20.8L-47.8,218.001c0,0 5.6,-8.8 5.6,-15.2L-50.2,205.201c0,0 15.469,-26.578 4.8,-28c-6,-0.8 -8.8,-0.8 -8.8,-0.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-21.8,193.201c0,0 2.8,-4.4 0,-3.6c-2.8,0.8 -34,15.6 -40,25.2c0,0 34.4,-24.4 40,-21.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-11.4,201.201c0,0 2.8,-4.4 0,-3.6c-2.8,0.8 -34,15.6 -40,25.2c0,0 34.4,-24.4 40,-21.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M1.8,186.001c0,0 2.8,-4.4 0,-3.6c-2.8,0.8 -34,15.6 -40,25.2c0,0 34.4,-24.4 40,-21.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-21.4,229.601c0,0 0,-6 -2.8,-5.2c-2.8,0.8 -38.8,18.4 -44.8,28c0,0 42,-25.6 47.6,-22.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-20.2,218.801c0,0 1.2,-4.8 -1.6,-4c-2,0 -28.4,11.6 -34.4,21.2c0,0 29.6,-21.6 36,-17.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-34.6,266.401L-44.6,274.001c0,0 10.4,-7.6 14,-6.4c0,0 -6.8,11.2 -7.6,16.4c0,0 10.4,-12.8 16,-12.4c0,0 7.6,0.4 7.6,11.2c0,0 5.6,-10.4 8.8,-10c0,0 1.2,6.4 0,13.2c0,0 4,-7.6 8,-6c0,0 6.4,-2 5.6,9.6c0,0 0,10.4 -0.8,13.2c0,0 5.6,-26.4 8,-26.8c0,0 8,-1.2 12.8,7.6c0,0 -4,-7.6 0.8,-5.6c0,0 10.8,1.6 14,8.4c0,0 -6.8,-12 -1.2,-8.8c0,0 6.8,0 8,6.4c0,0 8.4,21.2 10.4,22.8c0,0 -7.6,-21.6 -6,-21.6c0,0 -2,-12 3.2,2.8c0,0 -3.2,-14 2.4,-13.2c5.6,0.8 10,10.8 18.4,8.4c0,0 9.601,5.6 11.601,-63.6L-34.6,266.401z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-29.8,173.601c0,0 14.8,-6 54.8,0c0,0 7.2,0.4 14,-8.4c6.8,-8.8 33.6,-16 40,-14L88.601,157.601L89.401,158.801c0,0 12.4,10.4 12.8,18c0.4,7.6 -14.4,55.6 -24.001,71.6c-9.6,16 -19.2,28.4 -38.4,26c0,0 -20.8,-4 -46.4,0c0,0 -29.2,-1.6 -32,-9.6c-2.8,-8 11.2,-23.2 11.2,-23.2c0,0 4.4,-8.4 3.2,-22.8c-1.2,-14.4 -0.8,-42.4 -5.6,-45.2z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-7.8,175.601c8.4,18.4 -21.2,83.6 -21.2,83.6c-2,1.6 12.66,7.645 22.8,5.2c10.946,-2.638 51.2,1.6 51.2,1.6c23.6,-15.6 36.4,-60 36.4,-60c0,0 10.401,-24 -7.2,-27.2c-17.6,-3.2 -82,-3.2 -82,-3.2z","fillColor":["rgb",0.89804,0.4,0.54902]}]]}],["Group",{"children":[["Path",{"pathData":"M-9.831,206.497c3.326,-12.79 4.91,-24.591 2.031,-30.896c0,0 62.4,6.4 73.6,-14.4c4.241,-7.875 19.001,22.8 18.6,32.4c0,0 -63,14.4 -77.8,3.2L-9.831,206.497z","fillColor":["rgb",0.69804,0.19608,0.34902]}]]}],["Group",{"children":[["Path",{"pathData":"M-5.4,222.801c0,0 2,7.2 -0.4,11.2c0,0 -1.6,0.8 -2.8,1.2c0,0 1.2,3.6 7.2,5.2c0,0 2,4.4 4.4,4.8c2.4,0.4 7.2,6 11.2,4.8c4,-1.2 15.2,-5.2 15.2,-5.2c0,0 5.6,-3.2 14.4,0.4c0,0 2.375,-0.802 2.8,-4.8c0.5,-4.7 3.6,-8.4 5.6,-10.4c2,-2 11.6,-14.8 10.4,-15.2c-1.2,-0.4 -68,8 -68,8z","fillColor":["rgb",0.64706,0.14902,0.29804]}]]}],["Group",{"children":[["Path",{"pathData":"M-9.8,174.401c0,0 -2.8,22.4 0.4,30.8c3.2,8.4 2.4,10.4 1.6,14.4c-0.8,4 3.6,14 9.2,20L13.4,241.201c0,0 15.2,-3.6 24.4,-0.8c0,0 8.994,1.343 12.4,-13.6c0,0 4.8,-6.4 12,-9.2c7.2,-2.8 14.4,-44.4 10.4,-52.4c-4,-8 -18.4,-12.4 -34.4,3.2c-16,15.6 -18,-1.2 -48,6z","fillColor":["rgb",1,0.44706,0.49804],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-8.2,249.201c0,0 -0.8,-2 -5.2,-2.4c0,0 -22.4,-3.6 -30.8,-16c0,0 -6.8,-5.6 -2.4,6c0,0 10.4,20.4 17.2,23.2c0,0 16.4,4 21.2,-10.8z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M71.742,185.229c0.659,-7.906 2.612,-16.52 0.858,-20.028c-6.446,-12.894 -23.419,-7.506 -34.4,3.2c-16,15.6 -18,-1.2 -48,6c0,0 -1.745,13.963 -0.905,23.975c0,0 37.305,-11.575 38.105,-5.975c0,0 1.6,-3.2 10.8,-3.2c9.2,0 31.942,-1.172 33.542,-3.972z","fillColor":["rgb",0.8,0.24706,0.29804]}]]}],["Group",{"children":[["Path",{"pathData":"M28.6,175.201c0,0 4.8,4.8 1.2,14.4c0,0 -14.4,16 -12.4,30","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.09804,0.14902],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M-19.4,260.001c0,0 -4.4,-12.8 4.4,-6c0,0 4.8,2 3.6,3.6c-1.2,1.6 -6.8,5.6 -8,2.4z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-14.36,261.201c0,0 -3.52,-10.24 3.52,-4.8c0,0 4.421,2.448 2.88,2.88c-4.56,1.28 0,3.84 -6.4,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-9.56,261.201c0,0 -3.52,-10.24 3.52,-4.8c0,0 4.375,2.31 2.88,2.88c-3.36,1.28 0,3.84 -6.4,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-2.96,261.401c0,0 -3.52,-10.24 3.52,-4.8c0,0 4.383,2.332 2.881,2.88c-2.961,1.08 0,3.84 -6.401,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M3.52,261.321c0,0 -3.52,-10.24 3.521,-4.8c0,0 3.84,1.6 2.88,2.88c-0.96,1.28 0,3.84 -6.401,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M10.2,262.001c0,0 -4.8,-12.4 4.4,-6c0,0 4.8,2 3.6,3.6c-1.2,1.6 0,4.8 -8,2.4z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-18.2,244.801c0,0 13.2,-2.8 19.2,0.4c0,0 6,1.2 7.2,0.8c1.2,-0.4 4.4,-0.8 4.4,-0.8","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M15.8,253.601c0,0 12,-13.6 24,-9.2c7.016,2.573 6,-0.8 6.8,-3.6c0.8,-2.8 1,-7 6,-10","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M33,237.601c0,0 -4,-10.8 -6.8,2c-2.8,12.8 -6,16.4 -7.6,19.2c0,0 0,5.2 8.4,4.8c0,0 10.8,-0.4 11.2,-3.2c0.4,-2.8 -1.2,-14.4 -5.2,-22.8z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M47,244.801c0,0 3.6,-2.4 6,-1.2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M53.5,228.401c0,0 2.9,-4.9 7.7,-5.7","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M-25.8,265.201c0,0 18,3.2 22.4,1.6c0,0 8.8,0 0.4,2c0,0 -12.8,0 -20.8,-1.2c0,0 -11.6,-5.6 -2,-2.4z","fillColor":["rgb",0.69804,0.69804,0.69804]}]]}],["Group",{"children":[["Path",{"pathData":"M-11.8,172.001c0,0 17.6,0 19.6,0.8c0,0 7.2,30.8 3.6,38.4c0,0 -1.2,2.8 -4,-2.8c0,0 -18.4,-32.8 -21.6,-34.8c-3.2,-2 1.2,-1.6 2.4,-1.6z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-88.9,169.301c0,0 8.9,1.7 21.5,4.3c0,0 4.8,22.4 8,27.2c3.2,4.8 -0.4,4.8 -4,2c-3.6,-2.8 -18.4,-16.8 -20.4,-21.2c-2,-4.4 -5.1,-12.3 -5.1,-12.3z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-67.039,173.818c0,0 5.8,1.548 6.809,3.763c1.008,2.214 -1.202,5.511 -1.202,5.511c0,0 -1,3.305 -2.202,1.143c-1.202,-2.163 -4.074,-9.823 -3.405,-10.417z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-67,173.601c0,0 3.6,5.2 7.2,5.2c3.6,0 3.982,-0.413 6.8,0.2c4.6,1 4.2,-1 10.8,0.2c2.64,0.48 5.2,-0.4 8,0.8c2.8,1.2 6,0.4 7.2,-1.6c1.2,-2 6,-6.2 6,-6.2c0,0 -12.8,1.8 -15.6,2.6c0,0 -22.4,1.2 -30.4,-1.2z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-22.4,173.801c0,0 -6.45,3.5 -6.85,5.9c-0.4,2.4 5.25,6.1 5.25,6.1c0,0 2.75,4.6 3.35,2.2c0.6,-2.4 -0.95,-13.8 -1.75,-14.2z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-59.885,179.265c0,0 7.007,11.188 7.224,-0.023c0,0 0.557,-1.258 -1.203,-1.28c-6.075,-0.076 -4.554,-4.178 -6.021,1.303z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-52.707,179.514c0,0 7.921,11.187 7.285,-0.093c0,0 0.007,-0.332 -1.746,-0.485c-4.747,-0.414 -4.402,-4.932 -5.539,0.578z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-45.494,179.522c0,0 7.96,10.628 7.291,0.962c0,0 0.119,-1.233 -1.535,-1.534c-3.892,-0.706 -4.103,-3.955 -5.756,0.572z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-38.618,179.602c0,0 7.9,11.561 8.248,1.78c0,0 1.644,-1.378 -0.102,-1.6c-5.818,-0.74 -5.02,-5.194 -8.146,-0.18z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-74.792,183.132L-82.45,181.601c-2.6,-5 -4.7,-11.15 -4.7,-11.15c0,0 6.35,1 18.85,3.8c0,0 0.876,3.318 2.348,9.113L-74.792,183.132z","fillColor":["rgb",0.89804,0.89804,0.69804]}]]}],["Group",{"children":[["Path",{"pathData":"M-9.724,178.47c-1.666,-2.506 -2.983,-4.264 -3.633,-4.67c-3.013,-1.883 1.13,-1.506 2.259,-1.506c0,0 16.571,0 18.454,0.753c0,0 0.524,2.242 1.208,5.633c0,0 -10.088,-2.01 -18.288,-0.21z","fillColor":["rgb",0.89804,0.89804,0.69804]}]]}],["Group",{"children":[["Path",{"pathData":"M43.88,40.321c27.721,3.96 53.241,-31.68 55.001,-41.361c1.76,-9.68 -8.36,-21.56 -8.36,-21.56c1.32,-3.08 -3.52,-17.16 -8.8,-26.4c-5.28,-9.24 -21.181,-8.266 -38.721,-9.24c-15.84,-0.88 -34.32,22.44 -35.64,24.2c-1.32,1.76 4.84,40.041 6.16,45.761c1.32,5.72 -1.32,32.12 -1.32,32.12c34.24,-9.1 3.96,-7.48 31.68,-3.52z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M8.088,-33.392c-1.296,1.728 4.752,39.313 6.048,44.929c1.296,5.616 -1.296,31.536 -1.296,31.536c32.672,-8.88 3.888,-7.344 31.104,-3.456c27.217,3.888 52.273,-31.104 54.001,-40.609c1.728,-9.504 -8.208,-21.168 -8.208,-21.168c1.296,-3.024 -3.456,-16.848 -8.64,-25.92c-5.184,-9.072 -20.795,-8.115 -38.017,-9.072c-15.552,-0.864 -33.696,22.032 -34.992,23.76z","fillColor":["rgb",0.91765,0.55686,0.31765]}]]}],["Group",{"children":[["Path",{"pathData":"M8.816,-32.744c-1.272,1.696 4.664,38.585 5.936,44.097c1.272,5.512 -1.272,30.952 -1.272,30.952c31.404,-9.16 3.816,-7.208 30.528,-3.392c26.713,3.816 51.305,-30.528 53.001,-39.857c1.696,-9.328 -8.056,-20.776 -8.056,-20.776c1.272,-2.968 -3.392,-16.536 -8.48,-25.44c-5.088,-8.904 -20.41,-7.965 -37.313,-8.904c-15.264,-0.848 -33.072,21.624 -34.344,23.32z","fillColor":["rgb",0.93725,0.66667,0.48627]}]]}],["Group",{"children":[["Path",{"pathData":"M9.544,-32.096c-1.248,1.664 4.576,37.857 5.824,43.265c1.248,5.408 -1.248,30.368 -1.248,30.368c29.436,-9.04 3.744,-7.072 29.952,-3.328c26.209,3.744 50.337,-29.952 52.001,-39.104c1.664,-9.153 -7.904,-20.385 -7.904,-20.385c1.248,-2.912 -3.328,-16.224 -8.32,-24.96c-4.992,-8.736 -20.025,-7.815 -36.609,-8.736c-14.976,-0.832 -32.448,21.216 -33.696,22.88z","fillColor":["rgb",0.95686,0.77647,0.65882]}]]}],["Group",{"children":[["Path",{"pathData":"M10.272,-31.448c-1.224,1.632 4.488,37.129 5.712,42.433c1.224,5.304 -1.224,29.784 -1.224,29.784c27.868,-8.92 3.672,-6.936 29.376,-3.264c25.705,3.672 49.369,-29.376 51.001,-38.353c1.632,-8.976 -7.752,-19.992 -7.752,-19.992c1.224,-2.856 -3.264,-15.912 -8.16,-24.48c-4.896,-8.568 -19.64,-7.665 -35.905,-8.568c-14.688,-0.816 -31.824,20.808 -33.048,22.44z","fillColor":["rgb",0.97647,0.88627,0.82745]}]]}],["Group",{"children":[["Path",{"pathData":"M44.2,36.8c25.2,3.6 48.401,-28.8 50.001,-37.6c1.6,-8.8 -7.6,-19.6 -7.6,-19.6c1.2,-2.8 -3.201,-15.6 -8.001,-24c-4.8,-8.4 -19.254,-7.514 -35.2,-8.4c-14.4,-0.8 -31.2,20.4 -32.4,22c-1.2,1.6 4.4,36.4 5.6,41.6c1.2,5.2 -1.2,29.2 -1.2,29.2c25.5,-8.6 3.6,-6.8 28.8,-3.2z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M90.601,2.8c0,0 -27.801,7.6 -39.401,6c0,0 -15.8,-6.6 -24.6,15.2c0,0 -3.6,7.2 -5.6,9.2c-2,2 69.601,-30.4 69.601,-30.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M94.401,0.6c0,0 -29.001,12.2 -39.001,11.8c0,0 -16.4,-4.6 -24.8,10c0,0 -8.4,9.2 -11.6,10.8c0,0 -0.4,1.6 6,-2.4L35.4,36c0,0 14.8,9.6 24.4,-6.4c0,0 4,-11.2 4,-13.2c0,-2 21.2,-7.6 22.801,-8c1.6,-0.4 8.2,-4.6 7.8,-7.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M47,36.514c-6.872,0 -15.245,-3.865 -15.245,-10.114c0,-6.248 8.373,-12.513 15.245,-12.513c6.874,0 12.446,5.065 12.446,11.313c0,6.249 -5.572,11.314 -12.446,11.314z","fillColor":["rgb",0.6,0.8,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M43.377,19.83c-4.846,0.722 -9.935,2.225 -9.863,2.009c1.54,-4.619 7.901,-7.952 13.486,-7.952c4.296,0 8.084,1.978 10.32,4.988c0,0 -5.316,-0.33 -13.943,0.955z","fillColor":["rgb",0.39608,0.6,0]}]]}],["Group",{"children":[["Path",{"pathData":"M55.4,19.6c0,0 -4.4,-3.2 -4.4,-1c0,0 3.6,4.4 4.4,1z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M45.4,27.726c-2.499,0 -4.525,-2.026 -4.525,-4.526c0,-2.499 2.026,-4.525 4.525,-4.525c2.5,0 4.526,2.026 4.526,4.525c0,2.5 -2.026,4.526 -4.526,4.526z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-58.6,14.4c0,0 -3.2,-21.2 -0.8,-25.6c0,0 10.8,-10 10.4,-13.6c0,0 -0.4,-18 -1.6,-18.8c-1.2,-0.8 -8.8,-6.8 -14.8,-0.4c0,0 -10.4,18 -9.6,24.4L-75,-17.6c0,0 -7.6,-0.4 -9.2,1.6c0,0 -1.2,5.2 -2.4,5.6c0,0 -2.8,2.4 -0.8,5.2c0,0 -2,2.4 -1.6,6.4L-81.4,5.2c0,0 2,14.4 12.8,19.6c4.836,2.329 8,-4.4 10,-10.4z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M-59.6,12.56c0,0 -2.88,-19.08 -0.72,-23.04c0,0 9.72,-9 9.36,-12.24c0,0 -0.36,-16.2 -1.44,-16.92c-1.08,-0.72 -7.92,-6.12 -13.32,-0.36c0,0 -9.36,16.2 -8.64,21.96L-74.36,-16.24c0,0 -6.84,-0.36 -8.28,1.44c0,0 -1.08,4.68 -2.16,5.04c0,0 -2.52,2.16 -0.72,4.68c0,0 -1.8,2.16 -1.44,5.76L-80.12,4.28c0,0 1.8,12.96 11.52,17.64c4.352,2.095 7.2,-3.96 9,-9.36z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-51.05,-42.61c-1.09,-0.86 -8.58,-6.63 -14.43,-0.39c0,0 -10.14,17.55 -9.36,23.79L-74.84,-17.26c0,0 -7.41,-0.39 -8.97,1.56c0,0 -1.17,5.07 -2.34,5.46c0,0 -2.73,2.34 -0.78,5.07c0,0 -1.95,2.34 -1.56,6.24L-81.08,4.97c0,0 1.95,14.04 12.48,19.11c4.714,2.27 7.8,-4.29 9.75,-10.14c0,0 -3.12,-20.67 -0.78,-24.96c0,0 10.53,-9.75 10.14,-13.26c0,0 -0.39,-17.55 -1.56,-18.33z","fillColor":["rgb",0.92157,0.58431,0.36078]}]]}],["Group",{"children":[["Path",{"pathData":"M-51.5,-41.62c-0.98,-0.92 -8.36,-6.46 -14.06,-0.38c0,0 -9.88,17.1 -9.12,23.18L-74.68,-16.92c0,0 -7.22,-0.38 -8.74,1.52c0,0 -1.14,4.94 -2.28,5.32c0,0 -2.66,2.28 -0.76,4.94c0,0 -1.9,2.28 -1.52,6.08L-80.76,4.74c0,0 1.9,13.68 12.16,18.62c4.594,2.212 7.6,-4.18 9.5,-9.88c0,0 -3.04,-20.14 -0.76,-24.32c0,0 10.26,-9.5 9.88,-12.92c0,0 -0.38,-17.1 -1.52,-17.86z","fillColor":["rgb",0.94902,0.72157,0.57255]}]]}],["Group",{"children":[["Path",{"pathData":"M-51.95,-40.63c-0.87,-0.98 -8.14,-6.29 -13.69,-0.37c0,0 -9.62,16.65 -8.88,22.57L-74.52,-16.58c0,0 -7.03,-0.37 -8.51,1.48c0,0 -1.11,4.81 -2.22,5.18c0,0 -2.59,2.22 -0.74,4.81c0,0 -1.85,2.22 -1.48,5.92L-80.44,4.51c0,0 1.85,13.32 11.84,18.13c4.473,2.154 7.4,-4.07 9.25,-9.62c0,0 -2.96,-19.61 -0.74,-23.68c0,0 9.99,-9.25 9.62,-12.58c0,0 -0.37,-16.65 -1.48,-17.39z","fillColor":["rgb",0.97255,0.86275,0.78431]}]]}],["Group",{"children":[["Path",{"pathData":"M-59.6,12.46c0,0 -2.88,-18.98 -0.72,-22.94c0,0 9.72,-9 9.36,-12.24c0,0 -0.36,-16.2 -1.44,-16.92c-0.76,-1.04 -7.92,-6.12 -13.32,-0.36c0,0 -9.36,16.2 -8.64,21.96L-74.36,-16.24c0,0 -6.84,-0.36 -8.28,1.44c0,0 -1.08,4.68 -2.16,5.04c0,0 -2.52,2.16 -0.72,4.68c0,0 -1.8,2.16 -1.44,5.76L-80.12,4.28c0,0 1.8,12.96 11.52,17.64c4.352,2.095 7.2,-4.06 9,-9.46z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-62.7,6.2c0,0 -21.6,-10.2 -22.5,-11c0,0 9.1,8.2 9.9,8.2c0.8,0 12.6,2.8 12.6,2.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-79.8,0c0,0 18.4,3.6 18.4,8c0,2.912 -0.243,16.331 -5.6,14.8c-8.4,-2.4 -4.8,-16.8 -12.8,-22.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-71.4,3.8c0,0 8.978,1.474 10,4.2c0.6,1.6 1.263,9.908 -4.2,11c-4.552,0.911 -6.782,-9.31 -5.8,-15.2z","fillColor":["rgb",0.6,0.8,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M14.595,46.349c-0.497,-1.742 0.814,-1.611 2.605,-2.149c2,-0.6 14.2,-4.4 15,-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children":[["Path",{"pathData":"M209.401,-120c0,0 -25.6,8 -28.4,26.8c0,0 -2.4,22.8 18,40.4c0,0 0.4,6.4 2.4,9.6c0,0 -1.6,4.8 17.2,-2.8L245.801,-54.4c0,0 6.4,-2.4 11.6,-11.2c5.2,-8.8 20.4,-27.6 16.8,-52.8c0,0 1.2,-11.2 -4.8,-11.6c0,0 -8.4,-1.6 -15.6,6c0,0 -6.8,3.2 -9.2,2.8L209.401,-120z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M264.022,-120.99c0,0 2.1,-8.93 -2.74,-4.09c0,0 -7.04,5.72 -14.521,5.72c0,0 -14.52,2.2 -18.92,15.4c0,0 -3.96,26.84 3.96,32.56c0,0 4.84,7.48 11.88,0.88c7.041,-6.6 22.541,-36.83 20.341,-50.47z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M263.648,-120.632c0,0 2.09,-8.744 -2.662,-3.992c0,0 -6.912,5.616 -14.257,5.616c0,0 -14.256,2.16 -18.576,15.12c0,0 -3.888,26.352 3.888,31.968c0,0 4.752,7.344 11.664,0.864c6.913,-6.48 22.103,-36.184 19.943,-49.576z","fillColor":["rgb",0.19608,0.19608,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M263.274,-120.274c0,0 2.08,-8.558 -2.584,-3.894c0,0 -6.784,5.512 -13.993,5.512c0,0 -13.992,2.12 -18.232,14.84c0,0 -3.816,25.864 3.816,31.376c0,0 4.664,7.208 11.448,0.848c6.785,-6.36 21.665,-35.538 19.545,-48.682z","fillColor":["rgb",0.4,0.4,0.4]}]]}],["Group",{"children":[["Path",{"pathData":"M262.9,-119.916c0,0 2.07,-8.372 -2.506,-3.796c0,0 -6.656,5.408 -13.729,5.408c0,0 -13.728,2.08 -17.888,14.56c0,0 -3.744,25.376 3.744,30.784c0,0 4.576,7.072 11.232,0.832c6.657,-6.24 21.227,-34.892 19.147,-47.788z","fillColor":["rgb",0.6,0.6,0.6]}]]}],["Group",{"children":[["Path",{"pathData":"M262.526,-119.558c0,0 2.06,-8.186 -2.428,-3.698c0,0 -6.529,5.304 -13.465,5.304c0,0 -13.464,2.04 -17.544,14.28c0,0 -3.672,24.888 3.672,30.192c0,0 4.488,6.936 11.016,0.816c6.528,-6.12 20.789,-34.246 18.749,-46.894z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M262.151,-119.2c0,0 2.05,-8 -2.35,-3.6c0,0 -6.4,5.2 -13.2,5.2c0,0 -13.2,2 -17.2,14c0,0 -3.6,24.4 3.6,29.6c0,0 4.4,6.8 10.8,0.8c6.4,-6 20.35,-33.6 18.35,-46z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M50.6,84c0,0 -20.4,-19.2 -28.4,-20c0,0 -34.4,-4 -49.2,14c0,0 17.6,-20.4 45.2,-14.8c0,0 -21.6,-4.4 -34,-1.2c0,0 -16.8,0 -26.4,14L-45,80.8c0,0 4,-14.8 22.4,-20.8c0,0 22.8,-4.8 33.6,0c0,0 -21.6,-6.8 -31.6,-4.8c0,0 -30.4,-2.4 -43.2,24c0,0 4,-14.4 18.8,-21.6c0,0 13.6,-8.8 34,-6c0,0 14.4,3.2 19.6,5.6c5.2,2.4 4,-0.4 -4.4,-5.2c0,0 -5.6,-10 -19.6,-9.6c0,0 -42.8,3.6 -53.2,15.6c0,0 13.6,-11.2 24,-14c0,0 22.4,-8 30.8,-7.2c0,0 24.8,1 32.4,-3c0,0 -11.2,5 -8,8.2c3.2,3.2 10,10.8 10,12c0,1.2 24.2,23.3 27.8,27.7L50.6,84z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M189,278c0,0 -15.5,-36.5 -28,-46c0,0 26,16 29.5,34c0,0 0,10 -1.5,12z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M236,285.5c0,0 -26.5,-55 -45,-79c0,0 43.5,37.5 48.5,64L240,276L237,273.5c0,0 -0.5,9 -1,12z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M292.5,237c0,0 -62.5,-59.5 -64,-62c0,0 60.5,66 63.5,73.5c0,0 -2,-9 0.5,-11.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M104,280.5c0,0 19.5,-52 38.5,-29.5c0,0 15,10 14.5,13c0,0 -4,-6.5 -22,-6c0,0 -19,-3 -31,22.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M294.5,153c0,0 -45,-28.5 -52.5,-30c-11.807,-2.361 49.5,29 54.5,39.5c0,0 2,-2.5 -2,-9.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M143.801,259.601c0,0 20.4,-2 27.2,-8.8L175.401,254.401L193.001,216.001L196.601,221.201c0,0 14.4,-14.8 13.6,-22.8c-0.8,-8 12.8,6 12.8,6c0,0 -0.8,-11.6 6.4,-4.8c0,0 -2.4,-15.6 6,-7.6c0,0 -10.537,-30.157 12,-4.4c5.6,6.4 1.2,-0.4 1.2,-0.4c0,0 -26,-48 -4.4,-33.6c0,0 2,-22.8 0.8,-27.2c-1.2,-4.4 -3.2,-26.801 -8,-32.001c-4.8,-5.2 0.4,-6.8 6,-1.6c0,0 -11.2,-24 2,-12c0,0 -3.6,-15.2 -8,-18c0,0 -5.6,-17.2 9.6,-6.4c0,0 -4.4,-12.4 -7.6,-15.6c0,0 -11.6,-27.6 -4.4,-22.8L239.001,21.6c0,0 -6.8,-14 -0.4,-9.6c6.4,4.4 6.4,4 6.4,4c0,0 -21.2,-33.2 -0.8,-15.6c0,0 -8.159,-13.918 -11.6,-20.8c0,0 -18.8,-20.4 -4.4,-14L233.001,-32.8c0,0 -8.8,-10 -16.8,-11.6c-8,-1.6 2.4,-8 8.8,-6c6.4,2 22,9.6 22,9.6c0,0 12.8,18.8 16.8,19.2c0,0 -20,-7.6 -14,0.4c0,0 14.4,14 7.2,13.6c0,0 -6,7.2 -1.2,16c0,0 -18.459,-18.391 -3.6,7.2L259.001,32c0,0 -24.4,-24.8 -13.2,-2.8c0,0 17.2,23.6 19.2,24c2,0.4 6.4,9.2 6.4,9.2L267.001,60.4L272.201,69.2c0,0 -11.2,-12 -5.2,1.2L272.601,84.8c0,0 -20.4,-22 -6.8,7.6c0,0 -16.4,-5.2 -7.6,12c0,0 -1.6,16.001 -1.2,21.201c0.4,5.2 1.6,33.6 -2.8,41.6c-4.4,8 6,27.2 8,31.2c2,4 5.6,14.8 -3.2,5.6c-8.8,-9.2 -4.4,-3.6 -2.4,5.2c2,8.8 8,24.4 7.2,30c0,0 -1.2,1.2 -4.4,-2.4c0,0 -14.8,-22.8 -13.2,-8.4c0,0 -1.2,8 -4.4,16.8c0,0 -3.2,10.8 -3.2,2c0,0 -3.2,-16.8 -6,-9.2c-2.8,7.6 -6.4,13.6 -9.2,16c-2.8,2.4 -8,-20.4 -9.2,-10c0,0 -12,-12.4 -16.8,4L185.801,264.401c0,0 -0.4,-12.4 -1.6,-6.4c0,0 -30,6 -40.4,1.6z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M109.401,-97.2c0,0 -11.6,-8 -15.6,-7.6c-4,0.4 27.6,-8.8 68.8,18.8c0,0 4.8,2.8 8.4,2.4c0,0 3.2,2.4 0.4,6c0,0 -8.8,9.6 2.4,20.8c0,0 18.4,6.8 12.8,-2c0,0 10.8,4 13.2,8c2.4,4 1.2,0 1.2,0c0,0 -6.4,-7.2 -12.4,-12.4c0,0 -5.2,-2 -8,-10.4c-2.8,-8.4 -5.2,-18.4 -0.8,-21.6c0,0 -4,4.4 -3.2,0.4c0.8,-4 4.4,-7.6 6,-8c1.6,-0.4 18,-16.2 24.8,-16.6c0,0 -9.2,1.4 -12.2,0.4c-3,-1 -29.6,-12.4 -35.6,-13.6c0,0 -16.8,-6.6 -4.8,-4.6c0,0 35.8,3.8 54,17c0,0 -7.2,-8.4 -25.6,-15.4c0,0 -22.2,-12.6 -57.4,-7.6c0,0 -17.8,3.2 -25.6,5c0,0 -2.6,-0.6 -3.2,-1c-0.6,-0.4 -12.401,-9.4 -40.001,-2.4c0,0 -17,4.6 -25.6,9.4c0,0 -15.2,1.2 -18.8,4.4c0,0 -18.6,14.6 -20.6,15.4c-2,0.8 -13.4,8.4 -14.2,8.8c0,0 24.6,-6.6 27,-9c2.4,-2.4 19.8,-5 22.2,-3.6c2.4,1.4 10.8,0.8 1.2,1.4c0,0 75.601,14.8 76.401,16.8c0.8,2 4.8,0.8 4.8,0.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M180.801,-106.4c0,0 -10.2,-7.4 -12.2,-7.4c-2,0 -14.4,-10.2 -18.6,-9.8c-4.2,0.4 -16.4,-9.6 -43.8,-1.4c0,0 -0.6,-2 3,-2.8c0,0 6.4,-2.2 6.8,-2.8c0,0 20.2,-4.2 27.4,-0.6c0,0 9.2,2.6 15.4,8.8c0,0 11.2,3.2 14.4,2.2c0,0 8.8,2.2 9.2,4c0,0 5.8,3 4,5.6c0,0 0.4,1.6 -5.6,4.2z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M168.33,-108.509c0.807,0.632 1.826,0.73 2.431,1.539c0.234,0.314 -0.055,0.64 -0.37,0.737c-1.043,0.317 -2.099,-0.253 -3.241,0.335c-0.402,0.207 -1.044,0.025 -1.597,-0.124c-1.632,-0.441 -3.461,-0.466 -5.152,0.222c-1.985,-1.129 -4.345,-0.545 -6.426,-1.546c-0.058,-0.027 -0.28,0.319 -0.354,0.292c-3.046,-1.145 -6.789,-0.862 -9.22,-3.146c-2.428,-0.412 -4.785,-0.874 -7.213,-1.554c-1.818,-0.509 -3.227,-1.498 -4.847,-2.33c-1.377,-0.708 -2.834,-1.23 -4.368,-1.602c-1.863,-0.452 -3.694,-0.34 -5.587,-0.86c-0.093,-0.025 -0.285,0.319 -0.367,0.292c-0.324,-0.108 -0.614,-0.691 -0.785,-0.638c-1.681,0.522 -3.169,-0.45 -4.833,-0.108c-1.178,-1.224 -2.906,-0.979 -4.452,-1.421c-2.964,-0.848 -6.118,0.422 -9.148,-0.579c4.113,-1.842 8.8,-0.61 12.862,-2.679c2.328,-1.186 4.99,-0.084 7.56,-0.844c0.487,-0.144 1.178,-0.346 1.578,0.323c0.134,-0.135 0.316,-0.374 0.374,-0.346c2.45,1.157 4.765,2.431 7.247,3.497c0.341,0.146 0.873,-0.086 1.125,0.116c1.52,1.216 3.463,1.113 4.854,2.333c1.698,-0.502 3.491,-0.122 5.22,-0.746c0.077,-0.027 0.311,0.314 0.344,0.292c1.13,-0.748 2.285,-0.477 3.177,-0.173c0.338,0.115 1.001,0.362 1.306,0.436c1.126,0.276 1.982,0.756 3.161,0.939c0.114,0.018 0.299,-0.322 0.371,-0.294c1.123,0.438 2.165,0.382 2.821,1.546c0.135,-0.135 0.3,-0.373 0.382,-0.346c1.027,0.338 1.676,1.093 2.777,1.334c0.485,0.106 1.097,0.732 1.673,0.908c2.392,0.731 4.235,2.26 6.429,3.155c0.759,0.31 1.635,0.544 2.268,1.04z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M91.696,-122.739c-2.518,-1.725 -4.886,-2.831 -7.328,-4.617c-0.181,-0.133 -0.541,0.037 -0.743,-0.085c-1.007,-0.609 -1.895,-1.19 -2.877,-1.886c-0.539,-0.382 -1.36,-0.371 -1.868,-0.629c-2.544,-1.292 -5.173,-1.85 -7.68,-3.044c0.682,-0.638 1.804,-0.394 2.4,-1.2c0.195,0.28 0.433,0.564 0.786,0.373c1.678,-0.904 3.528,-1.057 5.204,-0.967c1.704,0.092 3.424,0.397 5.199,0.669c0.307,0.047 0.506,0.57 0.829,0.667c2.228,0.663 4.617,0.138 6.736,0.976c1.591,0.629 3.161,1.452 4.4,2.727c0.252,0.26 -0.073,0.561 -0.353,0.755c0.388,-0.109 0.661,0.097 0.772,0.41c0.084,0.239 0.084,0.541 0,0.78c-0.112,0.312 -0.391,0.413 -0.765,0.464c-1.407,0.19 0.365,-1.19 -0.335,-0.742c-1.273,0.814 -0.527,2.22 -1.272,3.488c-0.28,-0.194 -0.51,-0.412 -0.4,-0.8c0.234,0.522 -0.368,0.812 -0.536,1.128c-0.385,0.725 -1.284,2.14 -2.169,1.533z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M59.198,-115.391c-3.154,-0.794 -6.204,-0.679 -9.22,-1.955c-0.067,-0.028 -0.29,0.319 -0.354,0.292c-1.366,-0.594 -2.284,-1.56 -3.36,-2.606c-0.913,-0.888 -2.571,-0.501 -3.845,-0.988c-0.324,-0.124 -0.527,-0.636 -0.828,-0.675c-1.219,-0.157 -2.146,-1.106 -3.191,-1.677c2.336,-0.795 4.747,-0.764 7.209,-1.148c0.113,-0.018 0.258,0.303 0.391,0.303c0.136,0 0.266,-0.221 0.4,-0.355c0.195,0.28 0.497,0.606 0.754,0.352c0.548,-0.54 1.104,-0.35 1.644,-0.31c0.144,0.01 0.269,0.313 0.402,0.313c0.136,0 0.267,-0.311 0.4,-0.311c0.136,0.001 0.267,0.311 0.4,0.311c0.136,0 0.266,-0.221 0.4,-0.355c0.692,0.782 1.577,0.228 2.399,0.407c1.038,0.227 1.305,1.375 2.379,1.673c4.715,1.304 8.852,3.449 13.215,5.536c0.307,0.147 0.517,0.395 0.407,0.784c0.267,0 0.58,-0.088 0.77,0.044c1.058,0.732 2.099,1.28 2.796,2.378c0.216,0.339 -0.113,0.746 -0.346,0.694c-4.429,-0.995 -8.435,-1.603 -12.822,-2.707z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M45.338,-71.179c-1.592,-1.219 -2.176,-3.25 -3.304,-5.042c-0.214,-0.34 0.06,-0.654 0.377,-0.743c0.56,-0.159 1.103,0.319 1.512,0.521c1.745,0.862 3.28,2.104 5.277,2.243c1.99,2.234 6.25,2.619 6.257,6c0.001,0.859 -1.427,-0.059 -1.857,0.8c-2.451,-1.003 -4.84,-0.9 -7.22,-2.367c-0.617,-0.381 -0.287,-0.834 -1.042,-1.412z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M17.8,-123.756c0.135,0.001 7.166,0.234 7.149,0.348c-0.045,0.309 -7.775,1.358 -8.139,1.188c-0.164,-0.076 -7.676,2.354 -7.81,2.22c0.268,-0.135 8.534,-3.756 8.8,-3.756z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M33.2,-114c0,0 -14.8,1.8 -19.2,3c-4.4,1.2 -23,8.8 -26,10.8c0,0 -13.4,5.4 -30.4,25.4c0,0 7.6,-3.4 9.8,-6.2c0,0 13.6,-12.6 13.4,-10c0,0 12.2,-8.6 11.6,-6.4c0,0 24.4,-11.2 22.4,-8c0,0 21.6,-4.6 20.6,-2.6c0,0 18.8,4.4 16,4.6c0,0 -5.8,1.2 0.6,4.8c0,0 -3.4,4.4 -8.8,0.4c-5.4,-4 -2.4,-1.8 -7.4,-0.8c0,0 -2.6,0.8 -7.2,-3.2c0,0 -5.6,-4.6 -14.4,-1c0,0 -30.6,12.6 -32.6,13.2c0,0 -3.6,2.8 -6,6.4c0,0 -5.8,4.4 -8.8,5.8c0,0 -12.8,11.6 -14,13c0,0 -3.4,5.2 -4.2,5.6c0,0 6.4,-3.8 8.4,-5.8c0,0 14,-10 19.4,-10.8c0,0 4.4,-3 5.2,-4.4c0,0 14.4,-9.2 18.6,-9.2c0,0 9.2,5.2 11.6,-1.8c0,0 5.8,-1.8 11.4,-0.6c0,0 3.2,-2.6 2.4,-4.8c0,0 1.6,-1.8 2.6,2c0,0 3.4,3.6 8.2,1.6c0,0 4,-0.2 2,2.2c0,0 -4.4,3.8 -16.2,4c0,0 -12.4,0.6 -28.8,8.2c0,0 -29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gb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M24.8,64.2c0,0 -25.2,-8 -40.6,-3.8c0,0 -18.4,2 -26.8,15.8","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M21.2,63c0,0 -17,-7.2 -31.8,-9.4c0,0 -16.6,-2.6 -33.2,4.6c0,0 -12.2,6 -17.6,16.2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M22.2,63.4c0,0 -15.4,-11 -16.4,-12.4c0,0 -7,-11 -20,-11.4c0,0 -21.4,0.8 -38.6,8.8","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M20.895,54.407c1.542,1.463 28.505,30.393 28.505,30.393c35.2,36.601 7.2,2.4 7.2,2.4c-7.6,-4.8 -16.8,-23.6 -16.8,-23.6c-1.2,-2.8 14,7.2 14,7.2c4,0.8 17.6,20 17.6,20c-6.8,-2.4 -2,4.8 -2,4.8c2.8,2 23.201,17.601 23.201,17.601c3.6,4 7.6,5.6 7.6,5.6c14,-5.2 7.6,8 7.6,8c2.4,6.8 8,-4.8 8,-4.8c11.2,-16.801 -5.2,-14.4 -5.2,-14.4c-30.001,2.8 -36.801,-13.201 -36.801,-13.201c-2.4,-2.4 6.4,0 6.4,0c8.401,2 -7.2,-12.4 -7.2,-12.4c2.4,0 11.6,6.8 11.6,6.8c10.401,9.2 12.401,7.2 12.401,7.2c18,-8.8 28.4,-1.2 28.4,-1.2c2,1.6 -3.6,8.4 -2,13.601c1.6,5.2 6.4,17.6 6.4,17.6c-2.4,1.6 -2,12.4 -2,12.4c16.8,23.2 7.2,21.2 7.2,21.2c-15.6,-0.4 -0.8,7.2 -0.8,7.2c3.2,2 12,9.2 12,9.2c-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.8 3.2,6 4,8c0.8,2 -3.2,2.2 -3.2,2.2c0.6,9.6 -14.8,5.4 -14.8,5.4c0,0 0,0 -1.6,0.2c-1.6,0.2 -12.8,-0.6 -18.6,-2.8c-5.8,-2.2 -12.6,-2.2 -12.6,-2.2c0,0 -4,1.8 -11.601,1.6c-7.6,-0.2 -15.6,2.6 -15.6,2.6c-4.4,-0.4 4.2,-4.8 4.4,-4.6c0.2,0.2 5.8,-5.4 -2.2,-4.8c-21.797,1.635 -32.6,-8.6 -32.6,-8.6c-2,-1.4 -4.6,-4.2 -4.6,-4.2c-10,-2 1.4,12.4 1.4,12.4c1.2,1.4 -0.2,2.4 -0.2,2.4c-0.8,-1.6 -8.6,-7 -8.6,-7c-2.811,-0.973 -4.174,-2.307 -6.505,-4.793z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-3,42.8c0,0 11.6,5.6 14.2,8.4c2.6,2.8 16.6,14.2 16.6,14.2c0,0 -5.4,-2 -8,-3.8c-2.6,-1.8 -13.4,-10 -13.4,-10c0,0 -3.8,-6 -9.4,-8.8z","fillColor":["rgb",0.29804,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-61.009,11.603c0.337,-0.148 -0.187,-2.86 -0.391,-3.403c-1.022,-2.726 -10,-4.2 -10,-4.2c-0.227,1.365 -0.282,2.961 -0.176,4.599c0,0 4.868,5.519 10.567,3.004z","fillColor":["rgb",0.6,0.8,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M-61.009,11.403c-0.449,0.158 -0.015,-2.734 -0.191,-3.203c-1.022,-2.726 -10.2,-4.3 -10.2,-4.3c-0.227,1.365 -0.282,2.961 -0.176,4.599c0,0 4.268,5.119 10.567,2.904z","fillColor":["rgb",0.39608,0.6,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-65.4,11.546c-0.625,0 -1.131,-1.14 -1.131,-2.546c0,-1.405 0.506,-2.545 1.131,-2.545c0.625,0 1.132,1.14 1.132,2.545c0,1.406 -0.507,2.546 -1.132,2.546z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-65.4,9z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-111,109.601c0,0 -5.6,10 19.2,4c0,0 14,-1.2 16.4,-3.6c1.2,0.8 9.566,3.733 12.4,4.4c6.8,1.6 15.2,-8.401 15.2,-8.401c0,0 4.6,-10.5 7.4,-10.5c2.8,0 -0.4,1.6 -0.4,1.6c0,0 -6.6,10.101 -6.2,11.701c0,0 -5.2,20 -21.2,20.8c0,0 -16.15,0.95 -14.8,6.8c0,0 8.8,-2.4 11.2,0c0,0 10.8,-0.4 2.8,6L-75.8,154.001c0,0 0.14,3.918 -10,0.4c-9.8,-3.4 -20.1,-16.3 -20.1,-16.3c0,0 -15.95,-14.55 -5.1,-28.5z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-112.2,113.601c0,0 -2,9.6 34.8,-0.8c0,0 4.4,0 6.8,0.8c2.4,0.8 14.4,3.6 16.4,2.4c0,0 -7.2,13.6 -18.8,12c0,0 -13.2,1.6 -12.8,6.4c0,0 4,7.2 8.8,9.6c0,0 2.8,2.4 2.4,5.6c-0.4,3.2 -3.2,4.8 -5.2,5.6c-2,0.8 -5.2,-2.4 -6.8,-2.4c-1.6,0 -10,-6.4 -14.4,-11.2c-4.4,-4.8 -12.8,-16.8 -12.4,-19.6c0.4,-2.8 1.2,-8.4 1.2,-8.4z","fillColor":["rgb",0.89804,0.6,0.6]}]]}],["Group",{"children":[["Path",{"pathData":"M-109,131.051c2.6,3.95 5.8,8.15 8,10.55c4.4,4.8 12.8,11.2 14.4,11.2c1.6,0 4.8,3.2 6.8,2.4c2,-0.8 4.8,-2.4 5.2,-5.6c0.4,-3.2 -2.4,-5.6 -2.4,-5.6c-3.066,-1.533 -5.806,-5.025 -7.385,-7.348c0,0 0.185,2.548 -5.015,1.748c-5.2,-0.8 -10.4,-3.6 -12,-6.8c-1.6,-3.2 -4,-5.6 -2.4,-2c1.6,3.6 4,7.2 5.6,7.6c1.6,0.4 1.2,1.6 -1.2,1.2c-2.4,-0.4 -5.2,-0.8 -9.6,-6z","fillColor":["rgb",0.69804,0.39608,0.39608]}]]}],["Group",{"children":[["Path",{"pathData":"M-111.6,110.001c0,0 1.8,-13.601 3,-17.601c0,0 -0.8,-6.8 1.6,-11c2.4,-4.2 4.4,-10.4 7.4,-15.8c3,-5.4 3.2,-9.4 7.2,-11c4,-1.6 10,-10.2 12.8,-11.2c2.8,-1 2.6,-0.2 2.6,-0.2c0,0 6.8,-14.8 20.4,-10.8c0,0 -16.2,-2.8 -0.4,-12.2c0,0 -4.8,1.1 -1.5,-5.9c2.201,-4.668 1.7,2.1 -9.3,13.9c0,0 -5,8.6 -10.2,11.6c-5.2,3 -17.2,10 -18.4,13.8c-1.2,3.8 -4.4,9.6 -6.4,11.2c-2,1.6 -4.8,5.8 -5.2,9.2c0,0 -1.2,4 -2.6,5.2c-1.4,1.2 -1.6,4.4 -1.6,6.4c0,2 -2,4.8 -1.8,7.2c0,0 0.8,19.001 0.4,21.001L-111.6,110.001z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-120.2,114.601c0,0 -2,-1.4 -6.4,4.6c0,0 7.3,33 7.3,34.4c0,0 1.1,-2.1 -0.2,-9.3c-1.3,-7.2 -2.2,-19.9 -2.2,-19.9L-120.2,114.601z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-98.6,54c0,0 -17.6,3.2 -17.2,32.4L-116.6,111.201c0,0 -1.2,-25.601 -2.4,-27.201c-1.2,-1.6 2.8,-12.8 -0.4,-6.8c0,0 -14,14 -6,35.201c0,0 1.5,3.3 -1.5,-1.3c0,0 -4.6,-12.601 -3.5,-19.001c0,0 0.2,-2.2 2.1,-5c0,0 8.6,-11.7 11.3,-14c0,0 1.8,-14.4 17.2,-19.6c0,0 5.7,-2.3 1.2,0.5z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M40.8,-12.2c0.66,-0.354 0.651,-1.324 1.231,-1.497c1.149,-0.344 1.313,-1.411 1.831,-2.195c0.873,-1.319 1.066,-2.852 1.648,-4.343c0.272,-0.7 0.299,-1.655 -0.014,-2.315c-1.174,-2.481 -1.876,-4.93 -3.318,-7.356c-0.268,-0.45 -0.53,-1.244 -0.731,-1.842c-0.463,-1.384 -1.72,-2.375 -2.58,-3.695c-0.288,-0.441 0.237,-1.366 -0.479,-1.45c-0.897,-0.105 -2.346,-0.685 -2.579,0.341c-0.588,2.587 0.423,5.11 1.391,7.552c-0.782,0.692 -0.448,1.613 -0.296,2.38c0.71,3.606 -0.488,6.958 -1.249,10.432c-0.023,0.104 0.319,0.302 0.291,0.364c-1.222,2.686 -2.674,5.131 -4.493,7.512c-0.758,0.992 -1.63,1.908 -2.127,2.971c-0.368,0.787 -0.776,1.753 -0.526,2.741c-3.435,2.78 -5.685,6.625 -8.296,10.471c-0.462,0.68 -0.171,1.889 0.38,2.158c0.813,0.398 1.769,-0.626 2.239,-1.472c0.389,-0.698 0.742,-1.348 1.233,-1.991c0.133,-0.175 -0.046,-0.594 0.089,-0.715c2.633,-2.347 4.302,-5.283 6.755,-7.651c1.95,-0.329 3.487,-1.327 5.235,-2.34c0.308,-0.179 0.832,0.07 1.122,-0.125c1.753,-1.177 1.751,-3.213 1.857,-5.123c0.05,-0.884 0.246,-2.201 1.386,-2.812z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M31.959,-16.666c0.124,-0.077 -0.031,-0.5 0.078,-0.716c0.162,-0.324 0.565,-0.512 0.727,-0.836c0.109,-0.216 -0.054,-0.596 0.082,-0.738c2.333,-2.447 2.59,-5.471 1.554,-8.444c1.024,-0.62 1.085,-1.882 0.66,-2.729c-0.853,-1.7 -1.046,-3.626 -2.021,-5.169c-0.802,-1.269 -2.38,-2.513 -3.751,-1.21c-0.421,0.4 -0.742,1.187 -0.464,1.899c0.064,0.163 0.349,0.309 0.322,0.391c-0.107,0.324 -0.653,0.548 -0.659,0.82c-0.03,1.496 -0.984,3.007 -0.354,4.336c0.772,1.629 1.591,3.486 2.267,5.262c-1.234,2.116 -0.201,4.565 -1.954,6.442c-0.136,0.146 -0.127,0.532 -0.005,0.734c0.292,0.486 0.698,0.892 1.184,1.184c0.202,0.121 0.55,0.123 0.75,-0.001c0.578,-0.362 0.976,-0.849 1.584,-1.225z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M94.771,-26.977c1.389,1.792 1.679,4.587 -0.37,5.977c0.55,3.309 3.901,1.33 6,0.8c-0.109,-0.388 0.118,-0.732 0.401,-0.737c1.057,-0.015 1.737,-1.047 2.799,-0.863c0.434,-1.557 2.072,-2.259 2.716,-3.639c1.726,-3.695 1.135,-7.968 -1.449,-11.214c-0.202,-0.254 0.015,-0.771 -0.109,-1.133c-0.756,-2.211 -2.824,-2.526 -4.758,-3.214c-1.177,-3.875 -1.838,-7.906 -3.6,-11.6c-1.614,-0.25 -2.312,-1.989 -3.649,-2.709c-1.333,-0.719 -1.901,0.86 -1.86,1.906c0.007,0.205 0.459,0.429 0.289,0.794c-0.076,0.164 -0.336,0.275 -0.336,0.409c0.001,0.135 0.222,0.266 0.356,0.4c-0.918,0.82 -2.341,1.297 -2.636,2.442c-0.954,3.71 1.619,6.835 3.287,10.036c0.591,1.135 -0.145,2.406 -0.905,3.614c-0.438,0.695 -0.33,1.822 -0.054,2.678c0.752,2.331 2.343,4.07 3.878,6.053z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M57.611,-8.591c-1.487,1.851 -4.899,4.42 -1.982,6.348c0.194,0.129 0.564,0.133 0.737,-0.001c2.021,-1.565 4.024,-2.468 6.46,-3.05c0.124,-0.029 0.398,0.438 0.767,0.277c1.613,-0.703 3.623,-0.645 4.807,-1.983c3.767,0.224 7.332,-0.892 10.723,-2.2c1.161,-0.448 2.431,-1.007 3.632,-1.509c1.376,-0.576 2.58,-1.504 3.692,-2.645c0.133,-0.136 0.487,-0.046 0.754,-0.046c-0.04,-0.863 0.922,-0.99 1.169,-1.612c0.092,-0.232 -0.058,-0.628 0.075,-0.73c2.138,-1.63 3.058,-3.648 1.889,-6.025c-0.285,-0.578 -0.534,-1.196 -1.1,-1.672c-1.085,-0.911 -2.187,-0.057 -3.234,-0.361c-0.159,0.628 -0.888,0.456 -1.274,0.654c-0.859,0.439 -2.192,-0.146 -3.051,0.292c-1.362,0.695 -2.603,0.864 -4.025,1.241c-0.312,0.082 -1.09,-0.014 -1.25,0.613c-0.134,-0.134 -0.282,-0.368 -0.388,-0.346c-1.908,0.396 -3.168,0.61 -4.469,2.302c-0.103,0.133 -0.545,-0.046 -0.704,0.089c-0.957,0.808 -1.362,2.042 -2.463,2.714c-0.201,0.123 -0.553,-0.045 -0.747,0.084c-0.646,0.431 -1.013,1.072 -1.655,1.519c-0.329,0.229 -0.729,-0.096 -0.697,-0.352c0.245,-1.947 0.898,-3.734 0.323,-5.61c2.077,-2.52 4.594,-4.469 6.4,-7.2c0.015,-2.166 0.707,-4.312 0.594,-6.389c-0.01,-0.193 -0.298,-0.926 -0.424,-1.273c-0.312,-0.854 0.594,-1.92 -0.25,-2.644c-1.404,-1.203 -2.696,-0.327 -3.52,1.106c-1.838,0.39 -3.904,1.083 -5.482,-0.151c-1.007,-0.787 -1.585,-1.693 -2.384,-2.749c-0.985,-1.302 -0.65,-2.738 -0.58,-4.302c0.006,-0.128 -0.309,-0.264 -0.309,-0.398c0.001,-0.135 0.221,-0.266 0.355,-0.4c-0.706,-0.626 -0.981,-1.684 -2,-2c0.305,-1.092 -0.371,-1.976 -1.242,-2.278c-1.995,-0.691 -3.672,1.221 -5.564,1.294c-0.514,0.019 -0.981,-1.019 -1.63,-1.344c-0.432,-0.216 -1.136,-0.249 -1.498,0.017c-0.688,0.504 -1.277,0.618 -2.035,0.823c-1.617,0.436 -2.895,1.53 -4.375,2.385c-1.485,0.857 -2.44,2.294 -3.52,3.614c-0.941,1.152 -1.077,3.566 0.343,4.066c1.843,0.65 3.147,-2.053 5.113,-1.727c0.312,0.051 0.518,0.362 0.408,0.75c0.389,0.109 0.607,-0.12 0.8,-0.4c0.858,1.019 2.022,1.356 2.96,2.229c0.97,0.904 2.716,0.486 3.731,1.483c1.529,1.502 0.97,4.183 2.909,5.488c-0.586,1.313 -1.193,2.59 -1.528,4.017c-0.282,1.206 0.712,2.403 1.923,2.312c1.258,-0.094 1.52,-0.853 2.005,-1.929c0.267,0.267 0.736,0.564 0.695,0.78c-0.457,2.387 -1.484,4.38 -1.942,6.811c-0.059,0.317 -0.364,0.519 -0.753,0.409c-0.468,4.149 -4.52,6.543 -7.065,9.708c-0.403,0.502 -0.407,1.751 0.002,2.154c1.403,1.387 3.363,-0.159 5.063,-0.662c0.213,-1.206 1.072,-2.148 2.404,-2.092c0.256,0.01 0.491,-0.532 0.815,-0.662c0.348,-0.138 0.85,0.086 1.136,-0.112c1.729,-1.195 3.137,-2.301 4.875,-3.49c0.192,-0.131 0.536,0.028 0.752,-0.08c0.325,-0.162 0.512,-0.549 0.835,-0.734c0.348,-0.2 0.59,0.09 0.783,0.37c-0.646,0.349 -0.65,1.306 -1.232,1.508c-0.775,0.268 -1.336,0.781 -2.01,1.228c-0.292,0.193 -0.951,-0.055 -1.055,0.124c-0.598,1.028 -1.782,1.466 -2.492,2.349z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M2.2,-58c0,0 -9.238,-2.872 -20.4,22.8c0,0 -2.4,5.2 -4.8,7.2c-2.4,2 -13.6,5.6 -15.6,9.6L-49,-2.4c0,0 14.8,-16 18,-18.4c0,0 8,-8.4 4.8,-1.6c0,0 -14,10.8 -12.8,20c0,0 -5.6,14.4 -6.4,16.4c0,0 16,-32 18.4,-33.2c2.4,-1.2 3.6,-1.2 2.4,2.4c-1.2,3.6 -1.6,20 -4.4,22c0,0 8,-20.4 7.2,-23.6c0,0 3.2,-3.6 5.6,1.6L-17.4,-0.8L-13,11.2c0,0 -2.4,-11.2 -0.8,-26.8c0,0 -2,-10.4 2,-4.8c4,5.6 13.6,11.6 13.6,16.4c0,0 -5.2,-17.6 -14.4,-22.4L-16.6,-20.4L-17.8,-22.4c0,0 -3.6,-0.8 0.8,-7.6c4.4,-6.8 4,-7.6 4,-7.6c0,0 6.4,7.2 8,7.2c0,0 13.2,-7.6 14.4,16.8c0,0 6.8,-14.4 -2.4,-21.2c0,0 -14.8,-2 -13.6,-7.2L0.6,-54.4c3.6,-5.2 2,-2.4 2,-2.4z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-17.8,-41.6c0,0 -12.8,0 -16,5.2L-41,-26.8c0,0 17.2,-10 21.2,-11.2c4,-1.2 2,-3.6 2,-3.6z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-57.8,-35.2c0,0 -2,1.2 -2.4,4c-0.4,2.8 -2.8,3.2 -2,6c0.8,2.8 2.8,5.2 2.8,1.2c0,-4 1.6,-6 2.4,-7.2c0.8,-1.2 2.4,-5.6 -0.8,-4z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-66.6,26c0,0 -8.4,-4 -11.6,-7.6c-3.2,-3.6 -2.748,1.566 -7.6,1.2c-5.847,-0.441 -4.8,-16.4 -4.8,-16.4L-94.6,10.8c0,0 -1.2,14.4 6.8,12c3.907,-1.172 5.2,0.4 3.6,1.2c-1.6,0.8 5.6,1.2 2.8,2.8c-2.8,1.6 11.6,-3.6 9.2,6.8L-66.6,26z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-79.2,40.4c0,0 -15.4,4.4 -19,-5.2c0,0 -4.8,2.4 -2.6,5.4c2.2,3 3.4,3.4 3.4,3.4c0,0 5.4,1.2 4.8,2c-0.6,0.8 -3,4.2 -3,4.2c0,0 10.2,-6 16.4,-9.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M149.201,118.601c-0.427,2.134 -2.098,2.935 -4,3.6c-1.917,-0.958 -4.515,-4.064 -6.4,-2c-0.474,-0.48 -1.253,-0.54 -1.597,-1.202c-0.465,-0.898 -0.193,-1.944 -0.535,-2.742c-0.545,-1.272 -1.254,-2.638 -1.068,-4.056c1.806,-0.712 2.401,-2.618 1.927,-4.381c-0.069,-0.257 -0.498,-0.454 -0.298,-0.803c0.186,-0.323 0.504,-0.55 0.771,-0.817c-0.135,0.135 -0.28,0.368 -0.391,0.348c-0.61,-0.106 -0.486,-0.743 -0.356,-1.13c0.585,-1.746 2.599,-2.01 3.947,-0.818c0.256,-0.565 0.765,-0.371 1.2,-0.4c-0.05,-0.579 0.358,-1.106 0.556,-1.526c0.518,-1.098 2.147,0.008 2.944,-0.604c1.076,-0.825 2.139,-1.524 3.217,-0.921c1.809,1.013 3.518,2.225 4.717,3.966c0.575,0.834 0.815,2.115 0.757,3.073c-0.038,0.647 -1.419,0.295 -1.762,1.224c-0.645,1.748 1.186,2.267 1.942,3.605c0.198,0.349 -0.066,0.653 -0.381,0.751c-0.411,0.128 -1.195,-0.061 -1.057,0.392c0.972,3.193 -1.784,3.871 -4.133,4.441z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M139.6,138.201c-0.007,-1.738 -1.608,-3.494 -0.399,-5.2c0.135,0.134 0.266,0.355 0.4,0.355c0.135,0 0.266,-0.221 0.4,-0.355c1.495,2.216 5.147,3.144 5.005,5.99c-0.022,0.447 -1.109,1.365 -0.205,2.01c-1.813,1.348 -1.868,3.718 -2.8,5.6c-1.238,-0.286 -2.45,-0.649 -3.6,-1.2c0.352,-1.486 0.235,-3.17 1.055,-4.49c0.434,-0.698 0.147,-1.777 0.144,-2.71z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-26.6,129.201c0,0 -16.858,10.136 -2.8,-5.2c8.8,-9.6 18.8,-15.2 18.8,-15.2c0,0 10.4,-4.401 14,-5.601c3.6,-1.2 18.8,-6.4 22,-6.8c3.2,-0.4 12.8,-4.4 19.6,-0.4c6.8,4 14.8,8.4 14.8,8.4c0,0 -16.4,-8.4 -20,-6c-3.6,2.4 -10.8,2 -16.8,5.2c0,0 -14.8,4.401 -18,6.401c-3.2,2 -13.6,13.6 -15.2,12.8c-1.6,-0.8 0.4,-1.2 1.6,-4c1.2,-2.8 -0.8,-4.4 -8.8,2c-8,6.4 -9.2,8.4 -9.2,8.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-19.195,123.234c0,0 1.41,-13.04 9.888,-11.375c0,0 8.226,-4.17 10.948,-6.138c0,0 8.139,-1.702 9.449,-2.319c18.479,-8.7 33.198,-4.181 33.745,-5.301c0.546,-1.119 20.171,5.998 23.78,10.084c0.391,0.443 -10.231,-5.597 -19.929,-7.488c-8.273,-1.614 -29.875,0.247 -40.781,5.783c-2.973,1.509 -11.918,7.293 -14.449,7.182c-2.531,-0.112 -12.651,9.572 -12.651,9.572z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-23,148.801c0,0 -15.2,-2.4 1.6,-4c0,0 18,-2 22,-7.2c0,0 13.6,-9.2 16.4,-9.6c2.8,-0.4 32.8,-7.6 33.2,-10c0.4,-2.4 6,-2.4 7.6,-1.6c1.6,0.8 0.8,2 -2,2.8c-2.8,0.8 -34,17.2 -40.4,18.4c-6.4,1.2 -18,8.8 -22.8,10c-4.8,1.2 -15.6,1.2 -15.6,1.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-3.48,141.403c0,0 -8.582,-0.829 0.019,-1.648c0,0 8.816,-3.424 10.864,-6.087c0,0 6.964,-4.711 8.397,-4.915c1.434,-0.205 15.394,-3.892 15.599,-5.12c0.205,-1.229 34.271,-13.81 38.691,-10.62c2.911,2.101 -6.99,0.424 -16.624,4.834c-1.355,0.62 -35.208,15.207 -38.485,15.821c-3.277,0.615 -9.216,4.506 -11.674,5.12c-2.457,0.615 -6.787,2.615 -6.787,2.615z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-11.4,143.601c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-11.4,143.601z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-18.6,145.201c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-18.6,145.201z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-29,146.801c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-29,146.801z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-36.6,147.601c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-36.6,147.601z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M1.8,108.001c0,0 4.4,0 3.2,1.6c-1.2,1.6 -4.4,1.2 -4.4,1.2L1.8,108.001z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-8.2,113.601c0,0 6.506,-2.141 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-8.2,113.601z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-19.4,118.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-19.4,118.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-27,124.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-27,124.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-33.8,129.201c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-33.8,129.201z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M5.282,135.598c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L5.282,135.598z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M15.682,130.798c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L15.682,130.798z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M26.482,126.398c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L26.482,126.398z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M36.882,121.598c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L36.882,121.598z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M9.282,103.598c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -5.592,1.865 -5.592,1.865L9.282,103.598z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M19.282,100.398c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -5.992,1.865 -5.992,1.865L19.282,100.398z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-3.4,140.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-3.4,140.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-76.6,41.2c0,0 -4.4,8.8 -4.8,12c0,0 0.8,-8.8 2,-10.8c1.2,-2 2.8,-1.2 2.8,-1.2z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-95,55.2c0,0 -3.2,14.4 -2.8,17.2c0,0 -1.2,-11.6 -0.8,-12.8c0.4,-1.2 3.6,-4.4 3.6,-4.4z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-74.2,-19.4L-74.4,-16.2L-76.6,-16c0,0 14.2,12.6 14.8,20.2c0,0 0.8,-8.2 -12.4,-23.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-70.216,-18.135c-0.431,-0.416 -0.212,-1.161 -0.62,-1.421c-0.809,-0.516 1.298,-0.573 1.07,-1.289c-0.383,-1.206 -0.196,-1.227 -0.318,-2.503c-0.057,-0.598 0.531,-2.138 0.916,-2.578c1.446,-1.652 0.122,-4.584 1.762,-6.135c0.304,-0.289 0.68,-0.841 0.965,-1.259c0.659,-0.963 1.843,-1.451 2.793,-2.279c0.318,-0.276 0.117,-1.103 0.686,-1.011c0.714,0.115 1.955,-0.015 1.91,0.826c-0.113,2.12 -1.442,3.84 -2.722,5.508c0.451,0.704 -0.007,1.339 -0.291,1.896c-1.335,2.62 -1.146,5.461 -1.32,8.301c-0.005,0.085 -0.312,0.163 -0.304,0.216c0.353,2.335 0.937,4.534 1.816,6.763c0.366,0.93 0.837,1.825 0.987,2.752c0.111,0.686 0.214,1.519 -0.194,2.224c2.035,2.89 0.726,5.541 1.895,9.072c0.207,0.625 1.899,2.539 1.436,2.378c-2.513,-0.871 -2.625,-1.269 -2.802,-2.022c-0.146,-0.623 -0.476,-2 -0.713,-2.602c-0.064,-0.164 -0.235,-2.048 -0.313,-2.17c-1.513,-2.382 -0.155,-2.206 -1.525,-4.564c-1.428,-0.68 -2.394,-1.784 -3.517,-2.946c-0.198,-0.204 0.945,-0.928 0.764,-1.141c-1.092,-1.289 -2.245,-2.056 -1.909,-3.549c0.155,-0.69 0.292,-1.747 -0.452,-2.467z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-73.8,-16.4c0,0 0.4,6.8 2.8,8.4c2.4,1.6 1.2,0.8 -2,-0.4c-3.2,-1.2 -2,-2 -2,-2c0,0 -2.8,0.4 -0.4,2.4c2.4,2 6,4.4 4.4,4.4c-1.6,0 -9.2,-4 -9.2,-6.8c0,-2.8 -1,-6.9 -1,-6.9c0,0 1.1,-0.8 5.9,-0.7c0,0 1.4,0.7 1.5,1.6z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-74.6,2.2c0,0 -8.52,-2.791 -27,0.6c0,0 9.031,-2.078 27.8,0.2c10.3,1.25 -0.8,-0.8 -0.8,-0.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-72.502,2.129c0,0 -8.246,-3.518 -26.951,-1.737c0,0 9.178,-1.289 27.679,2.603c10.154,2.136 -0.728,-0.866 -0.728,-0.866z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-70.714,2.222c0,0 -7.962,-4.121 -26.747,-3.736c0,0 9.248,-0.604 27.409,4.654c9.966,2.885 -0.662,-0.918 -0.662,-0.918z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-69.444,2.445c0,0 -6.824,-4.307 -23.698,-5.405c0,0 8.339,0.17 24.22,6.279c8.716,3.353 -0.522,-0.874 -0.522,-0.874z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M45.84,12.961c0,0 -0.93,0.644 -0.716,-0.537c0.215,-1.181 28.423,-14.351 32.037,-14.101c0,0 -30.248,13.206 -31.321,14.638z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M42.446,13.6c0,0 -0.876,0.715 -0.755,-0.479c0.121,-1.194 27.208,-16.539 30.83,-16.573c0,0 -29.117,15.541 -30.075,17.052z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M39.16,14.975c0,0 -0.828,0.772 -0.786,-0.428c0.042,-1.199 19.859,-16.696 29.671,-18.57c0,0 -18.03,8.127 -28.885,18.998z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M36.284,16.838c0,0 -0.745,0.694 -0.707,-0.385c0.038,-1.08 17.872,-15.027 26.703,-16.713c0,0 -16.226,7.314 -25.996,17.098z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M4.6,164.801c0,0 -15.2,-2.4 1.6,-4c0,0 18,-2 22,-7.2c0,0 13.6,-9.2 16.4,-9.6c2.8,-0.4 19.2,-4 19.6,-6.4c0.4,-2.4 6.4,-4.8 8,-4c1.6,0.8 1.6,10 -1.2,10.8c-2.8,0.8 -21.6,8 -28,9.2c-6.4,1.2 -18,8.8 -22.8,10c-4.8,1.2 -15.6,1.2 -15.6,1.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M77.6,127.401c0,0 -3,1.6 -4.2,4.2c0,0 -6.4,10.6 -20.6,13.8c0,0 -23,9 -30.8,11c0,0 -13.4,5 -20.8,4.2c0,0 -7,0.2 -0.8,1.8c0,0 20.2,-2 23.6,-3.8c0,0 15.6,-5.2 18.6,-7.8c3,-2.6 21.2,-7.6 23.4,-9.6c2.2,-2 12,-10.4 11.6,-13.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M18.882,158.911c0,0 5.229,-0.226 4.076,1.323c-1.153,1.55 -3.601,0.676 -3.601,0.676L18.882,158.911z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M11.68,160.263c0,0 5.228,-0.226 4.076,1.323c-1.153,1.55 -3.601,0.677 -3.601,0.677L11.68,160.263z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M1.251,161.511c0,0 5.229,-0.227 4.076,1.323c-1.153,1.549 -3.601,0.676 -3.601,0.676L1.251,161.511z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-6.383,162.055c0,0 5.229,-0.226 4.076,1.323c-1.153,1.55 -3.601,0.676 -3.601,0.676L-6.383,162.055z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M35.415,151.513c0,0 6.96,-0.301 5.425,1.761c-1.534,2.062 -4.793,0.9 -4.793,0.9L35.415,151.513z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M45.73,147.088c0,0 5.959,-3.301 5.425,1.761c-0.27,2.556 -4.793,0.9 -4.793,0.9L45.73,147.088z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M54.862,144.274c0,0 7.159,-3.701 5.425,1.761c-0.778,2.45 -4.794,0.9 -4.794,0.9L54.862,144.274z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M64.376,139.449c0,0 4.359,-4.901 5.425,1.761c0.406,2.538 -4.793,0.9 -4.793,0.9L64.376,139.449z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M26.834,155.997c0,0 5.228,-0.227 4.076,1.323c-1.153,1.549 -3.602,0.676 -3.602,0.676L26.834,155.997z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M62.434,34.603c0,0 -0.726,0.665 -0.727,-0.406c0,-1.07 17.484,-14.334 26.327,-15.718c0,0 -16.099,6.729 -25.6,16.124z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M65.4,98.4c0,0 22.001,22.401 31.201,26.001c0,0 9.2,11.2 5.2,37.2c0,0 -3.2,7.6 -6.4,-13.2c0,0 3.2,-25.2 -8,-9.2c0,0 -8.401,-9.9 -2.001,-9.6c0,0 3.201,2 3.601,0.4c0.4,-1.6 -7.601,-15.2 -24.801,-29.601c-17.2,-14.4 1.2,-2 1.2,-2z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M7,137.201c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 96.001,7 127.601,31c0,0 -45.2,-23.2 -129.201,-30z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M17.4,132.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 138.401,-0.2 162.001,32.2c0,0 -22,-25.2 -163.601,-31.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M29,128.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 175.201,-12.2 198.801,20.2c0,0 -9.6,-25.6 -200.401,-19.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M39,124.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 124.001,-37.801 147.601,-5.4c0,0 -13.4,-24.601 -149.201,6.4z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-19,146.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 19.6,3 21.6,41.8c0,0 -7.2,-42 -23.2,-40.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-27.8,148.401c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 16,-3.8 13.2,35c0,0 1.2,-35.2 -14.8,-34z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-35.8,148.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 17.2,1.4 4.8,23.8c0,0 9.6,-24 -6.4,-22.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M11.526,104.465c0,0 -0.444,1.999 1.105,0.782c16.068,-12.625 48.51,-71.527 104.195,-77.161c0,0 -38.308,-12.11 -105.3,76.379z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M22.726,102.665c0,0 -1.363,-1.193 0.505,-1.818c1.868,-0.625 114.31,-73.127 153.595,-65.161c0,0 -27.107,-7.51 -154.1,66.979z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M1.885,108.767c0,0 -0.509,1.599 1.202,0.623c8.975,-5.12 12.59,-62.331 56.167,-63.586c0,0 -32.411,-14.714 -57.369,62.963z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-18.038,119.793c0,0 -1.077,1.286 0.876,1.032c10.246,-1.332 31.651,-42.603 76.09,-37.524c0,0 -31.966,-14.346 -76.966,36.492z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-6.8,113.667c0,0 -0.811,1.469 1.058,0.844c9.799,-3.274 22.883,-47.886 67.471,-51.433c0,0 -34.126,-7.943 -68.529,50.589z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-25.078,124.912c0,0 -0.873,1.042 0.709,0.836c8.299,-1.079 25.637,-34.508 61.633,-30.394c0,0 -25.893,-11.62 -62.342,29.558z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-32.677,130.821c0,0 -1.005,1.045 0.586,0.927c4.168,-0.309 34.806,-33.388 53.274,-17.886c0,0 -12.015,-18.723 -53.86,16.959z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M36.855,98.898c0,0 -1.201,-1.355 0.731,-1.74c1.932,-0.384 122.635,-58.097 160.598,-45.231c0,0 -25.941,-10.874 -161.329,46.971z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M3.4,163.201c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 17.2,1.4 4.8,23.8c0,0 9.6,-24 -6.4,-22.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M13.8,161.601c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 19.6,3 21.6,41.8c0,0 -7.2,-42 -23.2,-40.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M20.6,160.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 26.4,4.2 50,36.6c0,0 -35.6,-36.8 -51.6,-35.6z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M28.225,157.972c0,0 -0.437,-1.758 1.453,-1.204c1.89,0.554 22.324,-1.345 60.421,32.831c0,0 -46.175,-34.943 -61.874,-31.627z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M38.625,153.572c0,0 -0.437,-1.758 1.453,-1.204c1.89,0.554 36.724,5.055 88.421,40.031c0,0 -74.175,-42.143 -89.874,-38.827z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-1.8,142.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 55.2,3.4 85.6,30.2c0,0 -34.901,-24.775 -87.2,-29.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-11.8,146.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 26.4,4.2 50,36.6c0,0 -35.6,-36.8 -51.6,-35.6z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M49.503,148.962c0,0 -0.565,-1.721 1.361,-1.307c1.926,0.413 36.996,2.349 91.117,33.443c0,0 -77.664,-34.394 -92.478,-32.136z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M57.903,146.562c0,0 -0.565,-1.721 1.361,-1.307c1.926,0.413 36.996,2.349 91.117,33.443c0,0 -77.064,-34.794 -92.478,-32.136z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M67.503,141.562c0,0 -0.565,-1.721 1.361,-1.307c1.926,0.413 44.996,4.749 134.718,39.043c0,0 -120.665,-40.394 -136.079,-37.736z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-43.8,148.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-43.8,148.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-13,162.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-13,162.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-21.8,162.001c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-21.8,162.001z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-117.169,150.182c0,0 5.045,1.323 3.387,2.442c-1.657,1.12 -3.664,-0.422 -3.664,-0.422L-117.169,150.182z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-115.169,140.582c0,0 5.045,1.323 3.387,2.442c-1.657,1.12 -3.664,-0.422 -3.664,-0.422L-115.169,140.582z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-122.369,136.182c0,0 5.045,1.323 3.387,2.442c-1.657,1.12 -3.664,-0.422 -3.664,-0.422L-122.369,136.182z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-42.6,211.201c0,0 -1.6,0 -5.6,2c-2,0 -13.2,3.6 -18.8,13.6c0,0 12.4,-9.6 24.4,-15.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M45.116,303.847c0.141,0.258 0.196,0.678 0.488,0.695c0.658,0.04 1.891,0.341 1.766,-0.295c-0.848,-4.306 -1.722,-9.243 -5.855,-11.05c-0.639,-0.279 -2.081,0.134 -2.155,1.018c-0.127,1.524 -0.244,2.873 0.065,4.339c0.3,1.421 2.458,1.431 3.375,0.047c0.936,1.672 1.368,3.515 2.316,5.246z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M34.038,308.581c0.748,1.413 0.621,3.272 2.036,3.835c0.74,0.294 2.59,-0.681 2.172,-1.755c-0.802,-2.061 -1.19,-4.3 -2.579,-6.111c-0.2,-0.262 0.04,-0.795 -0.12,-1.123c-0.594,-1.22 -1.739,-1.955 -3.147,-1.626c-1.115,2.203 0.033,4.332 1.555,6.041c0.136,0.152 -0.03,0.528 0.083,0.739z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-5.564,303.391c-0.108,-0.377 -0.146,-0.84 0.019,-1.161c0.531,-1.033 1.324,-2.155 0.987,-3.177c-0.348,-1.056 -1.464,-0.874 -2.114,-0.305c-1.135,0.994 -1.184,2.82 -1.875,4.179c-0.196,0.386 -0.145,0.959 -0.586,1.35c-0.474,0.421 -0.914,1.945 -0.818,2.516c0.053,0.313 -0.13,10.221 0.092,9.958c0.619,-0.733 3.669,-10.467 3.738,-11.359c0.057,-0.731 0.789,-1.196 0.557,-2.001z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-31.202,296.599c2.634,-2.499 5.424,-5.46 4.982,-9.172c-0.116,-0.976 -1.891,-0.449 -2.078,0.397c-0.802,3.625 -2.841,6.286 -5.409,8.678c-2.196,2.047 -4.058,8.391 -4.293,8.899c3.697,-5.256 5.954,-8.002 6.798,-8.802z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-44.776,290.635c0.523,-0.37 0.221,-0.861 0.438,-1.193c0.953,-1.458 2.254,-2.704 2.272,-4.442c0.003,-0.277 -0.375,-0.586 -0.71,-0.362c-0.277,0.184 -0.619,0.314 -0.727,0.444c-2.03,2.449 -3.43,5.12 -4.873,7.932c-0.183,0.357 -1.327,4.848 -1.014,4.959c0.239,0.085 1.959,-4.096 2.169,-4.21c1.263,-0.686 1.275,-2.301 2.445,-3.128z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-28.043,310.179c0.444,-0.869 2.02,-2.071 1.907,-2.96c-0.118,-0.928 0.35,-2.371 -0.562,-1.683c-1.257,0.948 -4.706,2.297 -4.976,8.105c-0.026,0.571 2.948,-2.122 3.631,-3.462z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-13.6,293.001c0.4,-0.668 1.108,-0.195 1.567,-0.458c0.648,-0.372 1.259,-0.93 1.551,-1.579c0.97,-2.149 2.739,-3.969 2.882,-6.363c-1.491,-1.405 -2.17,0.635 -2.8,1.6c-1.323,-1.647 -2.322,0.227 -3.622,0.746c-0.07,0.028 -0.283,-0.319 -0.358,-0.292c-1.177,0.44 -1.857,1.521 -2.855,2.302c-0.171,0.134 -0.576,-0.046 -0.723,0.09c-0.652,0.603 -1.625,0.928 -1.905,1.61c-1.11,2.707 -4.25,4.802 -6.137,12.344c0.381,0.909 4.512,-6.642 4.999,-7.34c0.836,-1.196 0.954,1.661 2.23,0.995c0.051,-0.027 0.237,0.211 0.371,0.345c0.194,-0.28 0.412,-0.509 0.8,-0.4c0,-0.4 -0.134,-0.956 0.067,-1.115c1.237,-0.977 1.153,-2.045 1.933,-3.285c0.458,0.789 1.519,0.07 2,0.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M46.2,347.401c0,0 7.4,-20.4 3,-31.6c0,0 11.4,21.6 6.8,32.8c0,0 -0.4,-10.4 -4.4,-15.4c0,0 -4,12.8 -5.4,14.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M31.4,344.801c0,0 5.4,-8.8 -2.6,-27.2c0,0 -0.8,20.4 -7.6,31.4c0,0 14.2,-20.2 10.2,-4.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M21.4,342.801c0,0 -0.2,-20 0.2,-23c0,0 -3.8,16.6 -14,26.2c0,0 14.4,-12 13.8,-3.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M11.8,310.801c0,0 6,13.6 -4,32c0,0 6.4,-12.2 1.6,-19.2c0,0 2.6,-3.4 2.4,-12.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-7.4,342.401c0,0 -1,-15.6 0.8,-17.8c0,0 0.2,-6.4 -0.2,-7.4c0,0 4,-6.2 4.2,1.2c0,0 1.4,7.8 4.2,12.4c0,0 3.6,5.4 3.4,11.8c0,0 -10,-30.2 -12.4,-0.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-11,314.801c0,0 -6.6,10.8 -8.4,29.8c0,0 -1.4,-6.2 2.4,-20.6c0,0 4.2,-15.4 6,-9.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-32.8,334.601c0,0 5,-5.4 6.4,-10.4c0,0 3.6,-15.8 -2.8,-7.2c0,0 0.2,8 -8,15.4c0,0 4.8,-2.4 4.4,2.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-38.6,329.601c0,0 3.4,-17.4 4.2,-18.2c0,0 1.8,-3.4 -1,-0.2c0,0 -8.8,19.2 -12.8,25.8c0,0 8,-9.2 9.6,-7.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-44.4,313.001c0,0 11.6,-22.4 -10.2,3.4c0,0 11,-9.8 10.2,-3.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-59.8,298.401c0,0 4.8,-18.8 7.4,-18.6c0,0 8.2,-9 1.6,1.6c0,0 -6,9.6 -5.4,19.4c0,0 -0.6,-9.6 -3.6,-2.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M270.5,287c0,0 -12,-10 -14.5,-13.5c0,0 13.5,18.5 13.5,25.5c0,0 2.5,-7.5 1,-12z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M276,265c0,0 -21,-15 -24.5,-22.5c0,0 26.5,29.5 26.5,34c0,0 0.5,-9 -2,-11.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M293,111c0,0 -12,-8 -13.5,-6c0,0 10.5,6.5 13,15c0,0 -1.5,-9 0.5,-9z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M301.5,191.5L284,179.5c0,0 19,17 19.5,21L301.5,191.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-89.25,169L-67.25,173.75","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-39,331c0,0 -0.5,-3.5 -9.5,7","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-33.5,336c0,0 2,-6.5 -4.5,-2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M20.5,344.5c0,0 1.5,-11 -10,2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}]]}]]}]]}]] \ No newline at end of file +[["Layer",{"children":[["Group",{"name":"svg","children":[["Group",{"matrix":[1,0,0,1,200,200],"children":[["Group",{"children":[["Path",{"pathData":"M-122.304,84.285c0,0 0.101,1.894 -0.723,1.875c-0.824,-0.019 -17.278,-48.094 -37.806,-45.851c0,0 17.783,-7.353 38.529,43.976z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-118.774,81.262c0,0 -0.549,1.816 -1.318,1.517c-0.768,-0.298 0.115,-51.104 -19.951,-55.978c0,0 19.223,-0.864 21.269,54.461z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-91.284,123.59c0,0 1.636,0.96 1.166,1.637c-0.471,0.677 -49.645,-12.125 -59.1,6.232c0,0 3.679,-18.887 57.934,-7.869z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-94.093,133.801c0,0 1.856,0.396 1.622,1.187c-0.233,0.791 -50.936,4.133 -54.126,24.534c0,0 -2.458,-19.085 52.504,-25.721z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-98.304,128.276c0,0 1.778,0.663 1.432,1.411c-0.346,0.748 -50.994,-3.341 -57.126,16.377c0,0 0.352,-19.239 55.694,-17.788z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-109.009,110.072c0,0 1.308,1.374 0.669,1.895c-0.639,0.521 -44.382,-25.333 -58.529,-10.291c0,0 8.741,-17.143 57.86,8.396z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-116.554,114.263c0,0 1.456,1.217 0.88,1.808c-0.576,0.59 -46.964,-20.149 -59.318,-3.602c0,0 6.745,-18.022 58.438,1.794z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-119.154,118.335c0,0 1.608,1.008 1.118,1.671c-0.49,0.663 -49.272,-13.56 -59.255,4.516c0,0 4.225,-18.773 58.137,-6.187z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-108.42,118.949c0,0 1.122,1.531 0.421,1.966c-0.701,0.435 -40.77,-30.813 -56.728,-17.708c0,0 10.865,-15.881 56.307,15.742z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-128.2,90c0,0 0.6,1.8 -0.2,2c-0.8,0.2 -29.4,-41.8 -48.601,-34.2c0,0 15.201,-11.8 48.801,32.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-127.505,96.979c0,0 0.975,1.629 0.236,1.996c-0.738,0.368 -37.723,-34.476 -54.832,-22.914c0,0 12.297,-14.8 54.596,20.918z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-127.62,101.349c0,0 1.122,1.531 0.421,1.966c-0.701,0.434 -40.77,-30.813 -56.728,-17.708c0,0 10.865,-15.881 56.307,15.742z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.172}]]}],["Group",{"children":[["Path",{"pathData":"M-129.83,103.065c0.503,6.048 1.491,12.617 3.23,15.736c0,0 -3.6,12.4 5.2,25.6c0,0 -0.4,7.2 1.2,10.4c0,0 4,8.4 8.8,9.2c3.884,0.647 12.607,3.716 22.468,5.12c0,0 17.132,14.08 13.932,26.88c0,0 -0.4,16.4 -4,18c0,0 11.6,-11.2 2,5.6L-81.4,238.401c0,0 25.6,-21.6 10,-3.2L-81.4,261.201c0,0 19.6,-18.4 12.4,-10L-72.2,260.001c0,0 43.2,-27.2 12.4,2.4c0,0 8,-3.6 12.4,-0.8c0,0 6.8,-1.2 6,0.4c0,0 -20.8,10.4 -24.4,28.8c0,0 8.4,-10 5.2,0.8L-60.2,303.201c0,0 4,-21.6 3.6,16c0,0 19.2,-18 7.6,2.8L-49,338.801c0,0 15.2,-16.4 8.8,-3.6c0,0 10,-8.8 6,6.4c0,0 -0.8,10.4 3.6,-0.8c0,0 16,-30.6 10,-4.4c0,0 -0.8,19.2 4,4.4c0,0 0.4,10.4 9.6,17.6c0,0 -1.2,-50.8 11.6,-14.8L8.6,360.001c0,0 2.8,-9.2 2.4,-14.4c0,0 14.8,-16.4 8,8c0,0 15.2,-22.8 12,-9.6c0,0 -7.6,16 -6,20.8c0,0 16.8,-34.8 18,-36.4c0,0 -2,42.401 8.8,6.4c0,0 5.6,12 2.8,16.4c0,0 8,-8 7.2,-11.2c0,0 4.6,-8.2 7.4,5.4c0,0 1.8,9.4 3.4,6.2c0,0 4,24.001 5.2,1.2c0,0 1.6,-13.6 -5.6,-25.2c0,0 0.8,-3.2 -2,-7.2c0,0 13.6,21.6 6.4,-7.2c0,0 11.201,8 12.401,8c0,0 -13.601,-23.2 -4.801,-18.4c0,0 -5.2,-10.4 12.801,1.6c0,0 -16.001,-16 1.6,-6.4c0,0 8,6.4 0.4,-3.6c0,0 -14.401,-16 7.6,2c0,0 11.6,16.4 12.4,19.2c0,0 -10,-29.2 -14.4,-32c0,0 8.4,-36.4 49.6,-20.8c0,0 6.8,17.2 11.2,-1.2c0,0 12.8,-6.4 24,21.2c0,0 4,-13.6 3.2,-16.4c0,0 6.8,1.2 6,0c0,0 13.2,4.4 14.4,3.6c0,0 6.8,6.8 7.2,3.2c0,0 9.2,2.8 7.2,-0.8c0,0 8.8,15.6 9.2,19.2L239.001,277.601L241.001,280.401c0,0 1.6,-7.6 0.8,-8.8c-0.8,-1.2 20,6.8 24.8,27.6L268.601,307.601c0,0 6,-14.8 4.4,-18.8c0,0 5.2,0.8 5.6,5.2c0,0 4,-23.2 -0.8,-29.2c0,0 4.4,-0.8 5.6,2.8L283.401,260.401c0,0 7.2,0.8 7.2,-1.6c0,0 4.4,-4 6.4,0.8c0,0 -12.4,-35.2 6,-16c0,0 7.2,10.8 3.6,-8c-3.6,-18.8 -7.6,-20.4 -2.8,-20.8c0,0 0.8,-3.6 -1.2,-5.2c-2,-1.6 1.2,0 1.2,0c0,0 4.8,4 -0.4,-18c0,0 6.4,1.6 -5.6,-27.6c0,0 2.8,-2.4 -1.2,-10.8c0,0 8,4.4 10.8,2.8c0,0 -0.4,-1.6 -3.6,-5.6c0,0 -21.6,-54.801 -1.2,-32.8c0,0 11.85,13.55 5.45,-9.25c0,0 -9.111,-24.01 -8.334,-28.306L-129.83,103.065z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M299.717,80.245c0.628,0.181 2.834,1.305 4.084,2.955c0,0 6.8,10.8 1.6,-7.6c0,0 -9.2,-28.8 -0.4,-17.6c0,0 6,7.2 2.8,-6.4c-3.865,-16.427 -6.4,-22.8 -6.4,-22.8c0,0 11.6,4.8 -15.2,-34.8L295.001,-2.4c0,0 -19.6,-39.6 -41.2,-44.8L245.801,-53.2c0,0 38.4,-38 25.6,-74.8c0,0 -6.8,-5.2 -16.4,4c0,0 -6.4,4.8 -12.4,3.2c0,0 -30.8,1.2 -32.8,1.2c-2,0 -36.8,-37.2 -102.4,-19.6c0,0 -5.2,2 -9.6,0.8c0,0 -18.401,-16 -67.201,6.8c0,0 -10,2 -11.6,2c-1.6,0 -4.4,0 -12.4,6.4c-8,6.4 -8.4,7.2 -10.4,8.8c0,0 -16.4,11.2 -21.2,12c0,0 -11.6,6.4 -16,16.4L-44.6,-84.8c0,0 -1.6,7.2 -2,8.4c0,0 -4.8,3.6 -5.6,9.2c0,0 -8.8,6 -8.4,10.4c0,0 -1.6,5.2 -2.4,10c0,0 -7.2,4.8 -6.4,7.6c0,0 -7.6,14 -6.4,20.8c0,0 -6.4,-0.4 -9.2,2c0,0 -0.8,4.8 -2.4,5.2c0,0 -2.8,1.2 -0.4,5.2c0,0 -1.6,2.8 -2,4.4c0,0 0.8,2.8 -3.6,8.4c0,0 -6.4,18.8 -4.4,24c0,0 0.4,4.8 -2.4,6.4c0,0 -3.6,-0.4 4.8,11.6c0,0 0.8,1.2 -2.4,3.6c0,0 -17.2,3.6 -19.6,20c0,0 -13.6,14.8 -13.6,20c0,2.305 0.271,5.452 0.97,10.065c0,0 -0.57,8.336 27.03,9.136c27.6,0.8 402.717,-31.356 402.717,-31.356z","fillColor":["rgb",0.8,0.44706,0.14902],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-115.6,102.6c-25,-39.4 -10.6,17.001 -10.6,17.001c8.8,34.4 138.4,-3.2 138.4,-3.2c0,0 168.801,-30.401 180.001,-34.401c11.2,-4 106.4,2.4 106.4,2.4L293.001,67.6c-64.8,-46.4 -84,-23.2 -97.6,-27.2c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2c-6.4,0.8 -31.742,-22.951 -16.8,8.8c16,34 -58.401,39.2 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -8.31,-23.101 -40,3.2c-20,16.601 -33.8,-5.4 -33.8,-5.4L-115.6,102.6z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M133.51,25.346c-6.4,0.8 -31.767,-22.939 -16.8,8.8c16.6,35.2 -58.4,39.2 -75.2,28c-16.801,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16.001,3.2 -16.001,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -8.179,-22.934 -40,3.2c-21.236,17.346 -34.727,-4.109 -34.727,-4.109L-115.618,104.146c-25,-39.8 -9.928,18.509 -9.928,18.509c8.801,34.401 139.055,-4.509 139.055,-4.509c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 105.528,2.327 105.528,2.327L293.51,68.764c-64.8,-46.4 -83.2,-22.618 -96.8,-26.618c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.9098,0.49804,0.22745]}]]}],["Group",{"children":[["Path",{"pathData":"M134.819,27.091c-6.4,0.8 -31.134,-23.229 -16.8,8.8c16.2,36.201 -58.4,39.201 -75.2,28.001c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.401,12.8 -61.601,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -8.048,-22.767 -40,3.2c-22.473,18.091 -35.654,-2.818 -35.654,-2.818L-115.636,105.692c-23.8,-39 -9.255,20.018 -9.255,20.018c8.8,34.4 139.71,-5.818 139.71,-5.818c0,0 168.8,-30.4 180,-34.4c11.2,-4 104.655,2.254 104.655,2.254L294.02,69.928c-64.801,-46.4 -82.401,-22.037 -96.001,-26.037c-13.6,-4 -11.2,5.6 -14.4,6.401c-3.2,0.8 -42.4,-24.001 -48.8,-23.201z","fillColor":["rgb",0.91765,0.54902,0.30196]}]]}],["Group",{"children":[["Path",{"pathData":"M136.128,28.837c-6.4,0.8 -31.129,-23.232 -16.8,8.8c16.8,37.556 -58.934,38.845 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.917,-22.598 -40.001,3.2c-23.709,18.837 -36.582,-1.527 -36.582,-1.527L-115.655,107.237c-21.8,-36.8 -8.581,21.528 -8.581,21.528c8.8,34.4 140.364,-7.128 140.364,-7.128c0,0 168.8,-30.4 180.001,-34.4c11.2,-4 103.782,2.182 103.782,2.182L294.529,71.092c-64.8,-46.401 -81.6,-21.455 -95.2,-25.455c-13.601,-4 -11.201,5.6 -14.401,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.92549,0.6,0.38039]}]]}],["Group",{"children":[["Path",{"pathData":"M137.438,30.583c-6.401,0.8 -30.624,-23.454 -16.801,8.8c16.801,39.2 -58.4,39.2 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.785,-22.431 -40,3.2c-24.946,19.582 -37.51,-0.237 -37.51,-0.237L-115.673,108.783c-19.8,-34.801 -7.909,23.036 -7.909,23.036c8.8,34.401 141.019,-8.436 141.019,-8.436c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 102.909,2.109 102.909,2.109L295.038,72.255c-64.8,-46.4 -80.8,-20.872 -94.4,-24.872c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.93333,0.64706,0.45882]}]]}],["Group",{"children":[["Path",{"pathData":"M138.747,32.328c-6.4,0.8 -32.364,-22.651 -16.8,8.8c19.2,38.8 -58.401,39.2 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.654,-22.263 -40,3.2c-26.182,20.328 -38.437,1.055 -38.437,1.055L-115.691,110.328c-18,-33.2 -7.236,24.546 -7.236,24.546c8.8,34.4 141.673,-9.746 141.673,-9.746c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 102.036,2.036 102.036,2.036L295.547,73.419c-64.8,-46.4 -80,-20.291 -93.6,-24.291c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.9451,0.69804,0.53333]}]]}],["Group",{"children":[["Path",{"pathData":"M140.056,34.073c-6.401,0.8 -32.743,-22.46 -16.801,8.8c20.401,40.001 -58.4,39.201 -75.2,28.001c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.523,-22.096 -40,3.2c-27.419,21.073 -39.364,2.345 -39.364,2.345L-115.709,111.874c-16,-30.2 -6.564,26.055 -6.564,26.055c8.8,34.4 142.328,-11.055 142.328,-11.055c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 101.164,1.963 101.164,1.963L296.056,74.583c-64.8,-46.4 -79.2,-19.709 -92.8,-23.709c-13.6,-4.001 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24.001 -48.8,-23.201z","fillColor":["rgb",0.95294,0.74902,0.61176]}]]}],["Group",{"children":[["Path",{"pathData":"M141.365,35.819c-6.4,0.8 -33.842,-21.875 -16.8,8.8c22,39.6 -58.401,39.2 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.391,-21.927 -40,3.2c-28.655,21.819 -40.291,3.637 -40.291,3.637L-115.727,113.419c-14.401,-28.4 -5.891,27.564 -5.891,27.564c8.8,34.401 142.982,-12.364 142.982,-12.364c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 100.291,1.891 100.291,1.891L296.565,75.746c-64.8,-46.4 -78.4,-19.127 -92,-23.127c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.96078,0.8,0.6902]}]]}],["Group",{"children":[["Path",{"pathData":"M142.674,37.565c-6.4,0.8 -33.842,-21.876 -16.8,8.8c22,39.6 -58.4,39.2 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.401,-12.8 -58.401,12.8 -61.601,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -7.259,-21.76 -40,3.2c-29.891,22.564 -41.218,4.928 -41.218,4.928L-115.745,114.965c-13.601,-26.401 -5.218,29.073 -5.218,29.073c8.8,34.4 143.636,-13.673 143.636,-13.673c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 99.419,1.818 99.419,1.818L297.075,76.91c-64.801,-46.4 -77.601,-18.545 -91.201,-22.545c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.97255,0.84706,0.76863]}]]}],["Group",{"children":[["Path",{"pathData":"M143.983,39.31c-6.4,0.8 -33.454,-22.087 -16.8,8.8c22,40.8 -58.4,39.2 -75.2,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.201,0.8 -8.001,4 -8.801,-2.4c-0.8,-6.4 -7.128,-21.592 -40,3.2c-31.127,23.31 -42.145,6.219 -42.145,6.219L-115.764,116.51c-13,-24 -4.545,30.583 -4.545,30.583c8.8,34.4 144.292,-14.983 144.292,-14.983c0,0 168.8,-30.4 180,-34.4c11.2,-4 98.546,1.746 98.546,1.746L297.583,78.074c-64.8,-46.401 -76.8,-17.964 -90.4,-21.964c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2z","fillColor":["rgb",0.98039,0.89804,0.84314]}]]}],["Group",{"children":[["Path",{"pathData":"M145.292,41.055c-6.4,0.8 -32.375,-22.644 -16.8,8.8c21.2,42.801 -58.4,39.201 -75.2,28.001c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.8 -61.6,13.6c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.4 -6.997,-21.424 -40,3.2c-32.365,24.055 -43.074,7.509 -43.074,7.509L-115.782,118.056c-12.8,-23.2 -3.872,32.091 -3.872,32.091c8.8,34.4 144.946,-16.291 144.946,-16.291c0,0 168.801,-30.4 180.001,-34.4c11.2,-4 97.672,1.672 97.672,1.672L298.093,79.237c-64.801,-46.4 -76,-17.381 -89.6,-21.381c-13.6,-4.001 -11.2,5.6 -14.4,6.4c-3.201,0.8 -42.401,-24.001 -48.801,-23.201z","fillColor":["rgb",0.98824,0.94902,0.92157]}]]}],["Group",{"children":[["Path",{"pathData":"M-115.8,119.601c-12.8,-22.001 -3.2,33.6 -3.2,33.6c8.8,34.4 145.6,-17.6 145.6,-17.6c0,0 168.801,-30.401 180.001,-34.401c11.2,-4 96.8,1.6 96.8,1.6L298.601,80.4c-64.8,-46.4 -75.2,-16.8 -88.8,-20.8c-13.6,-4 -11.2,5.6 -14.4,6.4c-3.2,0.8 -42.4,-24 -48.8,-23.2c-6.4,0.8 -31.62,-23.007 -16.8,8.8c22.227,47.707 -60.76,37.627 -75.201,28c-16.8,-11.2 7.2,18.4 7.2,18.4c18.4,20.001 -16,3.2 -16,3.2c-34.4,-12.8 -58.4,12.801 -61.6,13.601c-3.2,0.8 -8,4 -8.8,-2.4c-0.8,-6.401 -6.865,-21.257 -40,3.2c-33.6,24.8 -44,8.8 -44,8.8L-115.8,119.601z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-74.2,149.601c0,0 -7.2,11.6 13.6,24.8c0,0 1.4,1.4 -16.6,-2.8c0,0 -6.2,-2 -7.8,-12.4c0,0 -4.8,-4.4 -9.6,-10c-4.8,-5.6 20.4,0.4 20.4,0.4z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M65.8,102c0,0 17.698,26.821 17.1,31.601c-1.3,10.4 -1.5,20 1.7,24c3.201,4 12.001,37.2 12.001,37.2c0,0 -0.4,1.2 12,-36.8c0,0 11.6,-16 -8.4,-34.4c0,0 -35.201,-28.801 -34.401,-21.601z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-54.2,176.401c0,0 11.2,7.2 -3.2,38.4L-51,212.401c0,0 -0.8,11.2 -4,13.6L-47.8,222.801c0,0 4.8,8 0.8,12.8c0,0 16.8,8 16,14.4c0,0 6.4,-8 2.4,-14.4c-4,-6.4 -11.2,-2.4 -10.4,-20.8L-47.8,218.001c0,0 5.6,-8.8 5.6,-15.2L-50.2,205.201c0,0 15.469,-26.578 4.8,-28c-6,-0.8 -8.8,-0.8 -8.8,-0.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-21.8,193.201c0,0 2.8,-4.4 0,-3.6c-2.8,0.8 -34,15.6 -40,25.2c0,0 34.4,-24.4 40,-21.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-11.4,201.201c0,0 2.8,-4.4 0,-3.6c-2.8,0.8 -34,15.6 -40,25.2c0,0 34.4,-24.4 40,-21.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M1.8,186.001c0,0 2.8,-4.4 0,-3.6c-2.8,0.8 -34,15.6 -40,25.2c0,0 34.4,-24.4 40,-21.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-21.4,229.601c0,0 0,-6 -2.8,-5.2c-2.8,0.8 -38.8,18.4 -44.8,28c0,0 42,-25.6 47.6,-22.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-20.2,218.801c0,0 1.2,-4.8 -1.6,-4c-2,0 -28.4,11.6 -34.4,21.2c0,0 29.6,-21.6 36,-17.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-34.6,266.401L-44.6,274.001c0,0 10.4,-7.6 14,-6.4c0,0 -6.8,11.2 -7.6,16.4c0,0 10.4,-12.8 16,-12.4c0,0 7.6,0.4 7.6,11.2c0,0 5.6,-10.4 8.8,-10c0,0 1.2,6.4 0,13.2c0,0 4,-7.6 8,-6c0,0 6.4,-2 5.6,9.6c0,0 0,10.4 -0.8,13.2c0,0 5.6,-26.4 8,-26.8c0,0 8,-1.2 12.8,7.6c0,0 -4,-7.6 0.8,-5.6c0,0 10.8,1.6 14,8.4c0,0 -6.8,-12 -1.2,-8.8c0,0 6.8,0 8,6.4c0,0 8.4,21.2 10.4,22.8c0,0 -7.6,-21.6 -6,-21.6c0,0 -2,-12 3.2,2.8c0,0 -3.2,-14 2.4,-13.2c5.6,0.8 10,10.8 18.4,8.4c0,0 9.601,5.6 11.601,-63.6L-34.6,266.401z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-29.8,173.601c0,0 14.8,-6 54.8,0c0,0 7.2,0.4 14,-8.4c6.8,-8.8 33.6,-16 40,-14L88.601,157.601L89.401,158.801c0,0 12.4,10.4 12.8,18c0.4,7.6 -14.4,55.6 -24.001,71.6c-9.6,16 -19.2,28.4 -38.4,26c0,0 -20.8,-4 -46.4,0c0,0 -29.2,-1.6 -32,-9.6c-2.8,-8 11.2,-23.2 11.2,-23.2c0,0 4.4,-8.4 3.2,-22.8c-1.2,-14.4 -0.8,-42.4 -5.6,-45.2z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-7.8,175.601c8.4,18.4 -21.2,83.6 -21.2,83.6c-2,1.6 12.66,7.645 22.8,5.2c10.946,-2.638 51.2,1.6 51.2,1.6c23.6,-15.6 36.4,-60 36.4,-60c0,0 10.401,-24 -7.2,-27.2c-17.6,-3.2 -82,-3.2 -82,-3.2z","fillColor":["rgb",0.89804,0.4,0.54902]}]]}],["Group",{"children":[["Path",{"pathData":"M-9.831,206.497c3.326,-12.79 4.91,-24.591 2.031,-30.896c0,0 62.4,6.4 73.6,-14.4c4.241,-7.875 19.001,22.8 18.6,32.4c0,0 -63,14.4 -77.8,3.2L-9.831,206.497z","fillColor":["rgb",0.69804,0.19608,0.34902]}]]}],["Group",{"children":[["Path",{"pathData":"M-5.4,222.801c0,0 2,7.2 -0.4,11.2c0,0 -1.6,0.8 -2.8,1.2c0,0 1.2,3.6 7.2,5.2c0,0 2,4.4 4.4,4.8c2.4,0.4 7.2,6 11.2,4.8c4,-1.2 15.2,-5.2 15.2,-5.2c0,0 5.6,-3.2 14.4,0.4c0,0 2.375,-0.802 2.8,-4.8c0.5,-4.7 3.6,-8.4 5.6,-10.4c2,-2 11.6,-14.8 10.4,-15.2c-1.2,-0.4 -68,8 -68,8z","fillColor":["rgb",0.64706,0.14902,0.29804]}]]}],["Group",{"children":[["Path",{"pathData":"M-9.8,174.401c0,0 -2.8,22.4 0.4,30.8c3.2,8.4 2.4,10.4 1.6,14.4c-0.8,4 3.6,14 9.2,20L13.4,241.201c0,0 15.2,-3.6 24.4,-0.8c0,0 8.994,1.343 12.4,-13.6c0,0 4.8,-6.4 12,-9.2c7.2,-2.8 14.4,-44.4 10.4,-52.4c-4,-8 -18.4,-12.4 -34.4,3.2c-16,15.6 -18,-1.2 -48,6z","fillColor":["rgb",1,0.44706,0.49804],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-8.2,249.201c0,0 -0.8,-2 -5.2,-2.4c0,0 -22.4,-3.6 -30.8,-16c0,0 -6.8,-5.6 -2.4,6c0,0 10.4,20.4 17.2,23.2c0,0 16.4,4 21.2,-10.8z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M71.742,185.229c0.659,-7.906 2.612,-16.52 0.858,-20.028c-6.446,-12.894 -23.419,-7.506 -34.4,3.2c-16,15.6 -18,-1.2 -48,6c0,0 -1.745,13.963 -0.905,23.975c0,0 37.305,-11.575 38.105,-5.975c0,0 1.6,-3.2 10.8,-3.2c9.2,0 31.942,-1.172 33.542,-3.972z","fillColor":["rgb",0.8,0.24706,0.29804]}]]}],["Group",{"children":[["Path",{"pathData":"M28.6,175.201c0,0 4.8,4.8 1.2,14.4c0,0 -14.4,16 -12.4,30","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.09804,0.14902],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M-19.4,260.001c0,0 -4.4,-12.8 4.4,-6c0,0 4.8,2 3.6,3.6c-1.2,1.6 -6.8,5.6 -8,2.4z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-14.36,261.201c0,0 -3.52,-10.24 3.52,-4.8c0,0 4.421,2.448 2.88,2.88c-4.56,1.28 0,3.84 -6.4,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-9.56,261.201c0,0 -3.52,-10.24 3.52,-4.8c0,0 4.375,2.31 2.88,2.88c-3.36,1.28 0,3.84 -6.4,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-2.96,261.401c0,0 -3.52,-10.24 3.52,-4.8c0,0 4.383,2.332 2.881,2.88c-2.961,1.08 0,3.84 -6.401,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M3.52,261.321c0,0 -3.52,-10.24 3.521,-4.8c0,0 3.84,1.6 2.88,2.88c-0.96,1.28 0,3.84 -6.401,1.92z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M10.2,262.001c0,0 -4.8,-12.4 4.4,-6c0,0 4.8,2 3.6,3.6c-1.2,1.6 0,4.8 -8,2.4z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-18.2,244.801c0,0 13.2,-2.8 19.2,0.4c0,0 6,1.2 7.2,0.8c1.2,-0.4 4.4,-0.8 4.4,-0.8","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M15.8,253.601c0,0 12,-13.6 24,-9.2c7.016,2.573 6,-0.8 6.8,-3.6c0.8,-2.8 1,-7 6,-10","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M33,237.601c0,0 -4,-10.8 -6.8,2c-2.8,12.8 -6,16.4 -7.6,19.2c0,0 0,5.2 8.4,4.8c0,0 10.8,-0.4 11.2,-3.2c0.4,-2.8 -1.2,-14.4 -5.2,-22.8z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M47,244.801c0,0 3.6,-2.4 6,-1.2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M53.5,228.401c0,0 2.9,-4.9 7.7,-5.7","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.64706,0.14902,0.29804],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M-25.8,265.201c0,0 18,3.2 22.4,1.6c0,0 8.8,0 0.4,2c0,0 -12.8,0 -20.8,-1.2c0,0 -11.6,-5.6 -2,-2.4z","fillColor":["rgb",0.69804,0.69804,0.69804]}]]}],["Group",{"children":[["Path",{"pathData":"M-11.8,172.001c0,0 17.6,0 19.6,0.8c0,0 7.2,30.8 3.6,38.4c0,0 -1.2,2.8 -4,-2.8c0,0 -18.4,-32.8 -21.6,-34.8c-3.2,-2 1.2,-1.6 2.4,-1.6z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-88.9,169.301c0,0 8.9,1.7 21.5,4.3c0,0 4.8,22.4 8,27.2c3.2,4.8 -0.4,4.8 -4,2c-3.6,-2.8 -18.4,-16.8 -20.4,-21.2c-2,-4.4 -5.1,-12.3 -5.1,-12.3z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-67.039,173.818c0,0 5.8,1.548 6.809,3.763c1.008,2.214 -1.202,5.511 -1.202,5.511c0,0 -1,3.305 -2.202,1.143c-1.202,-2.163 -4.074,-9.823 -3.405,-10.417z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-67,173.601c0,0 3.6,5.2 7.2,5.2c3.6,0 3.982,-0.413 6.8,0.2c4.6,1 4.2,-1 10.8,0.2c2.64,0.48 5.2,-0.4 8,0.8c2.8,1.2 6,0.4 7.2,-1.6c1.2,-2 6,-6.2 6,-6.2c0,0 -12.8,1.8 -15.6,2.6c0,0 -22.4,1.2 -30.4,-1.2z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-22.4,173.801c0,0 -6.45,3.5 -6.85,5.9c-0.4,2.4 5.25,6.1 5.25,6.1c0,0 2.75,4.6 3.35,2.2c0.6,-2.4 -0.95,-13.8 -1.75,-14.2z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-59.885,179.265c0,0 7.007,11.188 7.224,-0.023c0,0 0.557,-1.258 -1.203,-1.28c-6.075,-0.076 -4.554,-4.178 -6.021,1.303z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-52.707,179.514c0,0 7.921,11.187 7.285,-0.093c0,0 0.007,-0.332 -1.746,-0.485c-4.747,-0.414 -4.402,-4.932 -5.539,0.578z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-45.494,179.522c0,0 7.96,10.628 7.291,0.962c0,0 0.119,-1.233 -1.535,-1.534c-3.892,-0.706 -4.103,-3.955 -5.756,0.572z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-38.618,179.602c0,0 7.9,11.561 8.248,1.78c0,0 1.644,-1.378 -0.102,-1.6c-5.818,-0.74 -5.02,-5.194 -8.146,-0.18z","fillColor":["rgb",1,1,0.8],"strokeColor":["rgb",0,0,0],"strokeWidth":0.5}]]}],["Group",{"children":[["Path",{"pathData":"M-74.792,183.132L-82.45,181.601c-2.6,-5 -4.7,-11.15 -4.7,-11.15c0,0 6.35,1 18.85,3.8c0,0 0.876,3.318 2.348,9.113L-74.792,183.132z","fillColor":["rgb",0.89804,0.89804,0.69804]}]]}],["Group",{"children":[["Path",{"pathData":"M-9.724,178.47c-1.666,-2.506 -2.983,-4.264 -3.633,-4.67c-3.013,-1.883 1.13,-1.506 2.259,-1.506c0,0 16.571,0 18.454,0.753c0,0 0.524,2.242 1.208,5.633c0,0 -10.088,-2.01 -18.288,-0.21z","fillColor":["rgb",0.89804,0.89804,0.69804]}]]}],["Group",{"children":[["Path",{"pathData":"M43.88,40.321c27.721,3.96 53.241,-31.68 55.001,-41.361c1.76,-9.68 -8.36,-21.56 -8.36,-21.56c1.32,-3.08 -3.52,-17.16 -8.8,-26.4c-5.28,-9.24 -21.181,-8.266 -38.721,-9.24c-15.84,-0.88 -34.32,22.44 -35.64,24.2c-1.32,1.76 4.84,40.041 6.16,45.761c1.32,5.72 -1.32,32.12 -1.32,32.12c34.24,-9.1 3.96,-7.48 31.68,-3.52z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M8.088,-33.392c-1.296,1.728 4.752,39.313 6.048,44.929c1.296,5.616 -1.296,31.536 -1.296,31.536c32.672,-8.88 3.888,-7.344 31.104,-3.456c27.217,3.888 52.273,-31.104 54.001,-40.609c1.728,-9.504 -8.208,-21.168 -8.208,-21.168c1.296,-3.024 -3.456,-16.848 -8.64,-25.92c-5.184,-9.072 -20.795,-8.115 -38.017,-9.072c-15.552,-0.864 -33.696,22.032 -34.992,23.76z","fillColor":["rgb",0.91765,0.55686,0.31765]}]]}],["Group",{"children":[["Path",{"pathData":"M8.816,-32.744c-1.272,1.696 4.664,38.585 5.936,44.097c1.272,5.512 -1.272,30.952 -1.272,30.952c31.404,-9.16 3.816,-7.208 30.528,-3.392c26.713,3.816 51.305,-30.528 53.001,-39.857c1.696,-9.328 -8.056,-20.776 -8.056,-20.776c1.272,-2.968 -3.392,-16.536 -8.48,-25.44c-5.088,-8.904 -20.41,-7.965 -37.313,-8.904c-15.264,-0.848 -33.072,21.624 -34.344,23.32z","fillColor":["rgb",0.93725,0.66667,0.48627]}]]}],["Group",{"children":[["Path",{"pathData":"M9.544,-32.096c-1.248,1.664 4.576,37.857 5.824,43.265c1.248,5.408 -1.248,30.368 -1.248,30.368c29.436,-9.04 3.744,-7.072 29.952,-3.328c26.209,3.744 50.337,-29.952 52.001,-39.104c1.664,-9.153 -7.904,-20.385 -7.904,-20.385c1.248,-2.912 -3.328,-16.224 -8.32,-24.96c-4.992,-8.736 -20.025,-7.815 -36.609,-8.736c-14.976,-0.832 -32.448,21.216 -33.696,22.88z","fillColor":["rgb",0.95686,0.77647,0.65882]}]]}],["Group",{"children":[["Path",{"pathData":"M10.272,-31.448c-1.224,1.632 4.488,37.129 5.712,42.433c1.224,5.304 -1.224,29.784 -1.224,29.784c27.868,-8.92 3.672,-6.936 29.376,-3.264c25.705,3.672 49.369,-29.376 51.001,-38.353c1.632,-8.976 -7.752,-19.992 -7.752,-19.992c1.224,-2.856 -3.264,-15.912 -8.16,-24.48c-4.896,-8.568 -19.64,-7.665 -35.905,-8.568c-14.688,-0.816 -31.824,20.808 -33.048,22.44z","fillColor":["rgb",0.97647,0.88627,0.82745]}]]}],["Group",{"children":[["Path",{"pathData":"M44.2,36.8c25.2,3.6 48.401,-28.8 50.001,-37.6c1.6,-8.8 -7.6,-19.6 -7.6,-19.6c1.2,-2.8 -3.201,-15.6 -8.001,-24c-4.8,-8.4 -19.254,-7.514 -35.2,-8.4c-14.4,-0.8 -31.2,20.4 -32.4,22c-1.2,1.6 4.4,36.4 5.6,41.6c1.2,5.2 -1.2,29.2 -1.2,29.2c25.5,-8.6 3.6,-6.8 28.8,-3.2z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M90.601,2.8c0,0 -27.801,7.6 -39.401,6c0,0 -15.8,-6.6 -24.6,15.2c0,0 -3.6,7.2 -5.6,9.2c-2,2 69.601,-30.4 69.601,-30.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M94.401,0.6c0,0 -29.001,12.2 -39.001,11.8c0,0 -16.4,-4.6 -24.8,10c0,0 -8.4,9.2 -11.6,10.8c0,0 -0.4,1.6 6,-2.4L35.4,36c0,0 14.8,9.6 24.4,-6.4c0,0 4,-11.2 4,-13.2c0,-2 21.2,-7.6 22.801,-8c1.6,-0.4 8.2,-4.6 7.8,-7.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M47,36.514c-6.872,0 -15.245,-3.865 -15.245,-10.114c0,-6.248 8.373,-12.513 15.245,-12.513c6.874,0 12.446,5.065 12.446,11.313c0,6.249 -5.572,11.314 -12.446,11.314z","fillColor":["rgb",0.6,0.8,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M43.377,19.83c-4.846,0.722 -9.935,2.225 -9.863,2.009c1.54,-4.619 7.901,-7.952 13.486,-7.952c4.296,0 8.084,1.978 10.32,4.988c0,0 -5.316,-0.33 -13.943,0.955z","fillColor":["rgb",0.39608,0.6,0]}]]}],["Group",{"children":[["Path",{"pathData":"M55.4,19.6c0,0 -4.4,-3.2 -4.4,-1c0,0 3.6,4.4 4.4,1z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M45.4,27.726c-2.499,0 -4.525,-2.026 -4.525,-4.526c0,-2.499 2.026,-4.525 4.525,-4.525c2.5,0 4.526,2.026 4.526,4.525c0,2.5 -2.026,4.526 -4.526,4.526z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-58.6,14.4c0,0 -3.2,-21.2 -0.8,-25.6c0,0 10.8,-10 10.4,-13.6c0,0 -0.4,-18 -1.6,-18.8c-1.2,-0.8 -8.8,-6.8 -14.8,-0.4c0,0 -10.4,18 -9.6,24.4L-75,-17.6c0,0 -7.6,-0.4 -9.2,1.6c0,0 -1.2,5.2 -2.4,5.6c0,0 -2.8,2.4 -0.8,5.2c0,0 -2,2.4 -1.6,6.4L-81.4,5.2c0,0 2,14.4 12.8,19.6c4.836,2.329 8,-4.4 10,-10.4z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M-59.6,12.56c0,0 -2.88,-19.08 -0.72,-23.04c0,0 9.72,-9 9.36,-12.24c0,0 -0.36,-16.2 -1.44,-16.92c-1.08,-0.72 -7.92,-6.12 -13.32,-0.36c0,0 -9.36,16.2 -8.64,21.96L-74.36,-16.24c0,0 -6.84,-0.36 -8.28,1.44c0,0 -1.08,4.68 -2.16,5.04c0,0 -2.52,2.16 -0.72,4.68c0,0 -1.8,2.16 -1.44,5.76L-80.12,4.28c0,0 1.8,12.96 11.52,17.64c4.352,2.095 7.2,-3.96 9,-9.36z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-51.05,-42.61c-1.09,-0.86 -8.58,-6.63 -14.43,-0.39c0,0 -10.14,17.55 -9.36,23.79L-74.84,-17.26c0,0 -7.41,-0.39 -8.97,1.56c0,0 -1.17,5.07 -2.34,5.46c0,0 -2.73,2.34 -0.78,5.07c0,0 -1.95,2.34 -1.56,6.24L-81.08,4.97c0,0 1.95,14.04 12.48,19.11c4.714,2.27 7.8,-4.29 9.75,-10.14c0,0 -3.12,-20.67 -0.78,-24.96c0,0 10.53,-9.75 10.14,-13.26c0,0 -0.39,-17.55 -1.56,-18.33z","fillColor":["rgb",0.92157,0.58431,0.36078]}]]}],["Group",{"children":[["Path",{"pathData":"M-51.5,-41.62c-0.98,-0.92 -8.36,-6.46 -14.06,-0.38c0,0 -9.88,17.1 -9.12,23.18L-74.68,-16.92c0,0 -7.22,-0.38 -8.74,1.52c0,0 -1.14,4.94 -2.28,5.32c0,0 -2.66,2.28 -0.76,4.94c0,0 -1.9,2.28 -1.52,6.08L-80.76,4.74c0,0 1.9,13.68 12.16,18.62c4.594,2.212 7.6,-4.18 9.5,-9.88c0,0 -3.04,-20.14 -0.76,-24.32c0,0 10.26,-9.5 9.88,-12.92c0,0 -0.38,-17.1 -1.52,-17.86z","fillColor":["rgb",0.94902,0.72157,0.57255]}]]}],["Group",{"children":[["Path",{"pathData":"M-51.95,-40.63c-0.87,-0.98 -8.14,-6.29 -13.69,-0.37c0,0 -9.62,16.65 -8.88,22.57L-74.52,-16.58c0,0 -7.03,-0.37 -8.51,1.48c0,0 -1.11,4.81 -2.22,5.18c0,0 -2.59,2.22 -0.74,4.81c0,0 -1.85,2.22 -1.48,5.92L-80.44,4.51c0,0 1.85,13.32 11.84,18.13c4.473,2.154 7.4,-4.07 9.25,-9.62c0,0 -2.96,-19.61 -0.74,-23.68c0,0 9.99,-9.25 9.62,-12.58c0,0 -0.37,-16.65 -1.48,-17.39z","fillColor":["rgb",0.97255,0.86275,0.78431]}]]}],["Group",{"children":[["Path",{"pathData":"M-59.6,12.46c0,0 -2.88,-18.98 -0.72,-22.94c0,0 9.72,-9 9.36,-12.24c0,0 -0.36,-16.2 -1.44,-16.92c-0.76,-1.04 -7.92,-6.12 -13.32,-0.36c0,0 -9.36,16.2 -8.64,21.96L-74.36,-16.24c0,0 -6.84,-0.36 -8.28,1.44c0,0 -1.08,4.68 -2.16,5.04c0,0 -2.52,2.16 -0.72,4.68c0,0 -1.8,2.16 -1.44,5.76L-80.12,4.28c0,0 1.8,12.96 11.52,17.64c4.352,2.095 7.2,-4.06 9,-9.46z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-62.7,6.2c0,0 -21.6,-10.2 -22.5,-11c0,0 9.1,8.2 9.9,8.2c0.8,0 12.6,2.8 12.6,2.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-79.8,0c0,0 18.4,3.6 18.4,8c0,2.912 -0.243,16.331 -5.6,14.8c-8.4,-2.4 -4.8,-16.8 -12.8,-22.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-71.4,3.8c0,0 8.978,1.474 10,4.2c0.6,1.6 1.263,9.908 -4.2,11c-4.552,0.911 -6.782,-9.31 -5.8,-15.2z","fillColor":["rgb",0.6,0.8,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M14.595,46.349c-0.497,-1.742 0.814,-1.611 2.605,-2.149c2,-0.6 14.2,-4.4 15,-7c0.8,-2.6 14,1.8 14,1.8c1.8,0.8 6.2,3.4 6.2,3.4c4.8,1.2 11.4,1.6 11.4,1.6c2.4,1 5.8,3.8 5.8,3.8c14.6,10.2 27.001,3 27.001,3c20,-6.6 14,-23.8 14,-23.8c-3,-9 0.2,-12.4 0.2,-12.4c0.2,-3.8 7.4,2.6 7.4,2.6c2.6,4.2 3.4,9.2 3.4,9.2c8,11.2 4.6,-6.6 4.6,-6.6c0.2,-1 -2.6,-4.6 -2.6,-5.8c0,-1.2 -1.8,-4.6 -1.8,-4.6c-3,-3.4 -0.6,-10.4 -0.6,-10.4c1.8,-13.8 -0.4,-12 -0.4,-12c-1.2,-1.8 -10.4,8.2 -10.4,8.2c-2.2,3.4 -8.2,5 -8.2,5c-2.8,1.8 -6.2,0.4 -6.2,0.4c-2.6,-0.4 -8.2,6.6 -8.2,6.6c2.8,-0.2 5.2,4.2 7.6,4.4c2.4,0.2 4.2,-2.4 5.8,-3c1.6,-0.6 4.4,5.2 4.4,5.2c0.4,2.6 -5.2,7.4 -5.2,7.4c-0.4,4.6 -2,3 -2,3c-3,-0.6 -4.2,3.2 -5.2,7.8c-1,4.6 -5.2,5 -5.2,5c-1.6,7.4 -2.801,4.4 -2.801,4.4c-0.2,-5.6 -6.2,0.2 -6.2,0.2c-1.2,2 -5.8,-0.2 -5.8,-0.2c-6.8,-2 -4.4,-4 -4.4,-4c1.8,-2.2 13,0 13,0c2.2,-1.6 -5.8,-5.6 -5.8,-5.6c-0.6,-1.8 0.4,-6.2 0.4,-6.2c1.2,-3.2 8,-8.8 8,-8.8c9.401,-1.2 6.601,-2.8 6.601,-2.8c-6.2,-5.2 -12.001,2.4 -12.001,2.4c-2.2,6.2 -19.6,21.2 -19.6,21.2c-4.8,3.4 -2.2,-3.4 -6.2,0c-4,3.4 -24.6,-5.6 -24.6,-5.6c-11.562,-1.193 -14.294,14.549 -17.823,11.429c0,0 5.418,8.52 3.818,2.92z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M209.401,-120c0,0 -25.6,8 -28.4,26.8c0,0 -2.4,22.8 18,40.4c0,0 0.4,6.4 2.4,9.6c0,0 -1.6,4.8 17.2,-2.8L245.801,-54.4c0,0 6.4,-2.4 11.6,-11.2c5.2,-8.8 20.4,-27.6 16.8,-52.8c0,0 1.2,-11.2 -4.8,-11.6c0,0 -8.4,-1.6 -15.6,6c0,0 -6.8,3.2 -9.2,2.8L209.401,-120z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M264.022,-120.99c0,0 2.1,-8.93 -2.74,-4.09c0,0 -7.04,5.72 -14.521,5.72c0,0 -14.52,2.2 -18.92,15.4c0,0 -3.96,26.84 3.96,32.56c0,0 4.84,7.48 11.88,0.88c7.041,-6.6 22.541,-36.83 20.341,-50.47z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M263.648,-120.632c0,0 2.09,-8.744 -2.662,-3.992c0,0 -6.912,5.616 -14.257,5.616c0,0 -14.256,2.16 -18.576,15.12c0,0 -3.888,26.352 3.888,31.968c0,0 4.752,7.344 11.664,0.864c6.913,-6.48 22.103,-36.184 19.943,-49.576z","fillColor":["rgb",0.19608,0.19608,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M263.274,-120.274c0,0 2.08,-8.558 -2.584,-3.894c0,0 -6.784,5.512 -13.993,5.512c0,0 -13.992,2.12 -18.232,14.84c0,0 -3.816,25.864 3.816,31.376c0,0 4.664,7.208 11.448,0.848c6.785,-6.36 21.665,-35.538 19.545,-48.682z","fillColor":["rgb",0.4,0.4,0.4]}]]}],["Group",{"children":[["Path",{"pathData":"M262.9,-119.916c0,0 2.07,-8.372 -2.506,-3.796c0,0 -6.656,5.408 -13.729,5.408c0,0 -13.728,2.08 -17.888,14.56c0,0 -3.744,25.376 3.744,30.784c0,0 4.576,7.072 11.232,0.832c6.657,-6.24 21.227,-34.892 19.147,-47.788z","fillColor":["rgb",0.6,0.6,0.6]}]]}],["Group",{"children":[["Path",{"pathData":"M262.526,-119.558c0,0 2.06,-8.186 -2.428,-3.698c0,0 -6.529,5.304 -13.465,5.304c0,0 -13.464,2.04 -17.544,14.28c0,0 -3.672,24.888 3.672,30.192c0,0 4.488,6.936 11.016,0.816c6.528,-6.12 20.789,-34.246 18.749,-46.894z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M262.151,-119.2c0,0 2.05,-8 -2.35,-3.6c0,0 -6.4,5.2 -13.2,5.2c0,0 -13.2,2 -17.2,14c0,0 -3.6,24.4 3.6,29.6c0,0 4.4,6.8 10.8,0.8c6.4,-6 20.35,-33.6 18.35,-46z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M50.6,84c0,0 -20.4,-19.2 -28.4,-20c0,0 -34.4,-4 -49.2,14c0,0 17.6,-20.4 45.2,-14.8c0,0 -21.6,-4.4 -34,-1.2c0,0 -16.8,0 -26.4,14L-45,80.8c0,0 4,-14.8 22.4,-20.8c0,0 22.8,-4.8 33.6,0c0,0 -21.6,-6.8 -31.6,-4.8c0,0 -30.4,-2.4 -43.2,24c0,0 4,-14.4 18.8,-21.6c0,0 13.6,-8.8 34,-6c0,0 14.4,3.2 19.6,5.6c5.2,2.4 4,-0.4 -4.4,-5.2c0,0 -5.6,-10 -19.6,-9.6c0,0 -42.8,3.6 -53.2,15.6c0,0 13.6,-11.2 24,-14c0,0 22.4,-8 30.8,-7.2c0,0 24.8,1 32.4,-3c0,0 -11.2,5 -8,8.2c3.2,3.2 10,10.8 10,12c0,1.2 24.2,23.3 27.8,27.7L50.6,84z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M189,278c0,0 -15.5,-36.5 -28,-46c0,0 26,16 29.5,34c0,0 0,10 -1.5,12z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M236,285.5c0,0 -26.5,-55 -45,-79c0,0 43.5,37.5 48.5,64L240,276L237,273.5c0,0 -0.5,9 -1,12z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M292.5,237c0,0 -62.5,-59.5 -64,-62c0,0 60.5,66 63.5,73.5c0,0 -2,-9 0.5,-11.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M104,280.5c0,0 19.5,-52 38.5,-29.5c0,0 15,10 14.5,13c0,0 -4,-6.5 -22,-6c0,0 -19,-3 -31,22.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M294.5,153c0,0 -45,-28.5 -52.5,-30c-11.807,-2.361 49.5,29 54.5,39.5c0,0 2,-2.5 -2,-9.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M143.801,259.601c0,0 20.4,-2 27.2,-8.8L175.401,254.401L193.001,216.001L196.601,221.201c0,0 14.4,-14.8 13.6,-22.8c-0.8,-8 12.8,6 12.8,6c0,0 -0.8,-11.6 6.4,-4.8c0,0 -2.4,-15.6 6,-7.6c0,0 -10.537,-30.157 12,-4.4c5.6,6.4 1.2,-0.4 1.2,-0.4c0,0 -26,-48 -4.4,-33.6c0,0 2,-22.8 0.8,-27.2c-1.2,-4.4 -3.2,-26.801 -8,-32.001c-4.8,-5.2 0.4,-6.8 6,-1.6c0,0 -11.2,-24 2,-12c0,0 -3.6,-15.2 -8,-18c0,0 -5.6,-17.2 9.6,-6.4c0,0 -4.4,-12.4 -7.6,-15.6c0,0 -11.6,-27.6 -4.4,-22.8L239.001,21.6c0,0 -6.8,-14 -0.4,-9.6c6.4,4.4 6.4,4 6.4,4c0,0 -21.2,-33.2 -0.8,-15.6c0,0 -8.159,-13.918 -11.6,-20.8c0,0 -18.8,-20.4 -4.4,-14L233.001,-32.8c0,0 -8.8,-10 -16.8,-11.6c-8,-1.6 2.4,-8 8.8,-6c6.4,2 22,9.6 22,9.6c0,0 12.8,18.8 16.8,19.2c0,0 -20,-7.6 -14,0.4c0,0 14.4,14 7.2,13.6c0,0 -6,7.2 -1.2,16c0,0 -18.459,-18.391 -3.6,7.2L259.001,32c0,0 -24.4,-24.8 -13.2,-2.8c0,0 17.2,23.6 19.2,24c2,0.4 6.4,9.2 6.4,9.2L267.001,60.4L272.201,69.2c0,0 -11.2,-12 -5.2,1.2L272.601,84.8c0,0 -20.4,-22 -6.8,7.6c0,0 -16.4,-5.2 -7.6,12c0,0 -1.6,16.001 -1.2,21.201c0.4,5.2 1.6,33.6 -2.8,41.6c-4.4,8 6,27.2 8,31.2c2,4 5.6,14.8 -3.2,5.6c-8.8,-9.2 -4.4,-3.6 -2.4,5.2c2,8.8 8,24.4 7.2,30c0,0 -1.2,1.2 -4.4,-2.4c0,0 -14.8,-22.8 -13.2,-8.4c0,0 -1.2,8 -4.4,16.8c0,0 -3.2,10.8 -3.2,2c0,0 -3.2,-16.8 -6,-9.2c-2.8,7.6 -6.4,13.6 -9.2,16c-2.8,2.4 -8,-20.4 -9.2,-10c0,0 -12,-12.4 -16.8,4L185.801,264.401c0,0 -0.4,-12.4 -1.6,-6.4c0,0 -30,6 -40.4,1.6z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M109.401,-97.2c0,0 -11.6,-8 -15.6,-7.6c-4,0.4 27.6,-8.8 68.8,18.8c0,0 4.8,2.8 8.4,2.4c0,0 3.2,2.4 0.4,6c0,0 -8.8,9.6 2.4,20.8c0,0 18.4,6.8 12.8,-2c0,0 10.8,4 13.2,8c2.4,4 1.2,0 1.2,0c0,0 -6.4,-7.2 -12.4,-12.4c0,0 -5.2,-2 -8,-10.4c-2.8,-8.4 -5.2,-18.4 -0.8,-21.6c0,0 -4,4.4 -3.2,0.4c0.8,-4 4.4,-7.6 6,-8c1.6,-0.4 18,-16.2 24.8,-16.6c0,0 -9.2,1.4 -12.2,0.4c-3,-1 -29.6,-12.4 -35.6,-13.6c0,0 -16.8,-6.6 -4.8,-4.6c0,0 35.8,3.8 54,17c0,0 -7.2,-8.4 -25.6,-15.4c0,0 -22.2,-12.6 -57.4,-7.6c0,0 -17.8,3.2 -25.6,5c0,0 -2.6,-0.6 -3.2,-1c-0.6,-0.4 -12.401,-9.4 -40.001,-2.4c0,0 -17,4.6 -25.6,9.4c0,0 -15.2,1.2 -18.8,4.4c0,0 -18.6,14.6 -20.6,15.4c-2,0.8 -13.4,8.4 -14.2,8.8c0,0 24.6,-6.6 27,-9c2.4,-2.4 19.8,-5 22.2,-3.6c2.4,1.4 10.8,0.8 1.2,1.4c0,0 75.601,14.8 76.401,16.8c0.8,2 4.8,0.8 4.8,0.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M180.801,-106.4c0,0 -10.2,-7.4 -12.2,-7.4c-2,0 -14.4,-10.2 -18.6,-9.8c-4.2,0.4 -16.4,-9.6 -43.8,-1.4c0,0 -0.6,-2 3,-2.8c0,0 6.4,-2.2 6.8,-2.8c0,0 20.2,-4.2 27.4,-0.6c0,0 9.2,2.6 15.4,8.8c0,0 11.2,3.2 14.4,2.2c0,0 8.8,2.2 9.2,4c0,0 5.8,3 4,5.6c0,0 0.4,1.6 -5.6,4.2z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M168.33,-108.509c0.807,0.632 1.826,0.73 2.431,1.539c0.234,0.314 -0.055,0.64 -0.37,0.737c-1.043,0.317 -2.099,-0.253 -3.241,0.335c-0.402,0.207 -1.044,0.025 -1.597,-0.124c-1.632,-0.441 -3.461,-0.466 -5.152,0.222c-1.985,-1.129 -4.345,-0.545 -6.426,-1.546c-0.058,-0.027 -0.28,0.319 -0.354,0.292c-3.046,-1.145 -6.789,-0.862 -9.22,-3.146c-2.428,-0.412 -4.785,-0.874 -7.213,-1.554c-1.818,-0.509 -3.227,-1.498 -4.847,-2.33c-1.377,-0.708 -2.834,-1.23 -4.368,-1.602c-1.863,-0.452 -3.694,-0.34 -5.587,-0.86c-0.093,-0.025 -0.285,0.319 -0.367,0.292c-0.324,-0.108 -0.614,-0.691 -0.785,-0.638c-1.681,0.522 -3.169,-0.45 -4.833,-0.108c-1.178,-1.224 -2.906,-0.979 -4.452,-1.421c-2.964,-0.848 -6.118,0.422 -9.148,-0.579c4.113,-1.842 8.8,-0.61 12.862,-2.679c2.328,-1.186 4.99,-0.084 7.56,-0.844c0.487,-0.144 1.178,-0.346 1.578,0.323c0.134,-0.135 0.316,-0.374 0.374,-0.346c2.45,1.157 4.765,2.431 7.247,3.497c0.341,0.146 0.873,-0.086 1.125,0.116c1.52,1.216 3.463,1.113 4.854,2.333c1.698,-0.502 3.491,-0.122 5.22,-0.746c0.077,-0.027 0.311,0.314 0.344,0.292c1.13,-0.748 2.285,-0.477 3.177,-0.173c0.338,0.115 1.001,0.362 1.306,0.436c1.126,0.276 1.982,0.756 3.161,0.939c0.114,0.018 0.299,-0.322 0.371,-0.294c1.123,0.438 2.165,0.382 2.821,1.546c0.135,-0.135 0.3,-0.373 0.382,-0.346c1.027,0.338 1.676,1.093 2.777,1.334c0.485,0.106 1.097,0.732 1.673,0.908c2.392,0.731 4.235,2.26 6.429,3.155c0.759,0.31 1.635,0.544 2.268,1.04z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M91.696,-122.739c-2.518,-1.725 -4.886,-2.831 -7.328,-4.617c-0.181,-0.133 -0.541,0.037 -0.743,-0.085c-1.007,-0.609 -1.895,-1.19 -2.877,-1.886c-0.539,-0.382 -1.36,-0.371 -1.868,-0.629c-2.544,-1.292 -5.173,-1.85 -7.68,-3.044c0.682,-0.638 1.804,-0.394 2.4,-1.2c0.195,0.28 0.433,0.564 0.786,0.373c1.678,-0.904 3.528,-1.057 5.204,-0.967c1.704,0.092 3.424,0.397 5.199,0.669c0.307,0.047 0.506,0.57 0.829,0.667c2.228,0.663 4.617,0.138 6.736,0.976c1.591,0.629 3.161,1.452 4.4,2.727c0.252,0.26 -0.073,0.561 -0.353,0.755c0.388,-0.109 0.661,0.097 0.772,0.41c0.084,0.239 0.084,0.541 0,0.78c-0.112,0.312 -0.391,0.413 -0.765,0.464c-1.407,0.19 0.365,-1.19 -0.335,-0.742c-1.273,0.814 -0.527,2.22 -1.272,3.488c-0.28,-0.194 -0.51,-0.412 -0.4,-0.8c0.234,0.522 -0.368,0.812 -0.536,1.128c-0.385,0.725 -1.284,2.14 -2.169,1.533z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M59.198,-115.391c-3.154,-0.794 -6.204,-0.679 -9.22,-1.955c-0.067,-0.028 -0.29,0.319 -0.354,0.292c-1.366,-0.594 -2.284,-1.56 -3.36,-2.606c-0.913,-0.888 -2.571,-0.501 -3.845,-0.988c-0.324,-0.124 -0.527,-0.636 -0.828,-0.675c-1.219,-0.157 -2.146,-1.106 -3.191,-1.677c2.336,-0.795 4.747,-0.764 7.209,-1.148c0.113,-0.018 0.258,0.303 0.391,0.303c0.136,0 0.266,-0.221 0.4,-0.355c0.195,0.28 0.497,0.606 0.754,0.352c0.548,-0.54 1.104,-0.35 1.644,-0.31c0.144,0.01 0.269,0.313 0.402,0.313c0.136,0 0.267,-0.311 0.4,-0.311c0.136,0.001 0.267,0.311 0.4,0.311c0.136,0 0.266,-0.221 0.4,-0.355c0.692,0.782 1.577,0.228 2.399,0.407c1.038,0.227 1.305,1.375 2.379,1.673c4.715,1.304 8.852,3.449 13.215,5.536c0.307,0.147 0.517,0.395 0.407,0.784c0.267,0 0.58,-0.088 0.77,0.044c1.058,0.732 2.099,1.28 2.796,2.378c0.216,0.339 -0.113,0.746 -0.346,0.694c-4.429,-0.995 -8.435,-1.603 -12.822,-2.707z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M45.338,-71.179c-1.592,-1.219 -2.176,-3.25 -3.304,-5.042c-0.214,-0.34 0.06,-0.654 0.377,-0.743c0.56,-0.159 1.103,0.319 1.512,0.521c1.745,0.862 3.28,2.104 5.277,2.243c1.99,2.234 6.25,2.619 6.257,6c0.001,0.859 -1.427,-0.059 -1.857,0.8c-2.451,-1.003 -4.84,-0.9 -7.22,-2.367c-0.617,-0.381 -0.287,-0.834 -1.042,-1.412z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M17.8,-123.756c0.135,0.001 7.166,0.234 7.149,0.348c-0.045,0.309 -7.775,1.358 -8.139,1.188c-0.164,-0.076 -7.676,2.354 -7.81,2.22c0.268,-0.135 8.534,-3.756 8.8,-3.756z","fillColor":["rgb",0.8,0.44706,0.14902]}]]}],["Group",{"children":[["Path",{"pathData":"M33.2,-114c0,0 -14.8,1.8 -19.2,3c-4.4,1.2 -23,8.8 -26,10.8c0,0 -13.4,5.4 -30.4,25.4c0,0 7.6,-3.4 9.8,-6.2c0,0 13.6,-12.6 13.4,-10c0,0 12.2,-8.6 11.6,-6.4c0,0 24.4,-11.2 22.4,-8c0,0 21.6,-4.6 20.6,-2.6c0,0 18.8,4.4 16,4.6c0,0 -5.8,1.2 0.6,4.8c0,0 -3.4,4.4 -8.8,0.4c-5.4,-4 -2.4,-1.8 -7.4,-0.8c0,0 -2.6,0.8 -7.2,-3.2c0,0 -5.6,-4.6 -14.4,-1c0,0 -30.6,12.6 -32.6,13.2c0,0 -3.6,2.8 -6,6.4c0,0 -5.8,4.4 -8.8,5.8c0,0 -12.8,11.6 -14,13c0,0 -3.4,5.2 -4.2,5.6c0,0 6.4,-3.8 8.4,-5.8c0,0 14,-10 19.4,-10.8c0,0 4.4,-3 5.2,-4.4c0,0 14.4,-9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8c0,0 3.2,-1.8 4.6,-0.4c1.4,1.4 5.6,-19.8 5.6,-19.8L67.6,-92.4L111.201,-95.8L94.201,-102.6L33.2,-114z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M51.4,85c0,0 -15,-16.8 -23.4,-19.4c0,0 -13.4,-6.8 -38,1","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M24.8,64.2c0,0 -25.2,-8 -40.6,-3.8c0,0 -18.4,2 -26.8,15.8","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M21.2,63c0,0 -17,-7.2 -31.8,-9.4c0,0 -16.6,-2.6 -33.2,4.6c0,0 -12.2,6 -17.6,16.2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M22.2,63.4c0,0 -15.4,-11 -16.4,-12.4c0,0 -7,-11 -20,-11.4c0,0 -21.4,0.8 -38.6,8.8","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0.29804,0,0],"strokeWidth":2}]]}],["Group",{"children":[["Path",{"pathData":"M20.895,54.407c1.542,1.463 28.505,30.393 28.505,30.393c35.2,36.601 7.2,2.4 7.2,2.4c-7.6,-4.8 -16.8,-23.6 -16.8,-23.6c-1.2,-2.8 14,7.2 14,7.2c4,0.8 17.6,20 17.6,20c-6.8,-2.4 -2,4.8 -2,4.8c2.8,2 23.201,17.601 23.201,17.601c3.6,4 7.6,5.6 7.6,5.6c14,-5.2 7.6,8 7.6,8c2.4,6.8 8,-4.8 8,-4.8c11.2,-16.801 -5.2,-14.4 -5.2,-14.4c-30.001,2.8 -36.801,-13.201 -36.801,-13.201c-2.4,-2.4 6.4,0 6.4,0c8.401,2 -7.2,-12.4 -7.2,-12.4c2.4,0 11.6,6.8 11.6,6.8c10.401,9.2 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-2.4,6c-0.721,7.933 -9.6,14.2 -9.6,14.2c-11.2,6.2 -2,10.2 -2,10.2c6,6.6 -3.8,6.8 -3.8,6.8c-11,-1.8 -2.8,8.4 -2.8,8.4c10.8,12.8 7.8,15.6 7.8,15.6c-10.2,1 2.4,10.2 2.4,10.2c0,0 -0.8,-2 -0.6,-0.2c0.2,1.8 3.2,6 4,8c0.8,2 -3.2,2.2 -3.2,2.2c0.6,9.6 -14.8,5.4 -14.8,5.4c0,0 0,0 -1.6,0.2c-1.6,0.2 -12.8,-0.6 -18.6,-2.8c-5.8,-2.2 -12.6,-2.2 -12.6,-2.2c0,0 -4,1.8 -11.601,1.6c-7.6,-0.2 -15.6,2.6 -15.6,2.6c-4.4,-0.4 4.2,-4.8 4.4,-4.6c0.2,0.2 5.8,-5.4 -2.2,-4.8c-21.797,1.635 -32.6,-8.6 -32.6,-8.6c-2,-1.4 -4.6,-4.2 -4.6,-4.2c-10,-2 1.4,12.4 1.4,12.4c1.2,1.4 -0.2,2.4 -0.2,2.4c-0.8,-1.6 -8.6,-7 -8.6,-7c-2.811,-0.973 -4.174,-2.307 -6.505,-4.793z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-3,42.8c0,0 11.6,5.6 14.2,8.4c2.6,2.8 16.6,14.2 16.6,14.2c0,0 -5.4,-2 -8,-3.8c-2.6,-1.8 -13.4,-10 -13.4,-10c0,0 -3.8,-6 -9.4,-8.8z","fillColor":["rgb",0.29804,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-61.009,11.603c0.337,-0.148 -0.187,-2.86 -0.391,-3.403c-1.022,-2.726 -10,-4.2 -10,-4.2c-0.227,1.365 -0.282,2.961 -0.176,4.599c0,0 4.868,5.519 10.567,3.004z","fillColor":["rgb",0.6,0.8,0.19608]}]]}],["Group",{"children":[["Path",{"pathData":"M-61.009,11.403c-0.449,0.158 -0.015,-2.734 -0.191,-3.203c-1.022,-2.726 -10.2,-4.3 -10.2,-4.3c-0.227,1.365 -0.282,2.961 -0.176,4.599c0,0 4.268,5.119 10.567,2.904z","fillColor":["rgb",0.39608,0.6,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-65.4,11.546c-0.625,0 -1.131,-1.14 -1.131,-2.546c0,-1.405 0.506,-2.545 1.131,-2.545c0.625,0 1.132,1.14 1.132,2.545c0,1.406 -0.507,2.546 -1.132,2.546z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-65.4,9z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-111,109.601c0,0 -5.6,10 19.2,4c0,0 14,-1.2 16.4,-3.6c1.2,0.8 9.566,3.733 12.4,4.4c6.8,1.6 15.2,-8.401 15.2,-8.401c0,0 4.6,-10.5 7.4,-10.5c2.8,0 -0.4,1.6 -0.4,1.6c0,0 -6.6,10.101 -6.2,11.701c0,0 -5.2,20 -21.2,20.8c0,0 -16.15,0.95 -14.8,6.8c0,0 8.8,-2.4 11.2,0c0,0 10.8,-0.4 2.8,6L-75.8,154.001c0,0 0.14,3.918 -10,0.4c-9.8,-3.4 -20.1,-16.3 -20.1,-16.3c0,0 -15.95,-14.55 -5.1,-28.5z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-112.2,113.601c0,0 -2,9.6 34.8,-0.8c0,0 4.4,0 6.8,0.8c2.4,0.8 14.4,3.6 16.4,2.4c0,0 -7.2,13.6 -18.8,12c0,0 -13.2,1.6 -12.8,6.4c0,0 4,7.2 8.8,9.6c0,0 2.8,2.4 2.4,5.6c-0.4,3.2 -3.2,4.8 -5.2,5.6c-2,0.8 -5.2,-2.4 -6.8,-2.4c-1.6,0 -10,-6.4 -14.4,-11.2c-4.4,-4.8 -12.8,-16.8 -12.4,-19.6c0.4,-2.8 1.2,-8.4 1.2,-8.4z","fillColor":["rgb",0.89804,0.6,0.6]}]]}],["Group",{"children":[["Path",{"pathData":"M-109,131.051c2.6,3.95 5.8,8.15 8,10.55c4.4,4.8 12.8,11.2 14.4,11.2c1.6,0 4.8,3.2 6.8,2.4c2,-0.8 4.8,-2.4 5.2,-5.6c0.4,-3.2 -2.4,-5.6 -2.4,-5.6c-3.066,-1.533 -5.806,-5.025 -7.385,-7.348c0,0 0.185,2.548 -5.015,1.748c-5.2,-0.8 -10.4,-3.6 -12,-6.8c-1.6,-3.2 -4,-5.6 -2.4,-2c1.6,3.6 4,7.2 5.6,7.6c1.6,0.4 1.2,1.6 -1.2,1.2c-2.4,-0.4 -5.2,-0.8 -9.6,-6z","fillColor":["rgb",0.69804,0.39608,0.39608]}]]}],["Group",{"children":[["Path",{"pathData":"M-111.6,110.001c0,0 1.8,-13.601 3,-17.601c0,0 -0.8,-6.8 1.6,-11c2.4,-4.2 4.4,-10.4 7.4,-15.8c3,-5.4 3.2,-9.4 7.2,-11c4,-1.6 10,-10.2 12.8,-11.2c2.8,-1 2.6,-0.2 2.6,-0.2c0,0 6.8,-14.8 20.4,-10.8c0,0 -16.2,-2.8 -0.4,-12.2c0,0 -4.8,1.1 -1.5,-5.9c2.201,-4.668 1.7,2.1 -9.3,13.9c0,0 -5,8.6 -10.2,11.6c-5.2,3 -17.2,10 -18.4,13.8c-1.2,3.8 -4.4,9.6 -6.4,11.2c-2,1.6 -4.8,5.8 -5.2,9.2c0,0 -1.2,4 -2.6,5.2c-1.4,1.2 -1.6,4.4 -1.6,6.4c0,2 -2,4.8 -1.8,7.2c0,0 0.8,19.001 0.4,21.001L-111.6,110.001z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-120.2,114.601c0,0 -2,-1.4 -6.4,4.6c0,0 7.3,33 7.3,34.4c0,0 1.1,-2.1 -0.2,-9.3c-1.3,-7.2 -2.2,-19.9 -2.2,-19.9L-120.2,114.601z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-98.6,54c0,0 -17.6,3.2 -17.2,32.4L-116.6,111.201c0,0 -1.2,-25.601 -2.4,-27.201c-1.2,-1.6 2.8,-12.8 -0.4,-6.8c0,0 -14,14 -6,35.201c0,0 1.5,3.3 -1.5,-1.3c0,0 -4.6,-12.601 -3.5,-19.001c0,0 0.2,-2.2 2.1,-5c0,0 8.6,-11.7 11.3,-14c0,0 1.8,-14.4 17.2,-19.6c0,0 5.7,-2.3 1.2,0.5z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M40.8,-12.2c0.66,-0.354 0.651,-1.324 1.231,-1.497c1.149,-0.344 1.313,-1.411 1.831,-2.195c0.873,-1.319 1.066,-2.852 1.648,-4.343c0.272,-0.7 0.299,-1.655 -0.014,-2.315c-1.174,-2.481 -1.876,-4.93 -3.318,-7.356c-0.268,-0.45 -0.53,-1.244 -0.731,-1.842c-0.463,-1.384 -1.72,-2.375 -2.58,-3.695c-0.288,-0.441 0.237,-1.366 -0.479,-1.45c-0.897,-0.105 -2.346,-0.685 -2.579,0.341c-0.588,2.587 0.423,5.11 1.391,7.552c-0.782,0.692 -0.448,1.613 -0.296,2.38c0.71,3.606 -0.488,6.958 -1.249,10.432c-0.023,0.104 0.319,0.302 0.291,0.364c-1.222,2.686 -2.674,5.131 -4.493,7.512c-0.758,0.992 -1.63,1.908 -2.127,2.971c-0.368,0.787 -0.776,1.753 -0.526,2.741c-3.435,2.78 -5.685,6.625 -8.296,10.471c-0.462,0.68 -0.171,1.889 0.38,2.158c0.813,0.398 1.769,-0.626 2.239,-1.472c0.389,-0.698 0.742,-1.348 1.233,-1.991c0.133,-0.175 -0.046,-0.594 0.089,-0.715c2.633,-2.347 4.302,-5.283 6.755,-7.651c1.95,-0.329 3.487,-1.327 5.235,-2.34c0.308,-0.179 0.832,0.07 1.122,-0.125c1.753,-1.177 1.751,-3.213 1.857,-5.123c0.05,-0.884 0.246,-2.201 1.386,-2.812z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M31.959,-16.666c0.124,-0.077 -0.031,-0.5 0.078,-0.716c0.162,-0.324 0.565,-0.512 0.727,-0.836c0.109,-0.216 -0.054,-0.596 0.082,-0.738c2.333,-2.447 2.59,-5.471 1.554,-8.444c1.024,-0.62 1.085,-1.882 0.66,-2.729c-0.853,-1.7 -1.046,-3.626 -2.021,-5.169c-0.802,-1.269 -2.38,-2.513 -3.751,-1.21c-0.421,0.4 -0.742,1.187 -0.464,1.899c0.064,0.163 0.349,0.309 0.322,0.391c-0.107,0.324 -0.653,0.548 -0.659,0.82c-0.03,1.496 -0.984,3.007 -0.354,4.336c0.772,1.629 1.591,3.486 2.267,5.262c-1.234,2.116 -0.201,4.565 -1.954,6.442c-0.136,0.146 -0.127,0.532 -0.005,0.734c0.292,0.486 0.698,0.892 1.184,1.184c0.202,0.121 0.55,0.123 0.75,-0.001c0.578,-0.362 0.976,-0.849 1.584,-1.225z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M94.771,-26.977c1.389,1.792 1.679,4.587 -0.37,5.977c0.55,3.309 3.901,1.33 6,0.8c-0.109,-0.388 0.118,-0.732 0.401,-0.737c1.057,-0.015 1.737,-1.047 2.799,-0.863c0.434,-1.557 2.072,-2.259 2.716,-3.639c1.726,-3.695 1.135,-7.968 -1.449,-11.214c-0.202,-0.254 0.015,-0.771 -0.109,-1.133c-0.756,-2.211 -2.824,-2.526 -4.758,-3.214c-1.177,-3.875 -1.838,-7.906 -3.6,-11.6c-1.614,-0.25 -2.312,-1.989 -3.649,-2.709c-1.333,-0.719 -1.901,0.86 -1.86,1.906c0.007,0.205 0.459,0.429 0.289,0.794c-0.076,0.164 -0.336,0.275 -0.336,0.409c0.001,0.135 0.222,0.266 0.356,0.4c-0.918,0.82 -2.341,1.297 -2.636,2.442c-0.954,3.71 1.619,6.835 3.287,10.036c0.591,1.135 -0.145,2.406 -0.905,3.614c-0.438,0.695 -0.33,1.822 -0.054,2.678c0.752,2.331 2.343,4.07 3.878,6.053z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M57.611,-8.591c-1.487,1.851 -4.899,4.42 -1.982,6.348c0.194,0.129 0.564,0.133 0.737,-0.001c2.021,-1.565 4.024,-2.468 6.46,-3.05c0.124,-0.029 0.398,0.438 0.767,0.277c1.613,-0.703 3.623,-0.645 4.807,-1.983c3.767,0.224 7.332,-0.892 10.723,-2.2c1.161,-0.448 2.431,-1.007 3.632,-1.509c1.376,-0.576 2.58,-1.504 3.692,-2.645c0.133,-0.136 0.487,-0.046 0.754,-0.046c-0.04,-0.863 0.922,-0.99 1.169,-1.612c0.092,-0.232 -0.058,-0.628 0.075,-0.73c2.138,-1.63 3.058,-3.648 1.889,-6.025c-0.285,-0.578 -0.534,-1.196 -1.1,-1.672c-1.085,-0.911 -2.187,-0.057 -3.234,-0.361c-0.159,0.628 -0.888,0.456 -1.274,0.654c-0.859,0.439 -2.192,-0.146 -3.051,0.292c-1.362,0.695 -2.603,0.864 -4.025,1.241c-0.312,0.082 -1.09,-0.014 -1.25,0.613c-0.134,-0.134 -0.282,-0.368 -0.388,-0.346c-1.908,0.396 -3.168,0.61 -4.469,2.302c-0.103,0.133 -0.545,-0.046 -0.704,0.089c-0.957,0.808 -1.362,2.042 -2.463,2.714c-0.201,0.123 -0.553,-0.045 -0.747,0.084c-0.646,0.431 -1.013,1.072 -1.655,1.519c-0.329,0.229 -0.729,-0.096 -0.697,-0.352c0.245,-1.947 0.898,-3.734 0.323,-5.61c2.077,-2.52 4.594,-4.469 6.4,-7.2c0.015,-2.166 0.707,-4.312 0.594,-6.389c-0.01,-0.193 -0.298,-0.926 -0.424,-1.273c-0.312,-0.854 0.594,-1.92 -0.25,-2.644c-1.404,-1.203 -2.696,-0.327 -3.52,1.106c-1.838,0.39 -3.904,1.083 -5.482,-0.151c-1.007,-0.787 -1.585,-1.693 -2.384,-2.749c-0.985,-1.302 -0.65,-2.738 -0.58,-4.302c0.006,-0.128 -0.309,-0.264 -0.309,-0.398c0.001,-0.135 0.221,-0.266 0.355,-0.4c-0.706,-0.626 -0.981,-1.684 -2,-2c0.305,-1.092 -0.371,-1.976 -1.242,-2.278c-1.995,-0.691 -3.672,1.221 -5.564,1.294c-0.514,0.019 -0.981,-1.019 -1.63,-1.344c-0.432,-0.216 -1.136,-0.249 -1.498,0.017c-0.688,0.504 -1.277,0.618 -2.035,0.823c-1.617,0.436 -2.895,1.53 -4.375,2.385c-1.485,0.857 -2.44,2.294 -3.52,3.614c-0.941,1.152 -1.077,3.566 0.343,4.066c1.843,0.65 3.147,-2.053 5.113,-1.727c0.312,0.051 0.518,0.362 0.408,0.75c0.389,0.109 0.607,-0.12 0.8,-0.4c0.858,1.019 2.022,1.356 2.96,2.229c0.97,0.904 2.716,0.486 3.731,1.483c1.529,1.502 0.97,4.183 2.909,5.488c-0.586,1.313 -1.193,2.59 -1.528,4.017c-0.282,1.206 0.712,2.403 1.923,2.312c1.258,-0.094 1.52,-0.853 2.005,-1.929c0.267,0.267 0.736,0.564 0.695,0.78c-0.457,2.387 -1.484,4.38 -1.942,6.811c-0.059,0.317 -0.364,0.519 -0.753,0.409c-0.468,4.149 -4.52,6.543 -7.065,9.708c-0.403,0.502 -0.407,1.751 0.002,2.154c1.403,1.387 3.363,-0.159 5.063,-0.662c0.213,-1.206 1.072,-2.148 2.404,-2.092c0.256,0.01 0.491,-0.532 0.815,-0.662c0.348,-0.138 0.85,0.086 1.136,-0.112c1.729,-1.195 3.137,-2.301 4.875,-3.49c0.192,-0.131 0.536,0.028 0.752,-0.08c0.325,-0.162 0.512,-0.549 0.835,-0.734c0.348,-0.2 0.59,0.09 0.783,0.37c-0.646,0.349 -0.65,1.306 -1.232,1.508c-0.775,0.268 -1.336,0.781 -2.01,1.228c-0.292,0.193 -0.951,-0.055 -1.055,0.124c-0.598,1.028 -1.782,1.466 -2.492,2.349z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M2.2,-58c0,0 -9.238,-2.872 -20.4,22.8c0,0 -2.4,5.2 -4.8,7.2c-2.4,2 -13.6,5.6 -15.6,9.6L-49,-2.4c0,0 14.8,-16 18,-18.4c0,0 8,-8.4 4.8,-1.6c0,0 -14,10.8 -12.8,20c0,0 -5.6,14.4 -6.4,16.4c0,0 16,-32 18.4,-33.2c2.4,-1.2 3.6,-1.2 2.4,2.4c-1.2,3.6 -1.6,20 -4.4,22c0,0 8,-20.4 7.2,-23.6c0,0 3.2,-3.6 5.6,1.6L-17.4,-0.8L-13,11.2c0,0 -2.4,-11.2 -0.8,-26.8c0,0 -2,-10.4 2,-4.8c4,5.6 13.6,11.6 13.6,16.4c0,0 -5.2,-17.6 -14.4,-22.4L-16.6,-20.4L-17.8,-22.4c0,0 -3.6,-0.8 0.8,-7.6c4.4,-6.8 4,-7.6 4,-7.6c0,0 6.4,7.2 8,7.2c0,0 13.2,-7.6 14.4,16.8c0,0 6.8,-14.4 -2.4,-21.2c0,0 -14.8,-2 -13.6,-7.2L0.6,-54.4c3.6,-5.2 2,-2.4 2,-2.4z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-17.8,-41.6c0,0 -12.8,0 -16,5.2L-41,-26.8c0,0 17.2,-10 21.2,-11.2c4,-1.2 2,-3.6 2,-3.6z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-57.8,-35.2c0,0 -2,1.2 -2.4,4c-0.4,2.8 -2.8,3.2 -2,6c0.8,2.8 2.8,5.2 2.8,1.2c0,-4 1.6,-6 2.4,-7.2c0.8,-1.2 2.4,-5.6 -0.8,-4z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-66.6,26c0,0 -8.4,-4 -11.6,-7.6c-3.2,-3.6 -2.748,1.566 -7.6,1.2c-5.847,-0.441 -4.8,-16.4 -4.8,-16.4L-94.6,10.8c0,0 -1.2,14.4 6.8,12c3.907,-1.172 5.2,0.4 3.6,1.2c-1.6,0.8 5.6,1.2 2.8,2.8c-2.8,1.6 11.6,-3.6 9.2,6.8L-66.6,26z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-79.2,40.4c0,0 -15.4,4.4 -19,-5.2c0,0 -4.8,2.4 -2.6,5.4c2.2,3 3.4,3.4 3.4,3.4c0,0 5.4,1.2 4.8,2c-0.6,0.8 -3,4.2 -3,4.2c0,0 10.2,-6 16.4,-9.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M149.201,118.601c-0.427,2.134 -2.098,2.935 -4,3.6c-1.917,-0.958 -4.515,-4.064 -6.4,-2c-0.474,-0.48 -1.253,-0.54 -1.597,-1.202c-0.465,-0.898 -0.193,-1.944 -0.535,-2.742c-0.545,-1.272 -1.254,-2.638 -1.068,-4.056c1.806,-0.712 2.401,-2.618 1.927,-4.381c-0.069,-0.257 -0.498,-0.454 -0.298,-0.803c0.186,-0.323 0.504,-0.55 0.771,-0.817c-0.135,0.135 -0.28,0.368 -0.391,0.348c-0.61,-0.106 -0.486,-0.743 -0.356,-1.13c0.585,-1.746 2.599,-2.01 3.947,-0.818c0.256,-0.565 0.765,-0.371 1.2,-0.4c-0.05,-0.579 0.358,-1.106 0.556,-1.526c0.518,-1.098 2.147,0.008 2.944,-0.604c1.076,-0.825 2.139,-1.524 3.217,-0.921c1.809,1.013 3.518,2.225 4.717,3.966c0.575,0.834 0.815,2.115 0.757,3.073c-0.038,0.647 -1.419,0.295 -1.762,1.224c-0.645,1.748 1.186,2.267 1.942,3.605c0.198,0.349 -0.066,0.653 -0.381,0.751c-0.411,0.128 -1.195,-0.061 -1.057,0.392c0.972,3.193 -1.784,3.871 -4.133,4.441z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M139.6,138.201c-0.007,-1.738 -1.608,-3.494 -0.399,-5.2c0.135,0.134 0.266,0.355 0.4,0.355c0.135,0 0.266,-0.221 0.4,-0.355c1.495,2.216 5.147,3.144 5.005,5.99c-0.022,0.447 -1.109,1.365 -0.205,2.01c-1.813,1.348 -1.868,3.718 -2.8,5.6c-1.238,-0.286 -2.45,-0.649 -3.6,-1.2c0.352,-1.486 0.235,-3.17 1.055,-4.49c0.434,-0.698 0.147,-1.777 0.144,-2.71z","fillColor":["rgb",1,1,1]}]]}],["Group",{"children":[["Path",{"pathData":"M-26.6,129.201c0,0 -16.858,10.136 -2.8,-5.2c8.8,-9.6 18.8,-15.2 18.8,-15.2c0,0 10.4,-4.401 14,-5.601c3.6,-1.2 18.8,-6.4 22,-6.8c3.2,-0.4 12.8,-4.4 19.6,-0.4c6.8,4 14.8,8.4 14.8,8.4c0,0 -16.4,-8.4 -20,-6c-3.6,2.4 -10.8,2 -16.8,5.2c0,0 -14.8,4.401 -18,6.401c-3.2,2 -13.6,13.6 -15.2,12.8c-1.6,-0.8 0.4,-1.2 1.6,-4c1.2,-2.8 -0.8,-4.4 -8.8,2c-8,6.4 -9.2,8.4 -9.2,8.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-19.195,123.234c0,0 1.41,-13.04 9.888,-11.375c0,0 8.226,-4.17 10.948,-6.138c0,0 8.139,-1.702 9.449,-2.319c18.479,-8.7 33.198,-4.181 33.745,-5.301c0.546,-1.119 20.171,5.998 23.78,10.084c0.391,0.443 -10.231,-5.597 -19.929,-7.488c-8.273,-1.614 -29.875,0.247 -40.781,5.783c-2.973,1.509 -11.918,7.293 -14.449,7.182c-2.531,-0.112 -12.651,9.572 -12.651,9.572z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-23,148.801c0,0 -15.2,-2.4 1.6,-4c0,0 18,-2 22,-7.2c0,0 13.6,-9.2 16.4,-9.6c2.8,-0.4 32.8,-7.6 33.2,-10c0.4,-2.4 6,-2.4 7.6,-1.6c1.6,0.8 0.8,2 -2,2.8c-2.8,0.8 -34,17.2 -40.4,18.4c-6.4,1.2 -18,8.8 -22.8,10c-4.8,1.2 -15.6,1.2 -15.6,1.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-3.48,141.403c0,0 -8.582,-0.829 0.019,-1.648c0,0 8.816,-3.424 10.864,-6.087c0,0 6.964,-4.711 8.397,-4.915c1.434,-0.205 15.394,-3.892 15.599,-5.12c0.205,-1.229 34.271,-13.81 38.691,-10.62c2.911,2.101 -6.99,0.424 -16.624,4.834c-1.355,0.62 -35.208,15.207 -38.485,15.821c-3.277,0.615 -9.216,4.506 -11.674,5.12c-2.457,0.615 -6.787,2.615 -6.787,2.615z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-11.4,143.601c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-11.4,143.601z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-18.6,145.201c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-18.6,145.201z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-29,146.801c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-29,146.801z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-36.6,147.601c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-36.6,147.601z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M1.8,108.001c0,0 4.4,0 3.2,1.6c-1.2,1.6 -4.4,1.2 -4.4,1.2L1.8,108.001z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-8.2,113.601c0,0 6.506,-2.141 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-8.2,113.601z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-19.4,118.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-19.4,118.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-27,124.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-27,124.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-33.8,129.201c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-33.8,129.201z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M5.282,135.598c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L5.282,135.598z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M15.682,130.798c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L15.682,130.798z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M26.482,126.398c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L26.482,126.398z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M36.882,121.598c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -4.792,1.065 -4.792,1.065L36.882,121.598z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M9.282,103.598c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -5.592,1.865 -5.592,1.865L9.282,103.598z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M19.282,100.398c0,0 6.921,-0.532 5.324,1.597c-1.597,2.13 -5.992,1.865 -5.992,1.865L19.282,100.398z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-3.4,140.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-3.4,140.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-76.6,41.2c0,0 -4.4,8.8 -4.8,12c0,0 0.8,-8.8 2,-10.8c1.2,-2 2.8,-1.2 2.8,-1.2z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-95,55.2c0,0 -3.2,14.4 -2.8,17.2c0,0 -1.2,-11.6 -0.8,-12.8c0.4,-1.2 3.6,-4.4 3.6,-4.4z","fillColor":["rgb",0.6,0.14902,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-74.2,-19.4L-74.4,-16.2L-76.6,-16c0,0 14.2,12.6 14.8,20.2c0,0 0.8,-8.2 -12.4,-23.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-70.216,-18.135c-0.431,-0.416 -0.212,-1.161 -0.62,-1.421c-0.809,-0.516 1.298,-0.573 1.07,-1.289c-0.383,-1.206 -0.196,-1.227 -0.318,-2.503c-0.057,-0.598 0.531,-2.138 0.916,-2.578c1.446,-1.652 0.122,-4.584 1.762,-6.135c0.304,-0.289 0.68,-0.841 0.965,-1.259c0.659,-0.963 1.843,-1.451 2.793,-2.279c0.318,-0.276 0.117,-1.103 0.686,-1.011c0.714,0.115 1.955,-0.015 1.91,0.826c-0.113,2.12 -1.442,3.84 -2.722,5.508c0.451,0.704 -0.007,1.339 -0.291,1.896c-1.335,2.62 -1.146,5.461 -1.32,8.301c-0.005,0.085 -0.312,0.163 -0.304,0.216c0.353,2.335 0.937,4.534 1.816,6.763c0.366,0.93 0.837,1.825 0.987,2.752c0.111,0.686 0.214,1.519 -0.194,2.224c2.035,2.89 0.726,5.541 1.895,9.072c0.207,0.625 1.899,2.539 1.436,2.378c-2.513,-0.871 -2.625,-1.269 -2.802,-2.022c-0.146,-0.623 -0.476,-2 -0.713,-2.602c-0.064,-0.164 -0.235,-2.048 -0.313,-2.17c-1.513,-2.382 -0.155,-2.206 -1.525,-4.564c-1.428,-0.68 -2.394,-1.784 -3.517,-2.946c-0.198,-0.204 0.945,-0.928 0.764,-1.141c-1.092,-1.289 -2.245,-2.056 -1.909,-3.549c0.155,-0.69 0.292,-1.747 -0.452,-2.467z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-73.8,-16.4c0,0 0.4,6.8 2.8,8.4c2.4,1.6 1.2,0.8 -2,-0.4c-3.2,-1.2 -2,-2 -2,-2c0,0 -2.8,0.4 -0.4,2.4c2.4,2 6,4.4 4.4,4.4c-1.6,0 -9.2,-4 -9.2,-6.8c0,-2.8 -1,-6.9 -1,-6.9c0,0 1.1,-0.8 5.9,-0.7c0,0 1.4,0.7 1.5,1.6z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-74.6,2.2c0,0 -8.52,-2.791 -27,0.6c0,0 9.031,-2.078 27.8,0.2c10.3,1.25 -0.8,-0.8 -0.8,-0.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-72.502,2.129c0,0 -8.246,-3.518 -26.951,-1.737c0,0 9.178,-1.289 27.679,2.603c10.154,2.136 -0.728,-0.866 -0.728,-0.866z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-70.714,2.222c0,0 -7.962,-4.121 -26.747,-3.736c0,0 9.248,-0.604 27.409,4.654c9.966,2.885 -0.662,-0.918 -0.662,-0.918z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-69.444,2.445c0,0 -6.824,-4.307 -23.698,-5.405c0,0 8.339,0.17 24.22,6.279c8.716,3.353 -0.522,-0.874 -0.522,-0.874z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M45.84,12.961c0,0 -0.93,0.644 -0.716,-0.537c0.215,-1.181 28.423,-14.351 32.037,-14.101c0,0 -30.248,13.206 -31.321,14.638z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M42.446,13.6c0,0 -0.876,0.715 -0.755,-0.479c0.121,-1.194 27.208,-16.539 30.83,-16.573c0,0 -29.117,15.541 -30.075,17.052z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M39.16,14.975c0,0 -0.828,0.772 -0.786,-0.428c0.042,-1.199 19.859,-16.696 29.671,-18.57c0,0 -18.03,8.127 -28.885,18.998z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M36.284,16.838c0,0 -0.745,0.694 -0.707,-0.385c0.038,-1.08 17.872,-15.027 26.703,-16.713c0,0 -16.226,7.314 -25.996,17.098z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M4.6,164.801c0,0 -15.2,-2.4 1.6,-4c0,0 18,-2 22,-7.2c0,0 13.6,-9.2 16.4,-9.6c2.8,-0.4 19.2,-4 19.6,-6.4c0.4,-2.4 6.4,-4.8 8,-4c1.6,0.8 1.6,10 -1.2,10.8c-2.8,0.8 -21.6,8 -28,9.2c-6.4,1.2 -18,8.8 -22.8,10c-4.8,1.2 -15.6,1.2 -15.6,1.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M77.6,127.401c0,0 -3,1.6 -4.2,4.2c0,0 -6.4,10.6 -20.6,13.8c0,0 -23,9 -30.8,11c0,0 -13.4,5 -20.8,4.2c0,0 -7,0.2 -0.8,1.8c0,0 20.2,-2 23.6,-3.8c0,0 15.6,-5.2 18.6,-7.8c3,-2.6 21.2,-7.6 23.4,-9.6c2.2,-2 12,-10.4 11.6,-13.8z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M18.882,158.911c0,0 5.229,-0.226 4.076,1.323c-1.153,1.55 -3.601,0.676 -3.601,0.676L18.882,158.911z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M11.68,160.263c0,0 5.228,-0.226 4.076,1.323c-1.153,1.55 -3.601,0.677 -3.601,0.677L11.68,160.263z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M1.251,161.511c0,0 5.229,-0.227 4.076,1.323c-1.153,1.549 -3.601,0.676 -3.601,0.676L1.251,161.511z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-6.383,162.055c0,0 5.229,-0.226 4.076,1.323c-1.153,1.55 -3.601,0.676 -3.601,0.676L-6.383,162.055z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M35.415,151.513c0,0 6.96,-0.301 5.425,1.761c-1.534,2.062 -4.793,0.9 -4.793,0.9L35.415,151.513z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M45.73,147.088c0,0 5.959,-3.301 5.425,1.761c-0.27,2.556 -4.793,0.9 -4.793,0.9L45.73,147.088z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M54.862,144.274c0,0 7.159,-3.701 5.425,1.761c-0.778,2.45 -4.794,0.9 -4.794,0.9L54.862,144.274z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M64.376,139.449c0,0 4.359,-4.901 5.425,1.761c0.406,2.538 -4.793,0.9 -4.793,0.9L64.376,139.449z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M26.834,155.997c0,0 5.228,-0.227 4.076,1.323c-1.153,1.549 -3.602,0.676 -3.602,0.676L26.834,155.997z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M62.434,34.603c0,0 -0.726,0.665 -0.727,-0.406c0,-1.07 17.484,-14.334 26.327,-15.718c0,0 -16.099,6.729 -25.6,16.124z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M65.4,98.4c0,0 22.001,22.401 31.201,26.001c0,0 9.2,11.2 5.2,37.2c0,0 -3.2,7.6 -6.4,-13.2c0,0 3.2,-25.2 -8,-9.2c0,0 -8.401,-9.9 -2.001,-9.6c0,0 3.201,2 3.601,0.4c0.4,-1.6 -7.601,-15.2 -24.801,-29.601c-17.2,-14.4 1.2,-2 1.2,-2z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M7,137.201c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 96.001,7 127.601,31c0,0 -45.2,-23.2 -129.201,-30z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M17.4,132.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 138.401,-0.2 162.001,32.2c0,0 -22,-25.2 -163.601,-31.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M29,128.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 175.201,-12.2 198.801,20.2c0,0 -9.6,-25.6 -200.401,-19.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M39,124.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 124.001,-37.801 147.601,-5.4c0,0 -13.4,-24.601 -149.201,6.4z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-19,146.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 19.6,3 21.6,41.8c0,0 -7.2,-42 -23.2,-40.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-27.8,148.401c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 16,-3.8 13.2,35c0,0 1.2,-35.2 -14.8,-34z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-35.8,148.801c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 17.2,1.4 4.8,23.8c0,0 9.6,-24 -6.4,-22.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M11.526,104.465c0,0 -0.444,1.999 1.105,0.782c16.068,-12.625 48.51,-71.527 104.195,-77.161c0,0 -38.308,-12.11 -105.3,76.379z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M22.726,102.665c0,0 -1.363,-1.193 0.505,-1.818c1.868,-0.625 114.31,-73.127 153.595,-65.161c0,0 -27.107,-7.51 -154.1,66.979z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M1.885,108.767c0,0 -0.509,1.599 1.202,0.623c8.975,-5.12 12.59,-62.331 56.167,-63.586c0,0 -32.411,-14.714 -57.369,62.963z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-18.038,119.793c0,0 -1.077,1.286 0.876,1.032c10.246,-1.332 31.651,-42.603 76.09,-37.524c0,0 -31.966,-14.346 -76.966,36.492z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-6.8,113.667c0,0 -0.811,1.469 1.058,0.844c9.799,-3.274 22.883,-47.886 67.471,-51.433c0,0 -34.126,-7.943 -68.529,50.589z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-25.078,124.912c0,0 -0.873,1.042 0.709,0.836c8.299,-1.079 25.637,-34.508 61.633,-30.394c0,0 -25.893,-11.62 -62.342,29.558z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-32.677,130.821c0,0 -1.005,1.045 0.586,0.927c4.168,-0.309 34.806,-33.388 53.274,-17.886c0,0 -12.015,-18.723 -53.86,16.959z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M36.855,98.898c0,0 -1.201,-1.355 0.731,-1.74c1.932,-0.384 122.635,-58.097 160.598,-45.231c0,0 -25.941,-10.874 -161.329,46.971z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M3.4,163.201c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 17.2,1.4 4.8,23.8c0,0 9.6,-24 -6.4,-22.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M13.8,161.601c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 19.6,3 21.6,41.8c0,0 -7.2,-42 -23.2,-40.8z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M20.6,160.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 26.4,4.2 50,36.6c0,0 -35.6,-36.8 -51.6,-35.6z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M28.225,157.972c0,0 -0.437,-1.758 1.453,-1.204c1.89,0.554 22.324,-1.345 60.421,32.831c0,0 -46.175,-34.943 -61.874,-31.627z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M38.625,153.572c0,0 -0.437,-1.758 1.453,-1.204c1.89,0.554 36.724,5.055 88.421,40.031c0,0 -74.175,-42.143 -89.874,-38.827z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-1.8,142.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 55.2,3.4 85.6,30.2c0,0 -34.901,-24.775 -87.2,-29.2z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-11.8,146.001c0,0 -0.2,-1.8 1.6,-1c1.8,0.8 26.4,4.2 50,36.6c0,0 -35.6,-36.8 -51.6,-35.6z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M49.503,148.962c0,0 -0.565,-1.721 1.361,-1.307c1.926,0.413 36.996,2.349 91.117,33.443c0,0 -77.664,-34.394 -92.478,-32.136z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M57.903,146.562c0,0 -0.565,-1.721 1.361,-1.307c1.926,0.413 36.996,2.349 91.117,33.443c0,0 -77.064,-34.794 -92.478,-32.136z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M67.503,141.562c0,0 -0.565,-1.721 1.361,-1.307c1.926,0.413 44.996,4.749 134.718,39.043c0,0 -120.665,-40.394 -136.079,-37.736z","fillColor":["rgb",1,1,1],"strokeColor":["rgb",0,0,0],"strokeWidth":0.1}]]}],["Group",{"children":[["Path",{"pathData":"M-43.8,148.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-43.8,148.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-13,162.401c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-13,162.401z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-21.8,162.001c0,0 5.2,-0.4 4,1.2c-1.2,1.6 -3.6,0.8 -3.6,0.8L-21.8,162.001z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-117.169,150.182c0,0 5.045,1.323 3.387,2.442c-1.657,1.12 -3.664,-0.422 -3.664,-0.422L-117.169,150.182z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-115.169,140.582c0,0 5.045,1.323 3.387,2.442c-1.657,1.12 -3.664,-0.422 -3.664,-0.422L-115.169,140.582z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-122.369,136.182c0,0 5.045,1.323 3.387,2.442c-1.657,1.12 -3.664,-0.422 -3.664,-0.422L-122.369,136.182z","fillColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-42.6,211.201c0,0 -1.6,0 -5.6,2c-2,0 -13.2,3.6 -18.8,13.6c0,0 12.4,-9.6 24.4,-15.6z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M45.116,303.847c0.141,0.258 0.196,0.678 0.488,0.695c0.658,0.04 1.891,0.341 1.766,-0.295c-0.848,-4.306 -1.722,-9.243 -5.855,-11.05c-0.639,-0.279 -2.081,0.134 -2.155,1.018c-0.127,1.524 -0.244,2.873 0.065,4.339c0.3,1.421 2.458,1.431 3.375,0.047c0.936,1.672 1.368,3.515 2.316,5.246z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M34.038,308.581c0.748,1.413 0.621,3.272 2.036,3.835c0.74,0.294 2.59,-0.681 2.172,-1.755c-0.802,-2.061 -1.19,-4.3 -2.579,-6.111c-0.2,-0.262 0.04,-0.795 -0.12,-1.123c-0.594,-1.22 -1.739,-1.955 -3.147,-1.626c-1.115,2.203 0.033,4.332 1.555,6.041c0.136,0.152 -0.03,0.528 0.083,0.739z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-5.564,303.391c-0.108,-0.377 -0.146,-0.84 0.019,-1.161c0.531,-1.033 1.324,-2.155 0.987,-3.177c-0.348,-1.056 -1.464,-0.874 -2.114,-0.305c-1.135,0.994 -1.184,2.82 -1.875,4.179c-0.196,0.386 -0.145,0.959 -0.586,1.35c-0.474,0.421 -0.914,1.945 -0.818,2.516c0.053,0.313 -0.13,10.221 0.092,9.958c0.619,-0.733 3.669,-10.467 3.738,-11.359c0.057,-0.731 0.789,-1.196 0.557,-2.001z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-31.202,296.599c2.634,-2.499 5.424,-5.46 4.982,-9.172c-0.116,-0.976 -1.891,-0.449 -2.078,0.397c-0.802,3.625 -2.841,6.286 -5.409,8.678c-2.196,2.047 -4.058,8.391 -4.293,8.899c3.697,-5.256 5.954,-8.002 6.798,-8.802z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-44.776,290.635c0.523,-0.37 0.221,-0.861 0.438,-1.193c0.953,-1.458 2.254,-2.704 2.272,-4.442c0.003,-0.277 -0.375,-0.586 -0.71,-0.362c-0.277,0.184 -0.619,0.314 -0.727,0.444c-2.03,2.449 -3.43,5.12 -4.873,7.932c-0.183,0.357 -1.327,4.848 -1.014,4.959c0.239,0.085 1.959,-4.096 2.169,-4.21c1.263,-0.686 1.275,-2.301 2.445,-3.128z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-28.043,310.179c0.444,-0.869 2.02,-2.071 1.907,-2.96c-0.118,-0.928 0.35,-2.371 -0.562,-1.683c-1.257,0.948 -4.706,2.297 -4.976,8.105c-0.026,0.571 2.948,-2.122 3.631,-3.462z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-13.6,293.001c0.4,-0.668 1.108,-0.195 1.567,-0.458c0.648,-0.372 1.259,-0.93 1.551,-1.579c0.97,-2.149 2.739,-3.969 2.882,-6.363c-1.491,-1.405 -2.17,0.635 -2.8,1.6c-1.323,-1.647 -2.322,0.227 -3.622,0.746c-0.07,0.028 -0.283,-0.319 -0.358,-0.292c-1.177,0.44 -1.857,1.521 -2.855,2.302c-0.171,0.134 -0.576,-0.046 -0.723,0.09c-0.652,0.603 -1.625,0.928 -1.905,1.61c-1.11,2.707 -4.25,4.802 -6.137,12.344c0.381,0.909 4.512,-6.642 4.999,-7.34c0.836,-1.196 0.954,1.661 2.23,0.995c0.051,-0.027 0.237,0.211 0.371,0.345c0.194,-0.28 0.412,-0.509 0.8,-0.4c0,-0.4 -0.134,-0.956 0.067,-1.115c1.237,-0.977 1.153,-2.045 1.933,-3.285c0.458,0.789 1.519,0.07 2,0.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M46.2,347.401c0,0 7.4,-20.4 3,-31.6c0,0 11.4,21.6 6.8,32.8c0,0 -0.4,-10.4 -4.4,-15.4c0,0 -4,12.8 -5.4,14.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M31.4,344.801c0,0 5.4,-8.8 -2.6,-27.2c0,0 -0.8,20.4 -7.6,31.4c0,0 14.2,-20.2 10.2,-4.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M21.4,342.801c0,0 -0.2,-20 0.2,-23c0,0 -3.8,16.6 -14,26.2c0,0 14.4,-12 13.8,-3.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M11.8,310.801c0,0 6,13.6 -4,32c0,0 6.4,-12.2 1.6,-19.2c0,0 2.6,-3.4 2.4,-12.8z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-7.4,342.401c0,0 -1,-15.6 0.8,-17.8c0,0 0.2,-6.4 -0.2,-7.4c0,0 4,-6.2 4.2,1.2c0,0 1.4,7.8 4.2,12.4c0,0 3.6,5.4 3.4,11.8c0,0 -10,-30.2 -12.4,-0.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-11,314.801c0,0 -6.6,10.8 -8.4,29.8c0,0 -1.4,-6.2 2.4,-20.6c0,0 4.2,-15.4 6,-9.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-32.8,334.601c0,0 5,-5.4 6.4,-10.4c0,0 3.6,-15.8 -2.8,-7.2c0,0 0.2,8 -8,15.4c0,0 4.8,-2.4 4.4,2.2z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-38.6,329.601c0,0 3.4,-17.4 4.2,-18.2c0,0 1.8,-3.4 -1,-0.2c0,0 -8.8,19.2 -12.8,25.8c0,0 8,-9.2 9.6,-7.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-44.4,313.001c0,0 11.6,-22.4 -10.2,3.4c0,0 11,-9.8 10.2,-3.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-59.8,298.401c0,0 4.8,-18.8 7.4,-18.6c0,0 8.2,-9 1.6,1.6c0,0 -6,9.6 -5.4,19.4c0,0 -0.6,-9.6 -3.6,-2.4z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M270.5,287c0,0 -12,-10 -14.5,-13.5c0,0 13.5,18.5 13.5,25.5c0,0 2.5,-7.5 1,-12z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M276,265c0,0 -21,-15 -24.5,-22.5c0,0 26.5,29.5 26.5,34c0,0 0.5,-9 -2,-11.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M293,111c0,0 -12,-8 -13.5,-6c0,0 10.5,6.5 13,15c0,0 -1.5,-9 0.5,-9z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M301.5,191.5L284,179.5c0,0 19,17 19.5,21L301.5,191.5z","fillColor":["rgb",0.8,0.8,0.8]}]]}],["Group",{"children":[["Path",{"pathData":"M-89.25,169L-67.25,173.75","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-39,331c0,0 -0.5,-3.5 -9.5,7","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M-33.5,336c0,0 2,-6.5 -4.5,-2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}],["Group",{"children":[["Path",{"pathData":"M20.5,344.5c0,0 1.5,-11 -10,2","fillColor":["rgb",0,0,0],"strokeColor":["rgb",0,0,0]}]]}]]}]]}]]}]] diff --git a/package.json b/package.json index 005fa757..0bea68e8 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,8 @@ "node": ">=0.8.0 <5.0.0" }, "dependencies": { - "jsdom": ">=3.1.2 <8.0.0", - "mime": "^1.3.0", - "request": "^2.61.0" + "jsdom": "git://github.com/lehni/jsdom.git#45c5ad551ff7d12efacac06bea5b29cc3aeadb20", + "source-map-support": "^0.4.0" }, "optionalDependencies": { "canvas": "^1.2.9" diff --git a/src/canvas/CanvasProvider.js b/src/canvas/CanvasProvider.js index 8f7b0bb9..e5505cf2 100644 --- a/src/canvas/CanvasProvider.js +++ b/src/canvas/CanvasProvider.js @@ -25,12 +25,8 @@ var CanvasProvider = { if (this.canvases.length) { canvas = this.canvases.pop(); } else { -/*#*/ if (__options.environment == 'browser') { canvas = document.createElement('canvas'); -/*#*/ } else { // __options.environment != 'browser' - canvas = new Canvas(width, height); - clear = false; // It's already cleared through constructor. -/*#*/ } // __options.environment != 'browser' + clear = false; // It's already cleared through createElement(). } var ctx = canvas.getContext('2d'); // If they are not the same size, we don't need to clear them diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index c8b3bb46..f83a421b 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -71,48 +71,40 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ }; CanvasProvider.release(ctx); } - -/*#*/ if (__options.environment == 'browser') { - if (!this.browser) { - var agent = navigator.userAgent.toLowerCase(), + if (!this.agent) { + var user = navigator.userAgent.toLowerCase(), // Detect basic platforms, only mac internally required for now. - platform = (/(win)/.exec(agent) - || /(mac)/.exec(agent) - || /(linux)/.exec(agent) - || [])[0], - browser = proto.browser = { platform: platform }; + os = (/(darwin|win|mac|linux|freebsd|sunos)/.exec(user)||[])[0], + platform = os === 'darwin' ? 'mac' : os, + agent = proto.agent = proto.browser = { platform: platform }; if (platform) - browser[platform] = true; + agent[platform] = true; // Use replace() to get all matches, and deal with Chrome/Webkit // overlap: // TODO: Do we need Mozilla next to Firefox? Other than the // different treatment of the Chrome/Webkit overlap // here: { chrome: true, webkit: false }, Mozilla missing is the // only difference to jQuery.browser - agent.replace( - /(opera|chrome|safari|webkit|firefox|msie|trident|atom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:([.\d]+))?/g, + user.replace( + /(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g, function(all, n, v1, v2, rv) { // Do not set additional browsers once chrome is detected. - if (!browser.chrome) { - var v = n === 'opera' ? v2 : v1; - if (n === 'trident') { - // Use rv: and rename to msie - v = rv; - n = 'msie'; - } - browser.version = v; - browser.versionNumber = parseFloat(v); - browser.name = n; - browser[n] = true; + if (!agent.chrome) { + var v = n === 'opera' ? v2 : + /^(node|trident)$/.test(n) ? rv : v1; + agent.version = v; + agent.versionNumber = parseFloat(v); + n = n === 'trident' ? 'msie' : n; + agent.name = n; + agent[n] = true; } } ); - if (browser.chrome) - delete browser.webkit; - if (browser.atom) - delete browser.chrome; + if (agent.chrome) + delete agent.webkit; + if (agent.atom) + delete agent.chrome; } -/*#*/ } // __options.environment == 'browser' }, /** @@ -261,6 +253,18 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ return this; }, + createCanvas: function(width, height, type) { + if (type) { + // TODO: Support 'pdf' on node.js! + } + return CanvasProvider.getCanvas(width, height); + }, + + /** + * @deprecated, use use {@link #createCanvas(width, height)} instead. + */ + Canvas: '#createCanvas', + /** * Activates this PaperScope, so all newly created items will be placed * in its active project. diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 1bf4d2ef..339b910f 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -95,6 +95,8 @@ Base.exports.PaperScript = (function() { return scope.acorn.parse(code, options); } + var sourceMaps = {}; + /** * Compiles PaperScript code into JavaScript code. * @@ -261,20 +263,44 @@ Base.exports.PaperScript = (function() { break; } } -/*#*/ if (__options.environment == 'browser') { + // Source-map support: + // Encodes a Variable Length Quantity as a Base64 string. + // See: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps + function encodeVLQ(value) { + var res = '', + base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + value = (Math.abs(value) << 1) + (value < 0 ? 1 : 0); + while (value || !res) { + var next = value & ((1 << 5) - 1); + value >>= 5; + if (value) + next |= (1 << 5); + res += base64[next]; + } + return res; + } + var url = options.url || '', - browser = paper.browser, - version = browser.versionNumber, + agent = paper.agent, + version = agent.versionNumber, + offsetCode = false, sourceMap = null, + // Include the original code in the sourceMap if there is no linked + // source file so the debugger can still display it correctly. + source = options.source || code, lineBreaks = /\r\n|\n|\r/mg, offset = 0; // TODO: Verify these browser versions for source map support, and check // other browsers. - if (browser.chrome && version >= 30 - || browser.webkit && version >= 537.76 // >= Safari 7.0.4 - || browser.firefox && version >= 23) { - if (url && window.location.href.indexOf(url) === 0) { + if (agent.chrome && version >= 30 + || agent.webkit && version >= 537.76 // >= Safari 7.0.4 + || agent.firefox && version >= 23 + || agent.node) { + if (agent.node) { + code = 'require("source-map-support").install(paper.PaperScript.sourceMapSupport);\n' + code; + offset = -3; // -2 for function body, - 1 for require("source-map-support") + } else if (url && window.location.href.indexOf(url) === 0) { // If the code stems from the actual html page, determine the // offset of inlined code. var html = document.getElementsByTagName('html')[0].innerHTML; @@ -283,16 +309,17 @@ Base.exports.PaperScript = (function() { offset = html.substr(0, html.indexOf(code) + 1).match( lineBreaks).length + 1; } - // A hack required by all current browser versions: Instead of - // starting the mappings at the given offset, we have to shift the - // actual code down to the place in the original file, as source-map - // support seems incomplete in these browsers. This has some - // advantages too: No code for VLQ encoding is required. + // A hack required by most versions of browsers except chrome 36+: + // Instead of starting the mappings at the given offset, we have to + // shift the actual code down to the place in the original file, as + // source-map support seems incomplete in these browsers. // TODO: Report as bugs? - var mappings = ['AAAA']; - // Create empty entries by the amount of lines + 1, so join can be + offsetCode = offset > 0 && (!browser.chrome || version < 36); + var mappings = ['AA' + encodeVLQ(offsetCode ? 0 : offset) + 'A']; + // Create empty entries by the amount of lines + 1, so join can be // used below to produce the actual instructions that many times. - mappings.length = (code.match(lineBreaks) || []).length + 1 + offset; + mappings.length = (code.match(lineBreaks) || []).length + 1 + + (offsetCode ? offset : 0); sourceMap = { version: 3, file: url, @@ -303,29 +330,24 @@ Base.exports.PaperScript = (function() { // AACA is the instruction to increment the line by one. mappings: mappings.join(';AACA'), sourceRoot: '', - sources: [url] + sources: [url], + sourcesContent: [source] }; - // Include the original code in the sourceMap if there is no linked - // source file so the debugger can still display it correctly. - var source = options.source || !url && code; - if (source) - sourceMap.sourcesContent = [source]; } // Now do the parsing magic walkAST(parse(code, { ranges: true })); if (sourceMap) { // Adjust the line offset of the resulting code if required. // This is part of a browser hack, see above. - code = new Array(offset + 1).join('\n') + code - + "\n//# sourceMappingURL=data:application/json;base64," - + (btoa(unescape(encodeURIComponent( - JSON.stringify(sourceMap))))) + if (offsetCode) + code = new Array(offset + 1).join('\n') + code; + code += "\n//# sourceMappingURL=data:application/json;base64," + + window.btoa(unescape(encodeURIComponent( + JSON.stringify(sourceMap)))) + "\n//# sourceURL=" + (url || 'paperscript'); + if (url) + sourceMaps[url] = sourceMap; } -/*#*/ } else { // __options.environment != 'browser' - // Now do the parsing magic - walkAST(parse(code, { ranges: true })); -/*#*/ } // __options.environment != 'browser' return code; } @@ -405,9 +427,8 @@ Base.exports.PaperScript = (function() { // We need an additional line that returns the handlers in one object. if (handlers) code += '\nreturn { ' + handlers + ' };'; -/*#*/ if (__options.environment == 'browser') { - var browser = paper.browser; - if (browser.chrome || browser.firefox) { + var agent = paper.agent; + if (agent.chrome || agent.firefox) { // On Firefox, all error numbers inside dynamically compiled code // are relative to the line where the eval / compilation happened. // To fix this issue, we're temporarily inserting a new script @@ -418,7 +439,7 @@ Base.exports.PaperScript = (function() { head = document.head || document.getElementsByTagName('head')[0]; // Add a new-line before the code on Firefox since the error // messages appear to be aligned to line number 0... - if (browser.firefox) + if (agent.firefox) code = '\n' + code; script.appendChild(document.createTextNode( 'paper._execute = function(' + params + ') {' + code + '\n}' @@ -430,9 +451,6 @@ Base.exports.PaperScript = (function() { } else { func = Function(params, code); } -/*#*/ } else { // __options.environment != 'browser' - func = Function(params, code); -/*#*/ } // __options.environment != 'browser' var res = func.apply(scope, args) || {}; // Now install the 'global' tool and view handlers, and we're done! Base.each(toolHandlers, function(key) { @@ -456,8 +474,6 @@ Base.exports.PaperScript = (function() { } } -/*#*/ if (__options.environment == 'browser') { - function loadScript(script) { // Only load this script if it not loaded already. // Support both text/paperscript and text/x-paperscript: @@ -546,43 +562,14 @@ Base.exports.PaperScript = (function() { compile: compile, execute: execute, load: load, - parse: parse + parse: parse, + sourceMapSupport: { + retrieveSourceMap: function(source) { + var map = sourceMaps[source]; + return map ? { url: source, map: map } : null; + } + } }; - -/*#*/ } else { // __options.environment != 'browser' -/*#*/ if (__options.environment == 'node') { - - // Register the .pjs extension for automatic compilation as PaperScript - var fs = require('fs'), - path = require('path'); - - require.extensions['.pjs'] = function(module, uri) { - // Requiring a PaperScript on Node.js returns an initialize method which - // needs to receive a Canvas object when called and returns the - // PaperScope. - module.exports = function(canvas) { - var source = compile(fs.readFileSync(uri, 'utf8')), - scope = new PaperScope(); - scope.setup(canvas); - scope.__filename = uri; - scope.__dirname = path.dirname(uri); - // Expose core methods and values - scope.require = require; - scope.console = console; - execute(source, scope); - return scope; - }; - }; - -/*#*/ } // __options.environment == 'node' - - return { - compile: compile, - execute: execute, - parse: parse - }; - -/*#*/ } // __options.environment != 'browser' // Pass on `this` as the binding object, so we can reference Acorn both in // development and in the built library. }).call(this); diff --git a/src/event/Key.js b/src/event/Key.js index 296a63b4..ae8cbe0e 100644 --- a/src/event/Key.js +++ b/src/event/Key.js @@ -67,8 +67,8 @@ var Key = new function() { // based on whichever key is used for commands. command: { get: function() { - var browser = paper.browser; - return browser && browser.mac ? this.meta : this.control; + var agent = paper.agent; + return agent && agent.mac ? this.meta : this.control; } } }); @@ -108,8 +108,8 @@ var Key = new function() { // Detect modifiers and mark them as pressed / released if (key.length > 1 && (name = Base.camelize(key)) in modifiers) { modifiers[name] = down; - var browser = paper.browser; - if (name === 'meta' && browser && browser.mac) { + var agent = paper.agent; + if (name === 'meta' && agent && agent.mac) { // Fix a strange behavior on Mac where no keyup events are // received for any keys pressed while the meta key is down. // Keep track of the normal keys being pressed and trigger keyup @@ -142,14 +142,14 @@ var Key = new function() { DomEvent.add(document, { keydown: function(event) { var key = getKey(event), - browser = paper.browser; + agent = paper.agent; // Directly handle any special keys (key.length > 1) in keydown, as // not all of them will receive keypress events. // Chrome doesn't fire keypress events for command and alt keys, // so we need to handle this in a way that works across all OSes. - if (key.length > 1 || browser && (browser.chrome && (event.altKey - || browser.mac && event.metaKey - || !browser.mac && event.ctrlKey))) { + if (key.length > 1 || agent && (agent.chrome && (event.altKey + || agent.mac && event.metaKey + || !agent.mac && event.ctrlKey))) { handleKey(true, key, charLookup[key] || (key.length > 1 ? '' : key), event); } else { diff --git a/src/export.js b/src/export.js index 8c48c6cf..b2cd6cc3 100644 --- a/src/export.js +++ b/src/export.js @@ -26,6 +26,24 @@ paper = new (PaperScope.inject(Base.exports, { Key: Key }))(); +/*#*/ } else if (__options.environment == 'node') { + +paper = new (PaperScope.inject(Base.exports, { + // Mark fields as enumerable so PaperScope.inject can pick them up + enumerable: true, + Base: Base, + Numerical: Numerical, + // Export dom/node.js stuff too + XMLSerializer: XMLSerializer, + DOMParser: DOMParser, + HTMLCanvasElement: HTMLCanvasElement, + Image: Image, + document: document, + window: window +}))(); + +/*#*/ } // __options.environment == 'node' + // https://github.com/umdjs/umd if (typeof define === 'function' && define.amd) { // Support AMD (e.g. require.js) @@ -39,21 +57,3 @@ if (typeof define === 'function' && define.amd) { // the Base constructor function after straps.js is included. module.exports = paper; } - -/*#*/ } else if (__options.environment == 'node') { - -paper = new (PaperScope.inject(Base.exports, { - // Mark fields as enumerable so PaperScope.inject can pick them up - enumerable: true, - Base: Base, - Numerical: Numerical, - // Export dom/node.js stuff too - XMLSerializer: XMLSerializer, - DOMParser: DOMParser, - Canvas: Canvas -}))(); - -// Export the paper scope. -module.exports = paper; - -/*#*/ } // __options.environment == 'node' diff --git a/src/item/Raster.js b/src/item/Raster.js index c0a60db2..a78cbf74 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -324,10 +324,6 @@ var Raster = Item.extend(/** @lends Raster# */{ */ getSource: function() { var image = this._image; -/*#*/ if (__options.environment == 'node') { - // See #toDataURL() - image = image && this._src; -/*#*/ } // __options.environment == 'node' return image && image.src || this.toDataURL(); }, @@ -346,14 +342,11 @@ var Raster = Item.extend(/** @lends Raster# */{ } } -/*#*/ if (__options.environment == 'browser') { // src can be an URL or a DOM ID to load the image from image = document.getElementById(src) || new Image(); if (crossOrigin) image.crossOrigin = crossOrigin; - // IE has naturalWidth / Height defined, but width / height set to 0 - // when the image is invisible in the document. - if (image.naturalWidth && image.naturalHeight) { + if (image.complete) { // Emit load event with a delay, so behavior is the same as when // it's actually loaded and we give the code time to install event. setTimeout(loaded, 0); @@ -365,54 +358,6 @@ var Raster = Item.extend(/** @lends Raster# */{ image.src = src; } this.setImage(image); -/*#*/ } else if (__options.environment == 'node') { - image = new Image(); - if (crossOrigin) - image.crossOrigin = crossOrigin; - // If we're running on the server and it's a string, - // check if it is a data URL - if (/^data:/.test(src)) { - // Preserve the data in this._src since canvas-node eats it. - image.src = src; - this._src = { src: src, data: src }; - // Emit load event with a delay, so behavior is the same as when - // it's actually loaded and we give the code time to install event. - setTimeout(loaded, 0); - } else if (/^https?:\/\//.test(src)) { - // Load it from remote location: - require('request').get({ - url: src, - encoding: null // So the response data is a Buffer - }, function (err, response, buffer) { - if (err) - throw err; - if (response.statusCode == 200) { - image.src = buffer; - that._src = { - src: src, - buffer: buffer, - type: response.headers['content-type'] - }; - loaded(); - } - }); - } else { - // Load it from disk: - src = (src.match(/^file:\/\/(.*)$/) || [null, src])[1]; - require('fs').readFile(src, function (err, buffer) { - if (err) - throw err; - image.src = buffer; - that._src = { - src: 'file://' + src, - buffer: buffer, - type: require('mime').lookup(src) - }; - loaded(); - }); - } - this.setImage(image); -/*#*/ } // __options.environment == 'node' }, /** @@ -500,21 +445,7 @@ var Raster = Item.extend(/** @lends Raster# */{ // See if the linked image is base64 encoded already, if so reuse it, // otherwise try using canvas.toDataURL() var image = this._image, - src; -/*#*/ if (__options.environment == 'node') { - // Only use the information stored in _src if we still use the _image - // that goes with it. - var obj = image && this._src; - if (obj) { - if (!obj.data) { - obj.data = 'data:' + obj.type + ';base64,' + - obj.buffer.toString('base64'); - } - src = obj.data; - } -/*#*/ } else { - src = image && image.src; -/*#*/ } // __options.environment == 'node' + src = image && image.src; if (/^data:/.test(src)) return src; var canvas = this.getCanvas(); diff --git a/src/net/Http.js b/src/net/Http.js index 7f737e89..baeb0b60 100644 --- a/src/net/Http.js +++ b/src/net/Http.js @@ -14,7 +14,7 @@ var Http = { request: function(method, url, callback, async) { // Code borrowed from Coffee Script and extended: async = (async === undefined) ? true : async; - var ctor = window.ActiveXObject || XMLHttpRequest, + var ctor = window.ActiveXObject || window.XMLHttpRequest, xhr = new ctor('Microsoft.XMLHTTP'); xhr.open(method.toUpperCase(), url, async); if ('overrideMimeType' in xhr) diff --git a/src/dom/node.js b/src/node.js similarity index 50% rename from src/dom/node.js rename to src/node.js index db7c7a79..a2fd9125 100644 --- a/src/dom/node.js +++ b/src/node.js @@ -17,15 +17,32 @@ Image:true */ var jsdom = require('jsdom'), - // Node Canvas library: https://github.com/learnboost/node-canvas - Canvas = require('canvas'), - // Expose global browser variables and create a document and a window using - // jsdom, e.g. for import/exportSVG() - document = jsdom.jsdom(''), + idlUtils = require('jsdom/lib/jsdom/living/generated/utils'), + fs = require('fs'), + path = require('path'); + +// Expose global browser variables and create a document and a window using +// jsdom. +var document = jsdom.jsdom('', { + features: { + FetchExternalResources : ['img', 'script'] + } + }), window = document.defaultView, navigator = window.navigator, - HTMLCanvasElement = Canvas, - Image = Canvas.Image; + HTMLCanvasElement = window.HTMLCanvasElement, + Image = window.Image; + +Base.each( + ['pngStream', 'createPNGStream', 'jpgStream', 'createJPGStream'], + function(key) { + this[key] = function() { + var impl = idlUtils.implForWrapper(this), + canvas = impl && impl._canvas; + return canvas[key].apply(canvas, arguments); + }; + }, + HTMLCanvasElement.prototype); // Define XMLSerializer and DOMParser shims, to emulate browser behavior. // TODO: Put this into a simple node module, with dependency on jsdom? @@ -56,3 +73,24 @@ DOMParser.prototype.parseFromString = function(string, contenType) { div.innerHTML = string; return div.firstChild; }; + +// Register the .pjs extension for automatic compilation as PaperScript +require.extensions['.pjs'] = function(module, filename) { + // Requiring a PaperScript on Node.js returns an initialize method which + // needs to receive a Canvas object when called and returns the + // PaperScope. + module.exports = function(canvas) { + var source = fs.readFileSync(filename, 'utf8'); + scope = new paper.PaperScope(); + scope.setup(canvas); + scope.__filename = filename; + scope.__dirname = path.dirname(filename); + // Expose core methods and values + scope.require = require; + scope.console = console; + paper.PaperScript.execute(source, scope, { + url: filename + }); + return scope; + }; +}; diff --git a/src/paper.js b/src/paper.js index ebe6cd42..9a816ce1 100644 --- a/src/paper.js +++ b/src/paper.js @@ -44,6 +44,10 @@ var paper = new function(undefined) { /*#*/ include('constants.js'); /*#*/ } +/*#*/ if (__options.environment == 'node') { +/*#*/ include('node.js'); +/*#*/ } + /*#*/ include('core/Base.js'); /*#*/ include('core/Emitter.js'); /*#*/ include('core/PaperScope.js'); @@ -64,7 +68,7 @@ var paper = new function(undefined) { /*#*/ include('basic/Line.js'); /*#*/ include('project/Project.js'); -/*#*/ include('project/Symbol.js'); +// /*#*/ include('project/Symbol.js'); /*#*/ include('item/Item.js'); /*#*/ include('item/Group.js'); @@ -96,29 +100,21 @@ var paper = new function(undefined) { /*#*/ include('style/GradientStop.js'); /*#*/ include('style/Style.js'); -/*#*/ if (__options.environment == 'node') { -/*#*/ include('dom/node.js'); -/*#*/ } /*#*/ include('dom/DomElement.js'); -/*#*/ if (__options.environment == 'browser') { -// DomEvent doesn't make sense outside of the browser (yet) -/*#*/ include('dom/DomEvent.js'); -/*#*/ } +/*#*/ include('dom/DomEvent.js'); /*#*/ include('view/View.js'); /*#*/ include('view/CanvasView.js'); -/*#*/ if (__options.environment == 'browser') { -/*#*/ include('event/Event.js'); -/*#*/ include('event/KeyEvent.js'); -/*#*/ include('event/Key.js'); -/*#*/ include('event/MouseEvent.js'); +/*#*/ include('event/Event.js'); +/*#*/ include('event/KeyEvent.js'); +/*#*/ include('event/Key.js'); +/*#*/ include('event/MouseEvent.js'); -/*#*/ include('tool/ToolEvent.js'); -/*#*/ include('tool/Tool.js'); +/*#*/ include('tool/ToolEvent.js'); +/*#*/ include('tool/Tool.js'); -/*#*/ include('net/Http.js'); -/*#*/ } +/*#*/ include('net/Http.js'); /*#*/ include('canvas/CanvasProvider.js'); /*#*/ include('canvas/BlendMode.js'); diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 711952db..9ac7ea38 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -566,7 +566,6 @@ new function() { // as this is how SVG works too. // See if it's a string but handle markup separately if (typeof source === 'string' && !/^.* Date: Tue, 26 Jan 2016 12:38:58 +0100 Subject: [PATCH 02/11] More work on source-map support for node.js Relates to #656 --- src/core/PaperScript.js | 98 ++++++++++++++++++++++------------------- src/node.js | 25 +++++++++-- 2 files changed, 74 insertions(+), 49 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 339b910f..df4daf4a 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -95,8 +95,6 @@ Base.exports.PaperScript = (function() { return scope.acorn.parse(code, options); } - var sourceMaps = {}; - /** * Compiles PaperScript code into JavaScript code. * @@ -104,13 +102,14 @@ Base.exports.PaperScript = (function() { * @function * * @option options.url {String} the url of the source, for source-map - * debugging + * generation * @option options.source {String} the source to be used for the source- * mapping, in case the code that's passed in has already been mingled. * * @param {String} code the PaperScript code * @param {Object} [option] the compilation options - * @return {String} the compiled PaperScript translated into JavaScript code + * @return {Object} an object holding the compiled PaperScript translated + * into JavaScript code along with source-maps and other information. */ function compile(code, options) { if (!code) @@ -285,21 +284,23 @@ Base.exports.PaperScript = (function() { agent = paper.agent, version = agent.versionNumber, offsetCode = false, - sourceMap = null, + sourceMaps = options.sourceMaps, // Include the original code in the sourceMap if there is no linked // source file so the debugger can still display it correctly. source = options.source || code, lineBreaks = /\r\n|\n|\r/mg, - offset = 0; + offset = options.offset || 0, + map; // TODO: Verify these browser versions for source map support, and check // other browsers. - if (agent.chrome && version >= 30 + if (sourceMaps && (agent.chrome && version >= 30 || agent.webkit && version >= 537.76 // >= Safari 7.0.4 || agent.firefox && version >= 23 - || agent.node) { + || agent.node)) { if (agent.node) { - code = 'require("source-map-support").install(paper.PaperScript.sourceMapSupport);\n' + code; - offset = -3; // -2 for function body, - 1 for require("source-map-support") + // -2 required to remove function header: + // https://code.google.com/p/chromium/issues/detail?id=331655 + offset -= 2; } else if (url && window.location.href.indexOf(url) === 0) { // If the code stems from the actual html page, determine the // offset of inlined code. @@ -309,18 +310,21 @@ Base.exports.PaperScript = (function() { offset = html.substr(0, html.indexOf(code) + 1).match( lineBreaks).length + 1; } - // A hack required by most versions of browsers except chrome 36+: - // Instead of starting the mappings at the given offset, we have to - // shift the actual code down to the place in the original file, as - // source-map support seems incomplete in these browsers. - // TODO: Report as bugs? - offsetCode = offset > 0 && (!browser.chrome || version < 36); + // A hack required by older versions of browsers to align inlined + // code: Instead of starting the mappings at the given offset, we + // have to shift the actual code down to the place in the original + // file, as source-map support seems incomplete in these browsers. + offsetCode = offset > 0 && !( + agent.chrome && version >= 36 || + agent.safari && version >= 600 || + agent.firefox && version >= 40 || + agent.node); var mappings = ['AA' + encodeVLQ(offsetCode ? 0 : offset) + 'A']; // Create empty entries by the amount of lines + 1, so join can be // used below to produce the actual instructions that many times. mappings.length = (code.match(lineBreaks) || []).length + 1 + (offsetCode ? offset : 0); - sourceMap = { + map = { version: 3, file: url, names:[], @@ -328,6 +332,7 @@ Base.exports.PaperScript = (function() { // the lines of the original code, all that is required is a // mappings string that increments by one between each line. // AACA is the instruction to increment the line by one. + // TODO: Add support for column offsets! mappings: mappings.join(';AACA'), sourceRoot: '', sources: [url], @@ -336,19 +341,25 @@ Base.exports.PaperScript = (function() { } // Now do the parsing magic walkAST(parse(code, { ranges: true })); - if (sourceMap) { - // Adjust the line offset of the resulting code if required. - // This is part of a browser hack, see above. - if (offsetCode) + if (map) { + if (offsetCode) { + // Adjust the line offset of the resulting code if required. + // This is part of a browser hack, see above. code = new Array(offset + 1).join('\n') + code; - code += "\n//# sourceMappingURL=data:application/json;base64," - + window.btoa(unescape(encodeURIComponent( - JSON.stringify(sourceMap)))) - + "\n//# sourceURL=" + (url || 'paperscript'); - if (url) - sourceMaps[url] = sourceMap; + } + if (/^(inline|both)$/.test(sourceMaps)) { + code += "\n//# sourceMappingURL=data:application/json;base64," + + window.btoa(unescape(encodeURIComponent( + JSON.stringify(map)))); + } + code += "\n//# sourceURL=" + (url || 'paperscript'); } - return code; + return { + url: url, + source: source, + code: code, + map: map + }; } /** @@ -362,14 +373,15 @@ Base.exports.PaperScript = (function() { * @function * * @option options.url {String} the url of the source, for source-map - * debugging + * generation * @option options.source {String} the source to be used for the source- * mapping, in case the code that's passed in has already been mingled. * * @param {String} code the PaperScript code * @param {PaperScope} scope the scope for which the code is executed * @param {Object} [option] the compilation options - * @return {String} the compiled PaperScript translated into JavaScript code + * @return {Object} an object holding the compiled PaperScript translated + * into JavaScript code along with source-maps and other information. */ function execute(code, scope, options) { // Set currently active scope. @@ -393,8 +405,9 @@ Base.exports.PaperScript = (function() { // function call. params = [], args = [], - func; - code = compile(code, options); + func, + compiled = typeof code === 'object' ? code : compile(code, options); + code = compiled.code; function expose(scope, hidden) { // Look through all enumerable properties on the scope and expose // these too as pseudo-globals, but only if they seem to be in use. @@ -428,12 +441,12 @@ Base.exports.PaperScript = (function() { if (handlers) code += '\nreturn { ' + handlers + ' };'; var agent = paper.agent; - if (agent.chrome || agent.firefox) { - // On Firefox, all error numbers inside dynamically compiled code - // are relative to the line where the eval / compilation happened. - // To fix this issue, we're temporarily inserting a new script - // tag. We also use this on Chrome to fix an issue with compiled - // functions: + if (agent.chrome || agent.firefox && agent.versionNumber < 40) { + // On older Firefox, all error numbers inside dynamically compiled + // code are relative to the line where the eval / compilation + // happened. To fix this issue, we're temporarily inserting a new + // script tag. + // We also use this on Chrome to fix issues with compiled functions: // https://code.google.com/p/chromium/issues/detail?id=331655 var script = document.createElement('script'), head = document.head || document.getElementsByTagName('head')[0]; @@ -472,6 +485,7 @@ Base.exports.PaperScript = (function() { // Automatically update view at the end. view.update(); } + return compiled; } function loadScript(script) { @@ -562,13 +576,7 @@ Base.exports.PaperScript = (function() { compile: compile, execute: execute, load: load, - parse: parse, - sourceMapSupport: { - retrieveSourceMap: function(source) { - var map = sourceMaps[source]; - return map ? { url: source, map: map } : null; - } - } + parse: parse }; // Pass on `this` as the binding object, so we can reference Acorn both in // development and in the built library. diff --git a/src/node.js b/src/node.js index a2fd9125..8a6de8a8 100644 --- a/src/node.js +++ b/src/node.js @@ -74,23 +74,40 @@ DOMParser.prototype.parseFromString = function(string, contenType) { return div.firstChild; }; +var sourceMaps = {}; +var sourceMapSupport = { + retrieveSourceMap: function(source) { + var map = sourceMaps[source]; + return map ? { url: source, map: map } : null; + } +}; + // Register the .pjs extension for automatic compilation as PaperScript require.extensions['.pjs'] = function(module, filename) { // Requiring a PaperScript on Node.js returns an initialize method which // needs to receive a Canvas object when called and returns the // PaperScope. module.exports = function(canvas) { - var source = fs.readFileSync(filename, 'utf8'); + // TODO: Fix this once we can require('paper') from node specific code. + paper.PaperScript.sourceMapSupport = sourceMapSupport; + var source = fs.readFileSync(filename, 'utf8'), + code = 'require("source-map-support").install(paper.PaperScript.sourceMapSupport);\n' + source, + compiled = paper.PaperScript.compile(code, { + url: filename, + source: source, + sourceMaps: true, + offset: -1 // remove require("source-map-support")... + }), scope = new paper.PaperScope(); + // Keep track of sourceMaps so retrieveSourceMap() can link them up scope.setup(canvas); scope.__filename = filename; scope.__dirname = path.dirname(filename); // Expose core methods and values scope.require = require; scope.console = console; - paper.PaperScript.execute(source, scope, { - url: filename - }); + sourceMaps[filename] = compiled.map; + paper.PaperScript.execute(compiled, scope); return scope; }; }; From 7781ecb76afb7bd50f20f8d74cb918683e09294a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 16:29:13 +0100 Subject: [PATCH 03/11] Some minor cleanups. --- src/core/PaperScript.js | 4 ++-- src/node.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index df4daf4a..ead636f8 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -271,10 +271,10 @@ Base.exports.PaperScript = (function() { base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; value = (Math.abs(value) << 1) + (value < 0 ? 1 : 0); while (value || !res) { - var next = value & ((1 << 5) - 1); + var next = value & (32 - 1); value >>= 5; if (value) - next |= (1 << 5); + next |= 32; res += base64[next]; } return res; diff --git a/src/node.js b/src/node.js index 8a6de8a8..77c6f635 100644 --- a/src/node.js +++ b/src/node.js @@ -74,13 +74,13 @@ DOMParser.prototype.parseFromString = function(string, contenType) { return div.firstChild; }; -var sourceMaps = {}; -var sourceMapSupport = { - retrieveSourceMap: function(source) { - var map = sourceMaps[source]; - return map ? { url: source, map: map } : null; - } -}; +var sourceMaps = {}, + sourceMapSupport = { + retrieveSourceMap: function(source) { + var map = sourceMaps[source]; + return map ? { url: source, map: map } : null; + } + }; // Register the .pjs extension for automatic compilation as PaperScript require.extensions['.pjs'] = function(module, filename) { From 15797903cf5678a064eff9a05223f106f77a5f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 16:51:40 +0100 Subject: [PATCH 04/11] Update to jsdom v7.2.2 with https://github.com/tmpvar/jsdom/pull/1366 back-portedd. --- package.json | 2 +- src/node.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0bea68e8..396193a2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "node": ">=0.8.0 <5.0.0" }, "dependencies": { - "jsdom": "git://github.com/lehni/jsdom.git#45c5ad551ff7d12efacac06bea5b29cc3aeadb20", + "jsdom": "git://github.com/lehni/jsdom.git#3d55789d0f4d55392721b1e22890837fde472375", "source-map-support": "^0.4.0" }, "optionalDependencies": { diff --git a/src/node.js b/src/node.js index 77c6f635..25b3910f 100644 --- a/src/node.js +++ b/src/node.js @@ -37,7 +37,7 @@ Base.each( ['pngStream', 'createPNGStream', 'jpgStream', 'createJPGStream'], function(key) { this[key] = function() { - var impl = idlUtils.implForWrapper(this), + var impl = this._canvas ? this : idlUtils.implForWrapper(this), canvas = impl && impl._canvas; return canvas[key].apply(canvas, arguments); }; From e1a51f858ad78a9b1a9daf289d98c33ee1ce6101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 20:02:23 +0100 Subject: [PATCH 05/11] More work on unified version for browsers and node. Relates to #739 --- dist/paper-node.js | 1 - gulp/tasks/build.js | 9 ++- gulp/tasks/load.js | 8 +-- package.json | 3 +- src/core/PaperScope.js | 2 +- src/export.js | 25 +++------ src/init.js | 18 ++++++ src/item/Raster.js | 2 +- src/load.js | 14 ++++- src/node.js | 113 ------------------------------------- src/node/extend.js | 125 +++++++++++++++++++++++++++++++++++++++++ src/node/window.js | 71 +++++++++++++++++++++++ src/options.js | 1 - src/paper.js | 21 ++----- src/view/CanvasView.js | 89 +---------------------------- 15 files changed, 249 insertions(+), 253 deletions(-) delete mode 120000 dist/paper-node.js create mode 100644 src/init.js delete mode 100644 src/node.js create mode 100644 src/node/extend.js create mode 100644 src/node/window.js diff --git a/dist/paper-node.js b/dist/paper-node.js deleted file mode 120000 index 37e257c7..00000000 --- a/dist/paper-node.js +++ /dev/null @@ -1 +0,0 @@ -../src/load.js \ No newline at end of file diff --git a/gulp/tasks/build.js b/gulp/tasks/build.js index 5db38e3a..19a53ac9 100644 --- a/gulp/tasks/build.js +++ b/gulp/tasks/build.js @@ -23,8 +23,7 @@ var gulp = require('gulp'), // object, merged in with the options required above. var buildOptions = { full: { paperScript: true }, - core: { paperScript: false }, - node: { environment: 'node', paperScript: true } + core: { paperScript: false } }; var buildNames = Object.keys(buildOptions); @@ -32,9 +31,13 @@ var buildNames = Object.keys(buildOptions); gulp.task('build', buildNames.map(function(name) { return 'build:' + name; - }) + }).concat(['build:copy']) ); +gulp.task('build:copy', function() { + gulp.src(['src/node/*.js']).pipe(gulp.dest('dist/node')); +}); + buildNames.forEach(function(name) { gulp.task('build:' + name, ['clean:build:' + name, 'minify:acorn'], function() { return gulp.src('src/paper.js') diff --git a/gulp/tasks/load.js b/gulp/tasks/load.js index b1ceff99..228f0610 100644 --- a/gulp/tasks/load.js +++ b/gulp/tasks/load.js @@ -16,13 +16,9 @@ var gulp = require('gulp'), gulp.task('load', ['clean:load'], function() { return gulp.src('src/load.js') - .pipe(symlink('dist/paper-full.js')) - .pipe(symlink('dist/paper-node.js')); + .pipe(symlink('dist/paper-full.js')); }); gulp.task('clean:load', function() { - return del([ - 'dist/paper-full.js', - 'dist/paper-node.js' - ]); + return del([ 'dist/paper-full.js', 'dist/node/**' ]); }); diff --git a/package.json b/package.json index 396193a2..2dd6d60d 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,7 @@ "Jürg Lehni (http://scratchdisk.com)", "Jonathan Puckey (http://studiomoniker.com)" ], - "main": "dist/paper-node.js", - "browser": "dist/paper-full.js", + "main": "dist/paper-full.js", "scripts": { "lint": "jshint src" }, diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index f83a421b..04cc29d9 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -72,7 +72,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{ CanvasProvider.release(ctx); } if (!this.agent) { - var user = navigator.userAgent.toLowerCase(), + var user = window.navigator.userAgent.toLowerCase(), // Detect basic platforms, only mac internally required for now. os = (/(darwin|win|mac|linux|freebsd|sunos)/.exec(user)||[])[0], platform = os === 'darwin' ? 'mac' : os, diff --git a/src/export.js b/src/export.js index b2cd6cc3..a2828545 100644 --- a/src/export.js +++ b/src/export.js @@ -13,8 +13,6 @@ // First add Base and a couple of other objects that are not automatically // exported to exports (Numerical, Key, etc), then inject all exports into // PaperScope, and create the initial paper object, all in one statement: -/*#*/ if (__options.environment == 'browser') { - // NOTE: Do not create local variable `var paper` since it would shield the // global one in the whole scope. @@ -23,26 +21,17 @@ paper = new (PaperScope.inject(Base.exports, { enumerable: true, Base: Base, Numerical: Numerical, - Key: Key -}))(); - -/*#*/ } else if (__options.environment == 'node') { - -paper = new (PaperScope.inject(Base.exports, { - // Mark fields as enumerable so PaperScope.inject can pick them up - enumerable: true, - Base: Base, - Numerical: Numerical, - // Export dom/node.js stuff too - XMLSerializer: XMLSerializer, - DOMParser: DOMParser, - HTMLCanvasElement: HTMLCanvasElement, - Image: Image, + Key: Key, + // Export jsdom document and window too, for Node.js document: document, window: window }))(); -/*#*/ } // __options.environment == 'node' +// If we're on node, require some additional functionality now (PaperScript +// support in require() with sourceMaps, and exportFrames / exportImage on +// CanvasView) +if (paper.agent.node) + require('./node/extend')(paper); // https://github.com/umdjs/umd if (typeof define === 'function' && define.amd) { diff --git a/src/init.js b/src/init.js new file mode 100644 index 00000000..e9a8160a --- /dev/null +++ b/src/init.js @@ -0,0 +1,18 @@ +/* + * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. + * 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. + */ + +// Node.js emulation layer of browser based environment, based on node-canvas +// and jsdom. + +/* global document:true, window:true */ +window = window || require('./node/window'); +var document = window.document; diff --git a/src/item/Raster.js b/src/item/Raster.js index a78cbf74..71beaf8c 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -343,7 +343,7 @@ var Raster = Item.extend(/** @lends Raster# */{ } // src can be an URL or a DOM ID to load the image from - image = document.getElementById(src) || new Image(); + image = document.getElementById(src) || new window.Image(); if (crossOrigin) image.crossOrigin = crossOrigin; if (image.complete) { diff --git a/src/load.js b/src/load.js index 1f9816b6..3ec951e7 100644 --- a/src/load.js +++ b/src/load.js @@ -40,23 +40,31 @@ if (typeof window === 'object') { load(root + 'src/load.js'); } else { include('options.js'); + // Load constants.js, required by the on-the-fly preprocessing: + include('constants.js'); + // Automatically load stats.js while developing. + include('../node_modules/stats.js/build/stats.min.js'); include('paper.js'); } } else { // Node.js based loading through Prepro.js: var prepro = require('prepro/lib/node.js'), // Load the default browser-based options for further amendments. - // Step out and back into src, if this is loaded from dist/paper-node.js + // Step out and back into src, in case this is loaded from + // dist/paper-node.js options = require('../src/options.js'); // Override Node.js specific options. options.version += '-load'; - options.environment = 'node'; options.load = true; prepro.setup(function() { // Return objects to be defined in the preprocess-scope. // Note that this would be merge in with already existing objects. - return { __options: options }; + // We're defining window here since the paper-scope argument is only + // available in the included scripts when the library is actually built. + return { __options: options, window: null }; }); + // Load constants.js, required by the on-the-fly preprocessing: + prepro.include('../src/constants.js'); // Load Paper.js library files. prepro.include('../src/paper.js'); } diff --git a/src/node.js b/src/node.js deleted file mode 100644 index 25b3910f..00000000 --- a/src/node.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Paper.js - The Swiss Army Knife of Vector Graphics Scripting. - * 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. - */ - -// Node.js emulation layer of browser based environment, based on node-canvas -// and jsdom. - -/* global document:true, window:true, navigator:true, HTMLCanvasElement:true, - Image:true */ - -var jsdom = require('jsdom'), - idlUtils = require('jsdom/lib/jsdom/living/generated/utils'), - fs = require('fs'), - path = require('path'); - -// Expose global browser variables and create a document and a window using -// jsdom. -var document = jsdom.jsdom('', { - features: { - FetchExternalResources : ['img', 'script'] - } - }), - window = document.defaultView, - navigator = window.navigator, - HTMLCanvasElement = window.HTMLCanvasElement, - Image = window.Image; - -Base.each( - ['pngStream', 'createPNGStream', 'jpgStream', 'createJPGStream'], - function(key) { - this[key] = function() { - var impl = this._canvas ? this : idlUtils.implForWrapper(this), - canvas = impl && impl._canvas; - return canvas[key].apply(canvas, arguments); - }; - }, - HTMLCanvasElement.prototype); - -// Define XMLSerializer and DOMParser shims, to emulate browser behavior. -// TODO: Put this into a simple node module, with dependency on jsdom? -function XMLSerializer() { -} - -XMLSerializer.prototype.serializeToString = function(node) { - var text = jsdom.serializeDocument(node); - // Fix a jsdom issue where all SVG tagNames are lowercased: - // https://github.com/tmpvar/jsdom/issues/620 - var tagNames = ['linearGradient', 'radialGradient', 'clipPath']; - for (var i = 0, l = tagNames.length; i < l; i++) { - var tagName = tagNames[i]; - text = text.replace( - new RegExp('(<|', { + features: { + FetchExternalResources : ['img', 'script'] + } + }), + window = document.defaultView; + +['pngStream', 'createPNGStream', 'jpgStream', 'createJPGStream'].forEach( + function(key) { + this[key] = function() { + var impl = this._canvas ? this : idlUtils.implForWrapper(this), + canvas = impl && impl._canvas; + return canvas[key].apply(canvas, arguments); + }; + }, + window.HTMLCanvasElement.prototype); + +// Define XMLSerializer and DOMParser shims, to emulate browser behavior. +// TODO: Put this into a simple node module, with dependency on jsdom? +function XMLSerializer() { +} + +XMLSerializer.prototype.serializeToString = function(node) { + var text = jsdom.serializeDocument(node); + // Fix a jsdom issue where all SVG tagNames are lowercased: + // https://github.com/tmpvar/jsdom/issues/620 + var tagNames = ['linearGradient', 'radialGradient', 'clipPath']; + for (var i = 0, l = tagNames.length; i < l; i++) { + var tagName = tagNames[i]; + text = text.replace( + new RegExp('(<| Date: Tue, 26 Jan 2016 20:14:49 +0100 Subject: [PATCH 06/11] Improve some comments about new file structure. --- src/export.js | 6 +++--- src/init.js | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/export.js b/src/export.js index a2828545..6462dae4 100644 --- a/src/export.js +++ b/src/export.js @@ -27,9 +27,9 @@ paper = new (PaperScope.inject(Base.exports, { window: window }))(); -// If we're on node, require some additional functionality now (PaperScript -// support in require() with sourceMaps, and exportFrames / exportImage on -// CanvasView) +// If we're on node, require some additional functionality now before finishing: +// - PaperScript support in require() with sourceMaps +// - exportFrames / exportImage on CanvasView if (paper.agent.node) require('./node/extend')(paper); diff --git a/src/init.js b/src/init.js index e9a8160a..676fcfb7 100644 --- a/src/init.js +++ b/src/init.js @@ -10,8 +10,11 @@ * All rights reserved. */ -// Node.js emulation layer of browser based environment, based on node-canvas -// and jsdom. +// Here we only make sure that there's a window and document object in the node +// environment. We can't do this directly in src/paper.js, due to the nature of +// how Prepro.js loads the include() files in the various scenarios. E.g. on +// Node.js,only the files included in such a way see each other's variables in +// their shared scope. /* global document:true, window:true */ window = window || require('./node/window'); From 77be5616b6b04bc2bdea3ad048cda41fb7fe91f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 20:26:32 +0100 Subject: [PATCH 07/11] Include paper-core.js in load.js mechanism, and improve root folder guessing again. --- dist/paper-core.js | 13376 +------------------------------------------ gulp/tasks/load.js | 5 +- src/load.js | 8 +- 3 files changed, 8 insertions(+), 13381 deletions(-) mode change 100644 => 120000 dist/paper-core.js diff --git a/dist/paper-core.js b/dist/paper-core.js deleted file mode 100644 index 6568d2c8..00000000 --- a/dist/paper-core.js +++ /dev/null @@ -1,13375 +0,0 @@ -/*! - * Paper.js v0.9.25 - The Swiss Army Knife of Vector Graphics Scripting. - * http://paperjs.org/ - * - * Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey - * http://scratchdisk.com/ & http://jonathanpuckey.com/ - * - * Distributed under the MIT license. See LICENSE file for details. - * - * All rights reserved. - * - * Date: Sun Oct 25 11:23:38 2015 +0100 - * - *** - * - * Straps.js - Class inheritance library with support for bean-style accessors - * - * Copyright (c) 2006 - 2013 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. - * - */ - -var paper = new function(undefined) { - -var Base = new function() { - var hidden = /^(statics|enumerable|beans|preserve)$/, - - forEach = [].forEach || function(iter, bind) { - for (var i = 0, l = this.length; i < l; i++) - iter.call(bind, this[i], i, this); - }, - - forIn = function(iter, bind) { - for (var i in this) - if (this.hasOwnProperty(i)) - iter.call(bind, this[i], i, this); - }, - - create = Object.create || function(proto) { - return { __proto__: proto }; - }, - - describe = Object.getOwnPropertyDescriptor || function(obj, name) { - var get = obj.__lookupGetter__ && obj.__lookupGetter__(name); - return get - ? { get: get, set: obj.__lookupSetter__(name), - enumerable: true, configurable: true } - : obj.hasOwnProperty(name) - ? { value: obj[name], enumerable: true, - configurable: true, writable: true } - : null; - }, - - _define = Object.defineProperty || function(obj, name, desc) { - if ((desc.get || desc.set) && obj.__defineGetter__) { - if (desc.get) - obj.__defineGetter__(name, desc.get); - if (desc.set) - obj.__defineSetter__(name, desc.set); - } else { - obj[name] = desc.value; - } - return obj; - }, - - define = function(obj, name, desc) { - delete obj[name]; - return _define(obj, name, desc); - }; - - function inject(dest, src, enumerable, beans, preserve) { - var beansNames = {}; - - function field(name, val) { - val = val || (val = describe(src, name)) - && (val.get ? val : val.value); - if (typeof val === 'string' && val[0] === '#') - val = dest[val.substring(1)] || val; - var isFunc = typeof val === 'function', - res = val, - prev = preserve || isFunc && !val.base - ? (val && val.get ? name in dest : dest[name]) - : null, - bean; - if (!preserve || !prev) { - if (isFunc && prev) - val.base = prev; - if (isFunc && beans !== false - && (bean = name.match(/^([gs]et|is)(([A-Z])(.*))$/))) - beansNames[bean[3].toLowerCase() + bean[4]] = bean[2]; - if (!res || isFunc || !res.get || typeof res.get !== 'function' - || !Base.isPlainObject(res)) - res = { value: res, writable: true }; - if ((describe(dest, name) - || { configurable: true }).configurable) { - res.configurable = true; - res.enumerable = enumerable; - } - define(dest, name, res); - } - } - if (src) { - for (var name in src) { - if (src.hasOwnProperty(name) && !hidden.test(name)) - field(name); - } - for (var name in beansNames) { - var part = beansNames[name], - set = dest['set' + part], - get = dest['get' + part] || set && dest['is' + part]; - if (get && (beans === true || get.length === 0)) - field(name, { get: get, set: set }); - } - } - return dest; - } - - function each(obj, iter, bind) { - if (obj) - ('length' in obj && !obj.getLength - && typeof obj.length === 'number' - ? forEach - : forIn).call(obj, iter, bind = bind || obj); - return bind; - } - - function set(obj, props, exclude) { - for (var key in props) - if (props.hasOwnProperty(key) && !(exclude && exclude[key])) - obj[key] = props[key]; - return obj; - } - - return inject(function Base() { - for (var i = 0, l = arguments.length; i < l; i++) - set(this, arguments[i]); - }, { - inject: function(src) { - if (src) { - var statics = src.statics === true ? src : src.statics, - beans = src.beans, - preserve = src.preserve; - if (statics !== src) - inject(this.prototype, src, src.enumerable, beans, preserve); - inject(this, statics, true, beans, preserve); - } - for (var i = 1, l = arguments.length; i < l; i++) - this.inject(arguments[i]); - return this; - }, - - extend: function() { - var base = this, - ctor, - proto; - for (var i = 0, l = arguments.length; i < l; i++) - if (ctor = arguments[i].initialize) - break; - ctor = ctor || function() { - base.apply(this, arguments); - }; - proto = ctor.prototype = create(this.prototype); - define(proto, 'constructor', - { value: ctor, writable: true, configurable: true }); - inject(ctor, this, true); - if (arguments.length) - this.inject.apply(ctor, arguments); - ctor.base = base; - return ctor; - } - }, true).inject({ - inject: function() { - for (var i = 0, l = arguments.length; i < l; i++) { - var src = arguments[i]; - if (src) - inject(this, src, src.enumerable, src.beans, src.preserve); - } - return this; - }, - - extend: function() { - var res = create(this); - return res.inject.apply(res, arguments); - }, - - each: function(iter, bind) { - return each(this, iter, bind); - }, - - set: function(props) { - return set(this, props); - }, - - clone: function() { - return new this.constructor(this); - }, - - statics: { - each: each, - create: create, - define: define, - describe: describe, - set: set, - - clone: function(obj) { - return set(new obj.constructor(), obj); - }, - - isPlainObject: function(obj) { - var ctor = obj != null && obj.constructor; - return ctor && (ctor === Object || ctor === Base - || ctor.name === 'Object'); - }, - - pick: function(a, b) { - return a !== undefined ? a : b; - } - } - }); -}; - -if (typeof module !== 'undefined') - module.exports = Base; - -Base.inject({ - toString: function() { - return this._id != null - ? (this._class || 'Object') + (this._name - ? " '" + this._name + "'" - : ' @' + this._id) - : '{ ' + Base.each(this, function(value, key) { - if (!/^_/.test(key)) { - var type = typeof value; - this.push(key + ': ' + (type === 'number' - ? Formatter.instance.number(value) - : type === 'string' ? "'" + value + "'" : value)); - } - }, []).join(', ') + ' }'; - }, - - getClassName: function() { - return this._class || ''; - }, - - exportJSON: function(options) { - return Base.exportJSON(this, options); - }, - - toJSON: function() { - return Base.serialize(this); - }, - - _set: function(props, exclude, dontCheck) { - if (props && (dontCheck || Base.isPlainObject(props))) { - var keys = Object.keys(props._filtering || props); - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - if (!(exclude && exclude[key])) { - var value = props[key]; - if (value !== undefined) - this[key] = value; - } - } - return true; - } - }, - - statics: { - - exports: { - enumerable: true - }, - - extend: function extend() { - var res = extend.base.apply(this, arguments), - name = res.prototype._class; - if (name && !Base.exports[name]) - Base.exports[name] = res; - return res; - }, - - equals: function(obj1, obj2) { - if (obj1 === obj2) - return true; - if (obj1 && obj1.equals) - return obj1.equals(obj2); - if (obj2 && obj2.equals) - return obj2.equals(obj1); - if (obj1 && obj2 - && typeof obj1 === 'object' && typeof obj2 === 'object') { - if (Array.isArray(obj1) && Array.isArray(obj2)) { - var length = obj1.length; - if (length !== obj2.length) - return false; - while (length--) { - if (!Base.equals(obj1[length], obj2[length])) - return false; - } - } else { - var keys = Object.keys(obj1), - length = keys.length; - if (length !== Object.keys(obj2).length) - return false; - while (length--) { - var key = keys[length]; - if (!(obj2.hasOwnProperty(key) - && Base.equals(obj1[key], obj2[key]))) - return false; - } - } - return true; - } - return false; - }, - - read: function(list, start, options, length) { - if (this === Base) { - var value = this.peek(list, start); - list.__index++; - return value; - } - var proto = this.prototype, - readIndex = proto._readIndex, - index = start || readIndex && list.__index || 0; - if (!length) - length = list.length - index; - var obj = list[index]; - if (obj instanceof this - || options && options.readNull && obj == null && length <= 1) { - if (readIndex) - list.__index = index + 1; - return obj && options && options.clone ? obj.clone() : obj; - } - obj = Base.create(this.prototype); - if (readIndex) - obj.__read = true; - obj = obj.initialize.apply(obj, index > 0 || length < list.length - ? Array.prototype.slice.call(list, index, index + length) - : list) || obj; - if (readIndex) { - list.__index = index + obj.__read; - obj.__read = undefined; - } - return obj; - }, - - peek: function(list, start) { - return list[list.__index = start || list.__index || 0]; - }, - - remain: function(list) { - return list.length - (list.__index || 0); - }, - - readAll: function(list, start, options) { - var res = [], - entry; - for (var i = start || 0, l = list.length; i < l; i++) { - res.push(Array.isArray(entry = list[i]) - ? this.read(entry, 0, options) - : this.read(list, i, options, 1)); - } - return res; - }, - - readNamed: function(list, name, start, options, length) { - var value = this.getNamed(list, name), - hasObject = value !== undefined; - if (hasObject) { - var filtered = list._filtered; - if (!filtered) { - filtered = list._filtered = Base.create(list[0]); - filtered._filtering = list[0]; - } - filtered[name] = undefined; - } - return this.read(hasObject ? [value] : list, start, options, length); - }, - - getNamed: function(list, name) { - var arg = list[0]; - if (list._hasObject === undefined) - list._hasObject = list.length === 1 && Base.isPlainObject(arg); - if (list._hasObject) - return name ? arg[name] : list._filtered || arg; - }, - - hasNamed: function(list, name) { - return !!this.getNamed(list, name); - }, - - isPlainValue: function(obj, asString) { - return this.isPlainObject(obj) || Array.isArray(obj) - || asString && typeof obj === 'string'; - }, - - serialize: function(obj, options, compact, dictionary) { - options = options || {}; - - var root = !dictionary, - res; - if (root) { - options.formatter = new Formatter(options.precision); - dictionary = { - length: 0, - definitions: {}, - references: {}, - add: function(item, create) { - var id = '#' + item._id, - ref = this.references[id]; - if (!ref) { - this.length++; - var res = create.call(item), - name = item._class; - if (name && res[0] !== name) - res.unshift(name); - this.definitions[id] = res; - ref = this.references[id] = [id]; - } - return ref; - } - }; - } - if (obj && obj._serialize) { - res = obj._serialize(options, dictionary); - var name = obj._class; - if (name && !compact && !res._compact && res[0] !== name) - res.unshift(name); - } else if (Array.isArray(obj)) { - res = []; - for (var i = 0, l = obj.length; i < l; i++) - res[i] = Base.serialize(obj[i], options, compact, - dictionary); - if (compact) - res._compact = true; - } else if (Base.isPlainObject(obj)) { - res = {}; - var keys = Object.keys(obj); - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - res[key] = Base.serialize(obj[key], options, compact, - dictionary); - } - } else if (typeof obj === 'number') { - res = options.formatter.number(obj, options.precision); - } else { - res = obj; - } - return root && dictionary.length > 0 - ? [['dictionary', dictionary.definitions], res] - : res; - }, - - deserialize: function(json, create, _data, _isDictionary) { - var res = json, - isRoot = !_data; - _data = _data || {}; - if (Array.isArray(json)) { - var type = json[0], - isDictionary = type === 'dictionary'; - if (json.length == 1 && /^#/.test(type)) - return _data.dictionary[type]; - type = Base.exports[type]; - res = []; - if (_isDictionary) - _data.dictionary = res; - for (var i = type ? 1 : 0, l = json.length; i < l; i++) - res.push(Base.deserialize(json[i], create, _data, - isDictionary)); - if (type) { - var args = res; - if (create) { - res = create(type, args); - } else { - res = Base.create(type.prototype); - type.apply(res, args); - } - } - } else if (Base.isPlainObject(json)) { - res = {}; - if (_isDictionary) - _data.dictionary = res; - for (var key in json) - res[key] = Base.deserialize(json[key], create, _data); - } - return isRoot && json && json.length && json[0][0] === 'dictionary' - ? res[1] - : res; - }, - - exportJSON: function(obj, options) { - var json = Base.serialize(obj, options); - return options && options.asString === false - ? json - : JSON.stringify(json); - }, - - importJSON: function(json, target) { - return Base.deserialize( - typeof json === 'string' ? JSON.parse(json) : json, - function(type, args) { - var obj = target && target.constructor === type - ? target - : Base.create(type.prototype), - isTarget = obj === target; - if (args.length === 1 && obj instanceof Item - && (isTarget || !(obj instanceof Layer))) { - var arg = args[0]; - if (Base.isPlainObject(arg)) - arg.insert = false; - } - type.apply(obj, args); - if (isTarget) - target = null; - return obj; - }); - }, - - splice: function(list, items, index, remove) { - var amount = items && items.length, - append = index === undefined; - index = append ? list.length : index; - if (index > list.length) - index = list.length; - for (var i = 0; i < amount; i++) - items[i]._index = index + i; - if (append) { - list.push.apply(list, items); - return []; - } else { - var args = [index, remove]; - if (items) - args.push.apply(args, items); - var removed = list.splice.apply(list, args); - for (var i = 0, l = removed.length; i < l; i++) - removed[i]._index = undefined; - for (var i = index + amount, l = list.length; i < l; i++) - list[i]._index = i; - return removed; - } - }, - - capitalize: function(str) { - return str.replace(/\b[a-z]/g, function(match) { - return match.toUpperCase(); - }); - }, - - camelize: function(str) { - return str.replace(/-(.)/g, function(all, chr) { - return chr.toUpperCase(); - }); - }, - - hyphenate: function(str) { - return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); - } - } -}); - -var Emitter = { - on: function(type, func) { - if (typeof type !== 'string') { - Base.each(type, function(value, key) { - this.on(key, value); - }, this); - } else { - var types = this._eventTypes, - entry = types && types[type], - handlers = this._callbacks = this._callbacks || {}; - handlers = handlers[type] = handlers[type] || []; - if (handlers.indexOf(func) === -1) { - handlers.push(func); - if (entry && entry.install && handlers.length === 1) - entry.install.call(this, type); - } - } - return this; - }, - - off: function(type, func) { - if (typeof type !== 'string') { - Base.each(type, function(value, key) { - this.off(key, value); - }, this); - return; - } - var types = this._eventTypes, - entry = types && types[type], - handlers = this._callbacks && this._callbacks[type], - index; - if (handlers) { - if (!func || (index = handlers.indexOf(func)) !== -1 - && handlers.length === 1) { - if (entry && entry.uninstall) - entry.uninstall.call(this, type); - delete this._callbacks[type]; - } else if (index !== -1) { - handlers.splice(index, 1); - } - } - return this; - }, - - once: function(type, func) { - return this.on(type, function() { - func.apply(this, arguments); - this.off(type, func); - }); - }, - - emit: function(type, event) { - var handlers = this._callbacks && this._callbacks[type]; - if (!handlers) - return false; - var args = [].slice.call(arguments, 1); - handlers = handlers.slice(); - for (var i = 0, l = handlers.length; i < l; i++) { - if (handlers[i].apply(this, args) === false) { - if (event && event.stop) - event.stop(); - break; - } - } - return true; - }, - - responds: function(type) { - return !!(this._callbacks && this._callbacks[type]); - }, - - attach: '#on', - detach: '#off', - fire: '#emit', - - _installEvents: function(install) { - var handlers = this._callbacks, - key = install ? 'install' : 'uninstall'; - for (var type in handlers) { - if (handlers[type].length > 0) { - var types = this._eventTypes, - entry = types && types[type], - func = entry && entry[key]; - if (func) - func.call(this, type); - } - } - }, - - statics: { - inject: function inject(src) { - var events = src._events; - if (events) { - var types = {}; - Base.each(events, function(entry, key) { - var isString = typeof entry === 'string', - name = isString ? entry : key, - part = Base.capitalize(name), - type = name.substring(2).toLowerCase(); - types[type] = isString ? {} : entry; - name = '_' + name; - src['get' + part] = function() { - return this[name]; - }; - src['set' + part] = function(func) { - var prev = this[name]; - if (prev) - this.off(type, prev); - if (func) - this.on(type, func); - this[name] = func; - }; - }); - src._eventTypes = types; - } - return inject.base.apply(this, arguments); - } - } -}; - -var PaperScope = Base.extend({ - _class: 'PaperScope', - - initialize: function PaperScope() { - paper = this; - this.settings = new Base({ - applyMatrix: true, - handleSize: 4, - hitTolerance: 0 - }); - this.project = null; - this.projects = []; - this.tools = []; - this.palettes = []; - this._id = PaperScope._id++; - PaperScope._scopes[this._id] = this; - var proto = PaperScope.prototype; - if (!this.support) { - var ctx = CanvasProvider.getContext(1, 1); - proto.support = { - nativeDash: 'setLineDash' in ctx || 'mozDash' in ctx, - nativeBlendModes: BlendMode.nativeModes - }; - CanvasProvider.release(ctx); - } - - if (!this.browser) { - var agent = navigator.userAgent.toLowerCase(), - platform = (/(win)/.exec(agent) - || /(mac)/.exec(agent) - || /(linux)/.exec(agent) - || [])[0], - browser = proto.browser = { platform: platform }; - if (platform) - browser[platform] = true; - agent.replace( - /(opera|chrome|safari|webkit|firefox|msie|trident|atom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:([.\d]+))?/g, - function(all, n, v1, v2, rv) { - if (!browser.chrome) { - var v = n === 'opera' ? v2 : v1; - if (n === 'trident') { - v = rv; - n = 'msie'; - } - browser.version = v; - browser.versionNumber = parseFloat(v); - browser.name = n; - browser[n] = true; - } - } - ); - if (browser.chrome) - delete browser.webkit; - if (browser.atom) - delete browser.chrome; - } - }, - - version: "0.9.25", - - getView: function() { - return this.project && this.project.getView(); - }, - - getPaper: function() { - return this; - }, - - execute: function(code, url, options) { - paper.PaperScript.execute(code, this, url, options); - View.updateFocus(); - }, - - install: function(scope) { - var that = this; - Base.each(['project', 'view', 'tool'], function(key) { - Base.define(scope, key, { - configurable: true, - get: function() { - return that[key]; - } - }); - }); - for (var key in this) - if (!/^_/.test(key) && this[key]) - scope[key] = this[key]; - }, - - setup: function(element) { - paper = this; - this.project = new Project(element); - return this; - }, - - activate: function() { - paper = this; - }, - - clear: function() { - for (var i = this.projects.length - 1; i >= 0; i--) - this.projects[i].remove(); - for (var i = this.tools.length - 1; i >= 0; i--) - this.tools[i].remove(); - for (var i = this.palettes.length - 1; i >= 0; i--) - this.palettes[i].remove(); - }, - - remove: function() { - this.clear(); - delete PaperScope._scopes[this._id]; - }, - - statics: new function() { - function handleAttribute(name) { - name += 'Attribute'; - return function(el, attr) { - return el[name](attr) || el[name]('data-paper-' + attr); - }; - } - - return { - _scopes: {}, - _id: 0, - - get: function(id) { - return this._scopes[id] || null; - }, - - getAttribute: handleAttribute('get'), - hasAttribute: handleAttribute('has') - }; - } -}); - -var PaperScopeItem = Base.extend(Emitter, { - - initialize: function(activate) { - this._scope = paper; - this._index = this._scope[this._list].push(this) - 1; - if (activate || !this._scope[this._reference]) - this.activate(); - }, - - activate: function() { - if (!this._scope) - return false; - var prev = this._scope[this._reference]; - if (prev && prev !== this) - prev.emit('deactivate'); - this._scope[this._reference] = this; - this.emit('activate', prev); - return true; - }, - - isActive: function() { - return this._scope[this._reference] === this; - }, - - remove: function() { - if (this._index == null) - return false; - Base.splice(this._scope[this._list], null, this._index, 1); - if (this._scope[this._reference] == this) - this._scope[this._reference] = null; - this._scope = null; - return true; - } -}); - -var Formatter = Base.extend({ - initialize: function(precision) { - this.precision = precision || 5; - this.multiplier = Math.pow(10, this.precision); - }, - - number: function(val) { - return Math.round(val * this.multiplier) / this.multiplier; - }, - - pair: function(val1, val2, separator) { - return this.number(val1) + (separator || ',') + this.number(val2); - }, - - point: function(val, separator) { - return this.number(val.x) + (separator || ',') + this.number(val.y); - }, - - size: function(val, separator) { - return this.number(val.width) + (separator || ',') - + this.number(val.height); - }, - - rectangle: function(val, separator) { - return this.point(val, separator) + (separator || ',') - + this.size(val, separator); - } -}); - -Formatter.instance = new Formatter(); - -var Numerical = new function() { - - var abscissas = [ - [ 0.5773502691896257645091488], - [0,0.7745966692414833770358531], - [ 0.3399810435848562648026658,0.8611363115940525752239465], - [0,0.5384693101056830910363144,0.9061798459386639927976269], - [ 0.2386191860831969086305017,0.6612093864662645136613996,0.9324695142031520278123016], - [0,0.4058451513773971669066064,0.7415311855993944398638648,0.9491079123427585245261897], - [ 0.1834346424956498049394761,0.5255324099163289858177390,0.7966664774136267395915539,0.9602898564975362316835609], - [0,0.3242534234038089290385380,0.6133714327005903973087020,0.8360311073266357942994298,0.9681602395076260898355762], - [ 0.1488743389816312108848260,0.4333953941292471907992659,0.6794095682990244062343274,0.8650633666889845107320967,0.9739065285171717200779640], - [0,0.2695431559523449723315320,0.5190961292068118159257257,0.7301520055740493240934163,0.8870625997680952990751578,0.9782286581460569928039380], - [ 0.1252334085114689154724414,0.3678314989981801937526915,0.5873179542866174472967024,0.7699026741943046870368938,0.9041172563704748566784659,0.9815606342467192506905491], - [0,0.2304583159551347940655281,0.4484927510364468528779129,0.6423493394403402206439846,0.8015780907333099127942065,0.9175983992229779652065478,0.9841830547185881494728294], - [ 0.1080549487073436620662447,0.3191123689278897604356718,0.5152486363581540919652907,0.6872929048116854701480198,0.8272013150697649931897947,0.9284348836635735173363911,0.9862838086968123388415973], - [0,0.2011940939974345223006283,0.3941513470775633698972074,0.5709721726085388475372267,0.7244177313601700474161861,0.8482065834104272162006483,0.9372733924007059043077589,0.9879925180204854284895657], - [ 0.0950125098376374401853193,0.2816035507792589132304605,0.4580167776572273863424194,0.6178762444026437484466718,0.7554044083550030338951012,0.8656312023878317438804679,0.9445750230732325760779884,0.9894009349916499325961542] - ]; - - var weights = [ - [1], - [0.8888888888888888888888889,0.5555555555555555555555556], - [0.6521451548625461426269361,0.3478548451374538573730639], - [0.5688888888888888888888889,0.4786286704993664680412915,0.2369268850561890875142640], - [0.4679139345726910473898703,0.3607615730481386075698335,0.1713244923791703450402961], - [0.4179591836734693877551020,0.3818300505051189449503698,0.2797053914892766679014678,0.1294849661688696932706114], - [0.3626837833783619829651504,0.3137066458778872873379622,0.2223810344533744705443560,0.1012285362903762591525314], - [0.3302393550012597631645251,0.3123470770400028400686304,0.2606106964029354623187429,0.1806481606948574040584720,0.0812743883615744119718922], - [0.2955242247147528701738930,0.2692667193099963550912269,0.2190863625159820439955349,0.1494513491505805931457763,0.0666713443086881375935688], - [0.2729250867779006307144835,0.2628045445102466621806889,0.2331937645919904799185237,0.1862902109277342514260976,0.1255803694649046246346943,0.0556685671161736664827537], - [0.2491470458134027850005624,0.2334925365383548087608499,0.2031674267230659217490645,0.1600783285433462263346525,0.1069393259953184309602547,0.0471753363865118271946160], - [0.2325515532308739101945895,0.2262831802628972384120902,0.2078160475368885023125232,0.1781459807619457382800467,0.1388735102197872384636018,0.0921214998377284479144218,0.0404840047653158795200216], - [0.2152638534631577901958764,0.2051984637212956039659241,0.1855383974779378137417166,0.1572031671581935345696019,0.1215185706879031846894148,0.0801580871597602098056333,0.0351194603317518630318329], - [0.2025782419255612728806202,0.1984314853271115764561183,0.1861610000155622110268006,0.1662692058169939335532009,0.1395706779261543144478048,0.1071592204671719350118695,0.0703660474881081247092674,0.0307532419961172683546284], - [0.1894506104550684962853967,0.1826034150449235888667637,0.1691565193950025381893121,0.1495959888165767320815017,0.1246289712555338720524763,0.0951585116824927848099251,0.0622535239386478928628438,0.0271524594117540948517806] - ]; - - var abs = Math.abs, - sqrt = Math.sqrt, - pow = Math.pow, - EPSILON = 1e-12, - MACHINE_EPSILON = 1.12e-16; - - function clip(value, min, max) { - return value < min ? min : value > max ? max : value; - } - - return { - TOLERANCE: 1e-6, - EPSILON: EPSILON, - MACHINE_EPSILON: MACHINE_EPSILON, - CURVETIME_EPSILON: 4e-7, - GEOMETRIC_EPSILON: 2e-7, - WINDING_EPSILON: 2e-7, - TRIGONOMETRIC_EPSILON: 1e-7, - CLIPPING_EPSILON: 1e-7, - KAPPA: 4 * (sqrt(2) - 1) / 3, - - isZero: function(val) { - return val >= -EPSILON && val <= EPSILON; - }, - - integrate: function(f, a, b, n) { - var x = abscissas[n - 2], - w = weights[n - 2], - A = (b - a) * 0.5, - B = A + a, - i = 0, - m = (n + 1) >> 1, - sum = n & 1 ? w[i++] * f(B) : 0; - while (i < m) { - var Ax = A * x[i]; - sum += w[i++] * (f(B + Ax) + f(B - Ax)); - } - return A * sum; - }, - - findRoot: function(f, df, x, a, b, n, tolerance) { - for (var i = 0; i < n; i++) { - var fx = f(x), - dx = fx / df(x), - nx = x - dx; - if (abs(dx) < tolerance) - return nx; - if (fx > 0) { - b = x; - x = nx <= a ? (a + b) * 0.5 : nx; - } else { - a = x; - x = nx >= b ? (a + b) * 0.5 : nx; - } - } - return x; - }, - - solveQuadratic: function(a, b, c, roots, min, max) { - var count = 0, - eMin = min - EPSILON, - eMax = max + EPSILON, - x1, x2 = Infinity, - B = b, - D; - b /= -2; - D = b * b - a * c; - if (D !== 0 && abs(D) < MACHINE_EPSILON) { - var gmC = pow(abs(a * b * c), 1 / 3); - if (gmC < 1e-8) { - var mult = pow(10, - abs(Math.floor(Math.log(gmC) * Math.LOG10E))); - if (!isFinite(mult)) - mult = 0; - a *= mult; - b *= mult; - c *= mult; - D = b * b - a * c; - } - } - if (abs(a) < EPSILON) { - if (abs(B) < EPSILON) - return abs(c) < EPSILON ? -1 : 0; - x1 = -c / B; - } else if (D >= -MACHINE_EPSILON) { - var Q = D < 0 ? 0 : sqrt(D), - R = b + (b < 0 ? -Q : Q); - if (R === 0) { - x1 = c / a; - x2 = -x1; - } else { - x1 = R / a; - x2 = c / R; - } - } - if (isFinite(x1) && (min == null || x1 > eMin && x1 < eMax)) - roots[count++] = min == null ? x1 : clip(x1, min, max); - if (x2 !== x1 - && isFinite(x2) && (min == null || x2 > eMin && x2 < eMax)) - roots[count++] = min == null ? x2 : clip(x2, min, max); - return count; - }, - - solveCubic: function(a, b, c, d, roots, min, max) { - var count = 0, - x, b1, c2; - if (abs(a) < EPSILON) { - a = b; - b1 = c; - c2 = d; - x = Infinity; - } else if (abs(d) < EPSILON) { - b1 = b; - c2 = c; - x = 0; - } else { - var ec = 1 + MACHINE_EPSILON, - x0, q, qd, t, r, s, tmp; - x = -(b / a) / 3; - tmp = a * x, - b1 = tmp + b, - c2 = b1 * x + c, - qd = (tmp + b1) * x + c2, - q = c2 * x + d; - t = q /a; - r = pow(abs(t), 1/3); - s = t < 0 ? -1 : 1; - t = -qd / a; - r = t > 0 ? 1.3247179572 * Math.max(r, sqrt(t)) : r; - x0 = x - s * r; - if (x0 !== x) { - do { - x = x0; - tmp = a * x, - b1 = tmp + b, - c2 = b1 * x + c, - qd = (tmp + b1) * x + c2, - q = c2 * x + d; - x0 = qd === 0 ? x : x - q / qd / ec; - if (x0 === x) { - x = x0; - break; - } - } while (s * x0 > s * x); - if (abs(a) * x * x > abs(d / x)) { - c2 = -d / x; - b1 = (c2 - c) / x; - } - } - } - var count = Numerical.solveQuadratic(a, b1, c2, roots, min, max); - if (isFinite(x) && (count === 0 || x !== roots[count - 1]) - && (min == null || x > min - EPSILON && x < max + EPSILON)) - roots[count++] = min == null ? x : clip(x, min, max); - return count; - } - }; -}; - -var UID = { - _id: 1, - _pools: {}, - - get: function(ctor) { - if (ctor) { - var name = ctor._class, - pool = this._pools[name]; - if (!pool) - pool = this._pools[name] = { _id: 1 }; - return pool._id++; - } else { - return this._id++; - } - } -}; - -var Point = Base.extend({ - _class: 'Point', - _readIndex: true, - - initialize: function Point(arg0, arg1) { - var type = typeof arg0; - if (type === 'number') { - var hasY = typeof arg1 === 'number'; - this.x = arg0; - this.y = hasY ? arg1 : arg0; - if (this.__read) - this.__read = hasY ? 2 : 1; - } else if (type === 'undefined' || arg0 === null) { - this.x = this.y = 0; - if (this.__read) - this.__read = arg0 === null ? 1 : 0; - } else { - if (Array.isArray(arg0)) { - this.x = arg0[0]; - this.y = arg0.length > 1 ? arg0[1] : arg0[0]; - } else if (arg0.x != null) { - this.x = arg0.x; - this.y = arg0.y; - } else if (arg0.width != null) { - this.x = arg0.width; - this.y = arg0.height; - } else if (arg0.angle != null) { - this.x = arg0.length; - this.y = 0; - this.setAngle(arg0.angle); - } else { - this.x = this.y = 0; - if (this.__read) - this.__read = 0; - } - if (this.__read) - this.__read = 1; - } - }, - - set: function(x, y) { - this.x = x; - this.y = y; - return this; - }, - - equals: function(point) { - return this === point || point - && (this.x === point.x && this.y === point.y - || Array.isArray(point) - && this.x === point[0] && this.y === point[1]) - || false; - }, - - clone: function() { - return new Point(this.x, this.y); - }, - - toString: function() { - var f = Formatter.instance; - return '{ x: ' + f.number(this.x) + ', y: ' + f.number(this.y) + ' }'; - }, - - _serialize: function(options) { - var f = options.formatter; - return [f.number(this.x), f.number(this.y)]; - }, - - getLength: function() { - return Math.sqrt(this.x * this.x + this.y * this.y); - }, - - setLength: function(length) { - if (this.isZero()) { - var angle = this._angle || 0; - this.set( - Math.cos(angle) * length, - Math.sin(angle) * length - ); - } else { - var scale = length / this.getLength(); - if (Numerical.isZero(scale)) - this.getAngle(); - this.set( - this.x * scale, - this.y * scale - ); - } - }, - getAngle: function() { - return this.getAngleInRadians.apply(this, arguments) * 180 / Math.PI; - }, - - setAngle: function(angle) { - this.setAngleInRadians.call(this, angle * Math.PI / 180); - }, - - getAngleInDegrees: '#getAngle', - setAngleInDegrees: '#setAngle', - - getAngleInRadians: function() { - if (!arguments.length) { - return this.isZero() - ? this._angle || 0 - : this._angle = Math.atan2(this.y, this.x); - } else { - var point = Point.read(arguments), - div = this.getLength() * point.getLength(); - if (Numerical.isZero(div)) { - return NaN; - } else { - var a = this.dot(point) / div; - return Math.acos(a < -1 ? -1 : a > 1 ? 1 : a); - } - } - }, - - setAngleInRadians: function(angle) { - this._angle = angle; - if (!this.isZero()) { - var length = this.getLength(); - this.set( - Math.cos(angle) * length, - Math.sin(angle) * length - ); - } - }, - - getQuadrant: function() { - return this.x >= 0 ? this.y >= 0 ? 1 : 4 : this.y >= 0 ? 2 : 3; - } -}, { - beans: false, - - getDirectedAngle: function() { - var point = Point.read(arguments); - return Math.atan2(this.cross(point), this.dot(point)) * 180 / Math.PI; - }, - - getDistance: function() { - var point = Point.read(arguments), - x = point.x - this.x, - y = point.y - this.y, - d = x * x + y * y, - squared = Base.read(arguments); - return squared ? d : Math.sqrt(d); - }, - - normalize: function(length) { - if (length === undefined) - length = 1; - var current = this.getLength(), - scale = current !== 0 ? length / current : 0, - point = new Point(this.x * scale, this.y * scale); - if (scale >= 0) - point._angle = this._angle; - return point; - }, - - rotate: function(angle, center) { - if (angle === 0) - return this.clone(); - angle = angle * Math.PI / 180; - var point = center ? this.subtract(center) : this, - sin = Math.sin(angle), - cos = Math.cos(angle); - point = new Point( - point.x * cos - point.y * sin, - point.x * sin + point.y * cos - ); - return center ? point.add(center) : point; - }, - - transform: function(matrix) { - return matrix ? matrix._transformPoint(this) : this; - }, - - add: function() { - var point = Point.read(arguments); - return new Point(this.x + point.x, this.y + point.y); - }, - - subtract: function() { - var point = Point.read(arguments); - return new Point(this.x - point.x, this.y - point.y); - }, - - multiply: function() { - var point = Point.read(arguments); - return new Point(this.x * point.x, this.y * point.y); - }, - - divide: function() { - var point = Point.read(arguments); - return new Point(this.x / point.x, this.y / point.y); - }, - - modulo: function() { - var point = Point.read(arguments); - return new Point(this.x % point.x, this.y % point.y); - }, - - negate: function() { - return new Point(-this.x, -this.y); - }, - - isInside: function() { - return Rectangle.read(arguments).contains(this); - }, - - isClose: function() { - var point = Point.read(arguments), - tolerance = Base.read(arguments); - return this.getDistance(point) < tolerance; - }, - - isCollinear: function() { - var point = Point.read(arguments); - return Point.isCollinear(this.x, this.y, point.x, point.y); - }, - - isColinear: '#isCollinear', - - isOrthogonal: function() { - var point = Point.read(arguments); - return Point.isOrthogonal(this.x, this.y, point.x, point.y); - }, - - isZero: function() { - return Numerical.isZero(this.x) && Numerical.isZero(this.y); - }, - - isNaN: function() { - return isNaN(this.x) || isNaN(this.y); - }, - - dot: function() { - var point = Point.read(arguments); - return this.x * point.x + this.y * point.y; - }, - - cross: function() { - var point = Point.read(arguments); - return this.x * point.y - this.y * point.x; - }, - - project: function() { - var point = Point.read(arguments), - scale = point.isZero() ? 0 : this.dot(point) / point.dot(point); - return new Point( - point.x * scale, - point.y * scale - ); - }, - - statics: { - min: function() { - var point1 = Point.read(arguments), - point2 = Point.read(arguments); - return new Point( - Math.min(point1.x, point2.x), - Math.min(point1.y, point2.y) - ); - }, - - max: function() { - var point1 = Point.read(arguments), - point2 = Point.read(arguments); - return new Point( - Math.max(point1.x, point2.x), - Math.max(point1.y, point2.y) - ); - }, - - random: function() { - return new Point(Math.random(), Math.random()); - }, - - isCollinear: function(x1, y1, x2, y2) { - return Math.abs(x1 * y2 - y1 * x2) - <= Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)) - * 1e-7; - }, - - isOrthogonal: function(x1, y1, x2, y2) { - return Math.abs(x1 * x2 + y1 * y2) - <= Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)) - * 1e-7; - } - } -}, Base.each(['round', 'ceil', 'floor', 'abs'], function(name) { - var op = Math[name]; - this[name] = function() { - return new Point(op(this.x), op(this.y)); - }; -}, {})); - -var LinkedPoint = Point.extend({ - initialize: function Point(x, y, owner, setter) { - this._x = x; - this._y = y; - this._owner = owner; - this._setter = setter; - }, - - set: function(x, y, _dontNotify) { - this._x = x; - this._y = y; - if (!_dontNotify) - this._owner[this._setter](this); - return this; - }, - - getX: function() { - return this._x; - }, - - setX: function(x) { - this._x = x; - this._owner[this._setter](this); - }, - - getY: function() { - return this._y; - }, - - setY: function(y) { - this._y = y; - this._owner[this._setter](this); - } -}); - -var Size = Base.extend({ - _class: 'Size', - _readIndex: true, - - initialize: function Size(arg0, arg1) { - var type = typeof arg0; - if (type === 'number') { - var hasHeight = typeof arg1 === 'number'; - this.width = arg0; - this.height = hasHeight ? arg1 : arg0; - if (this.__read) - this.__read = hasHeight ? 2 : 1; - } else if (type === 'undefined' || arg0 === null) { - this.width = this.height = 0; - if (this.__read) - this.__read = arg0 === null ? 1 : 0; - } else { - if (Array.isArray(arg0)) { - this.width = arg0[0]; - this.height = arg0.length > 1 ? arg0[1] : arg0[0]; - } else if (arg0.width != null) { - this.width = arg0.width; - this.height = arg0.height; - } else if (arg0.x != null) { - this.width = arg0.x; - this.height = arg0.y; - } else { - this.width = this.height = 0; - if (this.__read) - this.__read = 0; - } - if (this.__read) - this.__read = 1; - } - }, - - set: function(width, height) { - this.width = width; - this.height = height; - return this; - }, - - equals: function(size) { - return size === this || size && (this.width === size.width - && this.height === size.height - || Array.isArray(size) && this.width === size[0] - && this.height === size[1]) || false; - }, - - clone: function() { - return new Size(this.width, this.height); - }, - - toString: function() { - var f = Formatter.instance; - return '{ width: ' + f.number(this.width) - + ', height: ' + f.number(this.height) + ' }'; - }, - - _serialize: function(options) { - var f = options.formatter; - return [f.number(this.width), - f.number(this.height)]; - }, - - add: function() { - var size = Size.read(arguments); - return new Size(this.width + size.width, this.height + size.height); - }, - - subtract: function() { - var size = Size.read(arguments); - return new Size(this.width - size.width, this.height - size.height); - }, - - multiply: function() { - var size = Size.read(arguments); - return new Size(this.width * size.width, this.height * size.height); - }, - - divide: function() { - var size = Size.read(arguments); - return new Size(this.width / size.width, this.height / size.height); - }, - - modulo: function() { - var size = Size.read(arguments); - return new Size(this.width % size.width, this.height % size.height); - }, - - negate: function() { - return new Size(-this.width, -this.height); - }, - - isZero: function() { - return Numerical.isZero(this.width) && Numerical.isZero(this.height); - }, - - isNaN: function() { - return isNaN(this.width) || isNaN(this.height); - }, - - statics: { - min: function(size1, size2) { - return new Size( - Math.min(size1.width, size2.width), - Math.min(size1.height, size2.height)); - }, - - max: function(size1, size2) { - return new Size( - Math.max(size1.width, size2.width), - Math.max(size1.height, size2.height)); - }, - - random: function() { - return new Size(Math.random(), Math.random()); - } - } -}, Base.each(['round', 'ceil', 'floor', 'abs'], function(name) { - var op = Math[name]; - this[name] = function() { - return new Size(op(this.width), op(this.height)); - }; -}, {})); - -var LinkedSize = Size.extend({ - initialize: function Size(width, height, owner, setter) { - this._width = width; - this._height = height; - this._owner = owner; - this._setter = setter; - }, - - set: function(width, height, _dontNotify) { - this._width = width; - this._height = height; - if (!_dontNotify) - this._owner[this._setter](this); - return this; - }, - - getWidth: function() { - return this._width; - }, - - setWidth: function(width) { - this._width = width; - this._owner[this._setter](this); - }, - - getHeight: function() { - return this._height; - }, - - setHeight: function(height) { - this._height = height; - this._owner[this._setter](this); - } -}); - -var Rectangle = Base.extend({ - _class: 'Rectangle', - _readIndex: true, - beans: true, - - initialize: function Rectangle(arg0, arg1, arg2, arg3) { - var type = typeof arg0, - read = 0; - if (type === 'number') { - this.x = arg0; - this.y = arg1; - this.width = arg2; - this.height = arg3; - read = 4; - } else if (type === 'undefined' || arg0 === null) { - this.x = this.y = this.width = this.height = 0; - read = arg0 === null ? 1 : 0; - } else if (arguments.length === 1) { - if (Array.isArray(arg0)) { - this.x = arg0[0]; - this.y = arg0[1]; - this.width = arg0[2]; - this.height = arg0[3]; - read = 1; - } else if (arg0.x !== undefined || arg0.width !== undefined) { - this.x = arg0.x || 0; - this.y = arg0.y || 0; - this.width = arg0.width || 0; - this.height = arg0.height || 0; - read = 1; - } else if (arg0.from === undefined && arg0.to === undefined) { - this.x = this.y = this.width = this.height = 0; - this._set(arg0); - read = 1; - } - } - if (!read) { - var point = Point.readNamed(arguments, 'from'), - next = Base.peek(arguments); - this.x = point.x; - this.y = point.y; - if (next && next.x !== undefined || Base.hasNamed(arguments, 'to')) { - var to = Point.readNamed(arguments, 'to'); - this.width = to.x - point.x; - this.height = to.y - point.y; - if (this.width < 0) { - this.x = to.x; - this.width = -this.width; - } - if (this.height < 0) { - this.y = to.y; - this.height = -this.height; - } - } else { - var size = Size.read(arguments); - this.width = size.width; - this.height = size.height; - } - read = arguments.__index; - } - if (this.__read) - this.__read = read; - }, - - set: function(x, y, width, height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - return this; - }, - - clone: function() { - return new Rectangle(this.x, this.y, this.width, this.height); - }, - - equals: function(rect) { - var rt = Base.isPlainValue(rect) - ? Rectangle.read(arguments) - : rect; - return rt === this - || rt && this.x === rt.x && this.y === rt.y - && this.width === rt.width && this.height === rt.height - || false; - }, - - toString: function() { - var f = Formatter.instance; - return '{ x: ' + f.number(this.x) - + ', y: ' + f.number(this.y) - + ', width: ' + f.number(this.width) - + ', height: ' + f.number(this.height) - + ' }'; - }, - - _serialize: function(options) { - var f = options.formatter; - return [f.number(this.x), - f.number(this.y), - f.number(this.width), - f.number(this.height)]; - }, - - getPoint: function(_dontLink) { - var ctor = _dontLink ? Point : LinkedPoint; - return new ctor(this.x, this.y, this, 'setPoint'); - }, - - setPoint: function() { - var point = Point.read(arguments); - this.x = point.x; - this.y = point.y; - }, - - getSize: function(_dontLink) { - var ctor = _dontLink ? Size : LinkedSize; - return new ctor(this.width, this.height, this, 'setSize'); - }, - - setSize: function() { - var size = Size.read(arguments); - if (this._fixX) - this.x += (this.width - size.width) * this._fixX; - if (this._fixY) - this.y += (this.height - size.height) * this._fixY; - this.width = size.width; - this.height = size.height; - this._fixW = 1; - this._fixH = 1; - }, - - getLeft: function() { - return this.x; - }, - - setLeft: function(left) { - if (!this._fixW) - this.width -= left - this.x; - this.x = left; - this._fixX = 0; - }, - - getTop: function() { - return this.y; - }, - - setTop: function(top) { - if (!this._fixH) - this.height -= top - this.y; - this.y = top; - this._fixY = 0; - }, - - getRight: function() { - return this.x + this.width; - }, - - setRight: function(right) { - if (this._fixX !== undefined && this._fixX !== 1) - this._fixW = 0; - if (this._fixW) - this.x = right - this.width; - else - this.width = right - this.x; - this._fixX = 1; - }, - - getBottom: function() { - return this.y + this.height; - }, - - setBottom: function(bottom) { - if (this._fixY !== undefined && this._fixY !== 1) - this._fixH = 0; - if (this._fixH) - this.y = bottom - this.height; - else - this.height = bottom - this.y; - this._fixY = 1; - }, - - getCenterX: function() { - return this.x + this.width * 0.5; - }, - - setCenterX: function(x) { - this.x = x - this.width * 0.5; - this._fixX = 0.5; - }, - - getCenterY: function() { - return this.y + this.height * 0.5; - }, - - setCenterY: function(y) { - this.y = y - this.height * 0.5; - this._fixY = 0.5; - }, - - getCenter: function(_dontLink) { - var ctor = _dontLink ? Point : LinkedPoint; - return new ctor(this.getCenterX(), this.getCenterY(), this, 'setCenter'); - }, - - setCenter: function() { - var point = Point.read(arguments); - this.setCenterX(point.x); - this.setCenterY(point.y); - return this; - }, - - getArea: function() { - return this.width * this.height; - }, - - isEmpty: function() { - return this.width === 0 || this.height === 0; - }, - - contains: function(arg) { - return arg && arg.width !== undefined - || (Array.isArray(arg) ? arg : arguments).length == 4 - ? this._containsRectangle(Rectangle.read(arguments)) - : this._containsPoint(Point.read(arguments)); - }, - - _containsPoint: function(point) { - var x = point.x, - y = point.y; - return x >= this.x && y >= this.y - && x <= this.x + this.width - && y <= this.y + this.height; - }, - - _containsRectangle: function(rect) { - var x = rect.x, - y = rect.y; - return x >= this.x && y >= this.y - && x + rect.width <= this.x + this.width - && y + rect.height <= this.y + this.height; - }, - - intersects: function() { - var rect = Rectangle.read(arguments); - return rect.x + rect.width > this.x - && rect.y + rect.height > this.y - && rect.x < this.x + this.width - && rect.y < this.y + this.height; - }, - - touches: function() { - var rect = Rectangle.read(arguments); - return rect.x + rect.width >= this.x - && rect.y + rect.height >= this.y - && rect.x <= this.x + this.width - && rect.y <= this.y + this.height; - }, - - intersect: function() { - var rect = Rectangle.read(arguments), - x1 = Math.max(this.x, rect.x), - y1 = Math.max(this.y, rect.y), - x2 = Math.min(this.x + this.width, rect.x + rect.width), - y2 = Math.min(this.y + this.height, rect.y + rect.height); - return new Rectangle(x1, y1, x2 - x1, y2 - y1); - }, - - unite: function() { - var rect = Rectangle.read(arguments), - x1 = Math.min(this.x, rect.x), - y1 = Math.min(this.y, rect.y), - x2 = Math.max(this.x + this.width, rect.x + rect.width), - y2 = Math.max(this.y + this.height, rect.y + rect.height); - return new Rectangle(x1, y1, x2 - x1, y2 - y1); - }, - - include: function() { - var point = Point.read(arguments); - var x1 = Math.min(this.x, point.x), - y1 = Math.min(this.y, point.y), - x2 = Math.max(this.x + this.width, point.x), - y2 = Math.max(this.y + this.height, point.y); - return new Rectangle(x1, y1, x2 - x1, y2 - y1); - }, - - expand: function() { - var amount = Size.read(arguments), - hor = amount.width, - ver = amount.height; - return new Rectangle(this.x - hor / 2, this.y - ver / 2, - this.width + hor, this.height + ver); - }, - - scale: function(hor, ver) { - return this.expand(this.width * hor - this.width, - this.height * (ver === undefined ? hor : ver) - this.height); - } -}, Base.each([ - ['Top', 'Left'], ['Top', 'Right'], - ['Bottom', 'Left'], ['Bottom', 'Right'], - ['Left', 'Center'], ['Top', 'Center'], - ['Right', 'Center'], ['Bottom', 'Center'] - ], - function(parts, index) { - var part = parts.join(''); - var xFirst = /^[RL]/.test(part); - if (index >= 4) - parts[1] += xFirst ? 'Y' : 'X'; - var x = parts[xFirst ? 0 : 1], - y = parts[xFirst ? 1 : 0], - getX = 'get' + x, - getY = 'get' + y, - setX = 'set' + x, - setY = 'set' + y, - get = 'get' + part, - set = 'set' + part; - this[get] = function(_dontLink) { - var ctor = _dontLink ? Point : LinkedPoint; - return new ctor(this[getX](), this[getY](), this, set); - }; - this[set] = function() { - var point = Point.read(arguments); - this[setX](point.x); - this[setY](point.y); - }; - }, { - beans: true - } -)); - -var LinkedRectangle = Rectangle.extend({ - initialize: function Rectangle(x, y, width, height, owner, setter) { - this.set(x, y, width, height, true); - this._owner = owner; - this._setter = setter; - }, - - set: function(x, y, width, height, _dontNotify) { - this._x = x; - this._y = y; - this._width = width; - this._height = height; - if (!_dontNotify) - this._owner[this._setter](this); - return this; - } -}, -new function() { - var proto = Rectangle.prototype; - - return Base.each(['x', 'y', 'width', 'height'], function(key) { - var part = Base.capitalize(key); - var internal = '_' + key; - this['get' + part] = function() { - return this[internal]; - }; - - this['set' + part] = function(value) { - this[internal] = value; - if (!this._dontNotify) - this._owner[this._setter](this); - }; - }, Base.each(['Point', 'Size', 'Center', - 'Left', 'Top', 'Right', 'Bottom', 'CenterX', 'CenterY', - 'TopLeft', 'TopRight', 'BottomLeft', 'BottomRight', - 'LeftCenter', 'TopCenter', 'RightCenter', 'BottomCenter'], - function(key) { - var name = 'set' + key; - this[name] = function() { - this._dontNotify = true; - proto[name].apply(this, arguments); - this._dontNotify = false; - this._owner[this._setter](this); - }; - }, { - isSelected: function() { - return this._owner._boundsSelected; - }, - - setSelected: function(selected) { - var owner = this._owner; - if (owner.setSelected) { - owner._boundsSelected = selected; - owner.setSelected(selected || owner._selectedSegmentState > 0); - } - } - }) - ); -}); - -var Matrix = Base.extend({ - _class: 'Matrix', - - initialize: function Matrix(arg) { - var count = arguments.length, - ok = true; - if (count === 6) { - this.set.apply(this, arguments); - } else if (count === 1) { - if (arg instanceof Matrix) { - this.set(arg._a, arg._c, arg._b, arg._d, arg._tx, arg._ty); - } else if (Array.isArray(arg)) { - this.set.apply(this, arg); - } else { - ok = false; - } - } else if (count === 0) { - this.reset(); - } else { - ok = false; - } - if (!ok) - throw new Error('Unsupported matrix parameters'); - }, - - set: function(a, c, b, d, tx, ty, _dontNotify) { - this._a = a; - this._c = c; - this._b = b; - this._d = d; - this._tx = tx; - this._ty = ty; - if (!_dontNotify) - this._changed(); - return this; - }, - - _serialize: function(options) { - return Base.serialize(this.getValues(), options); - }, - - _changed: function() { - var owner = this._owner; - if (owner) { - if (owner._applyMatrix) { - owner.transform(null, true); - } else { - owner._changed(9); - } - } - }, - - clone: function() { - return new Matrix(this._a, this._c, this._b, this._d, - this._tx, this._ty); - }, - - equals: function(mx) { - return mx === this || mx && this._a === mx._a && this._b === mx._b - && this._c === mx._c && this._d === mx._d - && this._tx === mx._tx && this._ty === mx._ty - || false; - }, - - toString: function() { - var f = Formatter.instance; - return '[[' + [f.number(this._a), f.number(this._b), - f.number(this._tx)].join(', ') + '], [' - + [f.number(this._c), f.number(this._d), - f.number(this._ty)].join(', ') + ']]'; - }, - - reset: function(_dontNotify) { - this._a = this._d = 1; - this._c = this._b = this._tx = this._ty = 0; - if (!_dontNotify) - this._changed(); - return this; - }, - - apply: function(recursively, _setApplyMatrix) { - var owner = this._owner; - if (owner) { - owner.transform(null, true, Base.pick(recursively, true), - _setApplyMatrix); - return this.isIdentity(); - } - return false; - }, - - translate: function() { - var point = Point.read(arguments), - x = point.x, - y = point.y; - this._tx += x * this._a + y * this._b; - this._ty += x * this._c + y * this._d; - this._changed(); - return this; - }, - - scale: function() { - var scale = Point.read(arguments), - center = Point.read(arguments, 0, { readNull: true }); - if (center) - this.translate(center); - this._a *= scale.x; - this._c *= scale.x; - this._b *= scale.y; - this._d *= scale.y; - if (center) - this.translate(center.negate()); - this._changed(); - return this; - }, - - rotate: function(angle ) { - angle *= Math.PI / 180; - var center = Point.read(arguments, 1), - x = center.x, - y = center.y, - cos = Math.cos(angle), - sin = Math.sin(angle), - tx = x - x * cos + y * sin, - ty = y - x * sin - y * cos, - a = this._a, - b = this._b, - c = this._c, - d = this._d; - this._a = cos * a + sin * b; - this._b = -sin * a + cos * b; - this._c = cos * c + sin * d; - this._d = -sin * c + cos * d; - this._tx += tx * a + ty * b; - this._ty += tx * c + ty * d; - this._changed(); - return this; - }, - - shear: function() { - var shear = Point.read(arguments), - center = Point.read(arguments, 0, { readNull: true }); - if (center) - this.translate(center); - var a = this._a, - c = this._c; - this._a += shear.y * this._b; - this._c += shear.y * this._d; - this._b += shear.x * a; - this._d += shear.x * c; - if (center) - this.translate(center.negate()); - this._changed(); - return this; - }, - - skew: function() { - var skew = Point.read(arguments), - center = Point.read(arguments, 0, { readNull: true }), - toRadians = Math.PI / 180, - shear = new Point(Math.tan(skew.x * toRadians), - Math.tan(skew.y * toRadians)); - return this.shear(shear, center); - }, - - concatenate: function(mx) { - var a1 = this._a, - b1 = this._b, - c1 = this._c, - d1 = this._d, - a2 = mx._a, - b2 = mx._b, - c2 = mx._c, - d2 = mx._d, - tx2 = mx._tx, - ty2 = mx._ty; - this._a = a2 * a1 + c2 * b1; - this._b = b2 * a1 + d2 * b1; - this._c = a2 * c1 + c2 * d1; - this._d = b2 * c1 + d2 * d1; - this._tx += tx2 * a1 + ty2 * b1; - this._ty += tx2 * c1 + ty2 * d1; - this._changed(); - return this; - }, - - preConcatenate: function(mx) { - var a1 = this._a, - b1 = this._b, - c1 = this._c, - d1 = this._d, - tx1 = this._tx, - ty1 = this._ty, - a2 = mx._a, - b2 = mx._b, - c2 = mx._c, - d2 = mx._d, - tx2 = mx._tx, - ty2 = mx._ty; - this._a = a2 * a1 + b2 * c1; - this._b = a2 * b1 + b2 * d1; - this._c = c2 * a1 + d2 * c1; - this._d = c2 * b1 + d2 * d1; - this._tx = a2 * tx1 + b2 * ty1 + tx2; - this._ty = c2 * tx1 + d2 * ty1 + ty2; - this._changed(); - return this; - }, - - chain: function(mx) { - var a1 = this._a, - b1 = this._b, - c1 = this._c, - d1 = this._d, - tx1 = this._tx, - ty1 = this._ty, - a2 = mx._a, - b2 = mx._b, - c2 = mx._c, - d2 = mx._d, - tx2 = mx._tx, - ty2 = mx._ty; - return new Matrix( - a2 * a1 + c2 * b1, - a2 * c1 + c2 * d1, - b2 * a1 + d2 * b1, - b2 * c1 + d2 * d1, - tx1 + tx2 * a1 + ty2 * b1, - ty1 + tx2 * c1 + ty2 * d1); - }, - - isIdentity: function() { - return this._a === 1 && this._c === 0 && this._b === 0 && this._d === 1 - && this._tx === 0 && this._ty === 0; - }, - - orNullIfIdentity: function() { - return this.isIdentity() ? null : this; - }, - - isInvertible: function() { - return !!this._getDeterminant(); - }, - - isSingular: function() { - return !this._getDeterminant(); - }, - - transform: function( src, dst, count) { - return arguments.length < 3 - ? this._transformPoint(Point.read(arguments)) - : this._transformCoordinates(src, dst, count); - }, - - _transformPoint: function(point, dest, _dontNotify) { - var x = point.x, - y = point.y; - if (!dest) - dest = new Point(); - return dest.set( - x * this._a + y * this._b + this._tx, - x * this._c + y * this._d + this._ty, - _dontNotify - ); - }, - - _transformCoordinates: function(src, dst, count) { - var i = 0, - j = 0, - max = 2 * count; - while (i < max) { - var x = src[i++], - y = src[i++]; - dst[j++] = x * this._a + y * this._b + this._tx; - dst[j++] = x * this._c + y * this._d + this._ty; - } - return dst; - }, - - _transformCorners: function(rect) { - var x1 = rect.x, - y1 = rect.y, - x2 = x1 + rect.width, - y2 = y1 + rect.height, - coords = [ x1, y1, x2, y1, x2, y2, x1, y2 ]; - return this._transformCoordinates(coords, coords, 4); - }, - - _transformBounds: function(bounds, dest, _dontNotify) { - var coords = this._transformCorners(bounds), - min = coords.slice(0, 2), - max = min.slice(); - for (var i = 2; i < 8; i++) { - var val = coords[i], - j = i & 1; - if (val < min[j]) - min[j] = val; - else if (val > max[j]) - max[j] = val; - } - if (!dest) - dest = new Rectangle(); - return dest.set(min[0], min[1], max[0] - min[0], max[1] - min[1], - _dontNotify); - }, - - inverseTransform: function() { - return this._inverseTransform(Point.read(arguments)); - }, - - _getDeterminant: function() { - var det = this._a * this._d - this._b * this._c; - return isFinite(det) && !Numerical.isZero(det) - && isFinite(this._tx) && isFinite(this._ty) - ? det : null; - }, - - _inverseTransform: function(point, dest, _dontNotify) { - var det = this._getDeterminant(); - if (!det) - return null; - var x = point.x - this._tx, - y = point.y - this._ty; - if (!dest) - dest = new Point(); - return dest.set( - (x * this._d - y * this._b) / det, - (y * this._a - x * this._c) / det, - _dontNotify - ); - }, - - decompose: function() { - var a = this._a, b = this._b, c = this._c, d = this._d; - if (Numerical.isZero(a * d - b * c)) - return null; - - var scaleX = Math.sqrt(a * a + b * b); - a /= scaleX; - b /= scaleX; - - var shear = a * c + b * d; - c -= a * shear; - d -= b * shear; - - var scaleY = Math.sqrt(c * c + d * d); - c /= scaleY; - d /= scaleY; - shear /= scaleY; - - if (a * d < b * c) { - a = -a; - b = -b; - shear = -shear; - scaleX = -scaleX; - } - - return { - scaling: new Point(scaleX, scaleY), - rotation: -Math.atan2(b, a) * 180 / Math.PI, - shearing: shear - }; - }, - - getValues: function() { - return [ this._a, this._c, this._b, this._d, this._tx, this._ty ]; - }, - - getTranslation: function() { - return new Point(this._tx, this._ty); - }, - - getScaling: function() { - return (this.decompose() || {}).scaling; - }, - - getRotation: function() { - return (this.decompose() || {}).rotation; - }, - - inverted: function() { - var det = this._getDeterminant(); - return det && new Matrix( - this._d / det, - -this._c / det, - -this._b / det, - this._a / det, - (this._b * this._ty - this._d * this._tx) / det, - (this._c * this._tx - this._a * this._ty) / det); - }, - - shiftless: function() { - return new Matrix(this._a, this._c, this._b, this._d, 0, 0); - }, - - applyToContext: function(ctx) { - ctx.transform(this._a, this._c, this._b, this._d, this._tx, this._ty); - } -}, Base.each(['a', 'c', 'b', 'd', 'tx', 'ty'], function(name) { - var part = Base.capitalize(name), - prop = '_' + name; - this['get' + part] = function() { - return this[prop]; - }; - this['set' + part] = function(value) { - this[prop] = value; - this._changed(); - }; -}, {})); - -var Line = Base.extend({ - _class: 'Line', - - initialize: function Line(arg0, arg1, arg2, arg3, arg4) { - var asVector = false; - if (arguments.length >= 4) { - this._px = arg0; - this._py = arg1; - this._vx = arg2; - this._vy = arg3; - asVector = arg4; - } else { - this._px = arg0.x; - this._py = arg0.y; - this._vx = arg1.x; - this._vy = arg1.y; - asVector = arg2; - } - if (!asVector) { - this._vx -= this._px; - this._vy -= this._py; - } - }, - - getPoint: function() { - return new Point(this._px, this._py); - }, - - getVector: function() { - return new Point(this._vx, this._vy); - }, - - getLength: function() { - return this.getVector().getLength(); - }, - - intersect: function(line, isInfinite) { - return Line.intersect( - this._px, this._py, this._vx, this._vy, - line._px, line._py, line._vx, line._vy, - true, isInfinite); - }, - - getSide: function(point, isInfinite) { - return Line.getSide( - this._px, this._py, this._vx, this._vy, - point.x, point.y, true, isInfinite); - }, - - getDistance: function(point) { - return Math.abs(Line.getSignedDistance( - this._px, this._py, this._vx, this._vy, - point.x, point.y, true)); - }, - - isCollinear: function(line) { - return Point.isCollinear(this._vx, this._vy, line._vx, line._vy); - }, - - isOrthogonal: function(line) { - return Point.isOrthogonal(this._vx, this._vy, line._vx, line._vy); - }, - - statics: { - intersect: function(p1x, p1y, v1x, v1y, p2x, p2y, v2x, v2y, asVector, - isInfinite) { - if (!asVector) { - v1x -= p1x; - v1y -= p1y; - v2x -= p2x; - v2y -= p2y; - } - var cross = v1x * v2y - v1y * v2x; - if (!Numerical.isZero(cross)) { - var dx = p1x - p2x, - dy = p1y - p2y, - u1 = (v2x * dy - v2y * dx) / cross, - u2 = (v1x * dy - v1y * dx) / cross, - epsilon = 1e-12, - uMin = -epsilon, - uMax = 1 + epsilon; - if (isInfinite - || uMin < u1 && u1 < uMax && uMin < u2 && u2 < uMax) { - if (!isInfinite) { - u1 = u1 <= 0 ? 0 : u1 >= 1 ? 1 : u1; - } - return new Point( - p1x + u1 * v1x, - p1y + u1 * v1y); - } - } - }, - - getSide: function(px, py, vx, vy, x, y, asVector, isInfinite) { - if (!asVector) { - vx -= px; - vy -= py; - } - var v2x = x - px, - v2y = y - py, - ccw = v2x * vy - v2y * vx; - if (ccw === 0 && !isInfinite) { - ccw = (v2x * vx + v2x * vx) / (vx * vx + vy * vy); - if (ccw >= 0 && ccw <= 1) - ccw = 0; - } - return ccw < 0 ? -1 : ccw > 0 ? 1 : 0; - }, - - getSignedDistance: function(px, py, vx, vy, x, y, asVector) { - if (!asVector) { - vx -= px; - vy -= py; - } - return vx === 0 ? vy > 0 ? x - px : px - x - : vy === 0 ? vx < 0 ? y - py : py - y - : ((x-px) * vy - (y-py) * vx) / Math.sqrt(vx * vx + vy * vy); - } - } -}); - -var Project = PaperScopeItem.extend({ - _class: 'Project', - _list: 'projects', - _reference: 'project', - - initialize: function Project(element) { - PaperScopeItem.call(this, true); - this.layers = []; - this._activeLayer = null; - this.symbols = []; - this._currentStyle = new Style(null, null, this); - this._view = View.create(this, - element || CanvasProvider.getCanvas(1, 1)); - this._selectedItems = {}; - this._selectedItemCount = 0; - this._updateVersion = 0; - }, - - _serialize: function(options, dictionary) { - return Base.serialize(this.layers, options, true, dictionary); - }, - - clear: function() { - for (var i = this.layers.length - 1; i >= 0; i--) - this.layers[i].remove(); - this.symbols = []; - }, - - isEmpty: function() { - return this.layers.length === 0; - }, - - remove: function remove() { - if (!remove.base.call(this)) - return false; - if (this._view) - this._view.remove(); - return true; - }, - - getView: function() { - return this._view; - }, - - getCurrentStyle: function() { - return this._currentStyle; - }, - - setCurrentStyle: function(style) { - this._currentStyle.initialize(style); - }, - - getIndex: function() { - return this._index; - }, - - getOptions: function() { - return this._scope.settings; - }, - - getActiveLayer: function() { - return this._activeLayer || new Layer({ project: this }); - }, - - getSelectedItems: function() { - var items = []; - for (var id in this._selectedItems) { - var item = this._selectedItems[id]; - if (item.isInserted()) - items.push(item); - } - return items; - }, - - insertChild: function(index, item, _preserve) { - if (item instanceof Layer) { - item._remove(false, true); - Base.splice(this.layers, [item], index, 0); - item._setProject(this, true); - if (this._changes) - item._changed(5); - if (!this._activeLayer) - this._activeLayer = item; - } else if (item instanceof Item) { - (this._activeLayer - || this.insertChild(index, new Layer(Item.NO_INSERT))) - .insertChild(index, item, _preserve); - } else { - item = null; - } - return item; - }, - - addChild: function(item, _preserve) { - return this.insertChild(undefined, item, _preserve); - }, - - _updateSelection: function(item) { - var id = item._id, - selectedItems = this._selectedItems; - if (item._selected) { - if (selectedItems[id] !== item) { - this._selectedItemCount++; - selectedItems[id] = item; - } - } else if (selectedItems[id] === item) { - this._selectedItemCount--; - delete selectedItems[id]; - } - }, - - selectAll: function() { - var layers = this.layers; - for (var i = 0, l = layers.length; i < l; i++) - layers[i].setFullySelected(true); - }, - - deselectAll: function() { - var selectedItems = this._selectedItems; - for (var i in selectedItems) - selectedItems[i].setFullySelected(false); - }, - - hitTest: function() { - var point = Point.read(arguments), - options = HitResult.getOptions(Base.read(arguments)); - for (var i = this.layers.length - 1; i >= 0; i--) { - var res = this.layers[i]._hitTest(point, options); - if (res) return res; - } - return null; - }, - - getItems: function(match) { - return Item._getItems(this.layers, match); - }, - - getItem: function(match) { - return Item._getItems(this.layers, match, null, null, true)[0] || null; - }, - - importJSON: function(json) { - this.activate(); - var layer = this._activeLayer; - return Base.importJSON(json, layer && layer.isEmpty() && layer); - }, - - draw: function(ctx, matrix, pixelRatio) { - this._updateVersion++; - ctx.save(); - matrix.applyToContext(ctx); - var param = new Base({ - offset: new Point(0, 0), - pixelRatio: pixelRatio, - viewMatrix: matrix.isIdentity() ? null : matrix, - matrices: [new Matrix()], - updateMatrix: true - }); - for (var i = 0, layers = this.layers, l = layers.length; i < l; i++) - layers[i].draw(ctx, param); - ctx.restore(); - - if (this._selectedItemCount > 0) { - ctx.save(); - ctx.strokeWidth = 1; - var items = this._selectedItems, - size = this._scope.settings.handleSize, - version = this._updateVersion; - for (var id in items) - items[id]._drawSelection(ctx, matrix, size, items, version); - ctx.restore(); - } - } -}); - -var Symbol = Base.extend({ - _class: 'Symbol', - - initialize: function Symbol(item, dontCenter) { - this._id = UID.get(); - this.project = paper.project; - this.project.symbols.push(this); - if (item) - this.setDefinition(item, dontCenter); - }, - - _serialize: function(options, dictionary) { - return dictionary.add(this, function() { - return Base.serialize([this._class, this._definition], - options, false, dictionary); - }); - }, - - _changed: function(flags) { - if (flags & 8) { - Item._clearBoundsCache(this); - } - if (flags & 1) { - this.project._needsUpdate = true; - } - }, - - getDefinition: function() { - return this._definition; - }, - - setDefinition: function(item, _dontCenter) { - if (item._parentSymbol) - item = item.clone(); - if (this._definition) - this._definition._parentSymbol = null; - this._definition = item; - item.remove(); - item.setSelected(false); - if (!_dontCenter) - item.setPosition(new Point()); - item._parentSymbol = this; - this._changed(9); - }, - - place: function(position) { - return new PlacedSymbol(this, position); - }, - - clone: function() { - return new Symbol(this._definition.clone(false)); - }, - - equals: function(symbol) { - return symbol === this - || symbol && this.definition.equals(symbol.definition) - || false; - } -}); - -var Item = Base.extend(Emitter, { - statics: { - extend: function extend(src) { - if (src._serializeFields) - src._serializeFields = new Base( - this.prototype._serializeFields, src._serializeFields); - return extend.base.apply(this, arguments); - }, - - NO_INSERT: { insert: false } - }, - - _class: 'Item', - _applyMatrix: true, - _canApplyMatrix: true, - _boundsSelected: false, - _selectChildren: false, - _serializeFields: { - name: null, - applyMatrix: null, - matrix: new Matrix(), - pivot: null, - locked: false, - visible: true, - blendMode: 'normal', - opacity: 1, - guide: false, - selected: false, - clipMask: false, - data: {} - }, - - initialize: function Item() { - }, - - _initialize: function(props, point) { - var hasProps = props && Base.isPlainObject(props), - internal = hasProps && props.internal === true, - matrix = this._matrix = new Matrix(), - project = hasProps && props.project || paper.project; - if (!internal) - this._id = UID.get(); - this._applyMatrix = this._canApplyMatrix && paper.settings.applyMatrix; - if (point) - matrix.translate(point); - matrix._owner = this; - this._style = new Style(project._currentStyle, this, project); - if (!this._project) { - if (internal || hasProps && props.insert === false) { - this._setProject(project); - } else if (hasProps && props.parent) { - this.setParent(props.parent); - } else { - (project._activeLayer || new Layer()).addChild(this); - } - } - if (hasProps && props !== Item.NO_INSERT) - this._set(props, { insert: true, project: true, parent: true }, - true); - return hasProps; - }, - - _events: Base.each(['onMouseDown', 'onMouseUp', 'onMouseDrag', 'onClick', - 'onDoubleClick', 'onMouseMove', 'onMouseEnter', 'onMouseLeave'], - function(name) { - this[name] = { - install: function(type) { - this.getView()._installEvent(type); - }, - - uninstall: function(type) { - this.getView()._uninstallEvent(type); - } - }; - }, { - onFrame: { - install: function() { - this.getView()._animateItem(this, true); - }, - - uninstall: function() { - this.getView()._animateItem(this, false); - } - }, - - onLoad: {} - } - ), - - _serialize: function(options, dictionary) { - var props = {}, - that = this; - - function serialize(fields) { - for (var key in fields) { - var value = that[key]; - if (!Base.equals(value, key === 'leading' - ? fields.fontSize * 1.2 : fields[key])) { - props[key] = Base.serialize(value, options, - key !== 'data', dictionary); - } - } - } - - serialize(this._serializeFields); - if (!(this instanceof Group)) - serialize(this._style._defaults); - return [ this._class, props ]; - }, - - _changed: function(flags) { - var symbol = this._parentSymbol, - cacheParent = this._parent || symbol, - project = this._project; - if (flags & 8) { - this._bounds = this._position = this._decomposed = - this._globalMatrix = this._currentPath = undefined; - } - if (cacheParent - && (flags & 40)) { - Item._clearBoundsCache(cacheParent); - } - if (flags & 2) { - Item._clearBoundsCache(this); - } - if (project) { - if (flags & 1) { - project._needsUpdate = true; - } - if (project._changes) { - var entry = project._changesById[this._id]; - if (entry) { - entry.flags |= flags; - } else { - entry = { item: this, flags: flags }; - project._changesById[this._id] = entry; - project._changes.push(entry); - } - } - } - if (symbol) - symbol._changed(flags); - }, - - set: function(props) { - if (props) - this._set(props); - return this; - }, - - getId: function() { - return this._id; - }, - - getName: function() { - return this._name; - }, - - setName: function(name, unique) { - - if (this._name) - this._removeNamed(); - if (name === (+name) + '') - throw new Error( - 'Names consisting only of numbers are not supported.'); - var parent = this._parent; - if (name && parent) { - var children = parent._children, - namedChildren = parent._namedChildren, - orig = name, - i = 1; - while (unique && children[name]) - name = orig + ' ' + (i++); - (namedChildren[name] = namedChildren[name] || []).push(this); - children[name] = this; - } - this._name = name || undefined; - this._changed(128); - }, - - getStyle: function() { - return this._style; - }, - - setStyle: function(style) { - this.getStyle().set(style); - } -}, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'], - function(name) { - var part = Base.capitalize(name), - name = '_' + name; - this['get' + part] = function() { - return this[name]; - }; - this['set' + part] = function(value) { - if (value != this[name]) { - this[name] = value; - this._changed(name === '_locked' - ? 128 : 129); - } - }; - }, -{}), { - beans: true, - - _locked: false, - - _visible: true, - - _blendMode: 'normal', - - _opacity: 1, - - _guide: false, - - isSelected: function() { - if (this._selectChildren) { - var children = this._children; - for (var i = 0, l = children.length; i < l; i++) - if (children[i].isSelected()) - return true; - } - return this._selected; - }, - - setSelected: function(selected, noChildren) { - if (!noChildren && this._selectChildren) { - var children = this._children; - for (var i = 0, l = children.length; i < l; i++) - children[i].setSelected(selected); - } - if ((selected = !!selected) ^ this._selected) { - this._selected = selected; - this._project._updateSelection(this); - this._changed(129); - } - }, - - _selected: false, - - isFullySelected: function() { - var children = this._children; - if (children && this._selected) { - for (var i = 0, l = children.length; i < l; i++) - if (!children[i].isFullySelected()) - return false; - return true; - } - return this._selected; - }, - - setFullySelected: function(selected) { - var children = this._children; - if (children) { - for (var i = 0, l = children.length; i < l; i++) - children[i].setFullySelected(selected); - } - this.setSelected(selected, true); - }, - - isClipMask: function() { - return this._clipMask; - }, - - setClipMask: function(clipMask) { - if (this._clipMask != (clipMask = !!clipMask)) { - this._clipMask = clipMask; - if (clipMask) { - this.setFillColor(null); - this.setStrokeColor(null); - } - this._changed(129); - if (this._parent) - this._parent._changed(1024); - } - }, - - _clipMask: false, - - getData: function() { - if (!this._data) - this._data = {}; - return this._data; - }, - - setData: function(data) { - this._data = data; - }, - - getPosition: function(_dontLink) { - var position = this._position, - ctor = _dontLink ? Point : LinkedPoint; - if (!position) { - var pivot = this._pivot; - position = this._position = pivot - ? this._matrix._transformPoint(pivot) - : this.getBounds().getCenter(true); - } - return new ctor(position.x, position.y, this, 'setPosition'); - }, - - setPosition: function() { - this.translate(Point.read(arguments).subtract(this.getPosition(true))); - }, - - getPivot: function(_dontLink) { - var pivot = this._pivot; - if (pivot) { - var ctor = _dontLink ? Point : LinkedPoint; - pivot = new ctor(pivot.x, pivot.y, this, 'setPivot'); - } - return pivot; - }, - - setPivot: function() { - this._pivot = Point.read(arguments, 0, { clone: true, readNull: true }); - this._position = undefined; - }, - - _pivot: null, -}, Base.each(['bounds', 'strokeBounds', 'handleBounds', 'roughBounds', - 'internalBounds', 'internalRoughBounds'], - function(key) { - var getter = 'get' + Base.capitalize(key), - match = key.match(/^internal(.*)$/), - internalGetter = match ? 'get' + match[1] : null; - this[getter] = function(_matrix) { - var boundsGetter = this._boundsGetter, - name = !internalGetter && (typeof boundsGetter === 'string' - ? boundsGetter : boundsGetter && boundsGetter[getter]) - || getter, - bounds = this._getCachedBounds(name, _matrix, this, - internalGetter); - return key === 'bounds' - ? new LinkedRectangle(bounds.x, bounds.y, bounds.width, - bounds.height, this, 'setBounds') - : bounds; - }; - }, -{ - beans: true, - - _getBounds: function(getter, matrix, cacheItem) { - var children = this._children; - if (!children || children.length == 0) - return new Rectangle(); - Item._updateBoundsCache(this, cacheItem); - var x1 = Infinity, - x2 = -x1, - y1 = x1, - y2 = x2; - for (var i = 0, l = children.length; i < l; i++) { - var child = children[i]; - if (child._visible && !child.isEmpty()) { - var rect = child._getCachedBounds(getter, - matrix && matrix.chain(child._matrix), cacheItem); - x1 = Math.min(rect.x, x1); - y1 = Math.min(rect.y, y1); - x2 = Math.max(rect.x + rect.width, x2); - y2 = Math.max(rect.y + rect.height, y2); - } - } - return isFinite(x1) - ? new Rectangle(x1, y1, x2 - x1, y2 - y1) - : new Rectangle(); - }, - - setBounds: function() { - var rect = Rectangle.read(arguments), - bounds = this.getBounds(), - matrix = new Matrix(), - center = rect.getCenter(); - matrix.translate(center); - if (rect.width != bounds.width || rect.height != bounds.height) { - matrix.scale( - bounds.width != 0 ? rect.width / bounds.width : 1, - bounds.height != 0 ? rect.height / bounds.height : 1); - } - center = bounds.getCenter(); - matrix.translate(-center.x, -center.y); - this.transform(matrix); - }, - - _getCachedBounds: function(getter, matrix, cacheItem, internalGetter) { - matrix = matrix && matrix.orNullIfIdentity(); - var _matrix = internalGetter ? null : this._matrix.orNullIfIdentity(), - cache = (!matrix || matrix.equals(_matrix)) && getter; - Item._updateBoundsCache(this._parent || this._parentSymbol, cacheItem); - if (cache && this._bounds && this._bounds[cache]) - return this._bounds[cache].clone(); - var bounds = this._getBounds(internalGetter || getter, - matrix || _matrix, cacheItem); - if (cache) { - if (!this._bounds) - this._bounds = {}; - var cached = this._bounds[cache] = bounds.clone(); - cached._internal = !!internalGetter; - } - return bounds; - }, - - statics: { - _updateBoundsCache: function(parent, item) { - if (parent) { - var id = item._id, - ref = parent._boundsCache = parent._boundsCache || { - ids: {}, - list: [] - }; - if (!ref.ids[id]) { - ref.list.push(item); - ref.ids[id] = item; - } - } - }, - - _clearBoundsCache: function(item) { - var cache = item._boundsCache; - if (cache) { - item._bounds = item._position = item._boundsCache = undefined; - for (var i = 0, list = cache.list, l = list.length; i < l; i++){ - var other = list[i]; - if (other !== item) { - other._bounds = other._position = undefined; - if (other._boundsCache) - Item._clearBoundsCache(other); - } - } - } - } - } - -}), { - beans: true, - - _decompose: function() { - return this._decomposed = this._matrix.decompose(); - }, - - getRotation: function() { - var decomposed = this._decomposed || this._decompose(); - return decomposed && decomposed.rotation; - }, - - setRotation: function(rotation) { - var current = this.getRotation(); - if (current != null && rotation != null) { - var decomposed = this._decomposed; - this.rotate(rotation - current); - decomposed.rotation = rotation; - this._decomposed = decomposed; - } - }, - - getScaling: function(_dontLink) { - var decomposed = this._decomposed || this._decompose(), - scaling = decomposed && decomposed.scaling, - ctor = _dontLink ? Point : LinkedPoint; - return scaling && new ctor(scaling.x, scaling.y, this, 'setScaling'); - }, - - setScaling: function() { - var current = this.getScaling(); - if (current) { - var scaling = Point.read(arguments, 0, { clone: true }), - decomposed = this._decomposed; - this.scale(scaling.x / current.x, scaling.y / current.y); - decomposed.scaling = scaling; - this._decomposed = decomposed; - } - }, - - getMatrix: function() { - return this._matrix; - }, - - setMatrix: function() { - var matrix = this._matrix; - matrix.initialize.apply(matrix, arguments); - if (this._applyMatrix) { - this.transform(null, true); - } else { - this._changed(9); - } - }, - - getGlobalMatrix: function(_dontClone) { - var matrix = this._globalMatrix, - updateVersion = this._project._updateVersion; - if (matrix && matrix._updateVersion !== updateVersion) - matrix = null; - if (!matrix) { - matrix = this._globalMatrix = this._matrix.clone(); - var parent = this._parent; - if (parent) - matrix.preConcatenate(parent.getGlobalMatrix(true)); - matrix._updateVersion = updateVersion; - } - return _dontClone ? matrix : matrix.clone(); - }, - - getApplyMatrix: function() { - return this._applyMatrix; - }, - - setApplyMatrix: function(apply) { - if (this._applyMatrix = this._canApplyMatrix && !!apply) - this.transform(null, true); - }, - - getTransformContent: '#getApplyMatrix', - setTransformContent: '#setApplyMatrix', -}, { - getProject: function() { - return this._project; - }, - - _setProject: function(project, installEvents) { - if (this._project !== project) { - if (this._project) - this._installEvents(false); - this._project = project; - var children = this._children; - for (var i = 0, l = children && children.length; i < l; i++) - children[i]._setProject(project); - installEvents = true; - } - if (installEvents) - this._installEvents(true); - }, - - getView: function() { - return this._project.getView(); - }, - - _installEvents: function _installEvents(install) { - _installEvents.base.call(this, install); - var children = this._children; - for (var i = 0, l = children && children.length; i < l; i++) - children[i]._installEvents(install); - }, - - getLayer: function() { - var parent = this; - while (parent = parent._parent) { - if (parent instanceof Layer) - return parent; - } - return null; - }, - - getParent: function() { - return this._parent; - }, - - setParent: function(item) { - return item.addChild(this); - }, - - getChildren: function() { - return this._children; - }, - - setChildren: function(items) { - this.removeChildren(); - this.addChildren(items); - }, - - getFirstChild: function() { - return this._children && this._children[0] || null; - }, - - getLastChild: function() { - return this._children && this._children[this._children.length - 1] - || null; - }, - - getNextSibling: function() { - return this._parent && this._parent._children[this._index + 1] || null; - }, - - getPreviousSibling: function() { - return this._parent && this._parent._children[this._index - 1] || null; - }, - - getIndex: function() { - return this._index; - }, - - equals: function(item) { - return item === this || item && this._class === item._class - && this._style.equals(item._style) - && this._matrix.equals(item._matrix) - && this._locked === item._locked - && this._visible === item._visible - && this._blendMode === item._blendMode - && this._opacity === item._opacity - && this._clipMask === item._clipMask - && this._guide === item._guide - && this._equals(item) - || false; - }, - - _equals: function(item) { - return Base.equals(this._children, item._children); - }, - - clone: function(insert) { - return this._clone(new this.constructor(Item.NO_INSERT), insert); - }, - - _clone: function(copy, insert, includeMatrix) { - var keys = ['_locked', '_visible', '_blendMode', '_opacity', - '_clipMask', '_guide'], - children = this._children; - copy.setStyle(this._style); - for (var i = 0, l = children && children.length; i < l; i++) { - copy.addChild(children[i].clone(false), true); - } - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - if (this.hasOwnProperty(key)) - copy[key] = this[key]; - } - if (includeMatrix !== false) - copy._matrix.initialize(this._matrix); - copy.setApplyMatrix(this._applyMatrix); - copy.setPivot(this._pivot); - copy.setSelected(this._selected); - copy._data = this._data ? Base.clone(this._data) : null; - if (insert || insert === undefined) - copy.insertAbove(this); - if (this._name) - copy.setName(this._name, true); - return copy; - }, - - copyTo: function(itemOrProject) { - return itemOrProject.addChild(this.clone(false)); - }, - - rasterize: function(resolution) { - var bounds = this.getStrokeBounds(), - scale = (resolution || this.getView().getResolution()) / 72, - topLeft = bounds.getTopLeft().floor(), - bottomRight = bounds.getBottomRight().ceil(), - size = new Size(bottomRight.subtract(topLeft)), - canvas = CanvasProvider.getCanvas(size.multiply(scale)), - ctx = canvas.getContext('2d'), - matrix = new Matrix().scale(scale).translate(topLeft.negate()); - ctx.save(); - matrix.applyToContext(ctx); - this.draw(ctx, new Base({ matrices: [matrix] })); - ctx.restore(); - var raster = new Raster(Item.NO_INSERT); - raster.setCanvas(canvas); - raster.transform(new Matrix().translate(topLeft.add(size.divide(2))) - .scale(1 / scale)); - raster.insertAbove(this); - return raster; - }, - - contains: function() { - return !!this._contains( - this._matrix._inverseTransform(Point.read(arguments))); - }, - - _contains: function(point) { - if (this._children) { - for (var i = this._children.length - 1; i >= 0; i--) { - if (this._children[i].contains(point)) - return true; - } - return false; - } - return point.isInside(this.getInternalBounds()); - }, - - isInside: function() { - return Rectangle.read(arguments).contains(this.getBounds()); - }, - - _asPathItem: function() { - return new Path.Rectangle({ - rectangle: this.getInternalBounds(), - matrix: this._matrix, - insert: false, - }); - }, - - intersects: function(item, _matrix) { - if (!(item instanceof Item)) - return false; - return this._asPathItem().getIntersections(item._asPathItem(), null, - _matrix || item._matrix, true).length > 0; - }, - - hitTest: function() { - return this._hitTest( - Point.read(arguments), - HitResult.getOptions(Base.read(arguments))); - }, - - _hitTest: function(point, options) { - if (this._locked || !this._visible || this._guide && !options.guides - || this.isEmpty()) - return null; - - var matrix = this._matrix, - parentTotalMatrix = options._totalMatrix, - view = this.getView(), - totalMatrix = options._totalMatrix = parentTotalMatrix - ? parentTotalMatrix.chain(matrix) - : this.getGlobalMatrix().preConcatenate(view._matrix), - tolerancePadding = options._tolerancePadding = new Size( - Path._getPenPadding(1, totalMatrix.inverted()) - ).multiply( - Math.max(options.tolerance, 1e-6) - ); - point = matrix._inverseTransform(point); - - if (!this._children && !this.getInternalRoughBounds() - .expand(tolerancePadding.multiply(2))._containsPoint(point)) - return null; - var checkSelf = !(options.guides && !this._guide - || options.selected && !this._selected - || options.type && options.type !== Base.hyphenate(this._class) - || options.class && !(this instanceof options.class)), - that = this, - res; - - function checkBounds(type, part) { - var pt = bounds['get' + part](); - if (point.subtract(pt).divide(tolerancePadding).length <= 1) - return new HitResult(type, that, - { name: Base.hyphenate(part), point: pt }); - } - - if (checkSelf && (options.center || options.bounds) && this._parent) { - var bounds = this.getInternalBounds(); - if (options.center) - res = checkBounds('center', 'Center'); - if (!res && options.bounds) { - var points = [ - 'TopLeft', 'TopRight', 'BottomLeft', 'BottomRight', - 'LeftCenter', 'TopCenter', 'RightCenter', 'BottomCenter' - ]; - for (var i = 0; i < 8 && !res; i++) - res = checkBounds('bounds', points[i]); - } - } - - var children = !res && this._children; - if (children) { - var opts = this._getChildHitTestOptions(options); - for (var i = children.length - 1; i >= 0 && !res; i--) - res = children[i]._hitTest(point, opts); - } - if (!res && checkSelf) - res = this._hitTestSelf(point, options); - if (res && res.point) - res.point = matrix.transform(res.point); - options._totalMatrix = parentTotalMatrix; - return res; - }, - - _getChildHitTestOptions: function(options) { - return options; - }, - - _hitTestSelf: function(point, options) { - if (options.fill && this.hasFill() && this._contains(point)) - return new HitResult('fill', this); - }, - - matches: function(name, compare) { - function matchObject(obj1, obj2) { - for (var i in obj1) { - if (obj1.hasOwnProperty(i)) { - var val1 = obj1[i], - val2 = obj2[i]; - if (Base.isPlainObject(val1) && Base.isPlainObject(val2)) { - if (!matchObject(val1, val2)) - return false; - } else if (!Base.equals(val1, val2)) { - return false; - } - } - } - return true; - } - var type = typeof name; - if (type === 'object') { - for (var key in name) { - if (name.hasOwnProperty(key) && !this.matches(key, name[key])) - return false; - } - } else if (type === 'function') { - return name(this); - } else { - var value = /^(empty|editable)$/.test(name) - ? this['is' + Base.capitalize(name)]() - : name === 'type' - ? Base.hyphenate(this._class) - : this[name]; - if (/^(constructor|class)$/.test(name)) { - if (!(this instanceof compare)) - return false; - } else if (compare instanceof RegExp) { - if (!compare.test(value)) - return false; - } else if (typeof compare === 'function') { - if (!compare(value)) - return false; - } else if (Base.isPlainObject(compare)) { - if (!matchObject(compare, value)) - return false; - } else if (!Base.equals(value, compare)) { - return false; - } - } - return true; - }, - - getItems: function(match) { - return Item._getItems(this._children, match, this._matrix); - }, - - getItem: function(match) { - return Item._getItems(this._children, match, this._matrix, null, true) - [0] || null; - }, - - statics: { - _getItems: function _getItems(children, match, matrix, param, - firstOnly) { - if (!param && typeof match === 'object') { - var overlapping = match.overlapping, - inside = match.inside, - bounds = overlapping || inside, - rect = bounds && Rectangle.read([bounds]); - param = { - items: [], - inside: !!inside, - overlapping: !!overlapping, - rect: rect, - path: overlapping && new Path.Rectangle({ - rectangle: rect, - insert: false - }) - }; - if (bounds) - match = Base.set({}, match, - { inside: true, overlapping: true }); - } - var items = param && param.items, - rect = param && param.rect; - matrix = rect && (matrix || new Matrix()); - for (var i = 0, l = children && children.length; i < l; i++) { - var child = children[i], - childMatrix = matrix && matrix.chain(child._matrix), - add = true; - if (rect) { - var bounds = child.getBounds(childMatrix); - if (!rect.intersects(bounds)) - continue; - if (!(param.inside && rect.contains(bounds)) - && !(param.overlapping && (bounds.contains(rect) - || param.path.intersects(child, childMatrix)))) - add = false; - } - if (add && child.matches(match)) { - items.push(child); - if (firstOnly) - break; - } - _getItems(child._children, match, - childMatrix, param, - firstOnly); - if (firstOnly && items.length > 0) - break; - } - return items; - } - } -}, { - - importJSON: function(json) { - var res = Base.importJSON(json, this); - return res !== this - ? this.addChild(res) - : res; - }, - - addChild: function(item, _preserve) { - return this.insertChild(undefined, item, _preserve); - }, - - insertChild: function(index, item, _preserve) { - var res = item ? this.insertChildren(index, [item], _preserve) : null; - return res && res[0]; - }, - - addChildren: function(items, _preserve) { - return this.insertChildren(this._children.length, items, _preserve); - }, - - insertChildren: function(index, items, _preserve, _proto) { - var children = this._children; - if (children && items && items.length > 0) { - items = Array.prototype.slice.apply(items); - for (var i = items.length - 1; i >= 0; i--) { - var item = items[i]; - if (_proto && !(item instanceof _proto)) { - items.splice(i, 1); - } else { - var shift = item._parent === this && item._index < index; - if (item._remove(false, true) && shift) - index--; - } - } - Base.splice(children, items, index, 0); - var project = this._project, - notifySelf = project && project._changes; - for (var i = 0, l = items.length; i < l; i++) { - var item = items[i]; - item._parent = this; - item._setProject(this._project, true); - if (item._name) - item.setName(item._name); - if (notifySelf) - this._changed(5); - } - this._changed(11); - } else { - items = null; - } - return items; - }, - - _insertSibling: function(index, item, _preserve) { - return this._parent - ? this._parent.insertChild(index, item, _preserve) - : null; - }, - - insertAbove: function(item, _preserve) { - return item._insertSibling(item._index + 1, this, _preserve); - }, - - insertBelow: function(item, _preserve) { - return item._insertSibling(item._index, this, _preserve); - }, - - sendToBack: function() { - return (this._parent || this instanceof Layer && this._project) - .insertChild(0, this); - }, - - bringToFront: function() { - return (this._parent || this instanceof Layer && this._project) - .addChild(this); - }, - - appendTop: '#addChild', - - appendBottom: function(item) { - return this.insertChild(0, item); - }, - - moveAbove: '#insertAbove', - - moveBelow: '#insertBelow', - - reduce: function() { - if (this._children && this._children.length === 1) { - var child = this._children[0].reduce(); - child.insertAbove(this); - child.setStyle(this._style); - this.remove(); - return child; - } - return this; - }, - - _removeNamed: function() { - var parent = this._parent; - if (parent) { - var children = parent._children, - namedChildren = parent._namedChildren, - name = this._name, - namedArray = namedChildren[name], - index = namedArray ? namedArray.indexOf(this) : -1; - if (index !== -1) { - if (children[name] == this) - delete children[name]; - namedArray.splice(index, 1); - if (namedArray.length) { - children[name] = namedArray[namedArray.length - 1]; - } else { - delete namedChildren[name]; - } - } - } - }, - - _remove: function(notifySelf, notifyParent) { - var parent = this._parent; - if (parent) { - if (this._name) - this._removeNamed(); - if (this._index != null) - Base.splice(parent._children, null, this._index, 1); - this._installEvents(false); - if (notifySelf) { - var project = this._project; - if (project && project._changes) - this._changed(5); - } - if (notifyParent) - parent._changed(11); - this._parent = null; - return true; - } - return false; - }, - - remove: function() { - return this._remove(true, true); - }, - - replaceWith: function(item) { - var ok = item && item.insertBelow(this); - if (ok) - this.remove(); - return ok; - }, - - removeChildren: function(from, to) { - if (!this._children) - return null; - from = from || 0; - to = Base.pick(to, this._children.length); - var removed = Base.splice(this._children, null, from, to - from); - for (var i = removed.length - 1; i >= 0; i--) { - removed[i]._remove(true, false); - } - if (removed.length > 0) - this._changed(11); - return removed; - }, - - clear: '#removeChildren', - - reverseChildren: function() { - if (this._children) { - this._children.reverse(); - for (var i = 0, l = this._children.length; i < l; i++) - this._children[i]._index = i; - this._changed(11); - } - }, - - isEmpty: function() { - return !this._children || this._children.length === 0; - }, - - isEditable: function() { - var item = this; - while (item) { - if (!item._visible || item._locked) - return false; - item = item._parent; - } - return true; - }, - - hasFill: function() { - return this.getStyle().hasFill(); - }, - - hasStroke: function() { - return this.getStyle().hasStroke(); - }, - - hasShadow: function() { - return this.getStyle().hasShadow(); - }, - - _getOrder: function(item) { - function getList(item) { - var list = []; - do { - list.unshift(item); - } while (item = item._parent); - return list; - } - var list1 = getList(this), - list2 = getList(item); - for (var i = 0, l = Math.min(list1.length, list2.length); i < l; i++) { - if (list1[i] != list2[i]) { - return list1[i]._index < list2[i]._index ? 1 : -1; - } - } - return 0; - }, - - hasChildren: function() { - return this._children && this._children.length > 0; - }, - - isInserted: function() { - return this._parent ? this._parent.isInserted() : false; - }, - - isAbove: function(item) { - return this._getOrder(item) === -1; - }, - - isBelow: function(item) { - return this._getOrder(item) === 1; - }, - - isParent: function(item) { - return this._parent === item; - }, - - isChild: function(item) { - return item && item._parent === this; - }, - - isDescendant: function(item) { - var parent = this; - while (parent = parent._parent) { - if (parent == item) - return true; - } - return false; - }, - - isAncestor: function(item) { - return item ? item.isDescendant(this) : false; - }, - - isSibling: function(item) { - return this._parent === item._parent; - }, - - isGroupedWith: function(item) { - var parent = this._parent; - while (parent) { - if (parent._parent - && /^(Group|Layer|CompoundPath)$/.test(parent._class) - && item.isDescendant(parent)) - return true; - parent = parent._parent; - } - return false; - }, - - translate: function() { - var mx = new Matrix(); - return this.transform(mx.translate.apply(mx, arguments)); - }, - - rotate: function(angle ) { - return this.transform(new Matrix().rotate(angle, - Point.read(arguments, 1, { readNull: true }) - || this.getPosition(true))); - } -}, Base.each(['scale', 'shear', 'skew'], function(name) { - this[name] = function() { - var point = Point.read(arguments), - center = Point.read(arguments, 0, { readNull: true }); - return this.transform(new Matrix()[name](point, - center || this.getPosition(true))); - }; -}, { - -}), { - transform: function(matrix, _applyMatrix, _applyRecursively, - _setApplyMatrix) { - if (matrix && matrix.isIdentity()) - matrix = null; - var _matrix = this._matrix, - applyMatrix = (_applyMatrix || this._applyMatrix) - && ((!_matrix.isIdentity() || matrix) - || _applyMatrix && _applyRecursively && this._children); - if (!matrix && !applyMatrix) - return this; - if (matrix) - _matrix.preConcatenate(matrix); - if (applyMatrix = applyMatrix && this._transformContent(_matrix, - _applyRecursively, _setApplyMatrix)) { - var pivot = this._pivot, - style = this._style, - fillColor = style.getFillColor(true), - strokeColor = style.getStrokeColor(true); - if (pivot) - _matrix._transformPoint(pivot, pivot, true); - if (fillColor) - fillColor.transform(_matrix); - if (strokeColor) - strokeColor.transform(_matrix); - _matrix.reset(true); - if (_setApplyMatrix && this._canApplyMatrix) - this._applyMatrix = true; - } - var bounds = this._bounds, - position = this._position; - this._changed(9); - var decomp = bounds && matrix && matrix.decompose(); - if (decomp && !decomp.shearing && decomp.rotation % 90 === 0) { - for (var key in bounds) { - var rect = bounds[key]; - if (applyMatrix || !rect._internal) - matrix._transformBounds(rect, rect); - } - var getter = this._boundsGetter, - rect = bounds[getter && getter.getBounds || getter || 'getBounds']; - if (rect) - this._position = rect.getCenter(true); - this._bounds = bounds; - } else if (matrix && position) { - this._position = matrix._transformPoint(position, position); - } - return this; - }, - - _transformContent: function(matrix, applyRecursively, setApplyMatrix) { - var children = this._children; - if (children) { - for (var i = 0, l = children.length; i < l; i++) - children[i].transform(matrix, true, applyRecursively, - setApplyMatrix); - return true; - } - }, - - globalToLocal: function() { - return this.getGlobalMatrix(true)._inverseTransform( - Point.read(arguments)); - }, - - localToGlobal: function() { - return this.getGlobalMatrix(true)._transformPoint( - Point.read(arguments)); - }, - - parentToLocal: function() { - return this._matrix._inverseTransform(Point.read(arguments)); - }, - - localToParent: function() { - return this._matrix._transformPoint(Point.read(arguments)); - }, - - fitBounds: function(rectangle, fill) { - rectangle = Rectangle.read(arguments); - var bounds = this.getBounds(), - itemRatio = bounds.height / bounds.width, - rectRatio = rectangle.height / rectangle.width, - scale = (fill ? itemRatio > rectRatio : itemRatio < rectRatio) - ? rectangle.width / bounds.width - : rectangle.height / bounds.height, - newBounds = new Rectangle(new Point(), - new Size(bounds.width * scale, bounds.height * scale)); - newBounds.setCenter(rectangle.getCenter()); - this.setBounds(newBounds); - }, - - _setStyles: function(ctx) { - var style = this._style, - fillColor = style.getFillColor(), - strokeColor = style.getStrokeColor(), - shadowColor = style.getShadowColor(); - if (fillColor) - ctx.fillStyle = fillColor.toCanvasStyle(ctx); - if (strokeColor) { - var strokeWidth = style.getStrokeWidth(); - if (strokeWidth > 0) { - ctx.strokeStyle = strokeColor.toCanvasStyle(ctx); - ctx.lineWidth = strokeWidth; - var strokeJoin = style.getStrokeJoin(), - strokeCap = style.getStrokeCap(), - miterLimit = style.getMiterLimit(); - if (strokeJoin) - ctx.lineJoin = strokeJoin; - if (strokeCap) - ctx.lineCap = strokeCap; - if (miterLimit) - ctx.miterLimit = miterLimit; - if (paper.support.nativeDash) { - var dashArray = style.getDashArray(), - dashOffset = style.getDashOffset(); - if (dashArray && dashArray.length) { - if ('setLineDash' in ctx) { - ctx.setLineDash(dashArray); - ctx.lineDashOffset = dashOffset; - } else { - ctx.mozDash = dashArray; - ctx.mozDashOffset = dashOffset; - } - } - } - } - } - if (shadowColor) { - var shadowBlur = style.getShadowBlur(); - if (shadowBlur > 0) { - ctx.shadowColor = shadowColor.toCanvasStyle(ctx); - ctx.shadowBlur = shadowBlur; - var offset = this.getShadowOffset(); - ctx.shadowOffsetX = offset.x; - ctx.shadowOffsetY = offset.y; - } - } - }, - - draw: function(ctx, param, parentStrokeMatrix) { - var updateVersion = this._updateVersion = this._project._updateVersion; - if (!this._visible || this._opacity === 0) - return; - var matrices = param.matrices, - viewMatrix = param.viewMatrix, - matrix = this._matrix, - globalMatrix = matrices[matrices.length - 1].chain(matrix); - if (!globalMatrix.isInvertible()) - return; - - function getViewMatrix(matrix) { - return viewMatrix ? viewMatrix.chain(matrix) : matrix; - } - - matrices.push(globalMatrix); - if (param.updateMatrix) { - globalMatrix._updateVersion = updateVersion; - this._globalMatrix = globalMatrix; - } - - var blendMode = this._blendMode, - opacity = this._opacity, - normalBlend = blendMode === 'normal', - nativeBlend = BlendMode.nativeModes[blendMode], - direct = normalBlend && opacity === 1 - || param.dontStart - || param.clip - || (nativeBlend || normalBlend && opacity < 1) - && this._canComposite(), - pixelRatio = param.pixelRatio || 1, - mainCtx, itemOffset, prevOffset; - if (!direct) { - var bounds = this.getStrokeBounds(getViewMatrix(globalMatrix)); - if (!bounds.width || !bounds.height) - return; - prevOffset = param.offset; - itemOffset = param.offset = bounds.getTopLeft().floor(); - mainCtx = ctx; - ctx = CanvasProvider.getContext(bounds.getSize().ceil().add(1) - .multiply(pixelRatio)); - if (pixelRatio !== 1) - ctx.scale(pixelRatio, pixelRatio); - } - ctx.save(); - var strokeMatrix = parentStrokeMatrix - ? parentStrokeMatrix.chain(matrix) - : !this.getStrokeScaling(true) && getViewMatrix(globalMatrix), - clip = !direct && param.clipItem, - transform = !strokeMatrix || clip; - if (direct) { - ctx.globalAlpha = opacity; - if (nativeBlend) - ctx.globalCompositeOperation = blendMode; - } else if (transform) { - ctx.translate(-itemOffset.x, -itemOffset.y); - } - if (transform) - (direct ? matrix : getViewMatrix(globalMatrix)).applyToContext(ctx); - if (clip) - param.clipItem.draw(ctx, param.extend({ clip: true })); - if (strokeMatrix) { - ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); - var offset = param.offset; - if (offset) - ctx.translate(-offset.x, -offset.y); - } - this._draw(ctx, param, strokeMatrix); - ctx.restore(); - matrices.pop(); - if (param.clip && !param.dontFinish) - ctx.clip(); - if (!direct) { - BlendMode.process(blendMode, ctx, mainCtx, opacity, - itemOffset.subtract(prevOffset).multiply(pixelRatio)); - CanvasProvider.release(ctx); - param.offset = prevOffset; - } - }, - - _isUpdated: function(updateVersion) { - var parent = this._parent; - if (parent instanceof CompoundPath) - return parent._isUpdated(updateVersion); - var updated = this._updateVersion === updateVersion; - if (!updated && parent && parent._visible - && parent._isUpdated(updateVersion)) { - this._updateVersion = updateVersion; - updated = true; - } - return updated; - }, - - _drawSelection: function(ctx, matrix, size, selectedItems, updateVersion) { - if ((this._drawSelected || this._boundsSelected) - && this._isUpdated(updateVersion)) { - var color = this.getSelectedColor(true) - || this.getLayer().getSelectedColor(true), - mx = matrix.chain(this.getGlobalMatrix(true)); - ctx.strokeStyle = ctx.fillStyle = color - ? color.toCanvasStyle(ctx) : '#009dec'; - if (this._drawSelected) - this._drawSelected(ctx, mx, selectedItems); - if (this._boundsSelected) { - var half = size / 2, - coords = mx._transformCorners(this.getInternalBounds()); - ctx.beginPath(); - for (var i = 0; i < 8; i++) - ctx[i === 0 ? 'moveTo' : 'lineTo'](coords[i], coords[++i]); - ctx.closePath(); - ctx.stroke(); - for (var i = 0; i < 8; i++) - ctx.fillRect(coords[i] - half, coords[++i] - half, - size, size); - } - } - }, - - _canComposite: function() { - return false; - } -}, Base.each(['down', 'drag', 'up', 'move'], function(name) { - this['removeOn' + Base.capitalize(name)] = function() { - var hash = {}; - hash[name] = true; - return this.removeOn(hash); - }; -}, { - - removeOn: function(obj) { - for (var name in obj) { - if (obj[name]) { - var key = 'mouse' + name, - project = this._project, - sets = project._removeSets = project._removeSets || {}; - sets[key] = sets[key] || {}; - sets[key][this._id] = this; - } - } - return this; - } -})); - -var Group = Item.extend({ - _class: 'Group', - _selectChildren: true, - _serializeFields: { - children: [] - }, - - initialize: function Group(arg) { - this._children = []; - this._namedChildren = {}; - if (!this._initialize(arg)) - this.addChildren(Array.isArray(arg) ? arg : arguments); - }, - - _changed: function _changed(flags) { - _changed.base.call(this, flags); - if (flags & 1026) { - this._clipItem = undefined; - } - }, - - _getClipItem: function() { - var clipItem = this._clipItem; - if (clipItem === undefined) { - clipItem = null; - for (var i = 0, l = this._children.length; i < l; i++) { - var child = this._children[i]; - if (child._clipMask) { - clipItem = child; - break; - } - } - this._clipItem = clipItem; - } - return clipItem; - }, - - isClipped: function() { - return !!this._getClipItem(); - }, - - setClipped: function(clipped) { - var child = this.getFirstChild(); - if (child) - child.setClipMask(clipped); - }, - - _draw: function(ctx, param) { - var clip = param.clip, - clipItem = !clip && this._getClipItem(), - draw = true; - param = param.extend({ clipItem: clipItem, clip: false }); - if (clip) { - if (this._currentPath) { - ctx.currentPath = this._currentPath; - draw = false; - } else { - ctx.beginPath(); - param.dontStart = param.dontFinish = true; - } - } else if (clipItem) { - clipItem.draw(ctx, param.extend({ clip: true })); - } - if (draw) { - for (var i = 0, l = this._children.length; i < l; i++) { - var item = this._children[i]; - if (item !== clipItem) - item.draw(ctx, param); - } - } - if (clip) { - this._currentPath = ctx.currentPath; - } - } -}); - -var Layer = Group.extend({ - _class: 'Layer', - - initialize: function Layer(arg) { - var props = Base.isPlainObject(arg) - ? new Base(arg) - : { children: Array.isArray(arg) ? arg : arguments }, - insert = props.insert; - props.insert = false; - Group.call(this, props); - if (insert || insert === undefined) { - this._project.addChild(this); - this.activate(); - } - }, - - _remove: function _remove(notifySelf, notifyParent) { - if (this._parent) - return _remove.base.call(this, notifySelf, notifyParent); - if (this._index != null) { - var project = this._project; - if (project._activeLayer === this) - project._activeLayer = this.getNextSibling() - || this.getPreviousSibling(); - Base.splice(project.layers, null, this._index, 1); - this._installEvents(false); - if (notifySelf && project._changes) - this._changed(5); - if (notifyParent) { - project._needsUpdate = true; - } - return true; - } - return false; - }, - - getNextSibling: function getNextSibling() { - return this._parent ? getNextSibling.base.call(this) - : this._project.layers[this._index + 1] || null; - }, - - getPreviousSibling: function getPreviousSibling() { - return this._parent ? getPreviousSibling.base.call(this) - : this._project.layers[this._index - 1] || null; - }, - - isInserted: function isInserted() { - return this._parent ? isInserted.base.call(this) : this._index != null; - }, - - activate: function() { - this._project._activeLayer = this; - }, - - _insertSibling: function _insertSibling(index, item, _preserve) { - return !this._parent - ? this._project.insertChild(index, item, _preserve) - : _insertSibling.base.call(this, index, item, _preserve); - } -}); - -var Shape = Item.extend({ - _class: 'Shape', - _applyMatrix: false, - _canApplyMatrix: false, - _boundsSelected: true, - _serializeFields: { - type: null, - size: null, - radius: null - }, - - initialize: function Shape(props) { - this._initialize(props); - }, - - _equals: function(item) { - return this._type === item._type - && this._size.equals(item._size) - && Base.equals(this._radius, item._radius); - }, - - clone: function(insert) { - var copy = new Shape(Item.NO_INSERT); - copy.setType(this._type); - copy.setSize(this._size); - copy.setRadius(this._radius); - return this._clone(copy, insert); - }, - - getType: function() { - return this._type; - }, - - setType: function(type) { - this._type = type; - }, - - getShape: '#getType', - setShape: '#setType', - - getSize: function() { - var size = this._size; - return new LinkedSize(size.width, size.height, this, 'setSize'); - }, - - setSize: function() { - var size = Size.read(arguments); - if (!this._size) { - this._size = size.clone(); - } else if (!this._size.equals(size)) { - var type = this._type, - width = size.width, - height = size.height; - if (type === 'rectangle') { - var radius = Size.min(this._radius, size.divide(2)); - this._radius.set(radius.width, radius.height); - } else if (type === 'circle') { - width = height = (width + height) / 2; - this._radius = width / 2; - } else if (type === 'ellipse') { - this._radius.set(width / 2, height / 2); - } - this._size.set(width, height); - this._changed(9); - } - }, - - getRadius: function() { - var rad = this._radius; - return this._type === 'circle' - ? rad - : new LinkedSize(rad.width, rad.height, this, 'setRadius'); - }, - - setRadius: function(radius) { - var type = this._type; - if (type === 'circle') { - if (radius === this._radius) - return; - var size = radius * 2; - this._radius = radius; - this._size.set(size, size); - } else { - radius = Size.read(arguments); - if (!this._radius) { - this._radius = radius.clone(); - } else { - if (this._radius.equals(radius)) - return; - this._radius.set(radius.width, radius.height); - if (type === 'rectangle') { - var size = Size.max(this._size, radius.multiply(2)); - this._size.set(size.width, size.height); - } else if (type === 'ellipse') { - this._size.set(radius.width * 2, radius.height * 2); - } - } - } - this._changed(9); - }, - - isEmpty: function() { - return false; - }, - - toPath: function(insert) { - var path = this._clone(new Path[Base.capitalize(this._type)]({ - center: new Point(), - size: this._size, - radius: this._radius, - insert: false - }), insert); - if (paper.settings.applyMatrix) - path.setApplyMatrix(true); - return path; - }, - - _draw: function(ctx, param, strokeMatrix) { - var style = this._style, - hasFill = style.hasFill(), - hasStroke = style.hasStroke(), - dontPaint = param.dontFinish || param.clip, - untransformed = !strokeMatrix; - if (hasFill || hasStroke || dontPaint) { - var type = this._type, - radius = this._radius, - isCircle = type === 'circle'; - if (!param.dontStart) - ctx.beginPath(); - if (untransformed && isCircle) { - ctx.arc(0, 0, radius, 0, Math.PI * 2, true); - } else { - var rx = isCircle ? radius : radius.width, - ry = isCircle ? radius : radius.height, - size = this._size, - width = size.width, - height = size.height; - if (untransformed && type === 'rectangle' && rx === 0 && ry === 0) { - ctx.rect(-width / 2, -height / 2, width, height); - } else { - var x = width / 2, - y = height / 2, - kappa = 1 - 0.5522847498307936, - cx = rx * kappa, - cy = ry * kappa, - c = [ - -x, -y + ry, - -x, -y + cy, - -x + cx, -y, - -x + rx, -y, - x - rx, -y, - x - cx, -y, - x, -y + cy, - x, -y + ry, - x, y - ry, - x, y - cy, - x - cx, y, - x - rx, y, - -x + rx, y, - -x + cx, y, - -x, y - cy, - -x, y - ry - ]; - if (strokeMatrix) - strokeMatrix.transform(c, c, 32); - ctx.moveTo(c[0], c[1]); - ctx.bezierCurveTo(c[2], c[3], c[4], c[5], c[6], c[7]); - if (x !== rx) - ctx.lineTo(c[8], c[9]); - ctx.bezierCurveTo(c[10], c[11], c[12], c[13], c[14], c[15]); - if (y !== ry) - ctx.lineTo(c[16], c[17]); - ctx.bezierCurveTo(c[18], c[19], c[20], c[21], c[22], c[23]); - if (x !== rx) - ctx.lineTo(c[24], c[25]); - ctx.bezierCurveTo(c[26], c[27], c[28], c[29], c[30], c[31]); - } - } - ctx.closePath(); - } - if (!dontPaint && (hasFill || hasStroke)) { - this._setStyles(ctx); - if (hasFill) { - ctx.fill(style.getWindingRule()); - ctx.shadowColor = 'rgba(0,0,0,0)'; - } - if (hasStroke) - ctx.stroke(); - } - }, - - _canComposite: function() { - return !(this.hasFill() && this.hasStroke()); - }, - - _getBounds: function(getter, matrix) { - var rect = new Rectangle(this._size).setCenter(0, 0); - if (getter !== 'getBounds' && this.hasStroke()) - rect = rect.expand(this.getStrokeWidth()); - return matrix ? matrix._transformBounds(rect) : rect; - } -}, -new function() { - function getCornerCenter(that, point, expand) { - var radius = that._radius; - if (!radius.isZero()) { - var halfSize = that._size.divide(2); - for (var i = 0; i < 4; i++) { - var dir = new Point(i & 1 ? 1 : -1, i > 1 ? 1 : -1), - corner = dir.multiply(halfSize), - center = corner.subtract(dir.multiply(radius)), - rect = new Rectangle(corner, center); - if ((expand ? rect.expand(expand) : rect).contains(point)) - return center; - } - } - } - - function getEllipseRadius(point, radius) { - var angle = point.getAngleInRadians(), - width = radius.width * 2, - height = radius.height * 2, - x = width * Math.sin(angle), - y = height * Math.cos(angle); - return width * height / (2 * Math.sqrt(x * x + y * y)); - } - - return { - _contains: function _contains(point) { - if (this._type === 'rectangle') { - var center = getCornerCenter(this, point); - return center - ? point.subtract(center).divide(this._radius) - .getLength() <= 1 - : _contains.base.call(this, point); - } else { - return point.divide(this.size).getLength() <= 0.5; - } - }, - - _hitTestSelf: function _hitTestSelf(point, options) { - var hit = false; - if (this.hasStroke()) { - var type = this._type, - radius = this._radius, - strokeWidth = this.getStrokeWidth() + 2 * options.tolerance; - if (type === 'rectangle') { - var center = getCornerCenter(this, point, strokeWidth); - if (center) { - var pt = point.subtract(center); - hit = 2 * Math.abs(pt.getLength() - - getEllipseRadius(pt, radius)) <= strokeWidth; - } else { - var rect = new Rectangle(this._size).setCenter(0, 0), - outer = rect.expand(strokeWidth), - inner = rect.expand(-strokeWidth); - hit = outer._containsPoint(point) - && !inner._containsPoint(point); - } - } else { - if (type === 'ellipse') - radius = getEllipseRadius(point, radius); - hit = 2 * Math.abs(point.getLength() - radius) - <= strokeWidth; - } - } - return hit - ? new HitResult('stroke', this) - : _hitTestSelf.base.apply(this, arguments); - } - }; -}, { - -statics: new function() { - function createShape(type, point, size, radius, args) { - var item = new Shape(Base.getNamed(args)); - item._type = type; - item._size = size; - item._radius = radius; - return item.translate(point); - } - - return { - Circle: function() { - var center = Point.readNamed(arguments, 'center'), - radius = Base.readNamed(arguments, 'radius'); - return createShape('circle', center, new Size(radius * 2), radius, - arguments); - }, - - Rectangle: function() { - var rect = Rectangle.readNamed(arguments, 'rectangle'), - radius = Size.min(Size.readNamed(arguments, 'radius'), - rect.getSize(true).divide(2)); - return createShape('rectangle', rect.getCenter(true), - rect.getSize(true), radius, arguments); - }, - - Ellipse: function() { - var ellipse = Shape._readEllipse(arguments), - radius = ellipse.radius; - return createShape('ellipse', ellipse.center, radius.multiply(2), - radius, arguments); - }, - - _readEllipse: function(args) { - var center, - radius; - if (Base.hasNamed(args, 'radius')) { - center = Point.readNamed(args, 'center'); - radius = Size.readNamed(args, 'radius'); - } else { - var rect = Rectangle.readNamed(args, 'rectangle'); - center = rect.getCenter(true); - radius = rect.getSize(true).divide(2); - } - return { center: center, radius: radius }; - } - }; -}}); - -var Raster = Item.extend({ - _class: 'Raster', - _applyMatrix: false, - _canApplyMatrix: false, - _boundsGetter: 'getBounds', - _boundsSelected: true, - _serializeFields: { - crossOrigin: null, - source: null - }, - - initialize: function Raster(object, position) { - if (!this._initialize(object, - position !== undefined && Point.read(arguments, 1))) { - if (typeof object === 'string') { - this.setSource(object); - } else { - this.setImage(object); - } - } - if (!this._size) { - this._size = new Size(); - this._loaded = false; - } - }, - - _equals: function(item) { - return this.getSource() === item.getSource(); - }, - - clone: function(insert) { - var copy = new Raster(Item.NO_INSERT), - image = this._image, - canvas = this._canvas; - if (image) { - copy.setImage(image); - } else if (canvas) { - var copyCanvas = CanvasProvider.getCanvas(this._size); - copyCanvas.getContext('2d').drawImage(canvas, 0, 0); - copy.setImage(copyCanvas); - } - copy._crossOrigin = this._crossOrigin; - return this._clone(copy, insert); - }, - - getSize: function() { - var size = this._size; - return new LinkedSize(size ? size.width : 0, size ? size.height : 0, - this, 'setSize'); - }, - - setSize: function() { - var size = Size.read(arguments); - if (!size.equals(this._size)) { - if (size.width > 0 && size.height > 0) { - var element = this.getElement(); - this.setImage(CanvasProvider.getCanvas(size)); - if (element) - this.getContext(true).drawImage(element, 0, 0, - size.width, size.height); - } else { - if (this._canvas) - CanvasProvider.release(this._canvas); - this._size = size.clone(); - } - } - }, - - getWidth: function() { - return this._size ? this._size.width : 0; - }, - - setWidth: function(width) { - this.setSize(width, this.getHeight()); - }, - - getHeight: function() { - return this._size ? this._size.height : 0; - }, - - setHeight: function(height) { - this.setSize(this.getWidth(), height); - }, - - isEmpty: function() { - var size = this._size; - return !size || size.width === 0 && size.height === 0; - }, - - getResolution: function() { - var matrix = this._matrix, - orig = new Point(0, 0).transform(matrix), - u = new Point(1, 0).transform(matrix).subtract(orig), - v = new Point(0, 1).transform(matrix).subtract(orig); - return new Size( - 72 / u.getLength(), - 72 / v.getLength() - ); - }, - - getPpi: '#getResolution', - - getImage: function() { - return this._image; - }, - - setImage: function(image) { - if (this._canvas) - CanvasProvider.release(this._canvas); - if (image && image.getContext) { - this._image = null; - this._canvas = image; - this._loaded = true; - } else { - this._image = image; - this._canvas = null; - this._loaded = image && image.complete; - } - this._size = new Size( - image ? image.naturalWidth || image.width : 0, - image ? image.naturalHeight || image.height : 0); - this._context = null; - this._changed(521); - }, - - getCanvas: function() { - if (!this._canvas) { - var ctx = CanvasProvider.getContext(this._size); - try { - if (this._image) - ctx.drawImage(this._image, 0, 0); - this._canvas = ctx.canvas; - } catch (e) { - CanvasProvider.release(ctx); - } - } - return this._canvas; - }, - - setCanvas: '#setImage', - - getContext: function(modify) { - if (!this._context) - this._context = this.getCanvas().getContext('2d'); - if (modify) { - this._image = null; - this._changed(513); - } - return this._context; - }, - - setContext: function(context) { - this._context = context; - }, - - getSource: function() { - return this._image && this._image.src || this.toDataURL(); - }, - - setSource: function(src) { - var that = this, - crossOrigin = this._crossOrigin, - image; - - function loaded() { - var view = that.getView(); - if (view) { - paper = view._scope; - that.setImage(image); - that.emit('load'); - view.update(); - } - } - - image = document.getElementById(src) || new Image(); - if (crossOrigin) - image.crossOrigin = crossOrigin; - if (image.naturalWidth && image.naturalHeight) { - setTimeout(loaded, 0); - } else { - DomEvent.add(image, { load: loaded }); - if (!image.src) - image.src = src; - } - this.setImage(image); - }, - - getCrossOrigin: function() { - return this._image && this._image.crossOrigin || this._crossOrigin || ''; - }, - - setCrossOrigin: function(crossOrigin) { - this._crossOrigin = crossOrigin; - if (this._image) - this._image.crossOrigin = crossOrigin; - }, - - getElement: function() { - return this._canvas || this._loaded && this._image; - } -}, { - beans: false, - - getSubCanvas: function() { - var rect = Rectangle.read(arguments), - ctx = CanvasProvider.getContext(rect.getSize()); - ctx.drawImage(this.getCanvas(), rect.x, rect.y, - rect.width, rect.height, 0, 0, rect.width, rect.height); - return ctx.canvas; - }, - - getSubRaster: function() { - var rect = Rectangle.read(arguments), - raster = new Raster(Item.NO_INSERT); - raster.setImage(this.getSubCanvas(rect)); - raster.translate(rect.getCenter().subtract(this.getSize().divide(2))); - raster._matrix.preConcatenate(this._matrix); - raster.insertAbove(this); - return raster; - }, - - toDataURL: function() { - var src = this._image && this._image.src; - if (/^data:/.test(src)) - return src; - var canvas = this.getCanvas(); - return canvas ? canvas.toDataURL.apply(canvas, arguments) : null; - }, - - drawImage: function(image ) { - var point = Point.read(arguments, 1); - this.getContext(true).drawImage(image, point.x, point.y); - }, - - getAverageColor: function(object) { - var bounds, path; - if (!object) { - bounds = this.getBounds(); - } else if (object instanceof PathItem) { - path = object; - bounds = object.getBounds(); - } else if (object.width) { - bounds = new Rectangle(object); - } else if (object.x) { - bounds = new Rectangle(object.x - 0.5, object.y - 0.5, 1, 1); - } - var sampleSize = 32, - width = Math.min(bounds.width, sampleSize), - height = Math.min(bounds.height, sampleSize); - var ctx = Raster._sampleContext; - if (!ctx) { - ctx = Raster._sampleContext = CanvasProvider.getContext( - new Size(sampleSize)); - } else { - ctx.clearRect(0, 0, sampleSize + 1, sampleSize + 1); - } - ctx.save(); - var matrix = new Matrix() - .scale(width / bounds.width, height / bounds.height) - .translate(-bounds.x, -bounds.y); - matrix.applyToContext(ctx); - if (path) - path.draw(ctx, new Base({ clip: true, matrices: [matrix] })); - this._matrix.applyToContext(ctx); - var element = this.getElement(), - size = this._size; - if (element) - ctx.drawImage(element, -size.width / 2, -size.height / 2); - ctx.restore(); - var pixels = ctx.getImageData(0.5, 0.5, Math.ceil(width), - Math.ceil(height)).data, - channels = [0, 0, 0], - total = 0; - for (var i = 0, l = pixels.length; i < l; i += 4) { - var alpha = pixels[i + 3]; - total += alpha; - alpha /= 255; - channels[0] += pixels[i] * alpha; - channels[1] += pixels[i + 1] * alpha; - channels[2] += pixels[i + 2] * alpha; - } - for (var i = 0; i < 3; i++) - channels[i] /= total; - return total ? Color.read(channels) : null; - }, - - getPixel: function() { - var point = Point.read(arguments); - var data = this.getContext().getImageData(point.x, point.y, 1, 1).data; - return new Color('rgb', [data[0] / 255, data[1] / 255, data[2] / 255], - data[3] / 255); - }, - - setPixel: function() { - var point = Point.read(arguments), - color = Color.read(arguments), - components = color._convert('rgb'), - alpha = color._alpha, - ctx = this.getContext(true), - imageData = ctx.createImageData(1, 1), - data = imageData.data; - data[0] = components[0] * 255; - data[1] = components[1] * 255; - data[2] = components[2] * 255; - data[3] = alpha != null ? alpha * 255 : 255; - ctx.putImageData(imageData, point.x, point.y); - }, - - createImageData: function() { - var size = Size.read(arguments); - return this.getContext().createImageData(size.width, size.height); - }, - - getImageData: function() { - var rect = Rectangle.read(arguments); - if (rect.isEmpty()) - rect = new Rectangle(this._size); - return this.getContext().getImageData(rect.x, rect.y, - rect.width, rect.height); - }, - - setImageData: function(data ) { - var point = Point.read(arguments, 1); - this.getContext(true).putImageData(data, point.x, point.y); - }, - - _getBounds: function(getter, matrix) { - var rect = new Rectangle(this._size).setCenter(0, 0); - return matrix ? matrix._transformBounds(rect) : rect; - }, - - _hitTestSelf: function(point) { - if (this._contains(point)) { - var that = this; - return new HitResult('pixel', that, { - offset: point.add(that._size.divide(2)).round(), - color: { - get: function() { - return that.getPixel(this.offset); - } - } - }); - } - }, - - _draw: function(ctx) { - var element = this.getElement(); - if (element) { - ctx.globalAlpha = this._opacity; - ctx.drawImage(element, - -this._size.width / 2, -this._size.height / 2); - } - }, - - _canComposite: function() { - return true; - } -}); - -var PlacedSymbol = Item.extend({ - _class: 'PlacedSymbol', - _applyMatrix: false, - _canApplyMatrix: false, - _boundsGetter: { getBounds: 'getStrokeBounds' }, - _boundsSelected: true, - _serializeFields: { - symbol: null - }, - - initialize: function PlacedSymbol(arg0, arg1) { - if (!this._initialize(arg0, - arg1 !== undefined && Point.read(arguments, 1))) - this.setSymbol(arg0 instanceof Symbol ? arg0 : new Symbol(arg0)); - }, - - _equals: function(item) { - return this._symbol === item._symbol; - }, - - getSymbol: function() { - return this._symbol; - }, - - setSymbol: function(symbol) { - this._symbol = symbol; - this._changed(9); - }, - - clone: function(insert) { - var copy = new PlacedSymbol(Item.NO_INSERT); - copy.setSymbol(this._symbol); - return this._clone(copy, insert); - }, - - isEmpty: function() { - return this._symbol._definition.isEmpty(); - }, - - _getBounds: function(getter, matrix, cacheItem) { - var definition = this.symbol._definition; - return definition._getCachedBounds(getter, - matrix && matrix.chain(definition._matrix), cacheItem); - }, - - _hitTestSelf: function(point, options) { - var res = this._symbol._definition._hitTest(point, options); - if (res) - res.item = this; - return res; - }, - - _draw: function(ctx, param) { - this.symbol._definition.draw(ctx, param); - } - -}); - -var HitResult = Base.extend({ - _class: 'HitResult', - - initialize: function HitResult(type, item, values) { - this.type = type; - this.item = item; - if (values) { - values.enumerable = true; - this.inject(values); - } - }, - - statics: { - getOptions: function(options) { - return new Base({ - type: null, - tolerance: paper.settings.hitTolerance, - fill: !options, - stroke: !options, - segments: !options, - handles: false, - ends: false, - center: false, - bounds: false, - guides: false, - selected: false - }, options); - } - } -}); - -var Segment = Base.extend({ - _class: 'Segment', - beans: true, - - initialize: function Segment(arg0, arg1, arg2, arg3, arg4, arg5) { - var count = arguments.length, - point, handleIn, handleOut; - if (count === 0) { - } else if (count === 1) { - if ('point' in arg0) { - point = arg0.point; - handleIn = arg0.handleIn; - handleOut = arg0.handleOut; - } else { - point = arg0; - } - } else if (count === 2 && typeof arg0 === 'number') { - point = arguments; - } else if (count <= 3) { - point = arg0; - handleIn = arg1; - handleOut = arg2; - } else { - point = arg0 !== undefined ? [ arg0, arg1 ] : null; - handleIn = arg2 !== undefined ? [ arg2, arg3 ] : null; - handleOut = arg4 !== undefined ? [ arg4, arg5 ] : null; - } - new SegmentPoint(point, this, '_point'); - new SegmentPoint(handleIn, this, '_handleIn'); - new SegmentPoint(handleOut, this, '_handleOut'); - }, - - _serialize: function(options) { - return Base.serialize(this.hasHandles() - ? [this._point, this._handleIn, this._handleOut] - : this._point, - options, true); - }, - - _changed: function(point) { - var path = this._path; - if (!path) - return; - var curves = path._curves, - index = this._index, - curve; - if (curves) { - if ((!point || point === this._point || point === this._handleIn) - && (curve = index > 0 ? curves[index - 1] : path._closed - ? curves[curves.length - 1] : null)) - curve._changed(); - if ((!point || point === this._point || point === this._handleOut) - && (curve = curves[index])) - curve._changed(); - } - path._changed(25); - }, - - getPoint: function() { - return this._point; - }, - - setPoint: function() { - var point = Point.read(arguments); - this._point.set(point.x, point.y); - }, - - getHandleIn: function() { - return this._handleIn; - }, - - setHandleIn: function() { - var point = Point.read(arguments); - this._handleIn.set(point.x, point.y); - }, - - getHandleOut: function() { - return this._handleOut; - }, - - setHandleOut: function() { - var point = Point.read(arguments); - this._handleOut.set(point.x, point.y); - }, - - hasHandles: function() { - return !this._handleIn.isZero() || !this._handleOut.isZero(); - }, - - clearHandles: function() { - this._handleIn.set(0, 0); - this._handleOut.set(0, 0); - }, - - _selectionState: 0, - - isSelected: function(_point) { - var state = this._selectionState; - return !_point ? !!(state & 7) - : _point === this._point ? !!(state & 4) - : _point === this._handleIn ? !!(state & 1) - : _point === this._handleOut ? !!(state & 2) - : false; - }, - - setSelected: function(selected, _point) { - var path = this._path, - selected = !!selected, - state = this._selectionState, - oldState = state, - flag = !_point ? 7 - : _point === this._point ? 4 - : _point === this._handleIn ? 1 - : _point === this._handleOut ? 2 - : 0; - if (selected) { - state |= flag; - } else { - state &= ~flag; - } - this._selectionState = state; - if (path && state !== oldState) { - path._updateSelection(this, oldState, state); - path._changed(129); - } - }, - - getIndex: function() { - return this._index !== undefined ? this._index : null; - }, - - getPath: function() { - return this._path || null; - }, - - getCurve: function() { - var path = this._path, - index = this._index; - if (path) { - if (index > 0 && !path._closed - && index === path._segments.length - 1) - index--; - return path.getCurves()[index] || null; - } - return null; - }, - - getLocation: function() { - var curve = this.getCurve(); - return curve - ? new CurveLocation(curve, this === curve._segment1 ? 0 : 1) - : null; - }, - - getNext: function() { - var segments = this._path && this._path._segments; - return segments && (segments[this._index + 1] - || this._path._closed && segments[0]) || null; - }, - - getPrevious: function() { - var segments = this._path && this._path._segments; - return segments && (segments[this._index - 1] - || this._path._closed && segments[segments.length - 1]) || null; - }, - - isFirst: function() { - return this._index === 0; - }, - - isLast: function() { - var path = this._path; - return path && this._index === path._segments.length - 1 || false; - }, - - reverse: function() { - var handleIn = this._handleIn, - handleOut = this._handleOut, - inX = handleIn._x, - inY = handleIn._y; - handleIn.set(handleOut._x, handleOut._y); - handleOut.set(inX, inY); - }, - - reversed: function() { - return new Segment(this._point, this._handleOut, this._handleIn); - }, - - remove: function() { - return this._path ? !!this._path.removeSegment(this._index) : false; - }, - - clone: function() { - return new Segment(this._point, this._handleIn, this._handleOut); - }, - - equals: function(segment) { - return segment === this || segment && this._class === segment._class - && this._point.equals(segment._point) - && this._handleIn.equals(segment._handleIn) - && this._handleOut.equals(segment._handleOut) - || false; - }, - - toString: function() { - var parts = [ 'point: ' + this._point ]; - if (!this._handleIn.isZero()) - parts.push('handleIn: ' + this._handleIn); - if (!this._handleOut.isZero()) - parts.push('handleOut: ' + this._handleOut); - return '{ ' + parts.join(', ') + ' }'; - }, - - transform: function(matrix) { - this._transformCoordinates(matrix, new Array(6), true); - this._changed(); - }, - - _transformCoordinates: function(matrix, coords, change) { - var point = this._point, - handleIn = !change || !this._handleIn.isZero() - ? this._handleIn : null, - handleOut = !change || !this._handleOut.isZero() - ? this._handleOut : null, - x = point._x, - y = point._y, - i = 2; - coords[0] = x; - coords[1] = y; - if (handleIn) { - coords[i++] = handleIn._x + x; - coords[i++] = handleIn._y + y; - } - if (handleOut) { - coords[i++] = handleOut._x + x; - coords[i++] = handleOut._y + y; - } - if (matrix) { - matrix._transformCoordinates(coords, coords, i / 2); - x = coords[0]; - y = coords[1]; - if (change) { - point._x = x; - point._y = y; - i = 2; - if (handleIn) { - handleIn._x = coords[i++] - x; - handleIn._y = coords[i++] - y; - } - if (handleOut) { - handleOut._x = coords[i++] - x; - handleOut._y = coords[i++] - y; - } - } else { - if (!handleIn) { - coords[i++] = x; - coords[i++] = y; - } - if (!handleOut) { - coords[i++] = x; - coords[i++] = y; - } - } - } - return coords; - } -}); - -var SegmentPoint = Point.extend({ - initialize: function SegmentPoint(point, owner, key) { - var x, y, selected; - if (!point) { - x = y = 0; - } else if ((x = point[0]) !== undefined) { - y = point[1]; - } else { - var pt = point; - if ((x = pt.x) === undefined) { - pt = Point.read(arguments); - x = pt.x; - } - y = pt.y; - selected = pt.selected; - } - this._x = x; - this._y = y; - this._owner = owner; - owner[key] = this; - if (selected) - this.setSelected(true); - }, - - set: function(x, y) { - this._x = x; - this._y = y; - this._owner._changed(this); - return this; - }, - - _serialize: function(options) { - var f = options.formatter, - x = f.number(this._x), - y = f.number(this._y); - return this.isSelected() - ? { x: x, y: y, selected: true } - : [x, y]; - }, - - getX: function() { - return this._x; - }, - - setX: function(x) { - this._x = x; - this._owner._changed(this); - }, - - getY: function() { - return this._y; - }, - - setY: function(y) { - this._y = y; - this._owner._changed(this); - }, - - isZero: function() { - return Numerical.isZero(this._x) && Numerical.isZero(this._y); - }, - - setSelected: function(selected) { - this._owner.setSelected(selected, this); - }, - - isSelected: function() { - return this._owner.isSelected(this); - } -}); - -var Curve = Base.extend({ - _class: 'Curve', - - initialize: function Curve(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { - var count = arguments.length, - seg1, seg2, - point1, point2, - handle1, handle2; - if (count === 3) { - this._path = arg0; - seg1 = arg1; - seg2 = arg2; - } else if (count === 0) { - seg1 = new Segment(); - seg2 = new Segment(); - } else if (count === 1) { - if ('segment1' in arg0) { - seg1 = new Segment(arg0.segment1); - seg2 = new Segment(arg0.segment2); - } else if ('point1' in arg0) { - point1 = arg0.point1; - handle1 = arg0.handle1; - handle2 = arg0.handle2; - point2 = arg0.point2; - } else if (Array.isArray(arg0)) { - point1 = [arg0[0], arg0[1]]; - point2 = [arg0[6], arg0[7]]; - handle1 = [arg0[2] - arg0[0], arg0[3] - arg0[1]]; - handle2 = [arg0[4] - arg0[6], arg0[5] - arg0[7]]; - } - } else if (count === 2) { - seg1 = new Segment(arg0); - seg2 = new Segment(arg1); - } else if (count === 4) { - point1 = arg0; - handle1 = arg1; - handle2 = arg2; - point2 = arg3; - } else if (count === 8) { - point1 = [arg0, arg1]; - point2 = [arg6, arg7]; - handle1 = [arg2 - arg0, arg3 - arg1]; - handle2 = [arg4 - arg6, arg5 - arg7]; - } - this._segment1 = seg1 || new Segment(point1, null, handle1); - this._segment2 = seg2 || new Segment(point2, handle2, null); - }, - - _serialize: function(options) { - return Base.serialize(this.hasHandles() - ? [this.getPoint1(), this.getHandle1(), this.getHandle2(), - this.getPoint2()] - : [this.getPoint1(), this.getPoint2()], - options, true); - }, - - _changed: function() { - this._length = this._bounds = undefined; - }, - - clone: function() { - return new Curve(this._segment1, this._segment2); - }, - - toString: function() { - var parts = [ 'point1: ' + this._segment1._point ]; - if (!this._segment1._handleOut.isZero()) - parts.push('handle1: ' + this._segment1._handleOut); - if (!this._segment2._handleIn.isZero()) - parts.push('handle2: ' + this._segment2._handleIn); - parts.push('point2: ' + this._segment2._point); - return '{ ' + parts.join(', ') + ' }'; - }, - - remove: function() { - var removed = false; - if (this._path) { - var segment2 = this._segment2, - handleOut = segment2._handleOut; - removed = segment2.remove(); - if (removed) - this._segment1._handleOut.set(handleOut.x, handleOut.y); - } - return removed; - }, - - getPoint1: function() { - return this._segment1._point; - }, - - setPoint1: function() { - var point = Point.read(arguments); - this._segment1._point.set(point.x, point.y); - }, - - getPoint2: function() { - return this._segment2._point; - }, - - setPoint2: function() { - var point = Point.read(arguments); - this._segment2._point.set(point.x, point.y); - }, - - getHandle1: function() { - return this._segment1._handleOut; - }, - - setHandle1: function() { - var point = Point.read(arguments); - this._segment1._handleOut.set(point.x, point.y); - }, - - getHandle2: function() { - return this._segment2._handleIn; - }, - - setHandle2: function() { - var point = Point.read(arguments); - this._segment2._handleIn.set(point.x, point.y); - }, - - getSegment1: function() { - return this._segment1; - }, - - getSegment2: function() { - return this._segment2; - }, - - getPath: function() { - return this._path; - }, - - getIndex: function() { - return this._segment1._index; - }, - - getNext: function() { - var curves = this._path && this._path._curves; - return curves && (curves[this._segment1._index + 1] - || this._path._closed && curves[0]) || null; - }, - - getPrevious: function() { - var curves = this._path && this._path._curves; - return curves && (curves[this._segment1._index - 1] - || this._path._closed && curves[curves.length - 1]) || null; - }, - - isFirst: function() { - return this._segment1._index === 0; - }, - - isLast: function() { - var path = this._path; - return path && this._segment1._index === path._curves.length - 1 - || false; - }, - - isSelected: function() { - return this.getPoint1().isSelected() - && this.getHandle2().isSelected() - && this.getHandle2().isSelected() - && this.getPoint2().isSelected(); - }, - - setSelected: function(selected) { - this.getPoint1().setSelected(selected); - this.getHandle1().setSelected(selected); - this.getHandle2().setSelected(selected); - this.getPoint2().setSelected(selected); - }, - - getValues: function(matrix) { - return Curve.getValues(this._segment1, this._segment2, matrix); - }, - - getPoints: function() { - var coords = this.getValues(), - points = []; - for (var i = 0; i < 8; i += 2) - points.push(new Point(coords[i], coords[i + 1])); - return points; - }, - - getLength: function() { - if (this._length == null) - this._length = Curve.getLength(this.getValues(), 0, 1); - return this._length; - }, - - getArea: function() { - return Curve.getArea(this.getValues()); - }, - - getLine: function() { - return new Line(this._segment1._point, this._segment2._point); - }, - - getPart: function(from, to) { - return new Curve(Curve.getPart(this.getValues(), from, to)); - }, - - getPartLength: function(from, to) { - return Curve.getLength(this.getValues(), from, to); - }, - - getIntersections: function(curve) { - return Curve._getIntersections(this.getValues(), - curve && curve !== this ? curve.getValues() : null, - this, curve, [], {}); - }, - - _getParameter: function(offset, isParameter) { - return isParameter - ? offset - : offset && offset.curve === this - ? offset.parameter - : offset === undefined && isParameter === undefined - ? 0.5 - : this.getParameterAt(offset, 0); - }, - - divide: function(offset, isParameter, _setHandles) { - var parameter = this._getParameter(offset, isParameter), - tMin = 4e-7, - tMax = 1 - tMin, - res = null; - if (parameter >= tMin && parameter <= tMax) { - var parts = Curve.subdivide(this.getValues(), parameter), - left = parts[0], - right = parts[1], - setHandles = _setHandles || this.hasHandles(), - segment1 = this._segment1, - segment2 = this._segment2, - path = this._path; - if (setHandles) { - segment1._handleOut.set(left[2] - left[0], - left[3] - left[1]); - segment2._handleIn.set(right[4] - right[6], - right[5] - right[7]); - } - var x = left[6], y = left[7], - segment = new Segment(new Point(x, y), - setHandles && new Point(left[4] - x, left[5] - y), - setHandles && new Point(right[2] - x, right[3] - y)); - if (path) { - path.insert(segment1._index + 1, segment); - res = this.getNext(); - } else { - this._segment2 = segment; - res = new Curve(segment, segment2); - } - } - return res; - }, - - split: function(offset, isParameter) { - return this._path - ? this._path.split(this._segment1._index, - this._getParameter(offset, isParameter)) - : null; - }, - - reversed: function() { - return new Curve(this._segment2.reversed(), this._segment1.reversed()); - }, - - clearHandles: function() { - this._segment1._handleOut.set(0, 0); - this._segment2._handleIn.set(0, 0); - }, - -statics: { - getValues: function(segment1, segment2, matrix) { - var p1 = segment1._point, - h1 = segment1._handleOut, - h2 = segment2._handleIn, - p2 = segment2._point, - values = [ - p1._x, p1._y, - p1._x + h1._x, p1._y + h1._y, - p2._x + h2._x, p2._y + h2._y, - p2._x, p2._y - ]; - if (matrix) - matrix._transformCoordinates(values, values, 4); - return values; - }, - - subdivide: function(v, t) { - var p1x = v[0], p1y = v[1], - c1x = v[2], c1y = v[3], - c2x = v[4], c2y = v[5], - p2x = v[6], p2y = v[7]; - if (t === undefined) - t = 0.5; - var u = 1 - t, - p3x = u * p1x + t * c1x, p3y = u * p1y + t * c1y, - p4x = u * c1x + t * c2x, p4y = u * c1y + t * c2y, - p5x = u * c2x + t * p2x, p5y = u * c2y + t * p2y, - p6x = u * p3x + t * p4x, p6y = u * p3y + t * p4y, - p7x = u * p4x + t * p5x, p7y = u * p4y + t * p5y, - p8x = u * p6x + t * p7x, p8y = u * p6y + t * p7y; - return [ - [p1x, p1y, p3x, p3y, p6x, p6y, p8x, p8y], - [p8x, p8y, p7x, p7y, p5x, p5y, p2x, p2y] - ]; - }, - - solveCubic: function (v, coord, val, roots, min, max) { - var p1 = v[coord], - c1 = v[coord + 2], - c2 = v[coord + 4], - p2 = v[coord + 6], - c = 3 * (c1 - p1), - b = 3 * (c2 - c1) - c, - a = p2 - p1 - c - b; - return Numerical.solveCubic(a, b, c, p1 - val, roots, min, max); - }, - - getParameterOf: function(v, point) { - var p1 = new Point(v[0], v[1]), - p2 = new Point(v[6], v[7]), - epsilon = 1e-12, - t = point.isClose(p1, epsilon) ? 0 - : point.isClose(p2, epsilon) ? 1 - : null; - if (t !== null) - return t; - var coords = [point.x, point.y], - roots = [], - geomEpsilon = 2e-7; - for (var c = 0; c < 2; c++) { - var count = Curve.solveCubic(v, c, coords[c], roots, 0, 1); - for (var i = 0; i < count; i++) { - t = roots[i]; - if (point.isClose(Curve.getPoint(v, t), geomEpsilon)) - return t; - } - } - return point.isClose(p1, geomEpsilon) ? 0 - : point.isClose(p2, geomEpsilon) ? 1 - : null; - }, - - getNearestParameter: function(v, point) { - if (Curve.isStraight(v)) { - var p1x = v[0], p1y = v[1], - p2x = v[6], p2y = v[7], - vx = p2x - p1x, vy = p2y - p1y, - det = vx * vx + vy * vy; - if (det === 0) - return 0; - var u = ((point.x - p1x) * vx + (point.y - p1y) * vy) / det; - return u < 1e-12 ? 0 - : u > 0.999999999999 ? 1 - : Curve.getParameterOf(v, - new Point(p1x + u * vx, p1y + u * vy)); - } - - var count = 100, - minDist = Infinity, - minT = 0; - - function refine(t) { - if (t >= 0 && t <= 1) { - var dist = point.getDistance(Curve.getPoint(v, t), true); - if (dist < minDist) { - minDist = dist; - minT = t; - return true; - } - } - } - - for (var i = 0; i <= count; i++) - refine(i / count); - - var step = 1 / (count * 2); - while (step > 4e-7) { - if (!refine(minT - step) && !refine(minT + step)) - step /= 2; - } - return minT; - }, - - getPart: function(v, from, to) { - var flip = from > to; - if (flip) { - var tmp = from; - from = to; - to = tmp; - } - if (from > 0) - v = Curve.subdivide(v, from)[1]; - if (to < 1) - v = Curve.subdivide(v, (to - from) / (1 - from))[0]; - return flip - ? [v[6], v[7], v[4], v[5], v[2], v[3], v[0], v[1]] - : v; - }, - - hasHandles: function(v) { - var isZero = Numerical.isZero; - return !(isZero(v[0] - v[2]) && isZero(v[1] - v[3]) - && isZero(v[4] - v[6]) && isZero(v[5] - v[7])); - }, - - isFlatEnough: function(v, tolerance) { - var p1x = v[0], p1y = v[1], - c1x = v[2], c1y = v[3], - c2x = v[4], c2y = v[5], - p2x = v[6], p2y = v[7], - ux = 3 * c1x - 2 * p1x - p2x, - uy = 3 * c1y - 2 * p1y - p2y, - vx = 3 * c2x - 2 * p2x - p1x, - vy = 3 * c2y - 2 * p2y - p1y; - return Math.max(ux * ux, vx * vx) + Math.max(uy * uy, vy * vy) - < 10 * tolerance * tolerance; - }, - - getArea: function(v) { - var p1x = v[0], p1y = v[1], - p2x = v[6], p2y = v[7], - h1x = (v[2] + p1x) / 2, - h1y = (v[3] + p1y) / 2, - h2x = (v[4] + v[6]) / 2, - h2y = (v[5] + v[7]) / 2; - return 6 * ((p1x - h1x) * (h1y + p1y) - + (h1x - h2x) * (h2y + h1y) - + (h2x - p2x) * (p2y + h2y)) / 10; - }, - - getBounds: function(v) { - var min = v.slice(0, 2), - max = min.slice(), - roots = [0, 0]; - for (var i = 0; i < 2; i++) - Curve._addBounds(v[i], v[i + 2], v[i + 4], v[i + 6], - i, 0, min, max, roots); - return new Rectangle(min[0], min[1], max[0] - min[0], max[1] - min[1]); - }, - - _addBounds: function(v0, v1, v2, v3, coord, padding, min, max, roots) { - function add(value, padding) { - var left = value - padding, - right = value + padding; - if (left < min[coord]) - min[coord] = left; - if (right > max[coord]) - max[coord] = right; - } - var a = 3 * (v1 - v2) - v0 + v3, - b = 2 * (v0 + v2) - 4 * v1, - c = v1 - v0, - count = Numerical.solveQuadratic(a, b, c, roots), - tMin = 4e-7, - tMax = 1 - tMin; - add(v3, 0); - for (var i = 0; i < count; i++) { - var t = roots[i], - u = 1 - t; - if (tMin < t && t < tMax) - add(u * u * u * v0 - + 3 * u * u * t * v1 - + 3 * u * t * t * v2 - + t * t * t * v3, - padding); - } - } -}}, Base.each( - ['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'], - function(name) { - this[name] = function() { - if (!this._bounds) - this._bounds = {}; - var bounds = this._bounds[name]; - if (!bounds) { - var path = this._path; - bounds = this._bounds[name] = Path[name]( - [this._segment1, this._segment2], false, - path && path.getStyle()); - } - return bounds.clone(); - }; - }, -{ - -}), Base.each({ - isStraight: function(l, h1, h2) { - if (h1.isZero() && h2.isZero()) { - return true; - } else if (l.isZero()) { - return false; - } else if (h1.isCollinear(l) && h2.isCollinear(l)) { - var div = l.dot(l), - p1 = l.dot(h1) / div, - p2 = l.dot(h2) / div; - return p1 >= 0 && p1 <= 1 && p2 <= 0 && p2 >= -1; - } - return false; - }, - - isLinear: function(l, h1, h2) { - var third = l.divide(3); - return h1.equals(third) && h2.negate().equals(third); - } -}, function(test, name) { - this[name] = function() { - var seg1 = this._segment1, - seg2 = this._segment2; - return test(seg2._point.subtract(seg1._point), - seg1._handleOut, seg2._handleIn); - }; - - this.statics[name] = function(v) { - var p1x = v[0], p1y = v[1], - p2x = v[6], p2y = v[7]; - return test(new Point(p2x - p1x, p2y - p1y), - new Point(v[2] - p1x, v[3] - p1y), - new Point(v[4] - p2x, v[5] - p2y)); - }; -}, { - statics: {}, - - hasHandles: function() { - return !this._segment1._handleOut.isZero() - || !this._segment2._handleIn.isZero(); - }, - - isCollinear: function(curve) { - return curve && this.isStraight() && curve.isStraight() - && this.getLine().isCollinear(curve.getLine()); - }, - - isHorizontal: function() { - return this.isStraight() && Math.abs(this.getTangentAt(0.5, true).y) - < 1e-7; - }, - - isVertical: function() { - return this.isStraight() && Math.abs(this.getTangentAt(0.5, true).x) - < 1e-7; - } -}), { - beans: false, - - getParameterAt: function(offset, start) { - return Curve.getParameterAt(this.getValues(), offset, start); - }, - - getParameterOf: function() { - return Curve.getParameterOf(this.getValues(), Point.read(arguments)); - }, - - getLocationAt: function(offset, isParameter) { - var t = isParameter ? offset : this.getParameterAt(offset); - return t != null && t >= 0 && t <= 1 - ? new CurveLocation(this, t) - : null; - }, - - getLocationOf: function() { - return this.getLocationAt(this.getParameterOf(Point.read(arguments)), - true); - }, - - getOffsetOf: function() { - var loc = this.getLocationOf.apply(this, arguments); - return loc ? loc.getOffset() : null; - }, - - getNearestLocation: function() { - var point = Point.read(arguments), - values = this.getValues(), - t = Curve.getNearestParameter(values, point), - pt = Curve.getPoint(values, t); - return new CurveLocation(this, t, pt, null, point.getDistance(pt)); - }, - - getNearestPoint: function() { - return this.getNearestLocation.apply(this, arguments).getPoint(); - } - -}, -new function() { - var methods = ['getPoint', 'getTangent', 'getNormal', 'getWeightedTangent', - 'getWeightedNormal', 'getCurvature']; - return Base.each(methods, - function(name) { - this[name + 'At'] = function(offset, isParameter) { - var values = this.getValues(); - return Curve[name](values, isParameter ? offset - : Curve.getParameterAt(values, offset, 0)); - }; - }, { - statics: { - evaluateMethods: methods - } - }) -}, -new function() { - - function getLengthIntegrand(v) { - var p1x = v[0], p1y = v[1], - c1x = v[2], c1y = v[3], - c2x = v[4], c2y = v[5], - p2x = v[6], p2y = v[7], - - ax = 9 * (c1x - c2x) + 3 * (p2x - p1x), - bx = 6 * (p1x + c2x) - 12 * c1x, - cx = 3 * (c1x - p1x), - - ay = 9 * (c1y - c2y) + 3 * (p2y - p1y), - by = 6 * (p1y + c2y) - 12 * c1y, - cy = 3 * (c1y - p1y); - - return function(t) { - var dx = (ax * t + bx) * t + cx, - dy = (ay * t + by) * t + cy; - return Math.sqrt(dx * dx + dy * dy); - }; - } - - function getIterations(a, b) { - return Math.max(2, Math.min(16, Math.ceil(Math.abs(b - a) * 32))); - } - - function evaluate(v, t, type, normalized) { - if (t == null || t < 0 || t > 1) - return null; - var p1x = v[0], p1y = v[1], - c1x = v[2], c1y = v[3], - c2x = v[4], c2y = v[5], - p2x = v[6], p2y = v[7], - tMin = 4e-7, - tMax = 1 - tMin, - x, y; - - if (type === 0 && (t < tMin || t > tMax)) { - var isZero = t < tMin; - x = isZero ? p1x : p2x; - y = isZero ? p1y : p2y; - } else { - var cx = 3 * (c1x - p1x), - bx = 3 * (c2x - c1x) - cx, - ax = p2x - p1x - cx - bx, - - cy = 3 * (c1y - p1y), - by = 3 * (c2y - c1y) - cy, - ay = p2y - p1y - cy - by; - if (type === 0) { - x = ((ax * t + bx) * t + cx) * t + p1x; - y = ((ay * t + by) * t + cy) * t + p1y; - } else { - if (t < tMin) { - x = cx; - y = cy; - } else if (t > tMax) { - x = 3 * (p2x - c2x); - y = 3 * (p2y - c2y); - } else { - x = (3 * ax * t + 2 * bx) * t + cx; - y = (3 * ay * t + 2 * by) * t + cy; - } - if (normalized) { - if (x === 0 && y === 0 && (t < tMin || t > tMax)) { - x = c2x - c1x; - y = c2y - c1y; - } - var len = Math.sqrt(x * x + y * y); - if (len) { - x /= len; - y /= len; - } - } - if (type === 3) { - var x2 = 6 * ax * t + 2 * bx, - y2 = 6 * ay * t + 2 * by, - d = Math.pow(x * x + y * y, 3 / 2); - x = d !== 0 ? (x * y2 - y * x2) / d : 0; - y = 0; - } - } - } - return type === 2 ? new Point(y, -x) : new Point(x, y); - } - - return { statics: { - - getLength: function(v, a, b) { - if (a === undefined) - a = 0; - if (b === undefined) - b = 1; - if (a === 0 && b === 1 && Curve.isStraight(v)) { - var dx = v[6] - v[0], - dy = v[7] - v[1]; - return Math.sqrt(dx * dx + dy * dy); - } - var ds = getLengthIntegrand(v); - return Numerical.integrate(ds, a, b, getIterations(a, b)); - }, - - getParameterAt: function(v, offset, start) { - if (start === undefined) - start = offset < 0 ? 1 : 0 - if (offset === 0) - return start; - var abs = Math.abs, - forward = offset > 0, - a = forward ? start : 0, - b = forward ? 1 : start, - ds = getLengthIntegrand(v), - rangeLength = Numerical.integrate(ds, a, b, - getIterations(a, b)); - if (abs(offset - rangeLength) < 1e-12) { - return forward ? b : a; - } else if (abs(offset) > rangeLength) { - return null; - } - var guess = offset / rangeLength, - length = 0; - function f(t) { - length += Numerical.integrate(ds, start, t, - getIterations(start, t)); - start = t; - return length - offset; - } - return Numerical.findRoot(f, ds, start + guess, a, b, 32, - 1e-12); - }, - - getPoint: function(v, t) { - return evaluate(v, t, 0, false); - }, - - getTangent: function(v, t) { - return evaluate(v, t, 1, true); - }, - - getWeightedTangent: function(v, t) { - return evaluate(v, t, 1, false); - }, - - getNormal: function(v, t) { - return evaluate(v, t, 2, true); - }, - - getWeightedNormal: function(v, t) { - return evaluate(v, t, 2, false); - }, - - getCurvature: function(v, t) { - return evaluate(v, t, 3, false).x; - } - }}; -}, -new function() { - - function addLocation(locations, param, v1, c1, t1, p1, v2, c2, t2, p2, - overlap) { - var startConnected = param.startConnected, - endConnected = param.endConnected, - tMin = 4e-7, - tMax = 1 - tMin; - if (t1 == null) - t1 = Curve.getParameterOf(v1, p1); - if (t1 !== null && t1 >= (startConnected ? tMin : 0) && - t1 <= (endConnected ? tMax : 1)) { - if (t2 == null) - t2 = Curve.getParameterOf(v2, p2); - if (t2 !== null && t2 >= (endConnected ? tMin : 0) && - t2 <= (startConnected ? tMax : 1)) { - var renormalize = param.renormalize; - if (renormalize) { - var res = renormalize(t1, t2); - t1 = res[0]; - t2 = res[1]; - } - var loc1 = new CurveLocation(c1, t1, - p1 || Curve.getPoint(v1, t1), overlap), - loc2 = new CurveLocation(c2, t2, - p2 || Curve.getPoint(v2, t2), overlap), - flip = loc1.getPath() === loc2.getPath() - && loc1.getIndex() > loc2.getIndex(), - loc = flip ? loc2 : loc1, - include = param.include; - loc1._intersection = loc2; - loc2._intersection = loc1; - if (!include || include(loc)) { - CurveLocation.insert(locations, loc, true); - } - } - } - } - - function addCurveIntersections(v1, v2, c1, c2, locations, param, - tMin, tMax, uMin, uMax, oldTDiff, reverse, recursion) { - if (++recursion >= 24) - return; - var q0x = v2[0], q0y = v2[1], q3x = v2[6], q3y = v2[7], - getSignedDistance = Line.getSignedDistance, - d1 = getSignedDistance(q0x, q0y, q3x, q3y, v2[2], v2[3]), - d2 = getSignedDistance(q0x, q0y, q3x, q3y, v2[4], v2[5]), - factor = d1 * d2 > 0 ? 3 / 4 : 4 / 9, - dMin = factor * Math.min(0, d1, d2), - dMax = factor * Math.max(0, d1, d2), - dp0 = getSignedDistance(q0x, q0y, q3x, q3y, v1[0], v1[1]), - dp1 = getSignedDistance(q0x, q0y, q3x, q3y, v1[2], v1[3]), - dp2 = getSignedDistance(q0x, q0y, q3x, q3y, v1[4], v1[5]), - dp3 = getSignedDistance(q0x, q0y, q3x, q3y, v1[6], v1[7]), - hull = getConvexHull(dp0, dp1, dp2, dp3), - top = hull[0], - bottom = hull[1], - tMinClip, - tMaxClip; - if ((tMinClip = clipConvexHull(top, bottom, dMin, dMax)) == null || - (tMaxClip = clipConvexHull(top.reverse(), bottom.reverse(), - dMin, dMax)) == null) - return; - v1 = Curve.getPart(v1, tMinClip, tMaxClip); - var tDiff = tMaxClip - tMinClip, - tMinNew = tMin + (tMax - tMin) * tMinClip, - tMaxNew = tMin + (tMax - tMin) * tMaxClip; - if (oldTDiff > 0.5 && tDiff > 0.5) { - if (tMaxNew - tMinNew > uMax - uMin) { - var parts = Curve.subdivide(v1, 0.5), - t = tMinNew + (tMaxNew - tMinNew) / 2; - addCurveIntersections( - v2, parts[0], c2, c1, locations, param, - uMin, uMax, tMinNew, t, tDiff, !reverse, recursion); - addCurveIntersections( - v2, parts[1], c2, c1, locations, param, - uMin, uMax, t, tMaxNew, tDiff, !reverse, recursion); - } else { - var parts = Curve.subdivide(v2, 0.5), - t = uMin + (uMax - uMin) / 2; - addCurveIntersections( - parts[0], v1, c2, c1, locations, param, - uMin, t, tMinNew, tMaxNew, tDiff, !reverse, recursion); - addCurveIntersections( - parts[1], v1, c2, c1, locations, param, - t, uMax, tMinNew, tMaxNew, tDiff, !reverse, recursion); - } - } else if (Math.max(uMax - uMin, tMaxNew - tMinNew) - < 1e-7) { - var t1 = tMinNew + (tMaxNew - tMinNew) / 2, - t2 = uMin + (uMax - uMin) / 2; - v1 = c1.getValues(); - v2 = c2.getValues(); - addLocation(locations, param, - reverse ? v2 : v1, reverse ? c2 : c1, reverse ? t2 : t1, null, - reverse ? v1 : v2, reverse ? c1 : c2, reverse ? t1 : t2, null); - } else if (tDiff > 1e-12) { - addCurveIntersections(v2, v1, c2, c1, locations, param, - uMin, uMax, tMinNew, tMaxNew, tDiff, !reverse, recursion); - } - } - - function getConvexHull(dq0, dq1, dq2, dq3) { - var p0 = [ 0, dq0 ], - p1 = [ 1 / 3, dq1 ], - p2 = [ 2 / 3, dq2 ], - p3 = [ 1, dq3 ], - dist1 = dq1 - (2 * dq0 + dq3) / 3, - dist2 = dq2 - (dq0 + 2 * dq3) / 3, - hull; - if (dist1 * dist2 < 0) { - hull = [[p0, p1, p3], [p0, p2, p3]]; - } else { - var distRatio = dist1 / dist2; - hull = [ - distRatio >= 2 ? [p0, p1, p3] - : distRatio <= .5 ? [p0, p2, p3] - : [p0, p1, p2, p3], - [p0, p3] - ]; - } - return (dist1 || dist2) < 0 ? hull.reverse() : hull; - } - - function clipConvexHull(hullTop, hullBottom, dMin, dMax) { - if (hullTop[0][1] < dMin) { - return clipConvexHullPart(hullTop, true, dMin); - } else if (hullBottom[0][1] > dMax) { - return clipConvexHullPart(hullBottom, false, dMax); - } else { - return hullTop[0][0]; - } - } - - function clipConvexHullPart(part, top, threshold) { - var px = part[0][0], - py = part[0][1]; - for (var i = 1, l = part.length; i < l; i++) { - var qx = part[i][0], - qy = part[i][1]; - if (top ? qy >= threshold : qy <= threshold) { - return qy === threshold ? qx - : px + (threshold - py) * (qx - px) / (qy - py); - } - px = qx; - py = qy; - } - return null; - } - - function addCurveLineIntersections(v1, v2, c1, c2, locations, param) { - var flip = Curve.isStraight(v1), - vc = flip ? v2 : v1, - vl = flip ? v1 : v2, - lx1 = vl[0], ly1 = vl[1], - lx2 = vl[6], ly2 = vl[7], - ldx = lx2 - lx1, - ldy = ly2 - ly1, - angle = Math.atan2(-ldy, ldx), - sin = Math.sin(angle), - cos = Math.cos(angle), - rvc = []; - for(var i = 0; i < 8; i += 2) { - var x = vc[i] - lx1, - y = vc[i + 1] - ly1; - rvc.push( - x * cos - y * sin, - x * sin + y * cos); - } - var roots = [], - count = Curve.solveCubic(rvc, 1, 0, roots, 0, 1); - for (var i = 0; i < count; i++) { - var tc = roots[i], - pc = Curve.getPoint(vc, tc), - tl = Curve.getParameterOf(vl, pc); - if (tl !== null) { - var pl = Curve.getPoint(vl, tl), - t1 = flip ? tl : tc, - t2 = flip ? tc : tl; - if (!param.endConnected || t2 > Numerical.CURVETIME_EPSILON) { - addLocation(locations, param, - v1, c1, t1, flip ? pl : pc, - v2, c2, t2, flip ? pc : pl); - } - } - } - } - - function addLineIntersection(v1, v2, c1, c2, locations, param) { - var pt = Line.intersect( - v1[0], v1[1], v1[6], v1[7], - v2[0], v2[1], v2[6], v2[7]); - if (pt) { - addLocation(locations, param, v1, c1, null, pt, v2, c2, null, pt); - } - } - - return { statics: { - _getIntersections: function(v1, v2, c1, c2, locations, param) { - if (!v2) { - return Curve._getSelfIntersection(v1, c1, locations, param); - } - var c1p1x = v1[0], c1p1y = v1[1], - c1p2x = v1[6], c1p2y = v1[7], - c2p1x = v2[0], c2p1y = v2[1], - c2p2x = v2[6], c2p2y = v2[7], - c1s1x = (3 * v1[2] + c1p1x) / 4, - c1s1y = (3 * v1[3] + c1p1y) / 4, - c1s2x = (3 * v1[4] + c1p2x) / 4, - c1s2y = (3 * v1[5] + c1p2y) / 4, - c2s1x = (3 * v2[2] + c2p1x) / 4, - c2s1y = (3 * v2[3] + c2p1y) / 4, - c2s2x = (3 * v2[4] + c2p2x) / 4, - c2s2y = (3 * v2[5] + c2p2y) / 4, - min = Math.min, - max = Math.max; - if (!( max(c1p1x, c1s1x, c1s2x, c1p2x) >= - min(c2p1x, c2s1x, c2s2x, c2p2x) && - min(c1p1x, c1s1x, c1s2x, c1p2x) <= - max(c2p1x, c2s1x, c2s2x, c2p2x) && - max(c1p1y, c1s1y, c1s2y, c1p2y) >= - min(c2p1y, c2s1y, c2s2y, c2p2y) && - min(c1p1y, c1s1y, c1s2y, c1p2y) <= - max(c2p1y, c2s1y, c2s2y, c2p2y))) - return locations; - if (!param.startConnected && !param.endConnected) { - var overlaps = Curve.getOverlaps(v1, v2); - if (overlaps) { - for (var i = 0; i < 2; i++) { - var overlap = overlaps[i]; - addLocation(locations, param, - v1, c1, overlap[0], null, - v2, c2, overlap[1], null, true); - } - return locations; - } - } - - var straight1 = Curve.isStraight(v1), - straight2 = Curve.isStraight(v2), - straight = straight1 && straight2, - epsilon = 1e-12, - before = locations.length; - (straight - ? addLineIntersection - : straight1 || straight2 - ? addCurveLineIntersections - : addCurveIntersections)( - v1, v2, c1, c2, locations, param, - 0, 1, 0, 1, 0, false, 0); - if (straight && locations.length > before) - return locations; - var c1p1 = new Point(c1p1x, c1p1y), - c1p2 = new Point(c1p2x, c1p2y), - c2p1 = new Point(c2p1x, c2p1y), - c2p2 = new Point(c2p2x, c2p2y); - if (c1p1.isClose(c2p1, epsilon)) - addLocation(locations, param, v1, c1, 0, c1p1, v2, c2, 0, c2p1); - if (!param.startConnected && c1p1.isClose(c2p2, epsilon)) - addLocation(locations, param, v1, c1, 0, c1p1, v2, c2, 1, c2p2); - if (!param.endConnected && c1p2.isClose(c2p1, epsilon)) - addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 0, c2p1); - if (c1p2.isClose(c2p2, epsilon)) - addLocation(locations, param, v1, c1, 1, c1p2, v2, c2, 1, c2p2); - return locations; - }, - - _getSelfIntersection: function(v1, c1, locations, param) { - var p1x = v1[0], p1y = v1[1], - h1x = v1[2], h1y = v1[3], - h2x = v1[4], h2y = v1[5], - p2x = v1[6], p2y = v1[7]; - var line = new Line(p1x, p1y, p2x, p2y, false), - side1 = line.getSide(new Point(h1x, h1y), true), - side2 = line.getSide(new Point(h2x, h2y), true); - if (side1 === side2) { - var edgeSum = (p1x - h2x) * (h1y - p2y) - + (h1x - p2x) * (h2y - p1y); - if (edgeSum * side1 > 0) - return locations; - } - var ax = p2x - 3 * h2x + 3 * h1x - p1x, - bx = h2x - 2 * h1x + p1x, - cx = h1x - p1x, - ay = p2y - 3 * h2y + 3 * h1y - p1y, - by = h2y - 2 * h1y + p1y, - cy = h1y - p1y, - ac = ay * cx - ax * cy, - ab = ay * bx - ax * by, - bc = by * cx - bx * cy; - if (ac * ac - 4 * ab * bc < 0) { - var roots = [], - tSplit, - count = Numerical.solveCubic( - ax * ax + ay * ay, - 3 * (ax * bx + ay * by), - 2 * (bx * bx + by * by) + ax * cx + ay * cy, - bx * cx + by * cy, - roots, 0, 1); - if (count > 0) { - for (var i = 0, maxCurvature = 0; i < count; i++) { - var curvature = Math.abs( - c1.getCurvatureAt(roots[i], true)); - if (curvature > maxCurvature) { - maxCurvature = curvature; - tSplit = roots[i]; - } - } - var parts = Curve.subdivide(v1, tSplit); - param.endConnected = true; - param.renormalize = function(t1, t2) { - return [t1 * tSplit, t2 * (1 - tSplit) + tSplit]; - }; - Curve._getIntersections(parts[0], parts[1], c1, c1, - locations, param); - } - } - return locations; - }, - - getOverlaps: function(v1, v2) { - var abs = Math.abs, - timeEpsilon = 4e-7, - geomEpsilon = 2e-7, - straight1 = Curve.isStraight(v1), - straight2 = Curve.isStraight(v2), - straight = straight1 && straight2; - - function getLineLengthSquared(v) { - var x = v[6] - v[0], - y = v[7] - v[1]; - return x * x + y * y; - } - - if (straight) { - var flip = getLineLengthSquared(v1) < getLineLengthSquared(v2), - l1 = flip ? v2 : v1, - l2 = flip ? v1 : v2, - line = new Line(l1[0], l1[1], l1[6], l1[7]); - if (line.getDistance(new Point(l2[0], l2[1])) > geomEpsilon || - line.getDistance(new Point(l2[6], l2[7])) > geomEpsilon) - return null; - } else if (straight1 ^ straight2) { - return null; - } - - var v = [v1, v2], - pairs = []; - for (var i = 0, t1 = 0; - i < 2 && pairs.length < 2; - i += t1 === 0 ? 0 : 1, t1 = t1 ^ 1) { - var t2 = Curve.getParameterOf(v[i ^ 1], new Point( - v[i][t1 === 0 ? 0 : 6], - v[i][t1 === 0 ? 1 : 7])); - if (t2 != null) { - var pair = i === 0 ? [t1, t2] : [t2, t1]; - if (pairs.length === 0 || - abs(pair[0] - pairs[0][0]) > timeEpsilon && - abs(pair[1] - pairs[0][1]) > timeEpsilon) - pairs.push(pair); - } - if (i === 1 && pairs.length === 0) - break; - } - if (pairs.length !== 2) { - pairs = null; - } else if (!straight) { - var o1 = Curve.getPart(v1, pairs[0][0], pairs[1][0]), - o2 = Curve.getPart(v2, pairs[0][1], pairs[1][1]); - if (abs(o2[2] - o1[2]) > geomEpsilon || - abs(o2[3] - o1[3]) > geomEpsilon || - abs(o2[4] - o1[4]) > geomEpsilon || - abs(o2[5] - o1[5]) > geomEpsilon) - pairs = null; - } - return pairs; - } - }}; -}); - -var CurveLocation = Base.extend({ - _class: 'CurveLocation', - beans: true, - - initialize: function CurveLocation(curve, parameter, point, - _overlap, _distance) { - if (parameter > 0.9999996) { - var next = curve.getNext(); - if (next) { - parameter = 0; - curve = next; - } - } - this._id = UID.get(CurveLocation); - this._setCurve(curve); - this._parameter = parameter; - this._point = point || curve.getPointAt(parameter, true); - this._overlap = _overlap; - this._distance = _distance; - this._intersection = this._next = this._prev = null; - }, - - _setCurve: function(curve) { - var path = curve._path; - this._version = path ? path._version : 0; - this._curve = curve; - this._segment = null; - this._segment1 = curve._segment1; - this._segment2 = curve._segment2; - }, - - _setSegment: function(segment) { - this._setCurve(segment.getCurve()); - this._segment = segment; - this._parameter = segment === this._segment1 ? 0 : 1; - this._point = segment._point.clone(); - }, - - getSegment: function() { - var curve = this.getCurve(), - segment = this._segment; - if (!segment) { - var parameter = this.getParameter(); - if (parameter === 0) { - segment = curve._segment1; - } else if (parameter === 1) { - segment = curve._segment2; - } else if (parameter != null) { - segment = curve.getPartLength(0, parameter) - < curve.getPartLength(parameter, 1) - ? curve._segment1 - : curve._segment2; - } - this._segment = segment; - } - return segment; - }, - - getCurve: function() { - var curve = this._curve, - path = curve && curve._path, - that = this; - if (path && path._version !== this._version) { - curve = this._parameter = this._curve = this._offset = null; - } - - function trySegment(segment) { - var curve = segment && segment.getCurve(); - if (curve && (that._parameter = curve.getParameterOf(that._point)) - != null) { - that._setCurve(curve); - that._segment = segment; - return curve; - } - } - - return curve - || trySegment(this._segment) - || trySegment(this._segment1) - || trySegment(this._segment2.getPrevious()); - }, - - getPath: function() { - var curve = this.getCurve(); - return curve && curve._path; - }, - - getIndex: function() { - var curve = this.getCurve(); - return curve && curve.getIndex(); - }, - - getParameter: function() { - var curve = this.getCurve(), - parameter = this._parameter; - return curve && parameter == null - ? this._parameter = curve.getParameterOf(this._point) - : parameter; - }, - - getPoint: function() { - return this._point; - }, - - getOffset: function() { - var offset = this._offset; - if (offset == null) { - offset = 0; - var path = this.getPath(), - index = this.getIndex(); - if (path && index != null) { - var curves = path.getCurves(); - for (var i = 0; i < index; i++) - offset += curves[i].getLength(); - } - this._offset = offset += this.getCurveOffset(); - } - return offset; - }, - - getCurveOffset: function() { - var curve = this.getCurve(), - parameter = this.getParameter(); - return parameter != null && curve && curve.getPartLength(0, parameter); - }, - - getIntersection: function() { - return this._intersection; - }, - - getDistance: function() { - return this._distance; - }, - - divide: function() { - var curve = this.getCurve(), - res = null; - if (curve) { - res = curve.divide(this.getParameter(), true); - if (res) - this._setSegment(res._segment1); - } - return res; - }, - - split: function() { - var curve = this.getCurve(); - return curve ? curve.split(this.getParameter(), true) : null; - }, - - equals: function(loc, _ignoreOther) { - var res = this === loc, - epsilon = 2e-7; - if (!res && loc instanceof CurveLocation - && this.getPath() === loc.getPath() - && this.getPoint().isClose(loc.getPoint(), epsilon)) { - var c1 = this.getCurve(), - c2 = loc.getCurve(), - abs = Math.abs, - diff = abs( - ((c1.isLast() && c2.isFirst() ? -1 : c1.getIndex()) - + this.getParameter()) - - ((c2.isLast() && c1.isFirst() ? -1 : c2.getIndex()) - + loc.getParameter())); - res = (diff < 4e-7 - || ((diff = abs(this.getOffset() - loc.getOffset())) < epsilon - || abs(this.getPath().getLength() - diff) < epsilon)) - && (_ignoreOther - || (!this._intersection && !loc._intersection - || this._intersection && this._intersection.equals( - loc._intersection, true))); - } - return res; - }, - - toString: function() { - var parts = [], - point = this.getPoint(), - f = Formatter.instance; - if (point) - parts.push('point: ' + point); - var index = this.getIndex(); - if (index != null) - parts.push('index: ' + index); - var parameter = this.getParameter(); - if (parameter != null) - parts.push('parameter: ' + f.number(parameter)); - if (this._distance != null) - parts.push('distance: ' + f.number(this._distance)); - return '{ ' + parts.join(', ') + ' }'; - }, - - isTouching: function() { - var inter = this._intersection; - if (inter && this.getTangent().isCollinear(inter.getTangent())) { - var curve1 = this.getCurve(), - curve2 = inter.getCurve(); - return !(curve1.isStraight() && curve2.isStraight() - && curve1.getLine().intersect(curve2.getLine())); - } - return false; - }, - - isCrossing: function() { - var inter = this._intersection; - if (!inter) - return false; - var t1 = this.getParameter(), - t2 = inter.getParameter(), - tMin = 4e-7, - tMax = 1 - tMin; - if (t1 >= tMin && t1 <= tMax || t2 >= tMin && t2 <= tMax) - return !this.isTouching(); - var c2 = this.getCurve(), - c1 = c2.getPrevious(), - c4 = inter.getCurve(), - c3 = c4.getPrevious(), - PI = Math.PI; - if (!c1 || !c3) - return false; - - function isInRange(angle, min, max) { - return min < max - ? angle > min && angle < max - : angle > min && angle <= PI || angle >= -PI && angle < max; - } - - var a1 = c1.getTangentAt(tMax, true).negate().getAngleInRadians(), - a2 = c2.getTangentAt(tMin, true).getAngleInRadians(), - a3 = c3.getTangentAt(tMax, true).negate().getAngleInRadians(), - a4 = c4.getTangentAt(tMin, true).getAngleInRadians(); - - return (isInRange(a3, a1, a2) ^ isInRange(a4, a1, a2)) - && (isInRange(a3, a2, a1) ^ isInRange(a4, a2, a1)); - }, - - isOverlap: function() { - return !!this._overlap; - } -}, Base.each(Curve.evaluateMethods, function(name) { - var get = name + 'At'; - this[name] = function() { - var parameter = this.getParameter(), - curve = this.getCurve(); - return parameter != null && curve && curve[get](parameter, true); - }; -}, { - preserve: true -}), -new function() { - - function insert(locations, loc, merge) { - var length = locations.length, - l = 0, - r = length - 1; - - function search(index, dir) { - for (var i = index + dir; i >= -1 && i <= length; i += dir) { - var loc2 = locations[((i % length) + length) % length]; - if (!loc.getPoint().isClose(loc2.getPoint(), - 2e-7)) - break; - if (loc.equals(loc2)) - return loc2; - } - return null; - } - - while (l <= r) { - var m = (l + r) >>> 1, - loc2 = locations[m], - found; - if (merge && (found = loc.equals(loc2) ? loc2 - : (search(m, -1) || search(m, 1)))) { - if (loc._overlap) { - found._overlap = found._intersection._overlap = true; - } - return found; - } - var path1 = loc.getPath(), - path2 = loc2.getPath(), - diff = path1 === path2 - ? (loc.getIndex() + loc.getParameter()) - - (loc2.getIndex() + loc2.getParameter()) - : path1._id - path2._id; - if (diff < 0) { - r = m - 1; - } else { - l = m + 1; - } - } - locations.splice(l, 0, loc); - return loc; - } - - return { statics: { - insert: insert, - - expand: function(locations) { - var expanded = locations.slice(); - for (var i = 0, l = locations.length; i < l; i++) { - insert(expanded, locations[i]._intersection, false); - } - return expanded; - } - }}; -}); - -var PathItem = Item.extend({ - _class: 'PathItem', - - initialize: function PathItem() { - }, - - getIntersections: function(path, include, _matrix, _returnFirst) { - var self = this === path || !path, - matrix1 = this._matrix.orNullIfIdentity(), - matrix2 = self ? matrix1 - : (_matrix || path._matrix).orNullIfIdentity(); - if (!self && !this.getBounds(matrix1).touches(path.getBounds(matrix2))) - return []; - var curves1 = this.getCurves(), - curves2 = self ? curves1 : path.getCurves(), - length1 = curves1.length, - length2 = self ? length1 : curves2.length, - values2 = [], - arrays = [], - locations, - path; - for (var i = 0; i < length2; i++) - values2[i] = curves2[i].getValues(matrix2); - for (var i = 0; i < length1; i++) { - var curve1 = curves1[i], - values1 = self ? values2[i] : curve1.getValues(matrix1), - path1 = curve1.getPath(); - if (path1 !== path) { - path = path1; - locations = []; - arrays.push(locations); - } - if (self) { - Curve._getSelfIntersection(values1, curve1, locations, { - include: include, - startConnected: length1 === 1 && - curve1.getPoint1().equals(curve1.getPoint2()) - }); - } - for (var j = self ? i + 1 : 0; j < length2; j++) { - if (_returnFirst && locations.length) - return locations; - var curve2 = curves2[j]; - Curve._getIntersections( - values1, values2[j], curve1, curve2, locations, - { - include: include, - startConnected: self && curve1.getPrevious() === curve2, - endConnected: self && curve1.getNext() === curve2 - } - ); - } - } - locations = []; - for (var i = 0, l = arrays.length; i < l; i++) { - locations.push.apply(locations, arrays[i]); - } - return locations; - }, - - getCrossings: function(path) { - return this.getIntersections(path, function(inter) { - return inter.isCrossing(); - }); - }, - - _asPathItem: function() { - return this; - }, - - setPathData: function(data) { - - var parts = data.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/ig), - coords, - relative = false, - previous, - control, - current = new Point(), - start = new Point(); - - function getCoord(index, coord) { - var val = +coords[index]; - if (relative) - val += current[coord]; - return val; - } - - function getPoint(index) { - return new Point( - getCoord(index, 'x'), - getCoord(index + 1, 'y') - ); - } - - this.clear(); - - for (var i = 0, l = parts && parts.length; i < l; i++) { - var part = parts[i], - command = part[0], - lower = command.toLowerCase(); - coords = part.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g); - var length = coords && coords.length; - relative = command === lower; - if (previous === 'z' && !/[mz]/.test(lower)) - this.moveTo(current = start); - switch (lower) { - case 'm': - case 'l': - var move = lower === 'm'; - for (var j = 0; j < length; j += 2) - this[j === 0 && move ? 'moveTo' : 'lineTo']( - current = getPoint(j)); - control = current; - if (move) - start = current; - break; - case 'h': - case 'v': - var coord = lower === 'h' ? 'x' : 'y'; - for (var j = 0; j < length; j++) { - current[coord] = getCoord(j, coord); - this.lineTo(current); - } - control = current; - break; - case 'c': - for (var j = 0; j < length; j += 6) { - this.cubicCurveTo( - getPoint(j), - control = getPoint(j + 2), - current = getPoint(j + 4)); - } - break; - case 's': - for (var j = 0; j < length; j += 4) { - this.cubicCurveTo( - /[cs]/.test(previous) - ? current.multiply(2).subtract(control) - : current, - control = getPoint(j), - current = getPoint(j + 2)); - previous = lower; - } - break; - case 'q': - for (var j = 0; j < length; j += 4) { - this.quadraticCurveTo( - control = getPoint(j), - current = getPoint(j + 2)); - } - break; - case 't': - for (var j = 0; j < length; j += 2) { - this.quadraticCurveTo( - control = (/[qt]/.test(previous) - ? current.multiply(2).subtract(control) - : current), - current = getPoint(j)); - previous = lower; - } - break; - case 'a': - for (var j = 0; j < length; j += 7) { - this.arcTo(current = getPoint(j + 5), - new Size(+coords[j], +coords[j + 1]), - +coords[j + 2], +coords[j + 4], +coords[j + 3]); - } - break; - case 'z': - this.closePath(true); - break; - } - previous = lower; - } - }, - - _canComposite: function() { - return !(this.hasFill() && this.hasStroke()); - }, - - _contains: function(point) { - var winding = this._getWinding(point, false, true); - return !!(this.getWindingRule() === 'evenodd' ? winding & 1 : winding); - } - -}); - -var Path = PathItem.extend({ - _class: 'Path', - _serializeFields: { - segments: [], - closed: false - }, - - initialize: function Path(arg) { - this._closed = false; - this._segments = []; - this._version = 0; - var segments = Array.isArray(arg) - ? typeof arg[0] === 'object' - ? arg - : arguments - : arg && (arg.size === undefined && (arg.x !== undefined - || arg.point !== undefined)) - ? arguments - : null; - if (segments && segments.length > 0) { - this.setSegments(segments); - } else { - this._curves = undefined; - this._selectedSegmentState = 0; - if (!segments && typeof arg === 'string') { - this.setPathData(arg); - arg = null; - } - } - this._initialize(!segments && arg); - }, - - _equals: function(item) { - return this._closed === item._closed - && Base.equals(this._segments, item._segments); - }, - - clone: function(insert) { - var copy = new Path(Item.NO_INSERT); - copy.setSegments(this._segments); - copy._closed = this._closed; - if (this._clockwise !== undefined) - copy._clockwise = this._clockwise; - return this._clone(copy, insert); - }, - - _changed: function _changed(flags) { - _changed.base.call(this, flags); - if (flags & 8) { - var parent = this._parent; - if (parent) - parent._currentPath = undefined; - this._length = this._area = this._clockwise = this._monoCurves = - undefined; - if (flags & 16) { - this._version++; - } else if (this._curves) { - for (var i = 0, l = this._curves.length; i < l; i++) - this._curves[i]._changed(); - } - } else if (flags & 32) { - this._bounds = undefined; - } - }, - - getStyle: function() { - var parent = this._parent; - return (parent instanceof CompoundPath ? parent : this)._style; - }, - - getSegments: function() { - return this._segments; - }, - - setSegments: function(segments) { - var fullySelected = this.isFullySelected(); - this._segments.length = 0; - this._selectedSegmentState = 0; - this._curves = undefined; - if (segments && segments.length > 0) - this._add(Segment.readAll(segments)); - if (fullySelected) - this.setFullySelected(true); - }, - - getFirstSegment: function() { - return this._segments[0]; - }, - - getLastSegment: function() { - return this._segments[this._segments.length - 1]; - }, - - getCurves: function() { - var curves = this._curves, - segments = this._segments; - if (!curves) { - var length = this._countCurves(); - curves = this._curves = new Array(length); - for (var i = 0; i < length; i++) - curves[i] = new Curve(this, segments[i], - segments[i + 1] || segments[0]); - } - return curves; - }, - - getFirstCurve: function() { - return this.getCurves()[0]; - }, - - getLastCurve: function() { - var curves = this.getCurves(); - return curves[curves.length - 1]; - }, - - isClosed: function() { - return this._closed; - }, - - setClosed: function(closed) { - if (this._closed != (closed = !!closed)) { - this._closed = closed; - if (this._curves) { - var length = this._curves.length = this._countCurves(); - if (closed) - this._curves[length - 1] = new Curve(this, - this._segments[length - 1], this._segments[0]); - } - this._changed(25); - } - } -}, { - beans: true, - - getPathData: function(_matrix, _precision) { - var segments = this._segments, - length = segments.length, - f = new Formatter(_precision), - coords = new Array(6), - first = true, - curX, curY, - prevX, prevY, - inX, inY, - outX, outY, - parts = []; - - function addSegment(segment, skipLine) { - segment._transformCoordinates(_matrix, coords, false); - curX = coords[0]; - curY = coords[1]; - if (first) { - parts.push('M' + f.pair(curX, curY)); - first = false; - } else { - inX = coords[2]; - inY = coords[3]; - if (inX === curX && inY === curY - && outX === prevX && outY === prevY) { - if (!skipLine) - parts.push('l' + f.pair(curX - prevX, curY - prevY)); - } else { - parts.push('c' + f.pair(outX - prevX, outY - prevY) - + ' ' + f.pair(inX - prevX, inY - prevY) - + ' ' + f.pair(curX - prevX, curY - prevY)); - } - } - prevX = curX; - prevY = curY; - outX = coords[4]; - outY = coords[5]; - } - - if (length === 0) - return ''; - - for (var i = 0; i < length; i++) - addSegment(segments[i]); - if (this._closed && length > 0) { - addSegment(segments[0], true); - parts.push('z'); - } - return parts.join(''); - } -}, { - - isEmpty: function() { - return this._segments.length === 0; - }, - - _transformContent: function(matrix) { - var coords = new Array(6); - for (var i = 0, l = this._segments.length; i < l; i++) - this._segments[i]._transformCoordinates(matrix, coords, true); - return true; - }, - - _add: function(segs, index) { - var segments = this._segments, - curves = this._curves, - amount = segs.length, - append = index == null, - index = append ? segments.length : index; - for (var i = 0; i < amount; i++) { - var segment = segs[i]; - if (segment._path) - segment = segs[i] = segment.clone(); - segment._path = this; - segment._index = index + i; - if (segment._selectionState) - this._updateSelection(segment, 0, segment._selectionState); - } - if (append) { - segments.push.apply(segments, segs); - } else { - segments.splice.apply(segments, [index, 0].concat(segs)); - for (var i = index + amount, l = segments.length; i < l; i++) - segments[i]._index = i; - } - if (curves) { - var total = this._countCurves(), - from = index + amount - 1 === total ? index - 1 : index, - start = from, - to = Math.min(from + amount, total); - if (segs._curves) { - curves.splice.apply(curves, [from, 0].concat(segs._curves)); - start += segs._curves.length; - } - for (var i = start; i < to; i++) - curves.splice(i, 0, new Curve(this, null, null)); - this._adjustCurves(from, to); - } - this._changed(25); - return segs; - }, - - _adjustCurves: function(from, to) { - var segments = this._segments, - curves = this._curves, - curve; - for (var i = from; i < to; i++) { - curve = curves[i]; - curve._path = this; - curve._segment1 = segments[i]; - curve._segment2 = segments[i + 1] || segments[0]; - curve._changed(); - } - if (curve = curves[this._closed && from === 0 ? segments.length - 1 - : from - 1]) { - curve._segment2 = segments[from] || segments[0]; - curve._changed(); - } - if (curve = curves[to]) { - curve._segment1 = segments[to]; - curve._changed(); - } - }, - - _countCurves: function() { - var length = this._segments.length; - return !this._closed && length > 0 ? length - 1 : length; - }, - - add: function(segment1 ) { - return arguments.length > 1 && typeof segment1 !== 'number' - ? this._add(Segment.readAll(arguments)) - : this._add([ Segment.read(arguments) ])[0]; - }, - - insert: function(index, segment1 ) { - return arguments.length > 2 && typeof segment1 !== 'number' - ? this._add(Segment.readAll(arguments, 1), index) - : this._add([ Segment.read(arguments, 1) ], index)[0]; - }, - - addSegment: function() { - return this._add([ Segment.read(arguments) ])[0]; - }, - - insertSegment: function(index ) { - return this._add([ Segment.read(arguments, 1) ], index)[0]; - }, - - addSegments: function(segments) { - return this._add(Segment.readAll(segments)); - }, - - insertSegments: function(index, segments) { - return this._add(Segment.readAll(segments), index); - }, - - removeSegment: function(index) { - return this.removeSegments(index, index + 1)[0] || null; - }, - - removeSegments: function(from, to, _includeCurves) { - from = from || 0; - to = Base.pick(to, this._segments.length); - var segments = this._segments, - curves = this._curves, - count = segments.length, - removed = segments.splice(from, to - from), - amount = removed.length; - if (!amount) - return removed; - for (var i = 0; i < amount; i++) { - var segment = removed[i]; - if (segment._selectionState) - this._updateSelection(segment, segment._selectionState, 0); - segment._index = segment._path = null; - } - for (var i = from, l = segments.length; i < l; i++) - segments[i]._index = i; - if (curves) { - var index = from > 0 && to === count + (this._closed ? 1 : 0) - ? from - 1 - : from, - curves = curves.splice(index, amount); - if (_includeCurves) - removed._curves = curves.slice(1); - this._adjustCurves(index, index); - } - this._changed(25); - return removed; - }, - - clear: '#removeSegments', - - hasHandles: function() { - var segments = this._segments; - for (var i = 0, l = segments.length; i < l; i++) { - if (segments[i].hasHandles()) - return true; - } - return false; - }, - - clearHandles: function() { - var segments = this._segments; - for (var i = 0, l = segments.length; i < l; i++) - segments[i].clearHandles(); - }, - - getLength: function() { - if (this._length == null) { - var curves = this.getCurves(), - length = 0; - for (var i = 0, l = curves.length; i < l; i++) - length += curves[i].getLength(); - this._length = length; - } - return this._length; - }, - - getArea: function() { - if (this._area == null) { - var segments = this._segments, - count = segments.length, - last = count - 1, - area = 0; - for (var i = 0, l = this._closed ? count : last; i < l; i++) { - area += Curve.getArea(Curve.getValues( - segments[i], segments[i < last ? i + 1 : 0])); - } - this._area = area; - } - return this._area; - }, - - isClockwise: function() { - if (this._clockwise !== undefined) - return this._clockwise; - return this.getArea() >= 0; - }, - - setClockwise: function(clockwise) { - if (this.isClockwise() != (clockwise = !!clockwise)) - this.reverse(); - this._clockwise = clockwise; - }, - - isFullySelected: function() { - var length = this._segments.length; - return this._selected && length > 0 && this._selectedSegmentState - === length * 7; - }, - - setFullySelected: function(selected) { - if (selected) - this._selectSegments(true); - this.setSelected(selected); - }, - - setSelected: function setSelected(selected) { - if (!selected) - this._selectSegments(false); - setSelected.base.call(this, selected); - }, - - _selectSegments: function(selected) { - var length = this._segments.length; - this._selectedSegmentState = selected - ? length * 7 : 0; - for (var i = 0; i < length; i++) - this._segments[i]._selectionState = selected - ? 7 : 0; - }, - - _updateSelection: function(segment, oldState, newState) { - segment._selectionState = newState; - var total = this._selectedSegmentState += newState - oldState; - if (total > 0) - this.setSelected(true); - }, - - flatten: function(maxDistance) { - var iterator = new PathIterator(this, 64, 0.1), - pos = 0, - step = iterator.length / Math.ceil(iterator.length / maxDistance), - end = iterator.length + (this._closed ? -step : step) / 2; - var segments = []; - while (pos <= end) { - segments.push(new Segment(iterator.getPointAt(pos))); - pos += step; - } - this.setSegments(segments); - }, - - reduce: function() { - var curves = this.getCurves(); - for (var i = curves.length - 1; i >= 0; i--) { - var curve = curves[i]; - if (!curve.hasHandles() && (curve.getLength() === 0 - || curve.isCollinear(curve.getNext()))) - curve.remove(); - } - return this; - }, - - simplify: function(tolerance) { - if (this._segments.length > 2) { - var fitter = new PathFitter(this, tolerance || 2.5); - this.setSegments(fitter.fit()); - } - }, - - split: function(index, parameter) { - if (parameter === null) - return null; - if (arguments.length === 1) { - var arg = index; - if (typeof arg === 'number') - arg = this.getLocationAt(arg); - if (!arg) - return null - index = arg.index; - parameter = arg.parameter; - } - var tMin = 4e-7, - tMax = 1 - tMin; - if (parameter >= tMax) { - index++; - parameter--; - } - var curves = this.getCurves(); - if (index >= 0 && index < curves.length) { - if (parameter >= tMin) { - curves[index++].divide(parameter, true); - } - var segs = this.removeSegments(index, this._segments.length, true), - path; - if (this._closed) { - this.setClosed(false); - path = this; - } else { - path = new Path(Item.NO_INSERT); - path.insertAbove(this, true); - this._clone(path); - } - path._add(segs, 0); - this.addSegment(segs[0]); - return path; - } - return null; - }, - - reverse: function() { - this._segments.reverse(); - for (var i = 0, l = this._segments.length; i < l; i++) { - var segment = this._segments[i]; - var handleIn = segment._handleIn; - segment._handleIn = segment._handleOut; - segment._handleOut = handleIn; - segment._index = i; - } - this._curves = null; - if (this._clockwise !== undefined) - this._clockwise = !this._clockwise; - this._changed(9); - }, - - join: function(path) { - if (path) { - var segments = path._segments, - last1 = this.getLastSegment(), - last2 = path.getLastSegment(); - if (!last2) - return this; - if (last1 && last1._point.equals(last2._point)) - path.reverse(); - var first2 = path.getFirstSegment(); - if (last1 && last1._point.equals(first2._point)) { - last1.setHandleOut(first2._handleOut); - this._add(segments.slice(1)); - } else { - var first1 = this.getFirstSegment(); - if (first1 && first1._point.equals(first2._point)) - path.reverse(); - last2 = path.getLastSegment(); - if (first1 && first1._point.equals(last2._point)) { - first1.setHandleIn(last2._handleIn); - this._add(segments.slice(0, segments.length - 1), 0); - } else { - this._add(segments.slice()); - } - } - if (path._closed) - this._add([segments[0]]); - path.remove(); - } - var first = this.getFirstSegment(), - last = this.getLastSegment(); - if (first !== last && first._point.equals(last._point)) { - first.setHandleIn(last._handleIn); - last.remove(); - this.setClosed(true); - } - return this; - }, - - toShape: function(insert) { - if (!this._closed) - return null; - - var segments = this._segments, - type, - size, - radius, - topCenter; - - function isCollinear(i, j) { - var seg1 = segments[i], - seg2 = seg1.getNext(), - seg3 = segments[j], - seg4 = seg3.getNext(); - return seg1._handleOut.isZero() && seg2._handleIn.isZero() - && seg3._handleOut.isZero() && seg4._handleIn.isZero() - && seg2._point.subtract(seg1._point).isCollinear( - seg4._point.subtract(seg3._point)); - } - - function isOrthogonal(i) { - var seg2 = segments[i], - seg1 = seg2.getPrevious(), - seg3 = seg2.getNext(); - return seg1._handleOut.isZero() && seg2._handleIn.isZero() - && seg2._handleOut.isZero() && seg3._handleIn.isZero() - && seg2._point.subtract(seg1._point).isOrthogonal( - seg3._point.subtract(seg2._point)); - } - - function isArc(i) { - var seg1 = segments[i], - seg2 = seg1.getNext(), - handle1 = seg1._handleOut, - handle2 = seg2._handleIn, - kappa = 0.5522847498307936; - if (handle1.isOrthogonal(handle2)) { - var pt1 = seg1._point, - pt2 = seg2._point, - corner = new Line(pt1, handle1, true).intersect( - new Line(pt2, handle2, true), true); - return corner && Numerical.isZero(handle1.getLength() / - corner.subtract(pt1).getLength() - kappa) - && Numerical.isZero(handle2.getLength() / - corner.subtract(pt2).getLength() - kappa); - } - return false; - } - - function getDistance(i, j) { - return segments[i]._point.getDistance(segments[j]._point); - } - - if (!this.hasHandles() && segments.length === 4 - && isCollinear(0, 2) && isCollinear(1, 3) && isOrthogonal(1)) { - type = Shape.Rectangle; - size = new Size(getDistance(0, 3), getDistance(0, 1)); - topCenter = segments[1]._point.add(segments[2]._point).divide(2); - } else if (segments.length === 8 && isArc(0) && isArc(2) && isArc(4) - && isArc(6) && isCollinear(1, 5) && isCollinear(3, 7)) { - type = Shape.Rectangle; - size = new Size(getDistance(1, 6), getDistance(0, 3)); - radius = size.subtract(new Size(getDistance(0, 7), - getDistance(1, 2))).divide(2); - topCenter = segments[3]._point.add(segments[4]._point).divide(2); - } else if (segments.length === 4 - && isArc(0) && isArc(1) && isArc(2) && isArc(3)) { - if (Numerical.isZero(getDistance(0, 2) - getDistance(1, 3))) { - type = Shape.Circle; - radius = getDistance(0, 2) / 2; - } else { - type = Shape.Ellipse; - radius = new Size(getDistance(2, 0) / 2, getDistance(3, 1) / 2); - } - topCenter = segments[1]._point; - } - - if (type) { - var center = this.getPosition(true), - shape = this._clone(new type({ - center: center, - size: size, - radius: radius, - insert: false - }), insert, false); - shape.rotate(topCenter.subtract(center).getAngle() + 90); - return shape; - } - return null; - }, - - _hitTestSelf: function(point, options) { - var that = this, - style = this.getStyle(), - segments = this._segments, - numSegments = segments.length, - closed = this._closed, - tolerancePadding = options._tolerancePadding, - strokePadding = tolerancePadding, - join, cap, miterLimit, - area, loc, res, - hitStroke = options.stroke && style.hasStroke(), - hitFill = options.fill && style.hasFill(), - hitCurves = options.curves, - radius = hitStroke - ? style.getStrokeWidth() / 2 - : hitFill && options.tolerance > 0 || hitCurves - ? 0 : null; - if (radius !== null) { - if (radius > 0) { - join = style.getStrokeJoin(); - cap = style.getStrokeCap(); - miterLimit = radius * style.getMiterLimit(); - strokePadding = tolerancePadding.add(new Point(radius, radius)); - } else { - join = cap = 'round'; - } - } - - function isCloseEnough(pt, padding) { - return point.subtract(pt).divide(padding).length <= 1; - } - - function checkSegmentPoint(seg, pt, name) { - if (!options.selected || pt.isSelected()) { - var anchor = seg._point; - if (pt !== anchor) - pt = pt.add(anchor); - if (isCloseEnough(pt, strokePadding)) { - return new HitResult(name, that, { - segment: seg, - point: pt - }); - } - } - } - - function checkSegmentPoints(seg, ends) { - return (ends || options.segments) - && checkSegmentPoint(seg, seg._point, 'segment') - || (!ends && options.handles) && ( - checkSegmentPoint(seg, seg._handleIn, 'handle-in') || - checkSegmentPoint(seg, seg._handleOut, 'handle-out')); - } - - function addToArea(point) { - area.add(point); - } - - function checkSegmentStroke(segment) { - if (join !== 'round' || cap !== 'round') { - area = new Path({ internal: true, closed: true }); - if (closed || segment._index > 0 - && segment._index < numSegments - 1) { - if (join !== 'round' && (segment._handleIn.isZero() - || segment._handleOut.isZero())) - Path._addBevelJoin(segment, join, radius, miterLimit, - addToArea, true); - } else if (cap !== 'round') { - Path._addSquareCap(segment, cap, radius, addToArea, true); - } - if (!area.isEmpty()) { - var loc; - return area.contains(point) - || (loc = area.getNearestLocation(point)) - && isCloseEnough(loc.getPoint(), tolerancePadding); - } - } - return isCloseEnough(segment._point, strokePadding); - } - - if (options.ends && !options.segments && !closed) { - if (res = checkSegmentPoints(segments[0], true) - || checkSegmentPoints(segments[numSegments - 1], true)) - return res; - } else if (options.segments || options.handles) { - for (var i = 0; i < numSegments; i++) - if (res = checkSegmentPoints(segments[i])) - return res; - } - if (radius !== null) { - loc = this.getNearestLocation(point); - if (loc) { - var parameter = loc.getParameter(); - if (parameter === 0 || parameter === 1 && numSegments > 1) { - if (!checkSegmentStroke(loc.getSegment())) - loc = null; - } else if (!isCloseEnough(loc.getPoint(), strokePadding)) { - loc = null; - } - } - if (!loc && join === 'miter' && numSegments > 1) { - for (var i = 0; i < numSegments; i++) { - var segment = segments[i]; - if (point.getDistance(segment._point) <= miterLimit - && checkSegmentStroke(segment)) { - loc = segment.getLocation(); - break; - } - } - } - } - return !loc && hitFill && this._contains(point) - || loc && !hitStroke && !hitCurves - ? new HitResult('fill', this) - : loc - ? new HitResult(hitStroke ? 'stroke' : 'curve', this, { - location: loc, - point: loc.getPoint() - }) - : null; - } - -}, Base.each(Curve.evaluateMethods, - function(name) { - this[name + 'At'] = function(offset, isParameter) { - var loc = this.getLocationAt(offset, isParameter); - return loc && loc[name](); - }; - }, -{ - beans: false, - - getLocationOf: function() { - var point = Point.read(arguments), - curves = this.getCurves(); - for (var i = 0, l = curves.length; i < l; i++) { - var loc = curves[i].getLocationOf(point); - if (loc) - return loc; - } - return null; - }, - - getOffsetOf: function() { - var loc = this.getLocationOf.apply(this, arguments); - return loc ? loc.getOffset() : null; - }, - - getLocationAt: function(offset, isParameter) { - var curves = this.getCurves(), - length = 0; - if (isParameter) { - var index = ~~offset, - curve = curves[index]; - return curve ? curve.getLocationAt(offset - index, true) : null; - } - for (var i = 0, l = curves.length; i < l; i++) { - var start = length, - curve = curves[i]; - length += curve.getLength(); - if (length > offset) { - return curve.getLocationAt(offset - start); - } - } - if (curves.length > 0 && offset <= this.getLength()) - return new CurveLocation(curves[curves.length - 1], 1); - return null; - }, - - getNearestLocation: function() { - var point = Point.read(arguments), - curves = this.getCurves(), - minDist = Infinity, - minLoc = null; - for (var i = 0, l = curves.length; i < l; i++) { - var loc = curves[i].getNearestLocation(point); - if (loc._distance < minDist) { - minDist = loc._distance; - minLoc = loc; - } - } - return minLoc; - }, - - getNearestPoint: function() { - return this.getNearestLocation.apply(this, arguments).getPoint(); - } -}), -new function() { - - function drawHandles(ctx, segments, matrix, size) { - var half = size / 2; - - function drawHandle(index) { - var hX = coords[index], - hY = coords[index + 1]; - if (pX != hX || pY != hY) { - ctx.beginPath(); - ctx.moveTo(pX, pY); - ctx.lineTo(hX, hY); - ctx.stroke(); - ctx.beginPath(); - ctx.arc(hX, hY, half, 0, Math.PI * 2, true); - ctx.fill(); - } - } - - var coords = new Array(6); - for (var i = 0, l = segments.length; i < l; i++) { - var segment = segments[i]; - segment._transformCoordinates(matrix, coords, false); - var state = segment._selectionState, - pX = coords[0], - pY = coords[1]; - if (state & 1) - drawHandle(2); - if (state & 2) - drawHandle(4); - ctx.fillRect(pX - half, pY - half, size, size); - if (!(state & 4)) { - var fillStyle = ctx.fillStyle; - ctx.fillStyle = '#ffffff'; - ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2); - ctx.fillStyle = fillStyle; - } - } - } - - function drawSegments(ctx, path, matrix) { - var segments = path._segments, - length = segments.length, - coords = new Array(6), - first = true, - curX, curY, - prevX, prevY, - inX, inY, - outX, outY; - - function drawSegment(segment) { - if (matrix) { - segment._transformCoordinates(matrix, coords, false); - curX = coords[0]; - curY = coords[1]; - } else { - var point = segment._point; - curX = point._x; - curY = point._y; - } - if (first) { - ctx.moveTo(curX, curY); - first = false; - } else { - if (matrix) { - inX = coords[2]; - inY = coords[3]; - } else { - var handle = segment._handleIn; - inX = curX + handle._x; - inY = curY + handle._y; - } - if (inX === curX && inY === curY - && outX === prevX && outY === prevY) { - ctx.lineTo(curX, curY); - } else { - ctx.bezierCurveTo(outX, outY, inX, inY, curX, curY); - } - } - prevX = curX; - prevY = curY; - if (matrix) { - outX = coords[4]; - outY = coords[5]; - } else { - var handle = segment._handleOut; - outX = prevX + handle._x; - outY = prevY + handle._y; - } - } - - for (var i = 0; i < length; i++) - drawSegment(segments[i]); - if (path._closed && length > 0) - drawSegment(segments[0]); - } - - return { - _draw: function(ctx, param, strokeMatrix) { - var dontStart = param.dontStart, - dontPaint = param.dontFinish || param.clip, - style = this.getStyle(), - hasFill = style.hasFill(), - hasStroke = style.hasStroke(), - dashArray = style.getDashArray(), - dashLength = !paper.support.nativeDash && hasStroke - && dashArray && dashArray.length; - - if (!dontStart) - ctx.beginPath(); - - if (!dontStart && this._currentPath) { - ctx.currentPath = this._currentPath; - } else if (hasFill || hasStroke && !dashLength || dontPaint) { - drawSegments(ctx, this, strokeMatrix); - if (this._closed) - ctx.closePath(); - if (!dontStart) - this._currentPath = ctx.currentPath; - } - - function getOffset(i) { - return dashArray[((i % dashLength) + dashLength) % dashLength]; - } - - if (!dontPaint && (hasFill || hasStroke)) { - this._setStyles(ctx); - if (hasFill) { - ctx.fill(style.getWindingRule()); - ctx.shadowColor = 'rgba(0,0,0,0)'; - } - if (hasStroke) { - if (dashLength) { - if (!dontStart) - ctx.beginPath(); - var iterator = new PathIterator(this, 32, 0.25, - strokeMatrix), - length = iterator.length, - from = -style.getDashOffset(), to, - i = 0; - from = from % length; - while (from > 0) { - from -= getOffset(i--) + getOffset(i--); - } - while (from < length) { - to = from + getOffset(i++); - if (from > 0 || to > 0) - iterator.drawPart(ctx, - Math.max(from, 0), Math.max(to, 0)); - from = to + getOffset(i++); - } - } - ctx.stroke(); - } - } - }, - - _drawSelected: function(ctx, matrix) { - ctx.beginPath(); - drawSegments(ctx, this, matrix); - ctx.stroke(); - drawHandles(ctx, this._segments, matrix, paper.settings.handleSize); - } - }; -}, -new function() { - function getFirstControlPoints(rhs) { - var n = rhs.length, - x = [], - tmp = [], - b = 2; - x[0] = rhs[0] / b; - for (var i = 1; i < n; i++) { - tmp[i] = 1 / b; - b = (i < n - 1 ? 4 : 2) - tmp[i]; - x[i] = (rhs[i] - x[i - 1]) / b; - } - for (var i = 1; i < n; i++) { - x[n - i - 1] -= tmp[n - i] * x[n - i]; - } - return x; - } - - return { - smooth: function() { - var segments = this._segments, - size = segments.length, - closed = this._closed, - n = size, - overlap = 0; - if (size <= 2) - return; - if (closed) { - overlap = Math.min(size, 4); - n += Math.min(size, overlap) * 2; - } - var knots = []; - for (var i = 0; i < size; i++) - knots[i + overlap] = segments[i]._point; - if (closed) { - for (var i = 0; i < overlap; i++) { - knots[i] = segments[i + size - overlap]._point; - knots[i + size + overlap] = segments[i]._point; - } - } else { - n--; - } - var rhs = []; - - for (var i = 1; i < n - 1; i++) - rhs[i] = 4 * knots[i]._x + 2 * knots[i + 1]._x; - rhs[0] = knots[0]._x + 2 * knots[1]._x; - rhs[n - 1] = 3 * knots[n - 1]._x; - var x = getFirstControlPoints(rhs); - - for (var i = 1; i < n - 1; i++) - rhs[i] = 4 * knots[i]._y + 2 * knots[i + 1]._y; - rhs[0] = knots[0]._y + 2 * knots[1]._y; - rhs[n - 1] = 3 * knots[n - 1]._y; - var y = getFirstControlPoints(rhs); - - if (closed) { - for (var i = 0, j = size; i < overlap; i++, j++) { - var f1 = i / overlap, - f2 = 1 - f1, - ie = i + overlap, - je = j + overlap; - x[j] = x[i] * f1 + x[j] * f2; - y[j] = y[i] * f1 + y[j] * f2; - x[je] = x[ie] * f2 + x[je] * f1; - y[je] = y[ie] * f2 + y[je] * f1; - } - n--; - } - var handleIn = null; - for (var i = overlap; i <= n - overlap; i++) { - var segment = segments[i - overlap]; - if (handleIn) - segment.setHandleIn(handleIn.subtract(segment._point)); - if (i < n) { - segment.setHandleOut( - new Point(x[i], y[i]).subtract(segment._point)); - handleIn = i < n - 1 - ? new Point( - 2 * knots[i + 1]._x - x[i + 1], - 2 * knots[i + 1]._y - y[i + 1]) - : new Point( - (knots[n]._x + x[n - 1]) / 2, - (knots[n]._y + y[n - 1]) / 2); - } - } - if (closed && handleIn) { - var segment = this._segments[0]; - segment.setHandleIn(handleIn.subtract(segment._point)); - } - } - }; -}, -new function() { - function getCurrentSegment(that) { - var segments = that._segments; - if (segments.length === 0) - throw new Error('Use a moveTo() command first'); - return segments[segments.length - 1]; - } - - return { - moveTo: function() { - var segments = this._segments; - if (segments.length === 1) - this.removeSegment(0); - if (!segments.length) - this._add([ new Segment(Point.read(arguments)) ]); - }, - - moveBy: function() { - throw new Error('moveBy() is unsupported on Path items.'); - }, - - lineTo: function() { - this._add([ new Segment(Point.read(arguments)) ]); - }, - - cubicCurveTo: function() { - var handle1 = Point.read(arguments), - handle2 = Point.read(arguments), - to = Point.read(arguments), - current = getCurrentSegment(this); - current.setHandleOut(handle1.subtract(current._point)); - this._add([ new Segment(to, handle2.subtract(to)) ]); - }, - - quadraticCurveTo: function() { - var handle = Point.read(arguments), - to = Point.read(arguments), - current = getCurrentSegment(this)._point; - this.cubicCurveTo( - handle.add(current.subtract(handle).multiply(1 / 3)), - handle.add(to.subtract(handle).multiply(1 / 3)), - to - ); - }, - - curveTo: function() { - var through = Point.read(arguments), - to = Point.read(arguments), - t = Base.pick(Base.read(arguments), 0.5), - t1 = 1 - t, - current = getCurrentSegment(this)._point, - handle = through.subtract(current.multiply(t1 * t1)) - .subtract(to.multiply(t * t)).divide(2 * t * t1); - if (handle.isNaN()) - throw new Error( - 'Cannot put a curve through points with parameter = ' + t); - this.quadraticCurveTo(handle, to); - }, - - arcTo: function() { - var current = getCurrentSegment(this), - from = current._point, - to = Point.read(arguments), - through, - peek = Base.peek(arguments), - clockwise = Base.pick(peek, true), - center, extent, vector, matrix; - if (typeof clockwise === 'boolean') { - var middle = from.add(to).divide(2), - through = middle.add(middle.subtract(from).rotate( - clockwise ? -90 : 90)); - } else if (Base.remain(arguments) <= 2) { - through = to; - to = Point.read(arguments); - } else { - var radius = Size.read(arguments); - if (radius.isZero()) - return this.lineTo(to); - var rotation = Base.read(arguments), - clockwise = !!Base.read(arguments), - large = !!Base.read(arguments), - middle = from.add(to).divide(2), - pt = from.subtract(middle).rotate(-rotation), - x = pt.x, - y = pt.y, - abs = Math.abs, - rx = abs(radius.width), - ry = abs(radius.height), - rxSq = rx * rx, - rySq = ry * ry, - xSq = x * x, - ySq = y * y; - var factor = Math.sqrt(xSq / rxSq + ySq / rySq); - if (factor > 1) { - rx *= factor; - ry *= factor; - rxSq = rx * rx; - rySq = ry * ry; - } - factor = (rxSq * rySq - rxSq * ySq - rySq * xSq) / - (rxSq * ySq + rySq * xSq); - if (abs(factor) < 1e-12) - factor = 0; - if (factor < 0) - throw new Error( - 'Cannot create an arc with the given arguments'); - center = new Point(rx * y / ry, -ry * x / rx) - .multiply((large === clockwise ? -1 : 1) - * Math.sqrt(factor)) - .rotate(rotation).add(middle); - matrix = new Matrix().translate(center).rotate(rotation) - .scale(rx, ry); - vector = matrix._inverseTransform(from); - extent = vector.getDirectedAngle(matrix._inverseTransform(to)); - if (!clockwise && extent > 0) - extent -= 360; - else if (clockwise && extent < 0) - extent += 360; - } - if (through) { - var l1 = new Line(from.add(through).divide(2), - through.subtract(from).rotate(90), true), - l2 = new Line(through.add(to).divide(2), - to.subtract(through).rotate(90), true), - line = new Line(from, to), - throughSide = line.getSide(through); - center = l1.intersect(l2, true); - if (!center) { - if (!throughSide) - return this.lineTo(to); - throw new Error( - 'Cannot create an arc with the given arguments'); - } - vector = from.subtract(center); - extent = vector.getDirectedAngle(to.subtract(center)); - var centerSide = line.getSide(center); - if (centerSide === 0) { - extent = throughSide * Math.abs(extent); - } else if (throughSide === centerSide) { - extent += extent < 0 ? 360 : -360; - } - } - var ext = Math.abs(extent), - count = ext >= 360 ? 4 : Math.ceil(ext / 90), - inc = extent / count, - half = inc * Math.PI / 360, - z = 4 / 3 * Math.sin(half) / (1 + Math.cos(half)), - segments = []; - for (var i = 0; i <= count; i++) { - var pt = to, - out = null; - if (i < count) { - out = vector.rotate(90).multiply(z); - if (matrix) { - pt = matrix._transformPoint(vector); - out = matrix._transformPoint(vector.add(out)) - .subtract(pt); - } else { - pt = center.add(vector); - } - } - if (i === 0) { - current.setHandleOut(out); - } else { - var _in = vector.rotate(-90).multiply(z); - if (matrix) { - _in = matrix._transformPoint(vector.add(_in)) - .subtract(pt); - } - segments.push(new Segment(pt, _in, out)); - } - vector = vector.rotate(inc); - } - this._add(segments); - }, - - lineBy: function() { - var to = Point.read(arguments), - current = getCurrentSegment(this)._point; - this.lineTo(current.add(to)); - }, - - curveBy: function() { - var through = Point.read(arguments), - to = Point.read(arguments), - parameter = Base.read(arguments), - current = getCurrentSegment(this)._point; - this.curveTo(current.add(through), current.add(to), parameter); - }, - - cubicCurveBy: function() { - var handle1 = Point.read(arguments), - handle2 = Point.read(arguments), - to = Point.read(arguments), - current = getCurrentSegment(this)._point; - this.cubicCurveTo(current.add(handle1), current.add(handle2), - current.add(to)); - }, - - quadraticCurveBy: function() { - var handle = Point.read(arguments), - to = Point.read(arguments), - current = getCurrentSegment(this)._point; - this.quadraticCurveTo(current.add(handle), current.add(to)); - }, - - arcBy: function() { - var current = getCurrentSegment(this)._point, - point = current.add(Point.read(arguments)), - clockwise = Base.pick(Base.peek(arguments), true); - if (typeof clockwise === 'boolean') { - this.arcTo(point, clockwise); - } else { - this.arcTo(point, current.add(Point.read(arguments))); - } - }, - - closePath: function(join) { - this.setClosed(true); - if (join) - this.join(); - } - }; -}, { - - _getBounds: function(getter, matrix) { - return Path[getter](this._segments, this._closed, this.getStyle(), - matrix); - }, - -statics: { - getBounds: function(segments, closed, style, matrix, strokePadding) { - var first = segments[0]; - if (!first) - return new Rectangle(); - var coords = new Array(6), - prevCoords = first._transformCoordinates(matrix, new Array(6), false), - min = prevCoords.slice(0, 2), - max = min.slice(), - roots = new Array(2); - - function processSegment(segment) { - segment._transformCoordinates(matrix, coords, false); - for (var i = 0; i < 2; i++) { - Curve._addBounds( - prevCoords[i], - prevCoords[i + 4], - coords[i + 2], - coords[i], - i, strokePadding ? strokePadding[i] : 0, min, max, roots); - } - var tmp = prevCoords; - prevCoords = coords; - coords = tmp; - } - - for (var i = 1, l = segments.length; i < l; i++) - processSegment(segments[i]); - if (closed) - processSegment(first); - return new Rectangle(min[0], min[1], max[0] - min[0], max[1] - min[1]); - }, - - getStrokeBounds: function(segments, closed, style, matrix) { - if (!style.hasStroke()) - return Path.getBounds(segments, closed, style, matrix); - var length = segments.length - (closed ? 0 : 1), - radius = style.getStrokeWidth() / 2, - padding = Path._getPenPadding(radius, matrix), - bounds = Path.getBounds(segments, closed, style, matrix, padding), - join = style.getStrokeJoin(), - cap = style.getStrokeCap(), - miterLimit = radius * style.getMiterLimit(); - var joinBounds = new Rectangle(new Size(padding).multiply(2)); - - function add(point) { - bounds = bounds.include(matrix - ? matrix._transformPoint(point, point) : point); - } - - function addRound(segment) { - bounds = bounds.unite(joinBounds.setCenter(matrix - ? matrix._transformPoint(segment._point) : segment._point)); - } - - function addJoin(segment, join) { - var handleIn = segment._handleIn, - handleOut = segment._handleOut; - if (join === 'round' || !handleIn.isZero() && !handleOut.isZero() - && handleIn.isCollinear(handleOut)) { - addRound(segment); - } else { - Path._addBevelJoin(segment, join, radius, miterLimit, add); - } - } - - function addCap(segment, cap) { - if (cap === 'round') { - addRound(segment); - } else { - Path._addSquareCap(segment, cap, radius, add); - } - } - - for (var i = 1; i < length; i++) - addJoin(segments[i], join); - if (closed) { - addJoin(segments[0], join); - } else if (length > 0) { - addCap(segments[0], cap); - addCap(segments[segments.length - 1], cap); - } - return bounds; - }, - - _getPenPadding: function(radius, matrix) { - if (!matrix) - return [radius, radius]; - var mx = matrix.shiftless(), - hor = mx.transform(new Point(radius, 0)), - ver = mx.transform(new Point(0, radius)), - phi = hor.getAngleInRadians(), - a = hor.getLength(), - b = ver.getLength(); - var sin = Math.sin(phi), - cos = Math.cos(phi), - tan = Math.tan(phi), - tx = -Math.atan(b * tan / a), - ty = Math.atan(b / (tan * a)); - return [Math.abs(a * Math.cos(tx) * cos - b * Math.sin(tx) * sin), - Math.abs(b * Math.sin(ty) * cos + a * Math.cos(ty) * sin)]; - }, - - _addBevelJoin: function(segment, join, radius, miterLimit, addPoint, area) { - var curve2 = segment.getCurve(), - curve1 = curve2.getPrevious(), - point = curve2.getPointAt(0, true), - normal1 = curve1.getNormalAt(1, true), - normal2 = curve2.getNormalAt(0, true), - step = normal1.getDirectedAngle(normal2) < 0 ? -radius : radius; - normal1.setLength(step); - normal2.setLength(step); - if (area) { - addPoint(point); - addPoint(point.add(normal1)); - } - if (join === 'miter') { - var corner = new Line( - point.add(normal1), - new Point(-normal1.y, normal1.x), true - ).intersect(new Line( - point.add(normal2), - new Point(-normal2.y, normal2.x), true - ), true); - if (corner && point.getDistance(corner) <= miterLimit) { - addPoint(corner); - if (!area) - return; - } - } - if (!area) - addPoint(point.add(normal1)); - addPoint(point.add(normal2)); - }, - - _addSquareCap: function(segment, cap, radius, addPoint, area) { - var point = segment._point, - loc = segment.getLocation(), - normal = loc.getNormal().multiply(radius); - if (area) { - addPoint(point.subtract(normal)); - addPoint(point.add(normal)); - } - if (cap === 'square') - point = point.add(normal.rotate(loc.getParameter() === 0 ? -90 : 90)); - addPoint(point.add(normal)); - addPoint(point.subtract(normal)); - }, - - getHandleBounds: function(segments, closed, style, matrix, strokePadding, - joinPadding) { - var coords = new Array(6), - x1 = Infinity, - x2 = -x1, - y1 = x1, - y2 = x2; - for (var i = 0, l = segments.length; i < l; i++) { - var segment = segments[i]; - segment._transformCoordinates(matrix, coords, false); - for (var j = 0; j < 6; j += 2) { - var padding = j === 0 ? joinPadding : strokePadding, - paddingX = padding ? padding[0] : 0, - paddingY = padding ? padding[1] : 0, - x = coords[j], - y = coords[j + 1], - xn = x - paddingX, - xx = x + paddingX, - yn = y - paddingY, - yx = y + paddingY; - if (xn < x1) x1 = xn; - if (xx > x2) x2 = xx; - if (yn < y1) y1 = yn; - if (yx > y2) y2 = yx; - } - } - return new Rectangle(x1, y1, x2 - x1, y2 - y1); - }, - - getRoughBounds: function(segments, closed, style, matrix) { - var strokeRadius = style.hasStroke() ? style.getStrokeWidth() / 2 : 0, - joinRadius = strokeRadius; - if (strokeRadius > 0) { - if (style.getStrokeJoin() === 'miter') - joinRadius = strokeRadius * style.getMiterLimit(); - if (style.getStrokeCap() === 'square') - joinRadius = Math.max(joinRadius, strokeRadius * Math.sqrt(2)); - } - return Path.getHandleBounds(segments, closed, style, matrix, - Path._getPenPadding(strokeRadius, matrix), - Path._getPenPadding(joinRadius, matrix)); - } -}}); - -Path.inject({ statics: new function() { - - var kappa = 0.5522847498307936, - ellipseSegments = [ - new Segment([-1, 0], [0, kappa ], [0, -kappa]), - new Segment([0, -1], [-kappa, 0], [kappa, 0 ]), - new Segment([1, 0], [0, -kappa], [0, kappa ]), - new Segment([0, 1], [kappa, 0 ], [-kappa, 0]) - ]; - - function createPath(segments, closed, args) { - var props = Base.getNamed(args), - path = new Path(props && props.insert === false && Item.NO_INSERT); - path._add(segments); - path._closed = closed; - return path.set(props); - } - - function createEllipse(center, radius, args) { - var segments = new Array(4); - for (var i = 0; i < 4; i++) { - var segment = ellipseSegments[i]; - segments[i] = new Segment( - segment._point.multiply(radius).add(center), - segment._handleIn.multiply(radius), - segment._handleOut.multiply(radius) - ); - } - return createPath(segments, true, args); - } - - return { - Line: function() { - return createPath([ - new Segment(Point.readNamed(arguments, 'from')), - new Segment(Point.readNamed(arguments, 'to')) - ], false, arguments); - }, - - Circle: function() { - var center = Point.readNamed(arguments, 'center'), - radius = Base.readNamed(arguments, 'radius'); - return createEllipse(center, new Size(radius), arguments); - }, - - Rectangle: function() { - var rect = Rectangle.readNamed(arguments, 'rectangle'), - radius = Size.readNamed(arguments, 'radius', 0, - { readNull: true }), - bl = rect.getBottomLeft(true), - tl = rect.getTopLeft(true), - tr = rect.getTopRight(true), - br = rect.getBottomRight(true), - segments; - if (!radius || radius.isZero()) { - segments = [ - new Segment(bl), - new Segment(tl), - new Segment(tr), - new Segment(br) - ]; - } else { - radius = Size.min(radius, rect.getSize(true).divide(2)); - var rx = radius.width, - ry = radius.height, - hx = rx * kappa, - hy = ry * kappa; - segments = [ - new Segment(bl.add(rx, 0), null, [-hx, 0]), - new Segment(bl.subtract(0, ry), [0, hy]), - new Segment(tl.add(0, ry), null, [0, -hy]), - new Segment(tl.add(rx, 0), [-hx, 0], null), - new Segment(tr.subtract(rx, 0), null, [hx, 0]), - new Segment(tr.add(0, ry), [0, -hy], null), - new Segment(br.subtract(0, ry), null, [0, hy]), - new Segment(br.subtract(rx, 0), [hx, 0]) - ]; - } - return createPath(segments, true, arguments); - }, - - RoundRectangle: '#Rectangle', - - Ellipse: function() { - var ellipse = Shape._readEllipse(arguments); - return createEllipse(ellipse.center, ellipse.radius, arguments); - }, - - Oval: '#Ellipse', - - Arc: function() { - var from = Point.readNamed(arguments, 'from'), - through = Point.readNamed(arguments, 'through'), - to = Point.readNamed(arguments, 'to'), - props = Base.getNamed(arguments), - path = new Path(props && props.insert === false - && Item.NO_INSERT); - path.moveTo(from); - path.arcTo(through, to); - return path.set(props); - }, - - RegularPolygon: function() { - var center = Point.readNamed(arguments, 'center'), - sides = Base.readNamed(arguments, 'sides'), - radius = Base.readNamed(arguments, 'radius'), - step = 360 / sides, - three = !(sides % 3), - vector = new Point(0, three ? -radius : radius), - offset = three ? -1 : 0.5, - segments = new Array(sides); - for (var i = 0; i < sides; i++) - segments[i] = new Segment(center.add( - vector.rotate((i + offset) * step))); - return createPath(segments, true, arguments); - }, - - Star: function() { - var center = Point.readNamed(arguments, 'center'), - points = Base.readNamed(arguments, 'points') * 2, - radius1 = Base.readNamed(arguments, 'radius1'), - radius2 = Base.readNamed(arguments, 'radius2'), - step = 360 / points, - vector = new Point(0, -1), - segments = new Array(points); - for (var i = 0; i < points; i++) - segments[i] = new Segment(center.add(vector.rotate(step * i) - .multiply(i % 2 ? radius2 : radius1))); - return createPath(segments, true, arguments); - } - }; -}}); - -var CompoundPath = PathItem.extend({ - _class: 'CompoundPath', - _serializeFields: { - children: [] - }, - - initialize: function CompoundPath(arg) { - this._children = []; - this._namedChildren = {}; - if (!this._initialize(arg)) { - if (typeof arg === 'string') { - this.setPathData(arg); - } else { - this.addChildren(Array.isArray(arg) ? arg : arguments); - } - } - }, - - insertChildren: function insertChildren(index, items, _preserve) { - for (var i = items.length - 1; i >= 0; i--) { - var item = items[i]; - if (item instanceof CompoundPath) { - items.splice.apply(items, [i, 1].concat(item.removeChildren())); - item.remove(); - } - } - items = insertChildren.base.call(this, index, items, _preserve, Path); - for (var i = 0, l = !_preserve && items && items.length; i < l; i++) { - var item = items[i]; - if (item._clockwise === undefined) - item.setClockwise(item._index === 0); - } - return items; - }, - - reverse: function() { - var children = this._children; - for (var i = 0, l = children.length; i < l; i++) - children[i].reverse(); - }, - - smooth: function() { - for (var i = 0, l = this._children.length; i < l; i++) - this._children[i].smooth(); - }, - - reduce: function reduce() { - var children = this._children; - for (var i = children.length - 1; i >= 0; i--) { - var path = children[i].reduce(); - if (path.isEmpty()) - children.splice(i, 1); - } - if (children.length === 0) { - var path = new Path(Item.NO_INSERT); - path.insertAbove(this); - path.setStyle(this._style); - this.remove(); - return path; - } - return reduce.base.call(this); - }, - - isClockwise: function() { - var child = this.getFirstChild(); - return child && child.isClockwise(); - }, - - setClockwise: function(clockwise) { - if (this.isClockwise() !== !!clockwise) - this.reverse(); - }, - - getFirstSegment: function() { - var first = this.getFirstChild(); - return first && first.getFirstSegment(); - }, - - getLastSegment: function() { - var last = this.getLastChild(); - return last && last.getLastSegment(); - }, - - getCurves: function() { - var children = this._children, - curves = []; - for (var i = 0, l = children.length; i < l; i++) - curves.push.apply(curves, children[i].getCurves()); - return curves; - }, - - getFirstCurve: function() { - var first = this.getFirstChild(); - return first && first.getFirstCurve(); - }, - - getLastCurve: function() { - var last = this.getLastChild(); - return last && last.getFirstCurve(); - }, - - getArea: function() { - var children = this._children, - area = 0; - for (var i = 0, l = children.length; i < l; i++) - area += children[i].getArea(); - return area; - } -}, { - beans: true, - - getPathData: function(_matrix, _precision) { - var children = this._children, - paths = []; - for (var i = 0, l = children.length; i < l; i++) { - var child = children[i], - mx = child._matrix; - paths.push(child.getPathData(_matrix && !mx.isIdentity() - ? _matrix.chain(mx) : _matrix, _precision)); - } - return paths.join(' '); - } -}, { - _getChildHitTestOptions: function(options) { - return options.class === Path || options.type === 'path' - ? options - : new Base(options, { fill: false }); - }, - - _draw: function(ctx, param, strokeMatrix) { - var children = this._children; - if (children.length === 0) - return; - - if (this._currentPath) { - ctx.currentPath = this._currentPath; - } else { - param = param.extend({ dontStart: true, dontFinish: true }); - ctx.beginPath(); - for (var i = 0, l = children.length; i < l; i++) - children[i].draw(ctx, param, strokeMatrix); - this._currentPath = ctx.currentPath; - } - - if (!param.clip) { - this._setStyles(ctx); - var style = this._style; - if (style.hasFill()) { - ctx.fill(style.getWindingRule()); - ctx.shadowColor = 'rgba(0,0,0,0)'; - } - if (style.hasStroke()) - ctx.stroke(); - } - }, - - _drawSelected: function(ctx, matrix, selectedItems) { - var children = this._children; - for (var i = 0, l = children.length; i < l; i++) { - var child = children[i], - mx = child._matrix; - if (!selectedItems[child._id]) - child._drawSelected(ctx, mx.isIdentity() ? matrix - : matrix.chain(mx)); - } - } -}, -new function() { - function getCurrentPath(that, check) { - var children = that._children; - if (check && children.length === 0) - throw new Error('Use a moveTo() command first'); - return children[children.length - 1]; - } - - var fields = { - moveTo: function() { - var current = getCurrentPath(this), - path = current && current.isEmpty() ? current - : new Path(Item.NO_INSERT); - if (path !== current) - this.addChild(path); - path.moveTo.apply(path, arguments); - }, - - moveBy: function() { - var current = getCurrentPath(this, true), - last = current && current.getLastSegment(), - point = Point.read(arguments); - this.moveTo(last ? point.add(last._point) : point); - }, - - closePath: function(join) { - getCurrentPath(this, true).closePath(join); - } - }; - - Base.each(['lineTo', 'cubicCurveTo', 'quadraticCurveTo', 'curveTo', 'arcTo', - 'lineBy', 'cubicCurveBy', 'quadraticCurveBy', 'curveBy', 'arcBy'], - function(key) { - fields[key] = function() { - var path = getCurrentPath(this, true); - path[key].apply(path, arguments); - }; - } - ); - - return fields; -}); - -PathItem.inject(new function() { - var operators = { - unite: function(w) { - return w === 1 || w === 0; - }, - - intersect: function(w) { - return w === 2; - }, - - subtract: function(w) { - return w === 1; - }, - - exclude: function(w) { - return w === 1; - } - }; - - function preparePath(path, resolve) { - var res = path.clone(false).reduce().transform(null, true, true); - return resolve ? res.resolveCrossings().reorient() : res; - } - - function finishBoolean(ctor, paths, path1, path2, reduce) { - var result = new ctor(Item.NO_INSERT); - result.addChildren(paths, true); - if (reduce) - result = result.reduce(); - result.insertAbove(path2 && path1.isSibling(path2) - && path1.getIndex() < path2.getIndex() - ? path2 : path1); - result.setStyle(path1._style); - return result; - } - - function computeBoolean(path1, path2, operation) { - if (!path1._children && !path1._closed) - return computeOpenBoolean(path1, path2, operation); - var _path1 = preparePath(path1, true), - _path2 = path2 && path1 !== path2 && preparePath(path2, true); - if (_path2 && /^(subtract|exclude)$/.test(operation) - ^ (_path2.isClockwise() !== _path1.isClockwise())) - _path2.reverse(); - var intersections = CurveLocation.expand( - _path1.getIntersections(_path2, function(inter) { - return _path2 && inter.isOverlap() || inter.isCrossing(); - }) - ); - divideLocations(intersections); - - var segments = [], - monoCurves = []; - - function collect(paths) { - for (var i = 0, l = paths.length; i < l; i++) { - var path = paths[i]; - segments.push.apply(segments, path._segments); - monoCurves.push.apply(monoCurves, path._getMonoCurves()); - } - } - - collect(_path1._children || [_path1]); - if (_path2) - collect(_path2._children || [_path2]); - for (var i = 0, l = intersections.length; i < l; i++) { - propagateWinding(intersections[i]._segment, _path1, _path2, - monoCurves, operation); - } - for (var i = 0, l = segments.length; i < l; i++) { - var segment = segments[i]; - if (segment._winding == null) { - propagateWinding(segment, _path1, _path2, monoCurves, - operation); - } - } - return finishBoolean(CompoundPath, tracePaths(segments, operation), - path1, path2, true); - } - - function computeOpenBoolean(path1, path2, operation) { - if (!path2 || !path2._children && !path2._closed - || !/^(subtract|intersect)$/.test(operation)) - return null; - var _path1 = preparePath(path1, false), - _path2 = preparePath(path2, false), - intersections = _path1.getIntersections(_path2, function(inter) { - return inter.isOverlap() || inter.isCrossing(); - }), - sub = operation === 'subtract', - paths = []; - - function addPath(path) { - if (_path2.contains(path.getPointAt(path.getLength() / 2)) ^ sub) { - paths.unshift(path); - return true; - } - } - - for (var i = intersections.length - 1; i >= 0; i--) { - var path = intersections[i].split(); - if (path) { - if (addPath(path)) - path.getFirstSegment().setHandleIn(0, 0); - _path1.getLastSegment().setHandleOut(0, 0); - } - } - addPath(_path1); - return finishBoolean(Group, paths, path1, path2); - } - - function linkIntersections(from, to) { - var prev = from; - while (prev) { - if (prev === to) - return; - prev = prev._prev; - } - while (from._next && from._next !== to) - from = from._next; - if (!from._next) { - while (to._prev) - to = to._prev; - from._next = to; - to._prev = from; - } - } - - function divideLocations(locations) { - var tMin = 4e-7, - tMax = 1 - tMin, - noHandles = false, - clearSegments = [], - prevCurve, - prevT; - - for (var i = locations.length - 1; i >= 0; i--) { - var loc = locations[i], - curve = loc._curve, - t = loc._parameter, - origT = t; - if (curve !== prevCurve) { - noHandles = !curve.hasHandles(); - } else if (prevT > 0) { - t /= prevT; - } - var segment; - if (t < tMin) { - segment = curve._segment1; - } else if (t > tMax) { - segment = curve._segment2; - } else { - segment = curve.divide(t, true, true)._segment1; - if (noHandles) - clearSegments.push(segment); - } - loc._setSegment(segment); - var inter = segment._intersection, - dest = loc._intersection; - if (inter) { - linkIntersections(inter, dest); - var other = inter; - while (other) { - linkIntersections(other._intersection, inter); - other = other._next; - } - } else { - segment._intersection = dest; - } - prevCurve = curve; - prevT = origT; - } - for (var i = 0, l = clearSegments.length; i < l; i++) { - clearSegments[i].clearHandles(); - } - } - - function getWinding(point, curves, horizontal, testContains) { - var epsilon = 2e-7, - tMin = 4e-7, - tMax = 1 - tMin, - px = point.x, - py = point.y, - windLeft = 0, - windRight = 0, - roots = [], - abs = Math.abs; - if (horizontal) { - var yTop = -Infinity, - yBottom = Infinity, - yBefore = py - epsilon, - yAfter = py + epsilon; - for (var i = 0, l = curves.length; i < l; i++) { - var values = curves[i].values; - if (Curve.solveCubic(values, 0, px, roots, 0, 1) > 0) { - for (var j = roots.length - 1; j >= 0; j--) { - var y = Curve.getPoint(values, roots[j]).y; - if (y < yBefore && y > yTop) { - yTop = y; - } else if (y > yAfter && y < yBottom) { - yBottom = y; - } - } - } - } - yTop = (yTop + py) / 2; - yBottom = (yBottom + py) / 2; - if (yTop > -Infinity) - windLeft = getWinding(new Point(px, yTop), curves, false, - testContains); - if (yBottom < Infinity) - windRight = getWinding(new Point(px, yBottom), curves, false, - testContains); - } else { - var xBefore = px - epsilon, - xAfter = px + epsilon; - var startCounted = false, - prevCurve, - prevT; - for (var i = 0, l = curves.length; i < l; i++) { - var curve = curves[i], - values = curve.values, - winding = curve.winding; - if (winding && (winding === 1 - && py >= values[1] && py <= values[7] - || py >= values[7] && py <= values[1]) - && Curve.solveCubic(values, 1, py, roots, 0, 1) === 1) { - var t = roots[0]; - if (!( - t > tMax && startCounted && curve.next !== curves[i + 1] - || t < tMin && prevT > tMax - && curve.previous === prevCurve)) { - var x = Curve.getPoint(values, t).x, - slope = Curve.getTangent(values, t).y, - counted = false; - if (Numerical.isZero(slope) && !Curve.isStraight(values) - || t < tMin && slope * Curve.getTangent( - curve.previous.values, 1).y < 0 - || t > tMax && slope * Curve.getTangent( - curve.next.values, 0).y < 0) { - if (testContains && x >= xBefore && x <= xAfter) { - ++windLeft; - ++windRight; - counted = true; - } - } else if (x <= xBefore) { - windLeft += winding; - counted = true; - } else if (x >= xAfter) { - windRight += winding; - counted = true; - } - if (curve.previous !== curves[i - 1]) - startCounted = t < tMin && counted; - } - prevCurve = curve; - prevT = t; - } - } - } - return Math.max(abs(windLeft), abs(windRight)); - } - - function propagateWinding(segment, path1, path2, monoCurves, operation) { - var epsilon = 2e-7, - chain = [], - start = segment, - totalLength = 0, - windingSum = 0; - do { - var curve = segment.getCurve(), - length = curve.getLength(); - chain.push({ segment: segment, curve: curve, length: length }); - totalLength += length; - segment = segment.getNext(); - } while (segment && !segment._intersection && segment !== start); - for (var i = 0; i < 3; i++) { - var length = totalLength * (i + 1) / 4; - for (var k = 0, m = chain.length; k < m; k++) { - var node = chain[k], - curveLength = node.length; - if (length <= curveLength) { - if (length < epsilon || curveLength - length < epsilon) - length = curveLength / 2; - var curve = node.curve, - path = curve._path, - parent = path._parent, - pt = curve.getPointAt(length), - hor = curve.isHorizontal(); - if (parent instanceof CompoundPath) - path = parent; - windingSum += operation === 'subtract' && path2 - && (path === path1 && path2._getWinding(pt, hor) - || path === path2 && !path1._getWinding(pt, hor)) - ? 0 - : getWinding(pt, monoCurves, hor); - break; - } - length -= curveLength; - } - } - var winding = Math.round(windingSum / 3); - for (var j = chain.length - 1; j >= 0; j--) - chain[j].segment._winding = winding; - } - - function tracePaths(segments, operation) { - var paths = [], - start, - otherStart, - operator = operators[operation], - overlapWinding = { - unite: { 1: 2 }, - intersect: { 2: 1 } - }[operation]; - - function isValid(seg, adjusted) { - if (seg._visited) - return false; - if (!operator) - return true; - var winding = seg._winding, - inter = seg._intersection; - if (inter && adjusted && overlapWinding && inter.isOverlap()) - winding = overlapWinding[winding] || winding; - return operator(winding); - } - - function isStart(seg) { - return seg === start || seg === otherStart; - } - - function findBestIntersection(inter, strict) { - if (!inter._next) - return inter; - while (inter) { - var seg = inter._segment, - nextSeg = seg.getNext(), - nextInter = nextSeg._intersection; - if (isStart(nextSeg) - || !seg._visited && !nextSeg._visited - && (!operator - || (!strict || isValid(seg)) - && (!(strict && nextInter && nextInter.isOverlap()) - && isValid(nextSeg) - || !strict && nextInter - && isValid(nextInter._segment)) - )) - return inter; - inter = inter._next; - } - return null; - } - - function findStartSegment(inter, next) { - while (inter) { - var seg = inter._segment; - if (isStart(seg)) - return seg; - inter = inter[next ? '_next' : '_prev']; - } - } - - for (var i = 0, l = segments.length; i < l; i++) { - var seg = segments[i], - path = null, - finished = false; - if (!isValid(seg, true)) - continue; - start = otherStart = null; - while (!finished) { - var inter = seg._intersection, - handleIn = path && seg._handleIn; - inter = inter && (findBestIntersection(inter, true) - || findBestIntersection(inter, false)) || inter; - var other = inter && inter._segment; - if (other && isValid(other)) - seg = other; - if (seg._visited) { - finished = isStart(seg); - if (!finished && inter) { - var found = findStartSegment(inter, true) - || findStartSegment(inter, false); - if (found) { - seg = found; - finished = true; - } - } - break; - } - if (!path) { - path = new Path(Item.NO_INSERT); - start = seg; - otherStart = other; - } - path.add(new Segment(seg._point, handleIn, seg._handleOut)); - seg._visited = true; - seg = seg.getNext(); - finished = isStart(seg); - } - if (finished) { - path.firstSegment.setHandleIn(seg._handleIn); - path.setClosed(true); - } else if (path) { - console.error('Boolean operation resulted in open path', - 'segments =', path._segments.length, - 'length =', path.getLength()); - path = null; - } - if (path && (path._segments.length > 8 - || !Numerical.isZero(path.getArea()))) { - paths.push(path); - path = null; - } - } - return paths; - } - - return { - _getWinding: function(point, horizontal, testContains) { - return getWinding(point, this._getMonoCurves(), - horizontal, testContains); - }, - - unite: function(path) { - return computeBoolean(this, path, 'unite'); - }, - - intersect: function(path) { - return computeBoolean(this, path, 'intersect'); - }, - - subtract: function(path) { - return computeBoolean(this, path, 'subtract'); - }, - - exclude: function(path) { - return computeBoolean(this, path, 'exclude'); - }, - - divide: function(path) { - return finishBoolean(Group, - [this.subtract(path), this.intersect(path)], - this, path, true); - }, - - resolveCrossings: function() { - var crossings = this.getCrossings(); - if (!crossings.length) - return this; - divideLocations(CurveLocation.expand(crossings)); - var paths = this._children || [this], - segments = []; - for (var i = 0, l = paths.length; i < l; i++) { - segments.push.apply(segments, paths[i]._segments); - } - return finishBoolean(CompoundPath, tracePaths(segments), - this, null, false); - } - }; -}); - -Path.inject({ - _getMonoCurves: function() { - var monoCurves = this._monoCurves, - prevCurve; - - function insertCurve(v) { - var y0 = v[1], - y1 = v[7], - curve = { - values: v, - winding: y0 === y1 - ? 0 - : y0 > y1 - ? -1 - : 1, - previous: prevCurve, - next: null - }; - if (prevCurve) - prevCurve.next = curve; - monoCurves.push(curve); - prevCurve = curve; - } - - function handleCurve(v) { - if (Curve.getLength(v) === 0) - return; - var y0 = v[1], - y1 = v[3], - y2 = v[5], - y3 = v[7]; - if (Curve.isStraight(v)) { - insertCurve(v); - } else { - var a = 3 * (y1 - y2) - y0 + y3, - b = 2 * (y0 + y2) - 4 * y1, - c = y1 - y0, - tMin = 4e-7, - tMax = 1 - tMin, - roots = [], - n = Numerical.solveQuadratic(a, b, c, roots, tMin, tMax); - if (n === 0) { - insertCurve(v); - } else { - roots.sort(); - var t = roots[0], - parts = Curve.subdivide(v, t); - insertCurve(parts[0]); - if (n > 1) { - t = (roots[1] - t) / (1 - t); - parts = Curve.subdivide(parts[1], t); - insertCurve(parts[0]); - } - insertCurve(parts[1]); - } - } - } - - if (!monoCurves) { - monoCurves = this._monoCurves = []; - var curves = this.getCurves(), - segments = this._segments; - for (var i = 0, l = curves.length; i < l; i++) - handleCurve(curves[i].getValues()); - if (!this._closed && segments.length > 1) { - var p1 = segments[segments.length - 1]._point, - p2 = segments[0]._point, - p1x = p1._x, p1y = p1._y, - p2x = p2._x, p2y = p2._y; - handleCurve([p1x, p1y, p1x, p1y, p2x, p2y, p2x, p2y]); - } - if (monoCurves.length > 0) { - var first = monoCurves[0], - last = monoCurves[monoCurves.length - 1]; - first.previous = last; - last.next = first; - } - } - return monoCurves; - }, - - getInteriorPoint: function() { - var bounds = this.getBounds(), - point = bounds.getCenter(true); - if (!this.contains(point)) { - var curves = this._getMonoCurves(), - roots = [], - y = point.y, - xIntercepts = []; - for (var i = 0, l = curves.length; i < l; i++) { - var values = curves[i].values; - if ((curves[i].winding === 1 - && y >= values[1] && y <= values[7] - || y >= values[7] && y <= values[1]) - && Curve.solveCubic(values, 1, y, roots, 0, 1) > 0) { - for (var j = roots.length - 1; j >= 0; j--) - xIntercepts.push(Curve.getPoint(values, roots[j]).x); - } - if (xIntercepts.length > 1) - break; - } - point.x = (xIntercepts[0] + xIntercepts[1]) / 2; - } - return point; - }, - - reorient: function() { - this.setClockwise(true); - return this; - } -}); - -CompoundPath.inject({ - _getMonoCurves: function() { - var children = this._children, - monoCurves = []; - for (var i = 0, l = children.length; i < l; i++) - monoCurves.push.apply(monoCurves, children[i]._getMonoCurves()); - return monoCurves; - }, - - reorient: function() { - var children = this.removeChildren().sort(function(a, b) { - return b.getBounds().getArea() - a.getBounds().getArea(); - }); - if (children.length > 0) { - this.addChildren(children); - var clockwise = children[0].isClockwise(); - for (var i = 1, l = children.length; i < l; i++) { - var point = children[i].getInteriorPoint(), - counters = 0; - for (var j = i - 1; j >= 0; j--) { - if (children[j].contains(point)) - counters++; - } - children[i].setClockwise(counters % 2 === 0 && clockwise); - } - } - return this; - } -}); - -var PathIterator = Base.extend({ - _class: 'PathIterator', - - initialize: function(path, maxRecursion, tolerance, matrix) { - var curves = [], - parts = [], - length = 0, - minDifference = 1 / (maxRecursion || 32), - segments = path._segments, - segment1 = segments[0], - segment2; - - function addCurve(segment1, segment2) { - var curve = Curve.getValues(segment1, segment2, matrix); - curves.push(curve); - computeParts(curve, segment1._index, 0, 1); - } - - function computeParts(curve, index, minT, maxT) { - if ((maxT - minT) > minDifference - && !Curve.isFlatEnough(curve, tolerance || 0.25)) { - var split = Curve.subdivide(curve, 0.5), - halfT = (minT + maxT) / 2; - computeParts(split[0], index, minT, halfT); - computeParts(split[1], index, halfT, maxT); - } else { - var x = curve[6] - curve[0], - y = curve[7] - curve[1], - dist = Math.sqrt(x * x + y * y); - if (dist > 1e-6) { - length += dist; - parts.push({ - offset: length, - value: maxT, - index: index - }); - } - } - } - - for (var i = 1, l = segments.length; i < l; i++) { - segment2 = segments[i]; - addCurve(segment1, segment2); - segment1 = segment2; - } - if (path._closed) - addCurve(segment2, segments[0]); - - this.curves = curves; - this.parts = parts; - this.length = length; - this.index = 0; - }, - - getParameterAt: function(offset) { - var i, j = this.index; - for (;;) { - i = j; - if (j == 0 || this.parts[--j].offset < offset) - break; - } - for (var l = this.parts.length; i < l; i++) { - var part = this.parts[i]; - if (part.offset >= offset) { - this.index = i; - var prev = this.parts[i - 1]; - var prevVal = prev && prev.index == part.index ? prev.value : 0, - prevLen = prev ? prev.offset : 0; - return { - value: prevVal + (part.value - prevVal) - * (offset - prevLen) / (part.offset - prevLen), - index: part.index - }; - } - } - var part = this.parts[this.parts.length - 1]; - return { - value: 1, - index: part.index - }; - }, - - drawPart: function(ctx, from, to) { - from = this.getParameterAt(from); - to = this.getParameterAt(to); - for (var i = from.index; i <= to.index; i++) { - var curve = Curve.getPart(this.curves[i], - i == from.index ? from.value : 0, - i == to.index ? to.value : 1); - if (i == from.index) - ctx.moveTo(curve[0], curve[1]); - ctx.bezierCurveTo.apply(ctx, curve.slice(2)); - } - } -}, Base.each(Curve.evaluateMethods, - function(name) { - this[name + 'At'] = function(offset, weighted) { - var param = this.getParameterAt(offset); - return Curve[name](this.curves[param.index], param.value, weighted); - }; - }, {}) -); - -var PathFitter = Base.extend({ - initialize: function(path, error) { - var points = this.points = [], - segments = path._segments, - prev; - for (var i = 0, l = segments.length; i < l; i++) { - var point = segments[i].point.clone(); - if (!prev || !prev.equals(point)) { - points.push(point); - prev = point; - } - } - - if (path._closed) { - this.closed = true; - points.unshift(points[points.length - 1]); - points.push(points[1]); - } - - this.error = error; - }, - - fit: function() { - var points = this.points, - length = points.length, - segments = this.segments = length > 0 - ? [new Segment(points[0])] : []; - if (length > 1) - this.fitCubic(0, length - 1, - points[1].subtract(points[0]).normalize(), - points[length - 2].subtract(points[length - 1]).normalize()); - - if (this.closed) { - segments.shift(); - segments.pop(); - } - - return segments; - }, - - fitCubic: function(first, last, tan1, tan2) { - if (last - first == 1) { - var pt1 = this.points[first], - pt2 = this.points[last], - dist = pt1.getDistance(pt2) / 3; - this.addCurve([pt1, pt1.add(tan1.normalize(dist)), - pt2.add(tan2.normalize(dist)), pt2]); - return; - } - var uPrime = this.chordLengthParameterize(first, last), - maxError = Math.max(this.error, this.error * this.error), - split, - parametersInOrder = true; - for (var i = 0; i <= 4; i++) { - var curve = this.generateBezier(first, last, uPrime, tan1, tan2); - var max = this.findMaxError(first, last, curve, uPrime); - if (max.error < this.error && parametersInOrder) { - this.addCurve(curve); - return; - } - split = max.index; - if (max.error >= maxError) - break; - parametersInOrder = this.reparameterize(first, last, uPrime, curve); - maxError = max.error; - } - var V1 = this.points[split - 1].subtract(this.points[split]), - V2 = this.points[split].subtract(this.points[split + 1]), - tanCenter = V1.add(V2).divide(2).normalize(); - this.fitCubic(first, split, tan1, tanCenter); - this.fitCubic(split, last, tanCenter.negate(), tan2); - }, - - addCurve: function(curve) { - var prev = this.segments[this.segments.length - 1]; - prev.setHandleOut(curve[1].subtract(curve[0])); - this.segments.push( - new Segment(curve[3], curve[2].subtract(curve[3]))); - }, - - generateBezier: function(first, last, uPrime, tan1, tan2) { - var epsilon = 1e-12, - pt1 = this.points[first], - pt2 = this.points[last], - C = [[0, 0], [0, 0]], - X = [0, 0]; - - for (var i = 0, l = last - first + 1; i < l; i++) { - var u = uPrime[i], - t = 1 - u, - b = 3 * u * t, - b0 = t * t * t, - b1 = b * t, - b2 = b * u, - b3 = u * u * u, - a1 = tan1.normalize(b1), - a2 = tan2.normalize(b2), - tmp = this.points[first + i] - .subtract(pt1.multiply(b0 + b1)) - .subtract(pt2.multiply(b2 + b3)); - C[0][0] += a1.dot(a1); - C[0][1] += a1.dot(a2); - C[1][0] = C[0][1]; - C[1][1] += a2.dot(a2); - X[0] += a1.dot(tmp); - X[1] += a2.dot(tmp); - } - - var detC0C1 = C[0][0] * C[1][1] - C[1][0] * C[0][1], - alpha1, alpha2; - if (Math.abs(detC0C1) > epsilon) { - var detC0X = C[0][0] * X[1] - C[1][0] * X[0], - detXC1 = X[0] * C[1][1] - X[1] * C[0][1]; - alpha1 = detXC1 / detC0C1; - alpha2 = detC0X / detC0C1; - } else { - var c0 = C[0][0] + C[0][1], - c1 = C[1][0] + C[1][1]; - if (Math.abs(c0) > epsilon) { - alpha1 = alpha2 = X[0] / c0; - } else if (Math.abs(c1) > epsilon) { - alpha1 = alpha2 = X[1] / c1; - } else { - alpha1 = alpha2 = 0; - } - } - - var segLength = pt2.getDistance(pt1), - eps = epsilon * segLength, - handle1, - handle2; - if (alpha1 < eps || alpha2 < eps) { - alpha1 = alpha2 = segLength / 3; - } else { - var line = pt2.subtract(pt1); - handle1 = tan1.normalize(alpha1); - handle2 = tan2.normalize(alpha2); - if (handle1.dot(line) - handle2.dot(line) > segLength * segLength) { - alpha1 = alpha2 = segLength / 3; - handle1 = handle2 = null; - } - } - - return [pt1, pt1.add(handle1 || tan1.normalize(alpha1)), - pt2.add(handle2 || tan2.normalize(alpha2)), pt2]; - }, - - reparameterize: function(first, last, u, curve) { - for (var i = first; i <= last; i++) { - u[i - first] = this.findRoot(curve, this.points[i], u[i - first]); - } - for (var i = 1, l = u.length; i < l; i++) { - if (u[i] <= u[i - 1]) - return false; - } - return true; - }, - - findRoot: function(curve, point, u) { - var curve1 = [], - curve2 = []; - for (var i = 0; i <= 2; i++) { - curve1[i] = curve[i + 1].subtract(curve[i]).multiply(3); - } - for (var i = 0; i <= 1; i++) { - curve2[i] = curve1[i + 1].subtract(curve1[i]).multiply(2); - } - var pt = this.evaluate(3, curve, u), - pt1 = this.evaluate(2, curve1, u), - pt2 = this.evaluate(1, curve2, u), - diff = pt.subtract(point), - df = pt1.dot(pt1) + diff.dot(pt2); - if (Math.abs(df) < 1e-6) - return u; - return u - diff.dot(pt1) / df; - }, - - evaluate: function(degree, curve, t) { - var tmp = curve.slice(); - for (var i = 1; i <= degree; i++) { - for (var j = 0; j <= degree - i; j++) { - tmp[j] = tmp[j].multiply(1 - t).add(tmp[j + 1].multiply(t)); - } - } - return tmp[0]; - }, - - chordLengthParameterize: function(first, last) { - var u = [0]; - for (var i = first + 1; i <= last; i++) { - u[i - first] = u[i - first - 1] - + this.points[i].getDistance(this.points[i - 1]); - } - for (var i = 1, m = last - first; i <= m; i++) { - u[i] /= u[m]; - } - return u; - }, - - findMaxError: function(first, last, curve, u) { - var index = Math.floor((last - first + 1) / 2), - maxDist = 0; - for (var i = first + 1; i < last; i++) { - var P = this.evaluate(3, curve, u[i - first]); - var v = P.subtract(this.points[i]); - var dist = v.x * v.x + v.y * v.y; - if (dist >= maxDist) { - maxDist = dist; - index = i; - } - } - return { - error: maxDist, - index: index - }; - } -}); - -var TextItem = Item.extend({ - _class: 'TextItem', - _boundsSelected: true, - _applyMatrix: false, - _canApplyMatrix: false, - _serializeFields: { - content: null - }, - _boundsGetter: 'getBounds', - - initialize: function TextItem(arg) { - this._content = ''; - this._lines = []; - var hasProps = arg && Base.isPlainObject(arg) - && arg.x === undefined && arg.y === undefined; - this._initialize(hasProps && arg, !hasProps && Point.read(arguments)); - }, - - _equals: function(item) { - return this._content === item._content; - }, - - _clone: function _clone(copy, insert, includeMatrix) { - copy.setContent(this._content); - return _clone.base.call(this, copy, insert, includeMatrix); - }, - - getContent: function() { - return this._content; - }, - - setContent: function(content) { - this._content = '' + content; - this._lines = this._content.split(/\r\n|\n|\r/mg); - this._changed(265); - }, - - isEmpty: function() { - return !this._content; - }, - - getCharacterStyle: '#getStyle', - setCharacterStyle: '#setStyle', - - getParagraphStyle: '#getStyle', - setParagraphStyle: '#setStyle' -}); - -var PointText = TextItem.extend({ - _class: 'PointText', - - initialize: function PointText() { - TextItem.apply(this, arguments); - }, - - clone: function(insert) { - return this._clone(new PointText(Item.NO_INSERT), insert); - }, - - getPoint: function() { - var point = this._matrix.getTranslation(); - return new LinkedPoint(point.x, point.y, this, 'setPoint'); - }, - - setPoint: function() { - var point = Point.read(arguments); - this.translate(point.subtract(this._matrix.getTranslation())); - }, - - _draw: function(ctx) { - if (!this._content) - return; - this._setStyles(ctx); - var style = this._style, - lines = this._lines, - leading = style.getLeading(), - shadowColor = ctx.shadowColor; - ctx.font = style.getFontStyle(); - ctx.textAlign = style.getJustification(); - for (var i = 0, l = lines.length; i < l; i++) { - ctx.shadowColor = shadowColor; - var line = lines[i]; - if (style.hasFill()) { - ctx.fillText(line, 0, 0); - ctx.shadowColor = 'rgba(0,0,0,0)'; - } - if (style.hasStroke()) - ctx.strokeText(line, 0, 0); - ctx.translate(0, leading); - } - }, - - _getBounds: function(getter, matrix) { - var style = this._style, - lines = this._lines, - numLines = lines.length, - justification = style.getJustification(), - leading = style.getLeading(), - width = this.getView().getTextWidth(style.getFontStyle(), lines), - x = 0; - if (justification !== 'left') - x -= width / (justification === 'center' ? 2: 1); - var bounds = new Rectangle(x, - numLines ? - 0.75 * leading : 0, - width, numLines * leading); - return matrix ? matrix._transformBounds(bounds, bounds) : bounds; - } -}); - -var Color = Base.extend(new function() { - var types = { - gray: ['gray'], - rgb: ['red', 'green', 'blue'], - hsb: ['hue', 'saturation', 'brightness'], - hsl: ['hue', 'saturation', 'lightness'], - gradient: ['gradient', 'origin', 'destination', 'highlight'] - }; - - var componentParsers = {}, - colorCache = {}, - colorCtx; - - function fromCSS(string) { - var match = string.match(/^#(\w{1,2})(\w{1,2})(\w{1,2})$/), - components; - if (match) { - components = [0, 0, 0]; - for (var i = 0; i < 3; i++) { - var value = match[i + 1]; - components[i] = parseInt(value.length == 1 - ? value + value : value, 16) / 255; - } - } else if (match = string.match(/^rgba?\((.*)\)$/)) { - components = match[1].split(','); - for (var i = 0, l = components.length; i < l; i++) { - var value = +components[i]; - components[i] = i < 3 ? value / 255 : value; - } - } else { - var cached = colorCache[string]; - if (!cached) { - if (!colorCtx) { - colorCtx = CanvasProvider.getContext(1, 1); - colorCtx.globalCompositeOperation = 'copy'; - } - colorCtx.fillStyle = 'rgba(0,0,0,0)'; - colorCtx.fillStyle = string; - colorCtx.fillRect(0, 0, 1, 1); - var data = colorCtx.getImageData(0, 0, 1, 1).data; - cached = colorCache[string] = [ - data[0] / 255, - data[1] / 255, - data[2] / 255 - ]; - } - components = cached.slice(); - } - return components; - } - - var hsbIndices = [ - [0, 3, 1], - [2, 0, 1], - [1, 0, 3], - [1, 2, 0], - [3, 1, 0], - [0, 1, 2] - ]; - - var converters = { - 'rgb-hsb': function(r, g, b) { - var max = Math.max(r, g, b), - min = Math.min(r, g, b), - delta = max - min, - h = delta === 0 ? 0 - : ( max == r ? (g - b) / delta + (g < b ? 6 : 0) - : max == g ? (b - r) / delta + 2 - : (r - g) / delta + 4) * 60; - return [h, max === 0 ? 0 : delta / max, max]; - }, - - 'hsb-rgb': function(h, s, b) { - h = (((h / 60) % 6) + 6) % 6; - var i = Math.floor(h), - f = h - i, - i = hsbIndices[i], - v = [ - b, - b * (1 - s), - b * (1 - s * f), - b * (1 - s * (1 - f)) - ]; - return [v[i[0]], v[i[1]], v[i[2]]]; - }, - - 'rgb-hsl': function(r, g, b) { - var max = Math.max(r, g, b), - min = Math.min(r, g, b), - delta = max - min, - achromatic = delta === 0, - h = achromatic ? 0 - : ( max == r ? (g - b) / delta + (g < b ? 6 : 0) - : max == g ? (b - r) / delta + 2 - : (r - g) / delta + 4) * 60, - l = (max + min) / 2, - s = achromatic ? 0 : l < 0.5 - ? delta / (max + min) - : delta / (2 - max - min); - return [h, s, l]; - }, - - 'hsl-rgb': function(h, s, l) { - h = (((h / 360) % 1) + 1) % 1; - if (s === 0) - return [l, l, l]; - var t3s = [ h + 1 / 3, h, h - 1 / 3 ], - t2 = l < 0.5 ? l * (1 + s) : l + s - l * s, - t1 = 2 * l - t2, - c = []; - for (var i = 0; i < 3; i++) { - var t3 = t3s[i]; - if (t3 < 0) t3 += 1; - if (t3 > 1) t3 -= 1; - c[i] = 6 * t3 < 1 - ? t1 + (t2 - t1) * 6 * t3 - : 2 * t3 < 1 - ? t2 - : 3 * t3 < 2 - ? t1 + (t2 - t1) * ((2 / 3) - t3) * 6 - : t1; - } - return c; - }, - - 'rgb-gray': function(r, g, b) { - return [r * 0.2989 + g * 0.587 + b * 0.114]; - }, - - 'gray-rgb': function(g) { - return [g, g, g]; - }, - - 'gray-hsb': function(g) { - return [0, 0, g]; - }, - - 'gray-hsl': function(g) { - return [0, 0, g]; - }, - - 'gradient-rgb': function() { - return []; - }, - - 'rgb-gradient': function() { - return []; - } - - }; - - return Base.each(types, function(properties, type) { - componentParsers[type] = []; - Base.each(properties, function(name, index) { - var part = Base.capitalize(name), - hasOverlap = /^(hue|saturation)$/.test(name), - parser = componentParsers[type][index] = name === 'gradient' - ? function(value) { - var current = this._components[0]; - value = Gradient.read(Array.isArray(value) ? value - : arguments, 0, { readNull: true }); - if (current !== value) { - if (current) - current._removeOwner(this); - if (value) - value._addOwner(this); - } - return value; - } - : type === 'gradient' - ? function() { - return Point.read(arguments, 0, { - readNull: name === 'highlight', - clone: true - }); - } - : function(value) { - return value == null || isNaN(value) ? 0 : value; - }; - - this['get' + part] = function() { - return this._type === type - || hasOverlap && /^hs[bl]$/.test(this._type) - ? this._components[index] - : this._convert(type)[index]; - }; - - this['set' + part] = function(value) { - if (this._type !== type - && !(hasOverlap && /^hs[bl]$/.test(this._type))) { - this._components = this._convert(type); - this._properties = types[type]; - this._type = type; - } - this._components[index] = parser.call(this, value); - this._changed(); - }; - }, this); - }, { - _class: 'Color', - _readIndex: true, - - initialize: function Color(arg) { - var slice = Array.prototype.slice, - args = arguments, - read = 0, - type, - components, - alpha, - values; - if (Array.isArray(arg)) { - args = arg; - arg = args[0]; - } - var argType = arg != null && typeof arg; - if (argType === 'string' && arg in types) { - type = arg; - arg = args[1]; - if (Array.isArray(arg)) { - components = arg; - alpha = args[2]; - } else { - if (this.__read) - read = 1; - args = slice.call(args, 1); - argType = typeof arg; - } - } - if (!components) { - values = argType === 'number' - ? args - : argType === 'object' && arg.length != null - ? arg - : null; - if (values) { - if (!type) - type = values.length >= 3 - ? 'rgb' - : 'gray'; - var length = types[type].length; - alpha = values[length]; - if (this.__read) - read += values === arguments - ? length + (alpha != null ? 1 : 0) - : 1; - if (values.length > length) - values = slice.call(values, 0, length); - } else if (argType === 'string') { - type = 'rgb'; - components = fromCSS(arg); - if (components.length === 4) { - alpha = components[3]; - components.length--; - } - } else if (argType === 'object') { - if (arg.constructor === Color) { - type = arg._type; - components = arg._components.slice(); - alpha = arg._alpha; - if (type === 'gradient') { - for (var i = 1, l = components.length; i < l; i++) { - var point = components[i]; - if (point) - components[i] = point.clone(); - } - } - } else if (arg.constructor === Gradient) { - type = 'gradient'; - values = args; - } else { - type = 'hue' in arg - ? 'lightness' in arg - ? 'hsl' - : 'hsb' - : 'gradient' in arg || 'stops' in arg - || 'radial' in arg - ? 'gradient' - : 'gray' in arg - ? 'gray' - : 'rgb'; - var properties = types[type], - parsers = componentParsers[type]; - this._components = components = []; - for (var i = 0, l = properties.length; i < l; i++) { - var value = arg[properties[i]]; - if (value == null && i === 0 && type === 'gradient' - && 'stops' in arg) { - value = { - stops: arg.stops, - radial: arg.radial - }; - } - value = parsers[i].call(this, value); - if (value != null) - components[i] = value; - } - alpha = arg.alpha; - } - } - if (this.__read && type) - read = 1; - } - this._type = type || 'rgb'; - this._id = UID.get(Color); - if (!components) { - this._components = components = []; - var parsers = componentParsers[this._type]; - for (var i = 0, l = parsers.length; i < l; i++) { - var value = parsers[i].call(this, values && values[i]); - if (value != null) - components[i] = value; - } - } - this._components = components; - this._properties = types[this._type]; - this._alpha = alpha; - if (this.__read) - this.__read = read; - }, - - _serialize: function(options, dictionary) { - var components = this.getComponents(); - return Base.serialize( - /^(gray|rgb)$/.test(this._type) - ? components - : [this._type].concat(components), - options, true, dictionary); - }, - - _changed: function() { - this._canvasStyle = null; - if (this._owner) - this._owner._changed(65); - }, - - _convert: function(type) { - var converter; - return this._type === type - ? this._components.slice() - : (converter = converters[this._type + '-' + type]) - ? converter.apply(this, this._components) - : converters['rgb-' + type].apply(this, - converters[this._type + '-rgb'].apply(this, - this._components)); - }, - - convert: function(type) { - return new Color(type, this._convert(type), this._alpha); - }, - - getType: function() { - return this._type; - }, - - setType: function(type) { - this._components = this._convert(type); - this._properties = types[type]; - this._type = type; - }, - - getComponents: function() { - var components = this._components.slice(); - if (this._alpha != null) - components.push(this._alpha); - return components; - }, - - getAlpha: function() { - return this._alpha != null ? this._alpha : 1; - }, - - setAlpha: function(alpha) { - this._alpha = alpha == null ? null : Math.min(Math.max(alpha, 0), 1); - this._changed(); - }, - - hasAlpha: function() { - return this._alpha != null; - }, - - equals: function(color) { - var col = Base.isPlainValue(color, true) - ? Color.read(arguments) - : color; - return col === this || col && this._class === col._class - && this._type === col._type - && this._alpha === col._alpha - && Base.equals(this._components, col._components) - || false; - }, - - toString: function() { - var properties = this._properties, - parts = [], - isGradient = this._type === 'gradient', - f = Formatter.instance; - for (var i = 0, l = properties.length; i < l; i++) { - var value = this._components[i]; - if (value != null) - parts.push(properties[i] + ': ' - + (isGradient ? value : f.number(value))); - } - if (this._alpha != null) - parts.push('alpha: ' + f.number(this._alpha)); - return '{ ' + parts.join(', ') + ' }'; - }, - - toCSS: function(hex) { - var components = this._convert('rgb'), - alpha = hex || this._alpha == null ? 1 : this._alpha; - function convert(val) { - return Math.round((val < 0 ? 0 : val > 1 ? 1 : val) * 255); - } - components = [ - convert(components[0]), - convert(components[1]), - convert(components[2]) - ]; - if (alpha < 1) - components.push(alpha < 0 ? 0 : alpha); - return hex - ? '#' + ((1 << 24) + (components[0] << 16) - + (components[1] << 8) - + components[2]).toString(16).slice(1) - : (components.length == 4 ? 'rgba(' : 'rgb(') - + components.join(',') + ')'; - }, - - toCanvasStyle: function(ctx) { - if (this._canvasStyle) - return this._canvasStyle; - if (this._type !== 'gradient') - return this._canvasStyle = this.toCSS(); - var components = this._components, - gradient = components[0], - stops = gradient._stops, - origin = components[1], - destination = components[2], - canvasGradient; - if (gradient._radial) { - var radius = destination.getDistance(origin), - highlight = components[3]; - if (highlight) { - var vector = highlight.subtract(origin); - if (vector.getLength() > radius) - highlight = origin.add(vector.normalize(radius - 0.1)); - } - var start = highlight || origin; - canvasGradient = ctx.createRadialGradient(start.x, start.y, - 0, origin.x, origin.y, radius); - } else { - canvasGradient = ctx.createLinearGradient(origin.x, origin.y, - destination.x, destination.y); - } - for (var i = 0, l = stops.length; i < l; i++) { - var stop = stops[i]; - canvasGradient.addColorStop(stop._rampPoint, - stop._color.toCanvasStyle()); - } - return this._canvasStyle = canvasGradient; - }, - - transform: function(matrix) { - if (this._type === 'gradient') { - var components = this._components; - for (var i = 1, l = components.length; i < l; i++) { - var point = components[i]; - matrix._transformPoint(point, point, true); - } - this._changed(); - } - }, - - statics: { - _types: types, - - random: function() { - var random = Math.random; - return new Color(random(), random(), random()); - } - } - }); -}, -new function() { - var operators = { - add: function(a, b) { - return a + b; - }, - - subtract: function(a, b) { - return a - b; - }, - - multiply: function(a, b) { - return a * b; - }, - - divide: function(a, b) { - return a / b; - } - }; - - return Base.each(operators, function(operator, name) { - this[name] = function(color) { - color = Color.read(arguments); - var type = this._type, - components1 = this._components, - components2 = color._convert(type); - for (var i = 0, l = components1.length; i < l; i++) - components2[i] = operator(components1[i], components2[i]); - return new Color(type, components2, - this._alpha != null - ? operator(this._alpha, color.getAlpha()) - : null); - }; - }, { - }); -}); - -var Gradient = Base.extend({ - _class: 'Gradient', - - initialize: function Gradient(stops, radial) { - this._id = UID.get(); - if (stops && this._set(stops)) - stops = radial = null; - if (!this._stops) - this.setStops(stops || ['white', 'black']); - if (this._radial == null) - this.setRadial(typeof radial === 'string' && radial === 'radial' - || radial || false); - }, - - _serialize: function(options, dictionary) { - return dictionary.add(this, function() { - return Base.serialize([this._stops, this._radial], - options, true, dictionary); - }); - }, - - _changed: function() { - for (var i = 0, l = this._owners && this._owners.length; i < l; i++) - this._owners[i]._changed(); - }, - - _addOwner: function(color) { - if (!this._owners) - this._owners = []; - this._owners.push(color); - }, - - _removeOwner: function(color) { - var index = this._owners ? this._owners.indexOf(color) : -1; - if (index != -1) { - this._owners.splice(index, 1); - if (this._owners.length === 0) - this._owners = undefined; - } - }, - - clone: function() { - var stops = []; - for (var i = 0, l = this._stops.length; i < l; i++) - stops[i] = this._stops[i].clone(); - return new Gradient(stops, this._radial); - }, - - getStops: function() { - return this._stops; - }, - - setStops: function(stops) { - if (this.stops) { - for (var i = 0, l = this._stops.length; i < l; i++) - this._stops[i]._owner = undefined; - } - if (stops.length < 2) - throw new Error( - 'Gradient stop list needs to contain at least two stops.'); - this._stops = GradientStop.readAll(stops, 0, { clone: true }); - for (var i = 0, l = this._stops.length; i < l; i++) { - var stop = this._stops[i]; - stop._owner = this; - if (stop._defaultRamp) - stop.setRampPoint(i / (l - 1)); - } - this._changed(); - }, - - getRadial: function() { - return this._radial; - }, - - setRadial: function(radial) { - this._radial = radial; - this._changed(); - }, - - equals: function(gradient) { - if (gradient === this) - return true; - if (gradient && this._class === gradient._class - && this._stops.length === gradient._stops.length) { - for (var i = 0, l = this._stops.length; i < l; i++) { - if (!this._stops[i].equals(gradient._stops[i])) - return false; - } - return true; - } - return false; - } -}); - -var GradientStop = Base.extend({ - _class: 'GradientStop', - - initialize: function GradientStop(arg0, arg1) { - if (arg0) { - var color, rampPoint; - if (arg1 === undefined && Array.isArray(arg0)) { - color = arg0[0]; - rampPoint = arg0[1]; - } else if (arg0.color) { - color = arg0.color; - rampPoint = arg0.rampPoint; - } else { - color = arg0; - rampPoint = arg1; - } - this.setColor(color); - this.setRampPoint(rampPoint); - } - }, - - clone: function() { - return new GradientStop(this._color.clone(), this._rampPoint); - }, - - _serialize: function(options, dictionary) { - return Base.serialize([this._color, this._rampPoint], options, true, - dictionary); - }, - - _changed: function() { - if (this._owner) - this._owner._changed(65); - }, - - getRampPoint: function() { - return this._rampPoint; - }, - - setRampPoint: function(rampPoint) { - this._defaultRamp = rampPoint == null; - this._rampPoint = rampPoint || 0; - this._changed(); - }, - - getColor: function() { - return this._color; - }, - - setColor: function(color) { - this._color = Color.read(arguments); - if (this._color === color) - this._color = color.clone(); - this._color._owner = this; - this._changed(); - }, - - equals: function(stop) { - return stop === this || stop && this._class === stop._class - && this._color.equals(stop._color) - && this._rampPoint == stop._rampPoint - || false; - } -}); - -var Style = Base.extend(new function() { - var defaults = { - fillColor: undefined, - strokeColor: undefined, - strokeWidth: 1, - strokeCap: 'butt', - strokeJoin: 'miter', - strokeScaling: true, - miterLimit: 10, - dashOffset: 0, - dashArray: [], - windingRule: 'nonzero', - shadowColor: undefined, - shadowBlur: 0, - shadowOffset: new Point(), - selectedColor: undefined, - fontFamily: 'sans-serif', - fontWeight: 'normal', - fontSize: 12, - font: 'sans-serif', - leading: null, - justification: 'left' - }; - - var flags = { - strokeWidth: 97, - strokeCap: 97, - strokeJoin: 97, - strokeScaling: 105, - miterLimit: 97, - fontFamily: 9, - fontWeight: 9, - fontSize: 9, - font: 9, - leading: 9, - justification: 9 - }; - - var item = { beans: true }, - fields = { - _defaults: defaults, - _textDefaults: new Base(defaults, { - fillColor: new Color() - }), - beans: true - }; - - Base.each(defaults, function(value, key) { - var isColor = /Color$/.test(key), - isPoint = key === 'shadowOffset', - part = Base.capitalize(key), - flag = flags[key], - set = 'set' + part, - get = 'get' + part; - - fields[set] = function(value) { - var owner = this._owner, - children = owner && owner._children; - if (children && children.length > 0 - && !(owner instanceof CompoundPath)) { - for (var i = 0, l = children.length; i < l; i++) - children[i]._style[set](value); - } else { - var old = this._values[key]; - if (old !== value) { - if (isColor) { - if (old) - old._owner = undefined; - if (value && value.constructor === Color) { - if (value._owner) - value = value.clone(); - value._owner = owner; - } - } - this._values[key] = value; - if (owner) - owner._changed(flag || 65); - } - } - }; - - fields[get] = function(_dontMerge) { - var owner = this._owner, - children = owner && owner._children, - value; - if (!children || children.length === 0 || _dontMerge - || owner instanceof CompoundPath) { - var value = this._values[key]; - if (value === undefined) { - value = this._defaults[key]; - if (value && value.clone) - value = value.clone(); - } else { - var ctor = isColor ? Color : isPoint ? Point : null; - if (ctor && !(value && value.constructor === ctor)) { - this._values[key] = value = ctor.read([value], 0, - { readNull: true, clone: true }); - if (value && isColor) - value._owner = owner; - } - } - return value; - } - for (var i = 0, l = children.length; i < l; i++) { - var childValue = children[i]._style[get](); - if (i === 0) { - value = childValue; - } else if (!Base.equals(value, childValue)) { - return undefined; - } - } - return value; - }; - - item[get] = function(_dontMerge) { - return this._style[get](_dontMerge); - }; - - item[set] = function(value) { - this._style[set](value); - }; - }); - - Item.inject(item); - return fields; -}, { - _class: 'Style', - - initialize: function Style(style, _owner, _project) { - this._values = {}; - this._owner = _owner; - this._project = _owner && _owner._project || _project || paper.project; - if (_owner instanceof TextItem) - this._defaults = this._textDefaults; - if (style) - this.set(style); - }, - - set: function(style) { - var isStyle = style instanceof Style, - values = isStyle ? style._values : style; - if (values) { - for (var key in values) { - if (key in this._defaults) { - var value = values[key]; - this[key] = value && isStyle && value.clone - ? value.clone() : value; - } - } - } - }, - - equals: function(style) { - return style === this || style && this._class === style._class - && Base.equals(this._values, style._values) - || false; - }, - - hasFill: function() { - return !!this.getFillColor(); - }, - - hasStroke: function() { - return !!this.getStrokeColor() && this.getStrokeWidth() > 0; - }, - - hasShadow: function() { - return !!this.getShadowColor() && this.getShadowBlur() > 0; - }, - - getView: function() { - return this._project.getView(); - }, - - getFontStyle: function() { - var fontSize = this.getFontSize(); - return this.getFontWeight() - + ' ' + fontSize + (/[a-z]/i.test(fontSize + '') ? ' ' : 'px ') - + this.getFontFamily(); - }, - - getFont: '#getFontFamily', - setFont: '#setFontFamily', - - getLeading: function getLeading() { - var leading = getLeading.base.call(this), - fontSize = this.getFontSize(); - if (/pt|em|%|px/.test(fontSize)) - fontSize = this.getView().getPixelSize(fontSize); - return leading != null ? leading : fontSize * 1.2; - } - -}); - -var DomElement = new function() { - function handlePrefix(el, name, set, value) { - var prefixes = ['', 'webkit', 'moz', 'Moz', 'ms', 'o'], - suffix = name[0].toUpperCase() + name.substring(1); - for (var i = 0; i < 6; i++) { - var prefix = prefixes[i], - key = prefix ? prefix + suffix : name; - if (key in el) { - if (set) { - el[key] = value; - } else { - return el[key]; - } - break; - } - } - } - - return { - getStyles: function(el) { - var doc = el && el.nodeType !== 9 ? el.ownerDocument : el, - view = doc && doc.defaultView; - return view && view.getComputedStyle(el, ''); - }, - - getBounds: function(el, viewport) { - var doc = el.ownerDocument, - body = doc.body, - html = doc.documentElement, - rect; - try { - rect = el.getBoundingClientRect(); - } catch (e) { - rect = { left: 0, top: 0, width: 0, height: 0 }; - } - var x = rect.left - (html.clientLeft || body.clientLeft || 0), - y = rect.top - (html.clientTop || body.clientTop || 0); - if (!viewport) { - var view = doc.defaultView; - x += view.pageXOffset || html.scrollLeft || body.scrollLeft; - y += view.pageYOffset || html.scrollTop || body.scrollTop; - } - return new Rectangle(x, y, rect.width, rect.height); - }, - - getViewportBounds: function(el) { - var doc = el.ownerDocument, - view = doc.defaultView, - html = doc.documentElement; - return new Rectangle(0, 0, - view.innerWidth || html.clientWidth, - view.innerHeight || html.clientHeight - ); - }, - - getOffset: function(el, viewport) { - return DomElement.getBounds(el, viewport).getPoint(); - }, - - getSize: function(el) { - return DomElement.getBounds(el, true).getSize(); - }, - - isInvisible: function(el) { - return DomElement.getSize(el).equals(new Size(0, 0)); - }, - - isInView: function(el) { - return !DomElement.isInvisible(el) - && DomElement.getViewportBounds(el).intersects( - DomElement.getBounds(el, true)); - }, - - getPrefixed: function(el, name) { - return handlePrefix(el, name); - }, - - setPrefixed: function(el, name, value) { - if (typeof name === 'object') { - for (var key in name) - handlePrefix(el, key, true, name[key]); - } else { - handlePrefix(el, name, true, value); - } - } - }; -}; - -var DomEvent = { - add: function(el, events) { - for (var type in events) { - var func = events[type], - parts = type.split(/[\s,]+/g); - for (var i = 0, l = parts.length; i < l; i++) - el.addEventListener(parts[i], func, false); - } - }, - - remove: function(el, events) { - for (var type in events) { - var func = events[type], - parts = type.split(/[\s,]+/g); - for (var i = 0, l = parts.length; i < l; i++) - el.removeEventListener(parts[i], func, false); - } - }, - - getPoint: function(event) { - var pos = event.targetTouches - ? event.targetTouches.length - ? event.targetTouches[0] - : event.changedTouches[0] - : event; - return new Point( - pos.pageX || pos.clientX + document.documentElement.scrollLeft, - pos.pageY || pos.clientY + document.documentElement.scrollTop - ); - }, - - getTarget: function(event) { - return event.target || event.srcElement; - }, - - getRelatedTarget: function(event) { - return event.relatedTarget || event.toElement; - }, - - getOffset: function(event, target) { - return DomEvent.getPoint(event).subtract(DomElement.getOffset( - target || DomEvent.getTarget(event))); - }, - - stop: function(event) { - event.stopPropagation(); - event.preventDefault(); - } -}; - -DomEvent.requestAnimationFrame = new function() { - var nativeRequest = DomElement.getPrefixed(window, 'requestAnimationFrame'), - requested = false, - callbacks = [], - focused = true, - timer; - - DomEvent.add(window, { - focus: function() { - focused = true; - }, - blur: function() { - focused = false; - } - }); - - function handleCallbacks() { - for (var i = callbacks.length - 1; i >= 0; i--) { - var entry = callbacks[i], - func = entry[0], - el = entry[1]; - if (!el || (PaperScope.getAttribute(el, 'keepalive') == 'true' - || focused) && DomElement.isInView(el)) { - callbacks.splice(i, 1); - func(); - } - } - if (nativeRequest) { - if (callbacks.length) { - nativeRequest(handleCallbacks); - } else { - requested = false; - } - } - } - - return function(callback, element) { - callbacks.push([callback, element]); - if (nativeRequest) { - if (!requested) { - nativeRequest(handleCallbacks); - requested = true; - } - } else if (!timer) { - timer = setInterval(handleCallbacks, 1000 / 60); - } - }; -}; - -var View = Base.extend(Emitter, { - _class: 'View', - - initialize: function View(project, element) { - this._project = project; - this._scope = project._scope; - this._element = element; - var size; - if (!this._pixelRatio) - this._pixelRatio = window.devicePixelRatio || 1; - this._id = element.getAttribute('id'); - if (this._id == null) - element.setAttribute('id', this._id = 'view-' + View._id++); - DomEvent.add(element, this._viewEvents); - var none = 'none'; - DomElement.setPrefixed(element.style, { - userSelect: none, - touchAction: none, - touchCallout: none, - contentZooming: none, - userDrag: none, - tapHighlightColor: 'rgba(0,0,0,0)' - }); - - function getSize(name) { - return element[name] || parseInt(element.getAttribute(name), 10); - }; - - function getCanvasSize() { - var size = DomElement.getSize(element); - return size.isNaN() || size.isZero() - ? new Size(getSize('width'), getSize('height')) - : size; - }; - - if (PaperScope.hasAttribute(element, 'resize')) { - var that = this; - DomEvent.add(window, this._windowEvents = { - resize: function() { - that.setViewSize(getCanvasSize()); - } - }); - } - this._setViewSize(size = getCanvasSize()); - if (PaperScope.hasAttribute(element, 'stats') - && typeof Stats !== 'undefined') { - this._stats = new Stats(); - var stats = this._stats.domElement, - style = stats.style, - offset = DomElement.getOffset(element); - style.position = 'absolute'; - style.left = offset.x + 'px'; - style.top = offset.y + 'px'; - document.body.appendChild(stats); - } - View._views.push(this); - View._viewsById[this._id] = this; - this._viewSize = size; - (this._matrix = new Matrix())._owner = this; - this._zoom = 1; - if (!View._focused) - View._focused = this; - this._frameItems = {}; - this._frameItemCount = 0; - }, - - remove: function() { - if (!this._project) - return false; - if (View._focused === this) - View._focused = null; - View._views.splice(View._views.indexOf(this), 1); - delete View._viewsById[this._id]; - if (this._project._view === this) - this._project._view = null; - DomEvent.remove(this._element, this._viewEvents); - DomEvent.remove(window, this._windowEvents); - this._element = this._project = null; - this.off('frame'); - this._animate = false; - this._frameItems = {}; - return true; - }, - - _events: Base.each(['onResize', 'onMouseDown', 'onMouseUp', 'onMouseMove'], - function(name) { - this[name] = { - install: function(type) { - this._installEvent(type); - }, - - uninstall: function(type) { - this._uninstallEvent(type); - } - }; - }, { - onFrame: { - install: function() { - this.play(); - }, - - uninstall: function() { - this.pause(); - } - } - } - ), - - _animate: false, - _time: 0, - _count: 0, - - _requestFrame: function() { - var that = this; - DomEvent.requestAnimationFrame(function() { - that._requested = false; - if (!that._animate) - return; - that._requestFrame(); - that._handleFrame(); - }, this._element); - this._requested = true; - }, - - _handleFrame: function() { - paper = this._scope; - var now = Date.now() / 1000, - delta = this._before ? now - this._before : 0; - this._before = now; - this._handlingFrame = true; - this.emit('frame', new Base({ - delta: delta, - time: this._time += delta, - count: this._count++ - })); - if (this._stats) - this._stats.update(); - this._handlingFrame = false; - this.update(); - }, - - _animateItem: function(item, animate) { - var items = this._frameItems; - if (animate) { - items[item._id] = { - item: item, - time: 0, - count: 0 - }; - if (++this._frameItemCount === 1) - this.on('frame', this._handleFrameItems); - } else { - delete items[item._id]; - if (--this._frameItemCount === 0) { - this.off('frame', this._handleFrameItems); - } - } - }, - - _handleFrameItems: function(event) { - for (var i in this._frameItems) { - var entry = this._frameItems[i]; - entry.item.emit('frame', new Base(event, { - time: entry.time += event.delta, - count: entry.count++ - })); - } - }, - - _update: function() { - this._project._needsUpdate = true; - if (this._handlingFrame) - return; - if (this._animate) { - this._handleFrame(); - } else { - this.update(); - } - }, - - _changed: function(flags) { - if (flags & 1) - this._project._needsUpdate = true; - }, - - _transform: function(matrix) { - this._matrix.concatenate(matrix); - this._bounds = null; - this._update(); - }, - - getElement: function() { - return this._element; - }, - - getPixelRatio: function() { - return this._pixelRatio; - }, - - getResolution: function() { - return this._pixelRatio * 72; - }, - - getViewSize: function() { - var size = this._viewSize; - return new LinkedSize(size.width, size.height, this, 'setViewSize'); - }, - - setViewSize: function() { - var size = Size.read(arguments), - delta = size.subtract(this._viewSize); - if (delta.isZero()) - return; - this._viewSize.set(size.width, size.height); - this._setViewSize(size); - this._bounds = null; - this.emit('resize', { - size: size, - delta: delta - }); - this._update(); - }, - - _setViewSize: function(size) { - var element = this._element; - element.width = size.width; - element.height = size.height; - }, - - getBounds: function() { - if (!this._bounds) - this._bounds = this._matrix.inverted()._transformBounds( - new Rectangle(new Point(), this._viewSize)); - return this._bounds; - }, - - getSize: function() { - return this.getBounds().getSize(); - }, - - getCenter: function() { - return this.getBounds().getCenter(); - }, - - setCenter: function() { - var center = Point.read(arguments); - this.scrollBy(center.subtract(this.getCenter())); - }, - - getZoom: function() { - return this._zoom; - }, - - setZoom: function(zoom) { - this._transform(new Matrix().scale(zoom / this._zoom, - this.getCenter())); - this._zoom = zoom; - }, - - isVisible: function() { - return DomElement.isInView(this._element); - }, - - scrollBy: function() { - this._transform(new Matrix().translate(Point.read(arguments).negate())); - }, - - play: function() { - this._animate = true; - if (!this._requested) - this._requestFrame(); - }, - - pause: function() { - this._animate = false; - }, - - draw: function() { - this.update(); - }, - - projectToView: function() { - return this._matrix._transformPoint(Point.read(arguments)); - }, - - viewToProject: function() { - return this._matrix._inverseTransform(Point.read(arguments)); - } - -}, { - statics: { - _views: [], - _viewsById: {}, - _id: 0, - - create: function(project, element) { - if (typeof element === 'string') - element = document.getElementById(element); - return new CanvasView(project, element); - } - } -}, -new function() { - var tool, - prevFocus, - tempFocus, - dragging = false; - - function getView(event) { - var target = DomEvent.getTarget(event); - return target.getAttribute && View._viewsById[target.getAttribute('id')]; - } - - function viewToProject(view, event) { - return view.viewToProject(DomEvent.getOffset(event, view._element)); - } - - function updateFocus() { - if (!View._focused || !View._focused.isVisible()) { - for (var i = 0, l = View._views.length; i < l; i++) { - var view = View._views[i]; - if (view && view.isVisible()) { - View._focused = tempFocus = view; - break; - } - } - } - } - - function handleMouseMove(view, point, event) { - view._handleEvent('mousemove', point, event); - var tool = view._scope.tool; - if (tool) { - tool._handleEvent(dragging && tool.responds('mousedrag') - ? 'mousedrag' : 'mousemove', point, event); - } - view.update(); - return tool; - } - - var navigator = window.navigator, - mousedown, mousemove, mouseup; - if (navigator.pointerEnabled || navigator.msPointerEnabled) { - mousedown = 'pointerdown MSPointerDown'; - mousemove = 'pointermove MSPointerMove'; - mouseup = 'pointerup pointercancel MSPointerUp MSPointerCancel'; - } else { - mousedown = 'touchstart'; - mousemove = 'touchmove'; - mouseup = 'touchend touchcancel'; - if (!('ontouchstart' in window && navigator.userAgent.match( - /mobile|tablet|ip(ad|hone|od)|android|silk/i))) { - mousedown += ' mousedown'; - mousemove += ' mousemove'; - mouseup += ' mouseup'; - } - } - - var viewEvents = { - 'selectstart dragstart': function(event) { - if (dragging) - event.preventDefault(); - } - }; - - var docEvents = { - mouseout: function(event) { - var view = View._focused, - target = DomEvent.getRelatedTarget(event); - if (view && (!target || target.nodeName === 'HTML')) - handleMouseMove(view, viewToProject(view, event), event); - }, - - scroll: updateFocus - }; - - viewEvents[mousedown] = function(event) { - var view = View._focused = getView(event), - point = viewToProject(view, event); - dragging = true; - view._handleEvent('mousedown', point, event); - if (tool = view._scope.tool) - tool._handleEvent('mousedown', point, event); - view.update(); - }; - - docEvents[mousemove] = function(event) { - var view = View._focused; - if (!dragging) { - var target = getView(event); - if (target) { - if (view !== target) - handleMouseMove(view, viewToProject(view, event), event); - prevFocus = view; - view = View._focused = tempFocus = target; - } else if (tempFocus && tempFocus === view) { - view = View._focused = prevFocus; - updateFocus(); - } - } - if (view) { - var point = viewToProject(view, event); - if (dragging || view.getBounds().contains(point)) - tool = handleMouseMove(view, point, event); - } - }; - - docEvents[mouseup] = function(event) { - var view = View._focused; - if (!view || !dragging) - return; - var point = viewToProject(view, event); - dragging = false; - view._handleEvent('mouseup', point, event); - if (tool) - tool._handleEvent('mouseup', point, event); - view.update(); - }; - - DomEvent.add(document, docEvents); - - DomEvent.add(window, { - load: updateFocus - }); - - var mouseFlags = { - mousedown: { - mousedown: 1, - mousedrag: 1, - click: 1, - doubleclick: 1 - }, - mouseup: { - mouseup: 1, - mousedrag: 1, - click: 1, - doubleclick: 1 - }, - mousemove: { - mousedrag: 1, - mousemove: 1, - mouseenter: 1, - mouseleave: 1 - } - }; - - return { - _viewEvents: viewEvents, - - _handleEvent: function() {}, - - _installEvent: function(type) { - var counters = this._eventCounters; - if (counters) { - for (var key in mouseFlags) { - counters[key] = (counters[key] || 0) - + (mouseFlags[key][type] || 0); - } - } - }, - - _uninstallEvent: function(type) { - var counters = this._eventCounters; - if (counters) { - for (var key in mouseFlags) - counters[key] -= mouseFlags[key][type] || 0; - } - }, - - statics: { - updateFocus: updateFocus - } - }; -}); - -var CanvasView = View.extend({ - _class: 'CanvasView', - - initialize: function CanvasView(project, canvas) { - if (!(canvas instanceof HTMLCanvasElement)) { - var size = Size.read(arguments, 1); - if (size.isZero()) - throw new Error( - 'Cannot create CanvasView with the provided argument: ' - + [].slice.call(arguments, 1)); - canvas = CanvasProvider.getCanvas(size); - } - this._context = canvas.getContext('2d'); - this._eventCounters = {}; - this._pixelRatio = 1; - if (!/^off|false$/.test(PaperScope.getAttribute(canvas, 'hidpi'))) { - var deviceRatio = window.devicePixelRatio || 1, - backingStoreRatio = DomElement.getPrefixed(this._context, - 'backingStorePixelRatio') || 1; - this._pixelRatio = deviceRatio / backingStoreRatio; - } - View.call(this, project, canvas); - }, - - _setViewSize: function(size) { - var element = this._element, - pixelRatio = this._pixelRatio, - width = size.width, - height = size.height; - element.width = width * pixelRatio; - element.height = height * pixelRatio; - if (pixelRatio !== 1) { - if (!PaperScope.hasAttribute(element, 'resize')) { - var style = element.style; - style.width = width + 'px'; - style.height = height + 'px'; - } - this._context.scale(pixelRatio, pixelRatio); - } - }, - - getPixelSize: function(size) { - var browser = paper.browser, - pixels; - if (browser && browser.firefox) { - var parent = this._element.parentNode, - temp = document.createElement('div'); - temp.style.fontSize = size; - parent.appendChild(temp); - pixels = parseFloat(DomElement.getStyles(temp).fontSize); - parent.removeChild(temp); - } else { - var ctx = this._context, - prevFont = ctx.font; - ctx.font = size + ' serif'; - pixels = parseFloat(ctx.font); - ctx.font = prevFont; - } - return pixels; - }, - - getTextWidth: function(font, lines) { - var ctx = this._context, - prevFont = ctx.font, - width = 0; - ctx.font = font; - for (var i = 0, l = lines.length; i < l; i++) - width = Math.max(width, ctx.measureText(lines[i]).width); - ctx.font = prevFont; - return width; - }, - - update: function(force) { - var project = this._project; - if (!project || !force && !project._needsUpdate) - return false; - var ctx = this._context, - size = this._viewSize; - ctx.clearRect(0, 0, size.width + 1, size.height + 1); - project.draw(ctx, this._matrix, this._pixelRatio); - project._needsUpdate = false; - return true; - } -}, -new function() { - var downPoint, - lastPoint, - overPoint, - downItem, - lastItem, - overItem, - dragItem, - dblClick, - clickTime; - - function callEvent(view, type, event, point, target, lastPoint) { - var item = target, - mouseEvent; - - function call(obj) { - if (obj.responds(type)) { - if (!mouseEvent) { - mouseEvent = new MouseEvent(type, event, point, target, - lastPoint ? point.subtract(lastPoint) : null); - } - if (obj.emit(type, mouseEvent) && mouseEvent.isStopped) { - event.preventDefault(); - return true; - } - } - } - - while (item) { - if (call(item)) - return true; - item = item.getParent(); - } - if (call(view)) - return true; - return false; - } - - return { - _handleEvent: function(type, point, event) { - if (!this._eventCounters[type]) - return; - var project = this._project, - hit = project.hitTest(point, { - tolerance: 0, - fill: true, - stroke: true - }), - item = hit && hit.item, - stopped = false; - switch (type) { - case 'mousedown': - stopped = callEvent(this, type, event, point, item); - dblClick = lastItem == item && (Date.now() - clickTime < 300); - downItem = lastItem = item; - downPoint = lastPoint = overPoint = point; - dragItem = !stopped && item; - while (dragItem && !dragItem.responds('mousedrag')) - dragItem = dragItem._parent; - break; - case 'mouseup': - stopped = callEvent(this, type, event, point, item, downPoint); - if (dragItem) { - if (lastPoint && !lastPoint.equals(point)) - callEvent(this, 'mousedrag', event, point, dragItem, - lastPoint); - if (item !== dragItem) { - overPoint = point; - callEvent(this, 'mousemove', event, point, item, - overPoint); - } - } - if (!stopped && item && item === downItem) { - clickTime = Date.now(); - callEvent(this, dblClick && downItem.responds('doubleclick') - ? 'doubleclick' : 'click', event, downPoint, item); - dblClick = false; - } - downItem = dragItem = null; - break; - case 'mousemove': - if (dragItem) - stopped = callEvent(this, 'mousedrag', event, point, - dragItem, lastPoint); - if (!stopped) { - if (item !== overItem) - overPoint = point; - stopped = callEvent(this, type, event, point, item, - overPoint); - } - lastPoint = overPoint = point; - if (item !== overItem) { - callEvent(this, 'mouseleave', event, point, overItem); - overItem = item; - callEvent(this, 'mouseenter', event, point, item); - } - break; - } - return stopped; - } - }; -}); - -var Event = Base.extend({ - _class: 'Event', - - initialize: function Event(event) { - this.event = event; - }, - - isPrevented: false, - isStopped: false, - - preventDefault: function() { - this.isPrevented = true; - this.event.preventDefault(); - }, - - stopPropagation: function() { - this.isStopped = true; - this.event.stopPropagation(); - }, - - stop: function() { - this.stopPropagation(); - this.preventDefault(); - }, - - getModifiers: function() { - return Key.modifiers; - } -}); - -var KeyEvent = Event.extend({ - _class: 'KeyEvent', - - initialize: function KeyEvent(down, key, character, event) { - Event.call(this, event); - this.type = down ? 'keydown' : 'keyup'; - this.key = key; - this.character = character; - }, - - toString: function() { - return "{ type: '" + this.type - + "', key: '" + this.key - + "', character: '" + this.character - + "', modifiers: " + this.getModifiers() - + " }"; - } -}); - -var Key = new function() { - - var specialKeys = { - 8: 'backspace', - 9: 'tab', - 13: 'enter', - 16: 'shift', - 17: 'control', - 18: 'option', - 19: 'pause', - 20: 'caps-lock', - 27: 'escape', - 32: 'space', - 35: 'end', - 36: 'home', - 37: 'left', - 38: 'up', - 39: 'right', - 40: 'down', - 46: 'delete', - 91: 'command', - 93: 'command', - 224: 'command' - }, - - specialChars = { - 9: true, - 13: true, - 32: true - }, - - modifiers = new Base({ - shift: false, - control: false, - option: false, - command: false, - capsLock: false, - space: false - }), - - charCodeMap = {}, - keyMap = {}, - commandFixMap, - downCode; - - function handleKey(down, keyCode, charCode, event) { - var character = charCode ? String.fromCharCode(charCode) : '', - specialKey = specialKeys[keyCode], - key = specialKey || character.toLowerCase(), - type = down ? 'keydown' : 'keyup', - view = View._focused, - scope = view && view.isVisible() && view._scope, - tool = scope && scope.tool, - name; - keyMap[key] = down; - if (down) { - charCodeMap[keyCode] = charCode; - } else { - delete charCodeMap[keyCode]; - } - if (specialKey && (name = Base.camelize(specialKey)) in modifiers) { - modifiers[name] = down; - var browser = paper.browser; - if (name === 'command' && browser && browser.mac) { - if (down) { - commandFixMap = {}; - } else { - for (var code in commandFixMap) { - if (code in charCodeMap) - handleKey(false, code, commandFixMap[code], event); - } - commandFixMap = null; - } - } - } else if (down && commandFixMap) { - commandFixMap[keyCode] = charCode; - } - if (tool && tool.responds(type)) { - paper = scope; - tool.emit(type, new KeyEvent(down, key, character, event)); - if (view) - view.update(); - } - } - - DomEvent.add(document, { - keydown: function(event) { - var code = event.which || event.keyCode; - if (code in specialKeys || modifiers.command) { - handleKey(true, code, - code in specialChars || modifiers.command ? code : 0, - event); - } else { - downCode = code; - } - }, - - keypress: function(event) { - if (downCode != null) { - handleKey(true, downCode, event.which || event.keyCode, event); - downCode = null; - } - }, - - keyup: function(event) { - var code = event.which || event.keyCode; - if (code in charCodeMap) - handleKey(false, code, charCodeMap[code], event); - } - }); - - DomEvent.add(window, { - blur: function(event) { - for (var code in charCodeMap) - handleKey(false, code, charCodeMap[code], event); - } - }); - - return { - modifiers: modifiers, - - isDown: function(key) { - return !!keyMap[key]; - } - }; -}; - -var MouseEvent = Event.extend({ - _class: 'MouseEvent', - - initialize: function MouseEvent(type, event, point, target, delta) { - Event.call(this, event); - this.type = type; - this.point = point; - this.target = target; - this.delta = delta; - }, - - toString: function() { - return "{ type: '" + this.type - + "', point: " + this.point - + ', target: ' + this.target - + (this.delta ? ', delta: ' + this.delta : '') - + ', modifiers: ' + this.getModifiers() - + ' }'; - } -}); - -var ToolEvent = Event.extend({ - _class: 'ToolEvent', - _item: null, - - initialize: function ToolEvent(tool, type, event) { - this.tool = tool; - this.type = type; - this.event = event; - }, - - _choosePoint: function(point, toolPoint) { - return point ? point : toolPoint ? toolPoint.clone() : null; - }, - - getPoint: function() { - return this._choosePoint(this._point, this.tool._point); - }, - - setPoint: function(point) { - this._point = point; - }, - - getLastPoint: function() { - return this._choosePoint(this._lastPoint, this.tool._lastPoint); - }, - - setLastPoint: function(lastPoint) { - this._lastPoint = lastPoint; - }, - - getDownPoint: function() { - return this._choosePoint(this._downPoint, this.tool._downPoint); - }, - - setDownPoint: function(downPoint) { - this._downPoint = downPoint; - }, - - getMiddlePoint: function() { - if (!this._middlePoint && this.tool._lastPoint) { - return this.tool._point.add(this.tool._lastPoint).divide(2); - } - return this._middlePoint; - }, - - setMiddlePoint: function(middlePoint) { - this._middlePoint = middlePoint; - }, - - getDelta: function() { - return !this._delta && this.tool._lastPoint - ? this.tool._point.subtract(this.tool._lastPoint) - : this._delta; - }, - - setDelta: function(delta) { - this._delta = delta; - }, - - getCount: function() { - return /^mouse(down|up)$/.test(this.type) - ? this.tool._downCount - : this.tool._count; - }, - - setCount: function(count) { - this.tool[/^mouse(down|up)$/.test(this.type) ? 'downCount' : 'count'] - = count; - }, - - getItem: function() { - if (!this._item) { - var result = this.tool._scope.project.hitTest(this.getPoint()); - if (result) { - var item = result.item, - parent = item._parent; - while (/^(Group|CompoundPath)$/.test(parent._class)) { - item = parent; - parent = parent._parent; - } - this._item = item; - } - } - return this._item; - }, - - setItem: function(item) { - this._item = item; - }, - - toString: function() { - return '{ type: ' + this.type - + ', point: ' + this.getPoint() - + ', count: ' + this.getCount() - + ', modifiers: ' + this.getModifiers() - + ' }'; - } -}); - -var Tool = PaperScopeItem.extend({ - _class: 'Tool', - _list: 'tools', - _reference: 'tool', - _events: [ 'onActivate', 'onDeactivate', 'onEditOptions', - 'onMouseDown', 'onMouseUp', 'onMouseDrag', 'onMouseMove', - 'onKeyDown', 'onKeyUp' ], - - initialize: function Tool(props) { - PaperScopeItem.call(this); - this._firstMove = true; - this._count = 0; - this._downCount = 0; - this._set(props); - }, - - getMinDistance: function() { - return this._minDistance; - }, - - setMinDistance: function(minDistance) { - this._minDistance = minDistance; - if (minDistance != null && this._maxDistance != null - && minDistance > this._maxDistance) { - this._maxDistance = minDistance; - } - }, - - getMaxDistance: function() { - return this._maxDistance; - }, - - setMaxDistance: function(maxDistance) { - this._maxDistance = maxDistance; - if (this._minDistance != null && maxDistance != null - && maxDistance < this._minDistance) { - this._minDistance = maxDistance; - } - }, - - getFixedDistance: function() { - return this._minDistance == this._maxDistance - ? this._minDistance : null; - }, - - setFixedDistance: function(distance) { - this._minDistance = this._maxDistance = distance; - }, - - _updateEvent: function(type, point, minDistance, maxDistance, start, - needsChange, matchMaxDistance) { - if (!start) { - if (minDistance != null || maxDistance != null) { - var minDist = minDistance != null ? minDistance : 0, - vector = point.subtract(this._point), - distance = vector.getLength(); - if (distance < minDist) - return false; - if (maxDistance != null && maxDistance != 0) { - if (distance > maxDistance) { - point = this._point.add(vector.normalize(maxDistance)); - } else if (matchMaxDistance) { - return false; - } - } - } - if (needsChange && point.equals(this._point)) - return false; - } - this._lastPoint = start && type == 'mousemove' ? point : this._point; - this._point = point; - switch (type) { - case 'mousedown': - this._lastPoint = this._downPoint; - this._downPoint = this._point; - this._downCount++; - break; - case 'mouseup': - this._lastPoint = this._downPoint; - break; - } - this._count = start ? 0 : this._count + 1; - return true; - }, - - _fireEvent: function(type, event) { - var sets = paper.project._removeSets; - if (sets) { - if (type === 'mouseup') - sets.mousedrag = null; - var set = sets[type]; - if (set) { - for (var id in set) { - var item = set[id]; - for (var key in sets) { - var other = sets[key]; - if (other && other != set) - delete other[item._id]; - } - item.remove(); - } - sets[type] = null; - } - } - return this.responds(type) - && this.emit(type, new ToolEvent(this, type, event)); - }, - - _handleEvent: function(type, point, event) { - paper = this._scope; - var called = false; - switch (type) { - case 'mousedown': - this._updateEvent(type, point, null, null, true, false, false); - called = this._fireEvent(type, event); - break; - case 'mousedrag': - var needsChange = false, - matchMaxDistance = false; - while (this._updateEvent(type, point, this.minDistance, - this.maxDistance, false, needsChange, matchMaxDistance)) { - called = this._fireEvent(type, event) || called; - needsChange = true; - matchMaxDistance = true; - } - break; - case 'mouseup': - if (!point.equals(this._point) - && this._updateEvent('mousedrag', point, this.minDistance, - this.maxDistance, false, false, false)) { - called = this._fireEvent('mousedrag', event); - } - this._updateEvent(type, point, null, this.maxDistance, false, - false, false); - called = this._fireEvent(type, event) || called; - this._updateEvent(type, point, null, null, true, false, false); - this._firstMove = true; - break; - case 'mousemove': - while (this._updateEvent(type, point, this.minDistance, - this.maxDistance, this._firstMove, true, false)) { - called = this._fireEvent(type, event) || called; - this._firstMove = false; - } - break; - } - if (called) - event.preventDefault(); - return called; - } - -}); - -var Http = { - request: function(method, url, callback, async) { - async = (async === undefined) ? true : async; - var xhr = new (window.ActiveXObject || XMLHttpRequest)( - 'Microsoft.XMLHTTP'); - xhr.open(method.toUpperCase(), url, async); - if ('overrideMimeType' in xhr) - xhr.overrideMimeType('text/plain'); - xhr.onreadystatechange = function() { - if (xhr.readyState === 4) { - var status = xhr.status; - if (status === 0 || status === 200) { - callback.call(xhr, xhr.responseText); - } else { - throw new Error('Could not load ' + url + ' (Error ' - + status + ')'); - } - } - }; - return xhr.send(null); - } -}; - -var CanvasProvider = { - canvases: [], - - getCanvas: function(width, height) { - var canvas, - clear = true; - if (typeof width === 'object') { - height = width.height; - width = width.width; - } - if (this.canvases.length) { - canvas = this.canvases.pop(); - } else { - canvas = document.createElement('canvas'); - } - var ctx = canvas.getContext('2d'); - if (canvas.width === width && canvas.height === height) { - if (clear) - ctx.clearRect(0, 0, width + 1, height + 1); - } else { - canvas.width = width; - canvas.height = height; - } - ctx.save(); - return canvas; - }, - - getContext: function(width, height) { - return this.getCanvas(width, height).getContext('2d'); - }, - - release: function(obj) { - var canvas = obj.canvas ? obj.canvas : obj; - canvas.getContext('2d').restore(); - this.canvases.push(canvas); - } -}; - -var BlendMode = new function() { - var min = Math.min, - max = Math.max, - abs = Math.abs, - sr, sg, sb, sa, - br, bg, bb, ba, - dr, dg, db; - - function getLum(r, g, b) { - return 0.2989 * r + 0.587 * g + 0.114 * b; - } - - function setLum(r, g, b, l) { - var d = l - getLum(r, g, b); - dr = r + d; - dg = g + d; - db = b + d; - var l = getLum(dr, dg, db), - mn = min(dr, dg, db), - mx = max(dr, dg, db); - if (mn < 0) { - var lmn = l - mn; - dr = l + (dr - l) * l / lmn; - dg = l + (dg - l) * l / lmn; - db = l + (db - l) * l / lmn; - } - if (mx > 255) { - var ln = 255 - l, - mxl = mx - l; - dr = l + (dr - l) * ln / mxl; - dg = l + (dg - l) * ln / mxl; - db = l + (db - l) * ln / mxl; - } - } - - function getSat(r, g, b) { - return max(r, g, b) - min(r, g, b); - } - - function setSat(r, g, b, s) { - var col = [r, g, b], - mx = max(r, g, b), - mn = min(r, g, b), - md; - mn = mn === r ? 0 : mn === g ? 1 : 2; - mx = mx === r ? 0 : mx === g ? 1 : 2; - md = min(mn, mx) === 0 ? max(mn, mx) === 1 ? 2 : 1 : 0; - if (col[mx] > col[mn]) { - col[md] = (col[md] - col[mn]) * s / (col[mx] - col[mn]); - col[mx] = s; - } else { - col[md] = col[mx] = 0; - } - col[mn] = 0; - dr = col[0]; - dg = col[1]; - db = col[2]; - } - - var modes = { - multiply: function() { - dr = br * sr / 255; - dg = bg * sg / 255; - db = bb * sb / 255; - }, - - screen: function() { - dr = br + sr - (br * sr / 255); - dg = bg + sg - (bg * sg / 255); - db = bb + sb - (bb * sb / 255); - }, - - overlay: function() { - dr = br < 128 ? 2 * br * sr / 255 : 255 - 2 * (255 - br) * (255 - sr) / 255; - dg = bg < 128 ? 2 * bg * sg / 255 : 255 - 2 * (255 - bg) * (255 - sg) / 255; - db = bb < 128 ? 2 * bb * sb / 255 : 255 - 2 * (255 - bb) * (255 - sb) / 255; - }, - - 'soft-light': function() { - var t = sr * br / 255; - dr = t + br * (255 - (255 - br) * (255 - sr) / 255 - t) / 255; - t = sg * bg / 255; - dg = t + bg * (255 - (255 - bg) * (255 - sg) / 255 - t) / 255; - t = sb * bb / 255; - db = t + bb * (255 - (255 - bb) * (255 - sb) / 255 - t) / 255; - }, - - 'hard-light': function() { - dr = sr < 128 ? 2 * sr * br / 255 : 255 - 2 * (255 - sr) * (255 - br) / 255; - dg = sg < 128 ? 2 * sg * bg / 255 : 255 - 2 * (255 - sg) * (255 - bg) / 255; - db = sb < 128 ? 2 * sb * bb / 255 : 255 - 2 * (255 - sb) * (255 - bb) / 255; - }, - - 'color-dodge': function() { - dr = br === 0 ? 0 : sr === 255 ? 255 : min(255, 255 * br / (255 - sr)); - dg = bg === 0 ? 0 : sg === 255 ? 255 : min(255, 255 * bg / (255 - sg)); - db = bb === 0 ? 0 : sb === 255 ? 255 : min(255, 255 * bb / (255 - sb)); - }, - - 'color-burn': function() { - dr = br === 255 ? 255 : sr === 0 ? 0 : max(0, 255 - (255 - br) * 255 / sr); - dg = bg === 255 ? 255 : sg === 0 ? 0 : max(0, 255 - (255 - bg) * 255 / sg); - db = bb === 255 ? 255 : sb === 0 ? 0 : max(0, 255 - (255 - bb) * 255 / sb); - }, - - darken: function() { - dr = br < sr ? br : sr; - dg = bg < sg ? bg : sg; - db = bb < sb ? bb : sb; - }, - - lighten: function() { - dr = br > sr ? br : sr; - dg = bg > sg ? bg : sg; - db = bb > sb ? bb : sb; - }, - - difference: function() { - dr = br - sr; - if (dr < 0) - dr = -dr; - dg = bg - sg; - if (dg < 0) - dg = -dg; - db = bb - sb; - if (db < 0) - db = -db; - }, - - exclusion: function() { - dr = br + sr * (255 - br - br) / 255; - dg = bg + sg * (255 - bg - bg) / 255; - db = bb + sb * (255 - bb - bb) / 255; - }, - - hue: function() { - setSat(sr, sg, sb, getSat(br, bg, bb)); - setLum(dr, dg, db, getLum(br, bg, bb)); - }, - - saturation: function() { - setSat(br, bg, bb, getSat(sr, sg, sb)); - setLum(dr, dg, db, getLum(br, bg, bb)); - }, - - luminosity: function() { - setLum(br, bg, bb, getLum(sr, sg, sb)); - }, - - color: function() { - setLum(sr, sg, sb, getLum(br, bg, bb)); - }, - - add: function() { - dr = min(br + sr, 255); - dg = min(bg + sg, 255); - db = min(bb + sb, 255); - }, - - subtract: function() { - dr = max(br - sr, 0); - dg = max(bg - sg, 0); - db = max(bb - sb, 0); - }, - - average: function() { - dr = (br + sr) / 2; - dg = (bg + sg) / 2; - db = (bb + sb) / 2; - }, - - negation: function() { - dr = 255 - abs(255 - sr - br); - dg = 255 - abs(255 - sg - bg); - db = 255 - abs(255 - sb - bb); - } - }; - - var nativeModes = this.nativeModes = Base.each([ - 'source-over', 'source-in', 'source-out', 'source-atop', - 'destination-over', 'destination-in', 'destination-out', - 'destination-atop', 'lighter', 'darker', 'copy', 'xor' - ], function(mode) { - this[mode] = true; - }, {}); - - var ctx = CanvasProvider.getContext(1, 1); - Base.each(modes, function(func, mode) { - var darken = mode === 'darken', - ok = false; - ctx.save(); - try { - ctx.fillStyle = darken ? '#300' : '#a00'; - ctx.fillRect(0, 0, 1, 1); - ctx.globalCompositeOperation = mode; - if (ctx.globalCompositeOperation === mode) { - ctx.fillStyle = darken ? '#a00' : '#300'; - ctx.fillRect(0, 0, 1, 1); - ok = ctx.getImageData(0, 0, 1, 1).data[0] !== darken ? 170 : 51; - } - } catch (e) {} - ctx.restore(); - nativeModes[mode] = ok; - }); - CanvasProvider.release(ctx); - - this.process = function(mode, srcContext, dstContext, alpha, offset) { - var srcCanvas = srcContext.canvas, - normal = mode === 'normal'; - if (normal || nativeModes[mode]) { - dstContext.save(); - dstContext.setTransform(1, 0, 0, 1, 0, 0); - dstContext.globalAlpha = alpha; - if (!normal) - dstContext.globalCompositeOperation = mode; - dstContext.drawImage(srcCanvas, offset.x, offset.y); - dstContext.restore(); - } else { - var process = modes[mode]; - if (!process) - return; - var dstData = dstContext.getImageData(offset.x, offset.y, - srcCanvas.width, srcCanvas.height), - dst = dstData.data, - src = srcContext.getImageData(0, 0, - srcCanvas.width, srcCanvas.height).data; - for (var i = 0, l = dst.length; i < l; i += 4) { - sr = src[i]; - br = dst[i]; - sg = src[i + 1]; - bg = dst[i + 1]; - sb = src[i + 2]; - bb = dst[i + 2]; - sa = src[i + 3]; - ba = dst[i + 3]; - process(); - var a1 = sa * alpha / 255, - a2 = 1 - a1; - dst[i] = a1 * dr + a2 * br; - dst[i + 1] = a1 * dg + a2 * bg; - dst[i + 2] = a1 * db + a2 * bb; - dst[i + 3] = sa * alpha + a2 * ba; - } - dstContext.putImageData(dstData, offset.x, offset.y); - } - }; -}; - -var SVGStyles = Base.each({ - fillColor: ['fill', 'color'], - strokeColor: ['stroke', 'color'], - strokeWidth: ['stroke-width', 'number'], - strokeCap: ['stroke-linecap', 'string'], - strokeJoin: ['stroke-linejoin', 'string'], - strokeScaling: ['vector-effect', 'lookup', { - true: 'none', - false: 'non-scaling-stroke' - }, function(item, value) { - return !value - && (item instanceof PathItem - || item instanceof Shape - || item instanceof TextItem); - }], - miterLimit: ['stroke-miterlimit', 'number'], - dashArray: ['stroke-dasharray', 'array'], - dashOffset: ['stroke-dashoffset', 'number'], - fontFamily: ['font-family', 'string'], - fontWeight: ['font-weight', 'string'], - fontSize: ['font-size', 'number'], - justification: ['text-anchor', 'lookup', { - left: 'start', - center: 'middle', - right: 'end' - }], - opacity: ['opacity', 'number'], - blendMode: ['mix-blend-mode', 'string'] -}, function(entry, key) { - var part = Base.capitalize(key), - lookup = entry[2]; - this[key] = { - type: entry[1], - property: key, - attribute: entry[0], - toSVG: lookup, - fromSVG: lookup && Base.each(lookup, function(value, name) { - this[value] = name; - }, {}), - exportFilter: entry[3], - get: 'get' + part, - set: 'set' + part - }; -}, {}); - -var SVGNamespaces = { - href: 'http://www.w3.org/1999/xlink', - xlink: 'http://www.w3.org/2000/xmlns' -}; - -new function() { - var formatter; - - function setAttributes(node, attrs) { - for (var key in attrs) { - var val = attrs[key], - namespace = SVGNamespaces[key]; - if (typeof val === 'number') - val = formatter.number(val); - if (namespace) { - node.setAttributeNS(namespace, key, val); - } else { - node.setAttribute(key, val); - } - } - return node; - } - - function createElement(tag, attrs) { - return setAttributes( - document.createElementNS('http://www.w3.org/2000/svg', tag), attrs); - } - - function getTransform(matrix, coordinates, center) { - var attrs = new Base(), - trans = matrix.getTranslation(); - if (coordinates) { - matrix = matrix.shiftless(); - var point = matrix._inverseTransform(trans); - attrs[center ? 'cx' : 'x'] = point.x; - attrs[center ? 'cy' : 'y'] = point.y; - trans = null; - } - if (!matrix.isIdentity()) { - var decomposed = matrix.decompose(); - if (decomposed && !decomposed.shearing) { - var parts = [], - angle = decomposed.rotation, - scale = decomposed.scaling; - if (trans && !trans.isZero()) - parts.push('translate(' + formatter.point(trans) + ')'); - if (!Numerical.isZero(scale.x - 1) - || !Numerical.isZero(scale.y - 1)) - parts.push('scale(' + formatter.point(scale) +')'); - if (angle) - parts.push('rotate(' + formatter.number(angle) + ')'); - attrs.transform = parts.join(' '); - } else { - attrs.transform = 'matrix(' + matrix.getValues().join(',') + ')'; - } - } - return attrs; - } - - function exportGroup(item, options) { - var attrs = getTransform(item._matrix), - children = item._children; - var node = createElement('g', attrs); - for (var i = 0, l = children.length; i < l; i++) { - var child = children[i]; - var childNode = exportSVG(child, options); - if (childNode) { - if (child.isClipMask()) { - var clip = createElement('clipPath'); - clip.appendChild(childNode); - setDefinition(child, clip, 'clip'); - setAttributes(node, { - 'clip-path': 'url(#' + clip.id + ')' - }); - } else { - node.appendChild(childNode); - } - } - } - return node; - } - - function exportRaster(item, options) { - var attrs = getTransform(item._matrix, true), - size = item.getSize(), - image = item.getImage(); - attrs.x -= size.width / 2; - attrs.y -= size.height / 2; - attrs.width = size.width; - attrs.height = size.height; - attrs.href = options.embedImages === false && image && image.src - || item.toDataURL(); - return createElement('image', attrs); - } - - function exportPath(item, options) { - var matchShapes = options.matchShapes; - if (matchShapes) { - var shape = item.toShape(false); - if (shape) - return exportShape(shape, options); - } - var segments = item._segments, - type, - attrs = getTransform(item._matrix); - if (segments.length === 0) - return null; - if (matchShapes && !item.hasHandles()) { - if (segments.length >= 3) { - type = item._closed ? 'polygon' : 'polyline'; - var parts = []; - for(var i = 0, l = segments.length; i < l; i++) - parts.push(formatter.point(segments[i]._point)); - attrs.points = parts.join(' '); - } else { - type = 'line'; - var first = segments[0]._point, - last = segments[segments.length - 1]._point; - attrs.set({ - x1: first.x, - y1: first.y, - x2: last.x, - y2: last.y - }); - } - } else { - type = 'path'; - attrs.d = item.getPathData(null, options.precision); - } - return createElement(type, attrs); - } - - function exportShape(item) { - var type = item._type, - radius = item._radius, - attrs = getTransform(item._matrix, true, type !== 'rectangle'); - if (type === 'rectangle') { - type = 'rect'; - var size = item._size, - width = size.width, - height = size.height; - attrs.x -= width / 2; - attrs.y -= height / 2; - attrs.width = width; - attrs.height = height; - if (radius.isZero()) - radius = null; - } - if (radius) { - if (type === 'circle') { - attrs.r = radius; - } else { - attrs.rx = radius.width; - attrs.ry = radius.height; - } - } - return createElement(type, attrs); - } - - function exportCompoundPath(item, options) { - var attrs = getTransform(item._matrix); - var data = item.getPathData(null, options.precision); - if (data) - attrs.d = data; - return createElement('path', attrs); - } - - function exportPlacedSymbol(item, options) { - var attrs = getTransform(item._matrix, true), - symbol = item.getSymbol(), - symbolNode = getDefinition(symbol, 'symbol'), - definition = symbol.getDefinition(), - bounds = definition.getBounds(); - if (!symbolNode) { - symbolNode = createElement('symbol', { - viewBox: formatter.rectangle(bounds) - }); - symbolNode.appendChild(exportSVG(definition, options)); - setDefinition(symbol, symbolNode, 'symbol'); - } - attrs.href = '#' + symbolNode.id; - attrs.x += bounds.x; - attrs.y += bounds.y; - attrs.width = formatter.number(bounds.width); - attrs.height = formatter.number(bounds.height); - attrs.overflow = 'visible'; - return createElement('use', attrs); - } - - function exportGradient(color) { - var gradientNode = getDefinition(color, 'color'); - if (!gradientNode) { - var gradient = color.getGradient(), - radial = gradient._radial, - origin = color.getOrigin().transform(), - destination = color.getDestination().transform(), - attrs; - if (radial) { - attrs = { - cx: origin.x, - cy: origin.y, - r: origin.getDistance(destination) - }; - var highlight = color.getHighlight(); - if (highlight) { - highlight = highlight.transform(); - attrs.fx = highlight.x; - attrs.fy = highlight.y; - } - } else { - attrs = { - x1: origin.x, - y1: origin.y, - x2: destination.x, - y2: destination.y - }; - } - attrs.gradientUnits = 'userSpaceOnUse'; - gradientNode = createElement( - (radial ? 'radial' : 'linear') + 'Gradient', attrs); - var stops = gradient._stops; - for (var i = 0, l = stops.length; i < l; i++) { - var stop = stops[i], - stopColor = stop._color, - alpha = stopColor.getAlpha(); - attrs = { - offset: stop._rampPoint, - 'stop-color': stopColor.toCSS(true) - }; - if (alpha < 1) - attrs['stop-opacity'] = alpha; - gradientNode.appendChild(createElement('stop', attrs)); - } - setDefinition(color, gradientNode, 'color'); - } - return 'url(#' + gradientNode.id + ')'; - } - - function exportText(item) { - var node = createElement('text', getTransform(item._matrix, true)); - node.textContent = item._content; - return node; - } - - var exporters = { - Group: exportGroup, - Layer: exportGroup, - Raster: exportRaster, - Path: exportPath, - Shape: exportShape, - CompoundPath: exportCompoundPath, - PlacedSymbol: exportPlacedSymbol, - PointText: exportText - }; - - function applyStyle(item, node, isRoot) { - var attrs = {}, - parent = !isRoot && item.getParent(); - - if (item._name != null) - attrs.id = item._name; - - Base.each(SVGStyles, function(entry) { - var get = entry.get, - type = entry.type, - value = item[get](); - if (entry.exportFilter - ? entry.exportFilter(item, value) - : !parent || !Base.equals(parent[get](), value)) { - if (type === 'color' && value != null) { - var alpha = value.getAlpha(); - if (alpha < 1) - attrs[entry.attribute + '-opacity'] = alpha; - } - attrs[entry.attribute] = value == null - ? 'none' - : type === 'number' - ? formatter.number(value) - : type === 'color' - ? value.gradient - ? exportGradient(value, item) - : value.toCSS(true) - : type === 'array' - ? value.join(',') - : type === 'lookup' - ? entry.toSVG[value] - : value; - } - }); - - if (attrs.opacity === 1) - delete attrs.opacity; - - if (!item._visible) - attrs.visibility = 'hidden'; - - return setAttributes(node, attrs); - } - - var definitions; - function getDefinition(item, type) { - if (!definitions) - definitions = { ids: {}, svgs: {} }; - return item && definitions.svgs[type + '-' + item._id]; - } - - function setDefinition(item, node, type) { - if (!definitions) - getDefinition(); - var id = definitions.ids[type] = (definitions.ids[type] || 0) + 1; - node.id = type + '-' + id; - definitions.svgs[type + '-' + item._id] = node; - } - - function exportDefinitions(node, options) { - var svg = node, - defs = null; - if (definitions) { - svg = node.nodeName.toLowerCase() === 'svg' && node; - for (var i in definitions.svgs) { - if (!defs) { - if (!svg) { - svg = createElement('svg'); - svg.appendChild(node); - } - defs = svg.insertBefore(createElement('defs'), - svg.firstChild); - } - defs.appendChild(definitions.svgs[i]); - } - definitions = null; - } - return options.asString - ? new XMLSerializer().serializeToString(svg) - : svg; - } - - function exportSVG(item, options, isRoot) { - var exporter = exporters[item._class], - node = exporter && exporter(item, options); - if (node) { - var onExport = options.onExport; - if (onExport) - node = onExport(item, node, options) || node; - var data = JSON.stringify(item._data); - if (data && data !== '{}' && data !== 'null') - node.setAttribute('data-paper-data', data); - } - return node && applyStyle(item, node, isRoot); - } - - function setOptions(options) { - if (!options) - options = {}; - formatter = new Formatter(options.precision); - return options; - } - - Item.inject({ - exportSVG: function(options) { - options = setOptions(options); - return exportDefinitions(exportSVG(this, options, true), options); - } - }); - - Project.inject({ - exportSVG: function(options) { - options = setOptions(options); - var layers = this.layers, - view = this.getView(), - size = view.getViewSize(), - node = createElement('svg', { - x: 0, - y: 0, - width: size.width, - height: size.height, - version: '1.1', - xmlns: 'http://www.w3.org/2000/svg', - 'xmlns:xlink': 'http://www.w3.org/1999/xlink' - }), - parent = node, - matrix = view._matrix; - if (!matrix.isIdentity()) - parent = node.appendChild( - createElement('g', getTransform(matrix))); - for (var i = 0, l = layers.length; i < l; i++) - parent.appendChild(exportSVG(layers[i], options, true)); - return exportDefinitions(node, options); - } - }); -}; - -new function() { - - function getValue(node, name, isString, allowNull) { - var namespace = SVGNamespaces[name], - value = namespace - ? node.getAttributeNS(namespace, name) - : node.getAttribute(name); - if (value === 'null') - value = null; - return value == null - ? allowNull - ? null - : isString - ? '' - : 0 - : isString - ? value - : parseFloat(value); - } - - function getPoint(node, x, y, allowNull) { - x = getValue(node, x, false, allowNull); - y = getValue(node, y, false, allowNull); - return allowNull && (x == null || y == null) ? null - : new Point(x, y); - } - - function getSize(node, w, h, allowNull) { - w = getValue(node, w, false, allowNull); - h = getValue(node, h, false, allowNull); - return allowNull && (w == null || h == null) ? null - : new Size(w, h); - } - - function convertValue(value, type, lookup) { - return value === 'none' - ? null - : type === 'number' - ? parseFloat(value) - : type === 'array' - ? value ? value.split(/[\s,]+/g).map(parseFloat) : [] - : type === 'color' - ? getDefinition(value) || value - : type === 'lookup' - ? lookup[value] - : value; - } - - function importGroup(node, type, options, isRoot) { - var nodes = node.childNodes, - isClip = type === 'clippath', - item = new Group(), - project = item._project, - currentStyle = project._currentStyle, - children = []; - if (!isClip) { - item = applyAttributes(item, node, isRoot); - project._currentStyle = item._style.clone(); - } - if (isRoot) { - var defs = node.querySelectorAll('defs'); - for (var i = 0, l = defs.length; i < l; i++) { - importSVG(defs[i], options, false); - } - } - for (var i = 0, l = nodes.length; i < l; i++) { - var childNode = nodes[i], - child; - if (childNode.nodeType === 1 - && childNode.nodeName.toLowerCase() !== 'defs' - && (child = importSVG(childNode, options, false)) - && !(child instanceof Symbol)) - children.push(child); - } - item.addChildren(children); - if (isClip) - item = applyAttributes(item.reduce(), node, isRoot); - project._currentStyle = currentStyle; - if (isClip || type === 'defs') { - item.remove(); - item = null; - } - return item; - } - - function importPoly(node, type) { - var coords = node.getAttribute('points').match( - /[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g), - points = []; - for (var i = 0, l = coords.length; i < l; i += 2) - points.push(new Point( - parseFloat(coords[i]), - parseFloat(coords[i + 1]))); - var path = new Path(points); - if (type === 'polygon') - path.closePath(); - return path; - } - - function importPath(node) { - var data = node.getAttribute('d'), - param = { pathData: data }; - return (data.match(/m/gi) || []).length > 1 || /z\S+/i.test(data) - ? new CompoundPath(param) - : new Path(param); - } - - function importGradient(node, type) { - var id = (getValue(node, 'href', true) || '').substring(1), - isRadial = type === 'radialgradient', - gradient; - if (id) { - gradient = definitions[id].getGradient(); - } else { - var nodes = node.childNodes, - stops = []; - for (var i = 0, l = nodes.length; i < l; i++) { - var child = nodes[i]; - if (child.nodeType === 1) - stops.push(applyAttributes(new GradientStop(), child)); - } - gradient = new Gradient(stops, isRadial); - } - var origin, destination, highlight; - if (isRadial) { - origin = getPoint(node, 'cx', 'cy'); - destination = origin.add(getValue(node, 'r'), 0); - highlight = getPoint(node, 'fx', 'fy', true); - } else { - origin = getPoint(node, 'x1', 'y1'); - destination = getPoint(node, 'x2', 'y2'); - } - applyAttributes( - new Color(gradient, origin, destination, highlight), node); - return null; - } - - var importers = { - '#document': function (node, type, options, isRoot) { - var nodes = node.childNodes; - for (var i = 0, l = nodes.length; i < l; i++) { - var child = nodes[i]; - if (child.nodeType === 1) { - var next = child.nextSibling; - document.body.appendChild(child); - var item = importSVG(child, options, isRoot); - if (next) { - node.insertBefore(child, next); - } else { - node.appendChild(child); - } - return item; - } - } - }, - g: importGroup, - svg: importGroup, - clippath: importGroup, - polygon: importPoly, - polyline: importPoly, - path: importPath, - lineargradient: importGradient, - radialgradient: importGradient, - - image: function (node) { - var raster = new Raster(getValue(node, 'href', true)); - raster.on('load', function() { - var size = getSize(node, 'width', 'height'); - this.setSize(size); - var center = this._matrix._transformPoint( - getPoint(node, 'x', 'y').add(size.divide(2))); - this.translate(center); - }); - return raster; - }, - - symbol: function(node, type, options, isRoot) { - return new Symbol(importGroup(node, type, options, isRoot), true); - }, - - defs: importGroup, - - use: function(node) { - var id = (getValue(node, 'href', true) || '').substring(1), - definition = definitions[id], - point = getPoint(node, 'x', 'y'); - return definition - ? definition instanceof Symbol - ? definition.place(point) - : definition.clone().translate(point) - : null; - }, - - circle: function(node) { - return new Shape.Circle(getPoint(node, 'cx', 'cy'), - getValue(node, 'r')); - }, - - ellipse: function(node) { - return new Shape.Ellipse({ - center: getPoint(node, 'cx', 'cy'), - radius: getSize(node, 'rx', 'ry') - }); - }, - - rect: function(node) { - var point = getPoint(node, 'x', 'y'), - size = getSize(node, 'width', 'height'), - radius = getSize(node, 'rx', 'ry'); - return new Shape.Rectangle(new Rectangle(point, size), radius); - }, - - line: function(node) { - return new Path.Line(getPoint(node, 'x1', 'y1'), - getPoint(node, 'x2', 'y2')); - }, - - text: function(node) { - var text = new PointText(getPoint(node, 'x', 'y') - .add(getPoint(node, 'dx', 'dy'))); - text.setContent(node.textContent.trim() || ''); - return text; - } - }; - - function applyTransform(item, value, name, node) { - var transforms = (node.getAttribute(name) || '').split(/\)\s*/g), - matrix = new Matrix(); - for (var i = 0, l = transforms.length; i < l; i++) { - var transform = transforms[i]; - if (!transform) - break; - var parts = transform.split(/\(\s*/), - command = parts[0], - v = parts[1].split(/[\s,]+/g); - for (var j = 0, m = v.length; j < m; j++) - v[j] = parseFloat(v[j]); - switch (command) { - case 'matrix': - matrix.concatenate( - new Matrix(v[0], v[1], v[2], v[3], v[4], v[5])); - break; - case 'rotate': - matrix.rotate(v[0], v[1], v[2]); - break; - case 'translate': - matrix.translate(v[0], v[1]); - break; - case 'scale': - matrix.scale(v); - break; - case 'skewX': - matrix.skew(v[0], 0); - break; - case 'skewY': - matrix.skew(0, v[0]); - break; - } - } - item.transform(matrix); - } - - function applyOpacity(item, value, name) { - var color = item[name === 'fill-opacity' ? 'getFillColor' - : 'getStrokeColor'](); - if (color) - color.setAlpha(parseFloat(value)); - } - - var attributes = Base.set(Base.each(SVGStyles, function(entry) { - this[entry.attribute] = function(item, value) { - item[entry.set](convertValue(value, entry.type, entry.fromSVG)); - if (entry.type === 'color' && item instanceof Shape) { - var color = item[entry.get](); - if (color) - color.transform(new Matrix().translate( - item.getPosition(true).negate())); - } - }; - }, {}), { - id: function(item, value) { - definitions[value] = item; - if (item.setName) - item.setName(value); - }, - - 'clip-path': function(item, value) { - var clip = getDefinition(value); - if (clip) { - clip = clip.clone(); - clip.setClipMask(true); - if (item instanceof Group) { - item.insertChild(0, clip); - } else { - return new Group(clip, item); - } - } - }, - - gradientTransform: applyTransform, - transform: applyTransform, - - 'fill-opacity': applyOpacity, - 'stroke-opacity': applyOpacity, - - visibility: function(item, value) { - item.setVisible(value === 'visible'); - }, - - display: function(item, value) { - item.setVisible(value !== null); - }, - - 'stop-color': function(item, value) { - if (item.setColor) - item.setColor(value); - }, - - 'stop-opacity': function(item, value) { - if (item._color) - item._color.setAlpha(parseFloat(value)); - }, - - offset: function(item, value) { - var percentage = value.match(/(.*)%$/); - item.setRampPoint(percentage - ? percentage[1] / 100 - : parseFloat(value)); - }, - - viewBox: function(item, value, name, node, styles) { - var rect = new Rectangle(convertValue(value, 'array')), - size = getSize(node, 'width', 'height', true); - if (item instanceof Group) { - var scale = size ? rect.getSize().divide(size) : 1, - matrix = new Matrix().translate(rect.getPoint()).scale(scale); - item.transform(matrix.inverted()); - } else if (item instanceof Symbol) { - if (size) - rect.setSize(size); - var clip = getAttribute(node, 'overflow', styles) != 'visible', - group = item._definition; - if (clip && !rect.contains(group.getBounds())) { - clip = new Shape.Rectangle(rect).transform(group._matrix); - clip.setClipMask(true); - group.addChild(clip); - } - } - } - }); - - function getAttribute(node, name, styles) { - var attr = node.attributes[name], - value = attr && attr.value; - if (!value) { - var style = Base.camelize(name); - value = node.style[style]; - if (!value && styles.node[style] !== styles.parent[style]) - value = styles.node[style]; - } - return !value - ? undefined - : value === 'none' - ? null - : value; - } - - function applyAttributes(item, node, isRoot) { - var styles = { - node: DomElement.getStyles(node) || {}, - parent: !isRoot && DomElement.getStyles(node.parentNode) || {} - }; - Base.each(attributes, function(apply, name) { - var value = getAttribute(node, name, styles); - if (value !== undefined) - item = Base.pick(apply(item, value, name, node, styles), item); - }); - return item; - } - - var definitions = {}; - function getDefinition(value) { - var match = value && value.match(/\((?:#|)([^)']+)/); - return match && definitions[match[1]]; - } - - function importSVG(source, options, isRoot) { - if (!source) - return null; - if (!options) { - options = {}; - } else if (typeof options === 'function') { - options = { onLoad: options }; - } - - var node = source, - scope = paper; - - function onLoadCallback(svg) { - paper = scope; - var item = importSVG(svg, options, isRoot), - onLoad = options.onLoad, - view = scope.project && scope.getView(); - if (onLoad) - onLoad.call(this, item); - view.update(); - } - - if (isRoot) { - if (typeof source === 'string' && !/^.* Date: Tue, 26 Jan 2016 20:33:19 +0100 Subject: [PATCH 08/11] Always access "global" constructors on window object now. --- examples/Node.js/Raster.js | 2 +- src/svg/SVGExport.js | 2 +- src/svg/SVGImport.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/Node.js/Raster.js b/examples/Node.js/Raster.js index 91242d10..381a7605 100644 --- a/examples/Node.js/Raster.js +++ b/examples/Node.js/Raster.js @@ -20,7 +20,7 @@ raster.onLoad = function() { var path = require('path'); var fs = require('fs'); - var svg = new XMLSerializer().serializeToString(project.exportSVG()); + var svg = new paper.XMLSerializer().serializeToString(project.exportSVG()); fs.writeFile(path.resolve(__dirname, 'out.svg'),svg, function (err) { if (err) throw err; console.log('Saved!'); diff --git a/src/svg/SVGExport.js b/src/svg/SVGExport.js index a18bb8c1..674430d2 100644 --- a/src/svg/SVGExport.js +++ b/src/svg/SVGExport.js @@ -380,7 +380,7 @@ new function() { definitions = null; } return options.asString - ? new XMLSerializer().serializeToString(svg) + ? new window.XMLSerializer().serializeToString(svg) : svg; } diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 9ac7ea38..63fc5b88 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -587,7 +587,8 @@ new function() { } if (typeof source === 'string') - node = new DOMParser().parseFromString(source, 'image/svg+xml'); + node = new window.DOMParser().parseFromString(source, + 'image/svg+xml'); if (!node.nodeName) throw new Error('Unsupported SVG source: ' + source); // jsdom in Node.js uses uppercase values for nodeName... From 3a8a7eff94debdc5b0dee0033d7a65cd7c1a6814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 20:33:33 +0100 Subject: [PATCH 09/11] Update node-canvas version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2dd6d60d..1a9c3730 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "source-map-support": "^0.4.0" }, "optionalDependencies": { - "canvas": "^1.2.9" + "canvas": "^1.3.5" }, "devDependencies": { "acorn": "~0.5.0", From 4dd00990945a358548aaf9fd6fcc0f4acdcb16ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 20:33:42 +0100 Subject: [PATCH 10/11] Fix some linting errors. --- test/js/helpers.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/js/helpers.js b/test/js/helpers.js index c1354d05..488a3402 100644 --- a/test/js/helpers.js +++ b/test/js/helpers.js @@ -35,7 +35,7 @@ var errorHandler = console.error; console.error = function() { QUnit.pushFailure([].join.call(arguments, ' '), QUnit.config.current.stack); errorHandler.apply(this, arguments); -} +}; // Register a jsDump parser for Base. QUnit.jsDump.setParser('Base', function (obj, stack) { @@ -75,14 +75,14 @@ function compareItem(actual, expected, message, options, properties) { function getImageTag(raster) { return '' + + '" src="' + raster.source + '">'; } if (options && options.rasterize) { // In order to properly compare pixel by pixel, we need to put each item // into a group with a white background of the united dimensions of the // bounds of both items before rasterizing. - var resolution = options.rasterize == true ? 72 : options.rasterize, + var resolution = options.rasterize === true ? 72 : options.rasterize, actualBounds = actual.strokeBounds, expecedBounds = expected.strokeBounds, bounds = actualBounds.isEmpty() @@ -120,7 +120,7 @@ function compareItem(actual, expected, message, options, properties) { .onComplete(function(data) { result = data; }); var identical = result ? 100 - result.misMatchPercentage : 0, ok = identical == 100, - text = identical.toFixed(2) + '% identical' + text = identical.toFixed(2) + '% identical'; QUnit.push(ok, text, '100.00% identical', message); if (!ok && result) { // Get the right entry for this unit test and assertion, and @@ -407,7 +407,7 @@ function createSVG(str, attrs) { node.setAttribute(key, attrs[key]); return node; } else { - return new DOMParser().parseFromString( + return new window.DOMParser().parseFromString( '' + str + '', 'text/xml'); } From 5e69de3bd17769defaca76db9f14c2b0210a7288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 21:06:36 +0100 Subject: [PATCH 11/11] Restructure event handling on Raster item. - Trigger #onLoad() events from Raster#setImage() also - Add support for Raster#onError() handler Closes #849 and #924 --- examples/Rasters/Raster.html | 5 +- src/event/Event.js | 1 + src/item/Item.js | 3 +- src/item/Raster.js | 90 +++++++++++++++++++++--------------- 4 files changed, 59 insertions(+), 40 deletions(-) diff --git a/examples/Rasters/Raster.html b/examples/Rasters/Raster.html index 323275b5..e147e315 100644 --- a/examples/Rasters/Raster.html +++ b/examples/Rasters/Raster.html @@ -19,7 +19,10 @@ var scale = (Math.sin(event.time * 2) + 1) / 2; raster.scale(scale / lastScale); lastScale = scale; - raster.position = center + [Math.sin(event.time * 3) * 256, Math.sin(event.time * 2.5) * 256]; + raster.position = center + [ + Math.sin(event.time * 3) * 256, + Math.sin(event.time * 2.5) * 256 + ]; raster.rotate(event.delta * 120); } diff --git a/src/event/Event.js b/src/event/Event.js index d450221e..5fb04b10 100644 --- a/src/event/Event.js +++ b/src/event/Event.js @@ -22,6 +22,7 @@ var Event = Base.extend(/** @lends Event# */{ initialize: function Event(event) { this.event = event; + this.type = event.type; }, prevented: false, diff --git a/src/item/Item.js b/src/item/Item.js index 2cd4b28f..6cd0ee7b 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -145,7 +145,8 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ }, // Only for external sources, e.g. Raster - onLoad: {} + onLoad: {}, + onError: {} } ), diff --git a/src/item/Raster.js b/src/item/Raster.js index 71beaf8c..2456fb38 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -221,6 +221,33 @@ var Raster = Item.extend(/** @lends Raster# */{ }, setImage: function(image) { + var that = this, + loaded = false; + + function emit(event) { + var view = that.getView(), + type = event && event.type || 'load'; + if (view && that.responds(type)) { + paper = view._scope; + that.emit(type, new Event(event)); + // TODO: Request a redraw in the next animation frame from + // update() instead! + view.update(); + } + } + + function update() { + // Both canvas and image have width / height attributes. Due to IE, + // naturalWidth / Height needs to be checked for a swell, because it + // apparently can have width / height set to 0 when the image is + // invisible in the document. + that._size = new Size( + image ? image.naturalWidth || image.width : 0, + image ? image.naturalHeight || image.height : 0); + that._context = null; + that._changed(/*#=*/(Change.GEOMETRY | Change.PIXELS)); + } + if (this._canvas) CanvasProvider.release(this._canvas); // Due to similarities, we can handle both canvas and image types here. @@ -228,22 +255,30 @@ var Raster = Item.extend(/** @lends Raster# */{ // A canvas object this._image = null; this._canvas = image; - this._loaded = true; + loaded = true; } else { // A image object this._image = image; this._canvas = null; - this._loaded = image && image.complete; + loaded = image && image.complete; + } + this._loaded = loaded; + if (loaded) { + // Emit load event with a delay, so behavior is the same as when + // it's actually loaded and we give the code time to install event. + update(); + setTimeout(emit, 0); + } else if (image) { + // Trigger the load event on the image once it's loaded + DomEvent.add(image, { + load: function(event) { + that._loaded = true; + update(); + emit(event); + }, + error: emit + }); } - // Both canvas and image have width / height attributes. Due to IE, - // naturalWidth / Height needs to be checked for a swell, because it - // apparently can have width / height set to 0 when the image is - // invisible in the document. - this._size = new Size( - image ? image.naturalWidth || image.width : 0, - image ? image.naturalHeight || image.height : 0); - this._context = null; - this._changed(/*#=*/(Change.GEOMETRY | Change.PIXELS)); }, /** @@ -328,35 +363,14 @@ var Raster = Item.extend(/** @lends Raster# */{ }, setSource: function(src) { - var that = this, - crossOrigin = this._crossOrigin, - image; - - function loaded() { - var view = that.getView(); - if (view) { - paper = view._scope; - that.setImage(image); - that.emit('load'); - view.update(); - } - } - - // src can be an URL or a DOM ID to load the image from - image = document.getElementById(src) || new window.Image(); + var crossOrigin = this._crossOrigin, + // src can be an URL or a DOM ID to load the image from: + image = document.getElementById(src) || new window.Image(); if (crossOrigin) image.crossOrigin = crossOrigin; - if (image.complete) { - // Emit load event with a delay, so behavior is the same as when - // it's actually loaded and we give the code time to install event. - setTimeout(loaded, 0); - } else { - // Trigger the load event on the image once it's loaded - DomEvent.add(image, { load: loaded }); - // A new image created above? Set the source now. - if (!image.src) - image.src = src; - } + // A new image created above? Set the source now. + if (!image.src) + image.src = src; this.setImage(image); },