89a688acabab34c0643c392aadc48823c609856a
[clamp.git] / src / main / resources / META-INF / resources / designer / index.js
1 function activateMenu() {
2   isImportSchema = true;
3 }
4 var abootDiagram = null;
5
6 function cldsOpenDiagram(modelXml) {
7   cldsModelXml = modelXml;
8   console.log("cldsOpenDiagram: cldsModelXml=" + cldsModelXml);
9   $("#cldsopendiagrambtn").click();
10 }
11
12 function cldsGetDiagram() {
13   console.log("cldsGetDiagram: starting...");
14   $("#cldsgetdiagrambtn").click();
15   console.log("cldsGetDiagram: modelXML=" + modelXML);
16   return modelXML;
17 }
18
19 function uploaddata(file) {
20   uploadfile = file;
21   $("#uploadmodel").click();
22
23 }
24
25 function visibility_model() {
26   $("#openmodel").click();
27
28 }
29 (function e(t, n, r) {
30   function s(o, u) {
31     if (!n[o]) {
32       if (!t[o]) {
33         var a = typeof require == "function" && require;
34         if (!u && a) return a(o, !0);
35         if (i) return i(o, !0);
36         var f = new Error("Cannot find module '" + o + "'");
37         throw f.code = "MODULE_NOT_FOUND", f
38       }
39       var l = n[o] = {
40         exports: {}
41       };
42       t[o][0].call(l.exports, function(e) {
43         var n = t[o][1][e];
44         return s(n ? n : e)
45       }, l, l.exports, e, t, n, r)
46     }
47     return n[o].exports
48   }
49   var i = typeof require == "function" && require;
50   for (var o = 0; o < r.length; o++) s(r[o]);
51   return s;
52 })
53
54 ({
55   "\\bpmn-js-examples-master\\modeler\\app\\index.js":
56
57     [function(require, module, exports) {
58
59       'use strict';
60
61
62
63       var $ = require('jquery'),
64         BpmnModeler = require('bpmn-js/lib/Modeler');
65
66       var container = $('#js-drop-zone');
67
68       var canvas = $('#js-canvas');
69
70       var renderer = new BpmnModeler({
71         container: canvas
72       });
73       abootDiagram = renderer;
74
75       var newDiagramXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bpmn2:definitions xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:bpmn2=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd\" id=\"sample-diagram\" targetNamespace=\"http://bpmn.io/schema/bpmn\">\n  <bpmn2:process id=\"Process_1\" isExecutable=\"false\">\n    <bpmn2:startEvent id=\"StartEvent_1\"/>\n  </bpmn2:process>\n  <bpmndi:BPMNDiagram id=\"BPMNDiagram_1\">\n    <bpmndi:BPMNPlane id=\"BPMNPlane_1\" bpmnElement=\"Process_1\">\n      <bpmndi:BPMNShape id=\"_BPMNShape_StartEvent_2\" bpmnElement=\"StartEvent_1\">\n        <dc:Bounds height=\"36.0\" width=\"36.0\" x=\"25.0\" y=\"240.0\"/>\n      </bpmndi:BPMNShape>\n    </bpmndi:BPMNPlane>\n  </bpmndi:BPMNDiagram>\n</bpmn2:definitions>";
76       //
77       /*file_generate_test_case.addEventListener('click', function(e) {
78
79
80       });*/
81
82
83
84       function createNewDiagram(newDiagramXML) {
85         openDiagram(newDiagramXML);
86
87       }
88
89       function openDiagram(xml) {
90         renderer.importXML(xml, function(err) {
91
92           if (err) {
93             container
94               .removeClass('with-diagram')
95               .addClass('with-error');
96
97             container.find('.error pre').text(err.message);
98
99             console.error(err);
100           } else {
101             container
102               .removeClass('with-error')
103               .addClass('with-diagram');
104           }
105
106
107         });
108       }
109
110       function saveSVG(done) {
111         renderer.saveSVG(done);
112       }
113
114       function saveDiagram(done) {
115
116         renderer.saveXML({
117           format: true
118         }, function(err, xml) {
119           done(err, xml);
120         });
121       }
122
123
124       function registerFileDrop(container, callback) {
125
126         function handleFileSelect(e) {
127           e.stopPropagation();
128           e.preventDefault();
129
130           var files = e.dataTransfer.files;
131
132           var file = files[0];
133
134           var reader = new FileReader();
135
136           reader.onload = function(e) {
137
138             var xml = e.target.result;
139
140             callback(xml);
141           };
142
143           reader.readAsText(file);
144         }
145
146         function handleDragOver(e) {
147           e.stopPropagation();
148           e.preventDefault();
149
150           e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
151         }
152         if (container.get(0)) {
153           container.get(0).addEventListener('dragover', handleDragOver, false);
154           container.get(0).addEventListener('drop', handleFileSelect, false);
155         }
156       }
157
158
159       // //// file drag / drop ///////////////////////
160
161       // check file api availability
162       if (!window.FileList || !window.FileReader) {
163         window.alert(
164           'Looks like you use an older browser that does not support drag and drop. ' +
165           'Try using Chrome, Firefox or the Internet Explorer > 10.');
166       } else {
167         registerFileDrop(container, openDiagram);
168       }
169
170       // bootstrap diagram functions
171       function openNewWin(linkURL) {
172         window.open("" + linkURL + "", "_self" /*, "", "scrollbars, top="+winTop+", left="+winLeft+", height="+winHeight+", width="+winWidth+""*/ );
173       }
174
175
176       $(document).on('ready', function(e) {
177
178         /* $('#js-create-diagram').click(function(e) {*/
179         e.stopPropagation();
180         e.preventDefault();
181
182         createNewDiagram(newDiagramXML);
183
184         /*});*/
185         var fileInput = document.getElementById('fileInput');
186         var file_generate_test_case = document.getElementById('file_generate_test_case');
187
188         var downloadLink = $('#js-download-diagram');
189         var downloadSvgLink = $('#js-download-svg');
190         var readLink = $('#file_generate_test_case');
191         $('.buttons a').click(function(e) {
192           if (!$(this).is('.active')) {
193             e.preventDefault();
194             e.stopPropagation();
195           }
196         });
197         $('#openmodel').click(function() {
198
199           createNewDiagram(modelXML);
200
201         });
202
203         $('#cldsgetdiagrambtn').click(function() {
204           console.log("cldsgetdiagrambtn: starting...");
205           exportArtifacts();
206           console.log("cldsgetdiagrambtn: modelXML=" + modelXML);
207         });
208         $('#cldsopendiagrambtn').click(function() {
209           console.log("cldsopendiagrambtn: cldsModelXml=" + cldsModelXml);
210           createNewDiagram(cldsModelXml);
211           exportArtifacts();
212         });
213         $('#uploadmodel').click(function() {
214           var file = uploadfile;
215           var textType = /text.*/;
216
217           var reader = new FileReader();
218
219           reader.onload = function(e) {
220             newDiagramXML = reader.result;
221             e.stopPropagation();
222             e.preventDefault();
223             createNewDiagram(newDiagramXML);
224
225           }
226
227           reader.readAsText(file);
228           exportArtifacts();
229         });
230         if (fileInput) {
231           fileInput.addEventListener('change', function(e) {
232             var file = fileInput.files[0];
233             var textType = /text.*/;
234
235
236             var reader = new FileReader();
237
238             reader.onload = function(e) {
239               newDiagramXML = reader.result;
240               e.stopPropagation();
241               e.preventDefault();
242               createNewDiagram(newDiagramXML);
243
244             }
245
246             reader.readAsText(file);
247             exportArtifacts();
248           });
249         }
250
251         function setEncoded(link, name, data) {
252           var encodedData = encodeURIComponent(data);
253
254           var el = document.getElementById(selected_model);
255           var text = (el.innerText || el.textContent);
256
257
258           if (data) {
259             //var linkURL='data:application/bpmn20-xml;charset=UTF-8,' + encodedData;
260             link.addClass('active').attr({
261               'href': 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,
262               /*openNewWin( linkURL )*/ /*'*/
263               'download': text.trim() + '.utmxml',
264               'target': '_blank'
265             });
266
267           } else {
268             link.removeClass('active');
269           }
270         }
271
272         function setReadEncoded(link, name, data) {
273           var encodedData = encodeURIComponent(data);
274
275           if (data) {
276             link.addClass('active').attr({
277               'href': 'data:application/bpmn20-xml;charset=UTF-8,' + encodedData,
278               'download': name
279             });
280
281
282           } else {
283             link.removeClass('active');
284           }
285         }
286         var _ = require('lodash');
287         /*var model = $( "#modelName" ).val();
288          */
289
290         var exportArtifacts = _.debounce(function() {
291
292           saveSVG(function(err, svg) {
293             setEncoded(downloadSvgLink, 'diagram.svg', err ? null : svg);
294           });
295
296           saveDiagram(function(err, xml) {
297             setEncoded(downloadLink, "model.utmxml", err ? null : xml);
298           });
299
300         }, 500);
301
302         renderer.on('commandStack.changed', exportArtifacts);
303       });
304     }, {
305       "bpmn-js/lib/Modeler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Modeler.js",
306       "jquery": "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js",
307       "lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js"
308     }],
309   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Modeler.js": [function(require, module, exports) {
310     'use strict';
311
312     var inherits = require('inherits');
313
314     var IdSupport = require('bpmn-moddle/lib/id-support'),
315       Ids = require('ids');
316
317     var Viewer = require('./Viewer');
318
319     var initialDiagram =
320       '<?xml version="1.0" encoding="UTF-8"?>' +
321       '<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
322       'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
323       'xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" ' +
324       'xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" ' +
325       'targetNamespace="http://bpmn.io/schema/bpmn" ' +
326       'id="Definitions_1">' +
327       '<bpmn:process id="Process_1" isExecutable="false">' +
328       '<bpmn:startEvent id="StartEvent_1"/>' +
329       '</bpmn:process>' +
330       '<bpmndi:BPMNDiagram id="BPMNDiagram_1">' +
331       '<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">' +
332       '<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">' +
333       '<dc:Bounds height="36.0" width="36.0" x="50.0" y="102.0"/>' +
334       '</bpmndi:BPMNShape>' +
335       '</bpmndi:BPMNPlane>' +
336       '</bpmndi:BPMNDiagram>' +
337       '</bpmn:definitions>';
338
339
340     /**
341      * A modeler for BPMN 2.0 diagrams.
342      *
343      *  ## Extending the Modeler
344      *
345      * In order to extend the viewer pass extension modules to bootstrap via the
346      * `additionalModules` option. An extension module is an object that exposes
347      * named services.
348      *
349      * The following example depicts the integration of a simple logging component
350      * that integrates with interaction events:
351      *
352      *
353      * ```javascript
354      *  // logging component function InteractionLogger(eventBus) {
355      * eventBus.on('element.hover', function(event) { console.log() }) }
356      *
357      * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
358      *  // extension module var extensionModule = { __init__: [ 'interactionLogger' ],
359      * interactionLogger: [ 'type', InteractionLogger ] };
360      *  // extend the viewer var bpmnModeler = new Modeler({ additionalModules: [
361      * extensionModule ] }); bpmnModeler.importXML(...); ```
362      *
363      *  ## Customizing / Replacing Components
364      *
365      * You can replace individual diagram components by redefining them in override
366      * modules. This works for all components, including those defined in the core.
367      *
368      * Pass in override modules via the `options.additionalModules` flag like this:
369      *
370      * ```javascript function CustomContextPadProvider(contextPad) {
371      *
372      * contextPad.registerProvider(this);
373      *
374      * this.getContextPadEntries = function(element) { // no entries, effectively
375      * disable the context pad return {}; }; }
376      *
377      * CustomContextPadProvider.$inject = [ 'contextPad' ];
378      *
379      * var overrideModule = { contextPadProvider: [ 'type', CustomContextPadProvider ] };
380      *
381      * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]}); ```
382      *
383      * @param {Object}
384      *            [options] configuration options to pass to the viewer
385      * @param {DOMElement}
386      *            [options.container] the container to render the viewer in,
387      *            defaults to body.
388      * @param {String|Number}
389      *            [options.width] the width of the viewer
390      * @param {String|Number}
391      *            [options.height] the height of the viewer
392      * @param {Object}
393      *            [options.moddleExtensions] extension packages to provide
394      * @param {Array
395      *            <didi.Module>} [options.modules] a list of modules to override the
396      *            default modules
397      * @param {Array
398      *            <didi.Module>} [options.additionalModules] a list of modules to
399      *            use with the default modules
400      */
401     function Modeler(options) {
402       Viewer.call(this, options);
403     }
404
405     inherits(Modeler, Viewer);
406
407     Modeler.prototype.createDiagram = function(done) {
408       return this.importXML(initialDiagram, done);
409     };
410
411     Modeler.prototype.createModdle = function() {
412       var moddle = Viewer.prototype.createModdle.call(this);
413
414       IdSupport.extend(moddle, new Ids([32, 36, 1]));
415
416       return moddle;
417     };
418
419
420     Modeler.prototype._interactionModules = [
421       // non-modeling components
422       require('./features/label-editing'),
423       require('./features/keyboard'),
424       require('diagram-js/lib/navigation/zoomscroll'),
425       require('diagram-js/lib/navigation/movecanvas'),
426       require('diagram-js/lib/navigation/touch')
427     ];
428
429     Modeler.prototype._modelingModules = [
430       // modeling components
431       require('diagram-js/lib/features/move'),
432       require('diagram-js/lib/features/bendpoints'),
433       require('diagram-js/lib/features/resize'),
434       require('diagram-js/lib/features/space-tool'),
435       require('diagram-js/lib/features/lasso-tool'),
436       //require('./features/keyboard'),
437       require('./features/snapping'),
438       require('./features/modeling'),
439       require('./features/context-pad'),
440       require('./features/palette')
441     ];
442
443
444     // modules the modeler is composed of
445     //
446     // - viewer modules
447     // - interaction modules
448     // - modeling modules
449
450     Modeler.prototype._modules = [].concat(
451       Modeler.prototype._modules,
452       Modeler.prototype._interactionModules,
453       Modeler.prototype._modelingModules);
454
455
456     module.exports = Modeler;
457
458   }, {
459     "./Viewer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Viewer.js",
460     "./features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js",
461     "./features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js",
462     "./features/label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
463     "./features/modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js",
464     "./features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js",
465     "./features/snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js",
466     "bpmn-moddle/lib/id-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js",
467     "diagram-js/lib/features/bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js",
468     "diagram-js/lib/features/lasso-tool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js",
469     "diagram-js/lib/features/move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js",
470     "diagram-js/lib/features/resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js",
471     "diagram-js/lib/features/space-tool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js",
472     "diagram-js/lib/navigation/movecanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js",
473     "diagram-js/lib/navigation/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js",
474     "diagram-js/lib/navigation/zoomscroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js",
475     "ids": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js",
476     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
477   }],
478   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\Viewer.js": [function(require, module, exports) {
479     'use strict';
480
481     var assign = require('lodash/object/assign'),
482       omit = require('lodash/object/omit'),
483       isString = require('lodash/lang/isString'),
484       isNumber = require('lodash/lang/isNumber');
485
486     var domify = require('min-dom/lib/domify'),
487       domQuery = require('min-dom/lib/query'),
488       domRemove = require('min-dom/lib/remove');
489
490     var Diagram = require('diagram-js'),
491       BpmnModdle = require('bpmn-moddle');
492
493     var Importer = require('./import/Importer');
494
495
496     function initListeners(diagram, listeners) {
497       var events = diagram.get('eventBus');
498
499       listeners.forEach(function(l) {
500         events.on(l.event, l.handler);
501       });
502     }
503
504     function checkValidationError(err) {
505
506       // check if we can help the user by indicating wrong BPMN 2.0 xml
507       // (in case he or the exporting tool did not get that right)
508
509       var pattern = /unparsable content <([^>]+)> detected([\s\S]*)$/;
510       var match = pattern.exec(err.message);
511
512       if (match) {
513         err.message =
514           'unparsable content <' + match[1] + '> detected; ' +
515           'this may indicate an invalid BPMN 2.0 diagram file' + match[2];
516       }
517
518       return err;
519     }
520
521     var DEFAULT_OPTIONS = {
522       width: '100%',
523       height: '100%',
524       position: 'relative',
525       container: 'body'
526     };
527
528
529
530     /**
531      * Ensure the passed argument is a proper unit (defaulting to px)
532      */
533     function ensureUnit(val) {
534       return val + (isNumber(val) ? 'px' : '');
535     }
536
537     /**
538      * A viewer for BPMN 2.0 diagrams.
539      *
540      * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that
541      * include additional features.
542      *
543      *  ## Extending the Viewer
544      *
545      * In order to extend the viewer pass extension modules to bootstrap via the
546      * `additionalModules` option. An extension module is an object that exposes
547      * named services.
548      *
549      * The following example depicts the integration of a simple logging component
550      * that integrates with interaction events:
551      *
552      *
553      * ```javascript
554      *  // logging component function InteractionLogger(eventBus) {
555      * eventBus.on('element.hover', function(event) { console.log() }) }
556      *
557      * InteractionLogger.$inject = [ 'eventBus' ]; // minification save
558      *  // extension module var extensionModule = { __init__: [ 'interactionLogger' ],
559      * interactionLogger: [ 'type', InteractionLogger ] };
560      *  // extend the viewer var bpmnViewer = new Viewer({ additionalModules: [
561      * extensionModule ] }); bpmnViewer.importXML(...); ```
562      *
563      * @param {Object}
564      *            [options] configuration options to pass to the viewer
565      * @param {DOMElement}
566      *            [options.container] the container to render the viewer in,
567      *            defaults to body.
568      * @param {String|Number}
569      *            [options.width] the width of the viewer
570      * @param {String|Number}
571      *            [options.height] the height of the viewer
572      * @param {Object}
573      *            [options.moddleExtensions] extension packages to provide
574      * @param {Array
575      *            <didi.Module>} [options.modules] a list of modules to override the
576      *            default modules
577      * @param {Array
578      *            <didi.Module>} [options.additionalModules] a list of modules to
579      *            use with the default modules
580      */
581     function Viewer(options) {
582
583       this.options = options = assign({}, DEFAULT_OPTIONS, options || {});
584
585       var parent = options.container;
586
587       // support jquery element
588       // unwrap it if passed
589       if (parent.get) {
590         parent = parent.get(0);
591       }
592
593       // support selector
594       if (isString(parent)) {
595         parent = domQuery(parent);
596       }
597
598       var container = this.container = domify('<div class="bjs-container"></div>');
599       if (parent && parent.appendChild) {
600         parent.appendChild(container);
601       }
602
603
604       assign(container.style, {
605         width: ensureUnit(options.width),
606         height: ensureUnit(options.height),
607         position: options.position
608       });
609
610       /**
611        * The code in the <project-logo></project-logo> area must not be changed,
612        * see http://bpmn.io/license for more information
613        *
614        * <project-logo>
615        */
616
617       /* jshint -W101 */
618
619       // inlined ../resources/bpmnjs.png
620       var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';
621
622       /* jshint +W101 */
623
624       var linkMarkup =
625         '<a href="http://bpmn.io" ' +
626         'target="_blank" ' +
627         'class="bjs-powered-by" ' +
628         'title="Powered by bpmn.io" ' +
629         'style="position: absolute; bottom: 15px; right: 15px; z-index: 100">' +
630         '<img src="data:image/png;base64,' + logoData + '">' +
631         '</a>';
632       if (container && container.appendChild) {
633         container.appendChild(domify(linkMarkup));
634       }
635
636
637       /* </project-logo> */
638     }
639
640     Viewer.prototype.importXML = function(xml, done) {
641
642       var self = this;
643
644       this.moddle = this.createModdle();
645
646       this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
647
648         if (err) {
649           err = checkValidationError(err);
650           return done(err);
651         }
652
653         var parseWarnings = context.warnings;
654
655         self.importDefinitions(definitions, function(err, importWarnings) {
656           if (err) {
657             return done(err);
658           }
659
660           done(null, parseWarnings.concat(importWarnings || []));
661         });
662       });
663     };
664
665     Viewer.prototype.saveXML = function(options, done) {
666
667       if (!done) {
668         done = options;
669         options = {};
670       }
671
672       var definitions = this.definitions;
673
674       if (!definitions) {
675         return done(new Error('no definitions loaded'));
676       }
677
678       this.moddle.toXML(definitions, options, done);
679     };
680
681
682     Viewer.prototype.createModdle = function() {
683       return new BpmnModdle(this.options.moddleExtensions);
684     };
685
686     Viewer.prototype.saveSVG = function(options, done) {
687
688       if (!done) {
689         done = options;
690         options = {};
691       }
692
693       var canvas = this.get('canvas');
694
695       var contentNode = canvas.getDefaultLayer(),
696         defsNode = canvas._svg.select('defs');
697
698       var contents = contentNode.innerSVG(),
699         defs = (defsNode && defsNode.outerSVG()) || '';
700
701       var bbox = contentNode.getBBox();
702
703       var svg =
704         '<?xml version="1.0" encoding="utf-8"?>\n' +
705         '<!-- created with bpmn-js / http://bpmn.io -->\n' +
706         '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
707         '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
708         'width="' + bbox.width + '" height="' + bbox.height + '" ' +
709         'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
710         defs + contents +
711         '</svg>';
712
713       done(null, svg);
714     };
715
716     Viewer.prototype.get = function(name) {
717
718       if (!this.diagram) {
719         throw new Error('no diagram loaded');
720       }
721
722       return this.diagram.get(name);
723     };
724
725     Viewer.prototype.invoke = function(fn) {
726
727       if (!this.diagram) {
728         throw new Error('no diagram loaded');
729       }
730
731       return this.diagram.invoke(fn);
732     };
733
734     Viewer.prototype.importDefinitions = function(definitions, done) {
735
736       // use try/catch to not swallow synchronous exceptions
737       // that may be raised during model parsing
738       try {
739         if (this.diagram) {
740           this.clear();
741         }
742
743         this.definitions = definitions;
744
745         var diagram = this.diagram = this._createDiagram(this.options);
746
747         this._init(diagram);
748
749         Importer.importBpmnDiagram(diagram, definitions, done);
750       } catch (e) {
751         done(e);
752       }
753     };
754
755     Viewer.prototype._init = function(diagram) {
756       initListeners(diagram, this.__listeners || []);
757     };
758
759     Viewer.prototype._createDiagram = function(options) {
760
761       var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);
762
763       // add self as an available service
764       modules.unshift({
765         bpmnjs: ['value', this],
766         moddle: ['value', this.moddle]
767       });
768
769       options = omit(options, 'additionalModules');
770
771       options = assign(options, {
772         canvas: {
773           container: this.container
774         },
775         modules: modules
776       });
777
778       return new Diagram(options);
779     };
780
781
782     Viewer.prototype.getModules = function() {
783       return this._modules;
784     };
785
786     /**
787      * Remove all drawn elements from the viewer.
788      *
789      * After calling this method the viewer can still be reused for opening another
790      * diagram.
791      */
792     Viewer.prototype.clear = function() {
793       var diagram = this.diagram;
794
795       if (diagram) {
796         diagram.destroy();
797       }
798     };
799
800     /**
801      * Destroy the viewer instance and remove all its remainders from the document
802      * tree.
803      */
804     Viewer.prototype.destroy = function() {
805       // clear underlying diagram
806       this.clear();
807
808       // remove container
809       domRemove(this.container);
810     };
811
812     /**
813      * Register an event listener on the viewer
814      *
815      * @param {String}
816      *            event
817      * @param {Function}
818      *            handler
819      */
820     Viewer.prototype.on = function(event, handler) {
821       var diagram = this.diagram,
822         listeners = this.__listeners = this.__listeners || [];
823
824       listeners.push({
825         event: event,
826         handler: handler
827       });
828
829       if (diagram) {
830         diagram.get('eventBus').on(event, handler);
831       }
832     };
833
834     // modules the viewer is composed of
835     Viewer.prototype._modules = [
836       require('./core'),
837       require('diagram-js/lib/features/selection'),
838       require('diagram-js/lib/features/overlays')
839     ];
840
841     module.exports = Viewer;
842
843   }, {
844     "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\core\\index.js",
845     "./import/Importer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js",
846     "bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js",
847     "diagram-js": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js",
848     "diagram-js/lib/features/overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
849     "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
850     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
851     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
852     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
853     "lodash/object/omit": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js",
854     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js",
855     "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js",
856     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
857   }],
858   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\core\\index.js": [function(require, module, exports) {
859     module.exports = {
860       __depends__: [
861         require('../draw'),
862         require('../import')
863       ]
864     };
865   }, {
866     "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js",
867     "../import": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js"
868   }],
869   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js": [function(require, module, exports) {
870     'use strict';
871
872     var inherits = require('inherits'),
873       isArray = require('lodash/lang/isArray'),
874       isObject = require('lodash/lang/isObject'),
875       assign = require('lodash/object/assign'),
876       forEach = require('lodash/collection/forEach'),
877       every = require('lodash/collection/every'),
878       includes = require('lodash/collection/includes'),
879       some = require('lodash/collection/some');
880
881     var DefaultRenderer = require('diagram-js/lib/draw/Renderer'),
882       TextUtil = require('diagram-js/lib/util/Text'),
883       DiUtil = require('../util/DiUtil');
884
885     var createLine = DefaultRenderer.createLine;
886
887
888     function BpmnRenderer(events, styles, pathMap) {
889
890       DefaultRenderer.call(this, styles);
891
892       var TASK_BORDER_RADIUS = 10;
893       var INNER_OUTER_DIST = 3;
894
895       var LABEL_STYLE = {
896         fontFamily: 'Arial, sans-serif',
897         fontSize: '12px'
898       };
899
900       var textUtil = new TextUtil({
901         style: LABEL_STYLE,
902         size: {
903           width: 100
904         }
905       });
906
907       var markers = {};
908
909       function addMarker(id, element) {
910         markers[id] = element;
911       }
912
913       function marker(id) {
914         return markers[id];
915       }
916
917       function initMarkers(svg) {
918
919         function createMarker(id, options) {
920           var attrs = assign({
921             fill: 'black',
922             strokeWidth: 1,
923             strokeLinecap: 'round',
924             strokeDasharray: 'none'
925           }, options.attrs);
926
927           var ref = options.ref || {
928             x: 0,
929             y: 0
930           };
931
932           var scale = options.scale || 1;
933
934           // fix for safari / chrome / firefox bug not correctly
935           // resetting stroke dash array
936           if (attrs.strokeDasharray === 'none') {
937             attrs.strokeDasharray = [10000, 1];
938           }
939
940           var marker = options.element
941             .attr(attrs)
942             .marker(0, 0, 20, 20, ref.x, ref.y)
943             .attr({
944               markerWidth: 20 * scale,
945               markerHeight: 20 * scale
946             });
947
948           return addMarker(id, marker);
949         }
950
951
952         createMarker('sequenceflow-end', {
953           element: svg.path('M 1 5 L 11 10 L 1 15 Z'),
954           ref: {
955             x: 11,
956             y: 10
957           },
958           scale: 0.5
959         });
960
961         createMarker('messageflow-start', {
962           element: svg.circle(6, 6, 3.5),
963           attrs: {
964             fill: 'white',
965             stroke: 'black'
966           },
967           ref: {
968             x: 6,
969             y: 6
970           }
971         });
972
973         createMarker('messageflow-end', {
974           element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),
975           attrs: {
976             fill: 'white',
977             stroke: 'black',
978             strokeLinecap: 'butt'
979           },
980           ref: {
981             x: 8.5,
982             y: 5
983           }
984         });
985
986         createMarker('data-association-end', {
987           element: svg.path('M 1 5 L 11 10 L 1 15'),
988           attrs: {
989             fill: 'white',
990             stroke: 'black'
991           },
992           ref: {
993             x: 11,
994             y: 10
995           },
996           scale: 0.5
997         });
998
999         createMarker('conditional-flow-marker', {
1000           element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),
1001           attrs: {
1002             fill: 'white',
1003             stroke: 'black'
1004           },
1005           ref: {
1006             x: -1,
1007             y: 10
1008           },
1009           scale: 0.5
1010         });
1011
1012         createMarker('conditional-default-flow-marker', {
1013           element: svg.path('M 1 4 L 5 16'),
1014           attrs: {
1015             stroke: 'black'
1016           },
1017           ref: {
1018             x: -5,
1019             y: 10
1020           },
1021           scale: 0.5
1022         });
1023       }
1024
1025       function computeStyle(custom, traits, defaultStyles) {
1026         if (!isArray(traits)) {
1027           defaultStyles = traits;
1028           traits = [];
1029         }
1030
1031         return styles.style(traits || [], assign(defaultStyles, custom || {}));
1032       }
1033
1034       function drawCircle(p, width, height, offset, attrs) {
1035
1036         if (isObject(offset)) {
1037           attrs = offset;
1038           offset = 0;
1039         }
1040
1041         offset = offset || 0;
1042
1043         attrs = computeStyle(attrs, {
1044           stroke: 'black',
1045           strokeWidth: 2,
1046           fill: 'white'
1047         });
1048
1049         var cx = width / 2,
1050           cy = height / 2;
1051
1052         return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);
1053       }
1054
1055       function drawRect(p, width, height, r, offset, attrs) {
1056
1057         if (isObject(offset)) {
1058           attrs = offset;
1059           offset = 0;
1060         }
1061
1062         offset = offset || 0;
1063
1064         attrs = computeStyle(attrs, {
1065           stroke: 'black',
1066           strokeWidth: 2,
1067           fill: 'white'
1068         });
1069
1070         return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);
1071       }
1072
1073       function drawDiamond(p, width, height, attrs) {
1074
1075         var x_2 = width / 2;
1076         var y_2 = height / 2;
1077
1078         var points = [x_2, 0, width, y_2, x_2, height, 0, y_2];
1079
1080         attrs = computeStyle(attrs, {
1081           stroke: 'black',
1082           strokeWidth: 2,
1083           fill: 'white'
1084         });
1085
1086         return p.polygon(points).attr(attrs);
1087       }
1088
1089       function drawLine(p, waypoints, attrs) {
1090         attrs = computeStyle(attrs, ['no-fill'], {
1091           stroke: 'black',
1092           strokeWidth: 2,
1093           fill: 'none'
1094         });
1095
1096         return createLine(waypoints, attrs).appendTo(p);
1097       }
1098
1099       function drawPath(p, d, attrs) {
1100
1101         attrs = computeStyle(attrs, ['no-fill'], {
1102           strokeWidth: 2,
1103           stroke: 'black'
1104         });
1105
1106         return p.path(d).attr(attrs);
1107       }
1108
1109       function as(type) {
1110         return function(p, element) {
1111           return handlers[type](p, element);
1112         };
1113       }
1114
1115       function renderer(type) {
1116         return handlers[type];
1117       }
1118
1119       function renderEventContent(element, p) {
1120
1121         var event = getSemantic(element);
1122         var isThrowing = isThrowEvent(event);
1123
1124         if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
1125           return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);
1126         }
1127
1128         if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
1129           return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);
1130         }
1131
1132         if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
1133           return renderer('bpmn:ConditionalEventDefinition')(p, element);
1134         }
1135
1136         if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
1137           return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);
1138         }
1139
1140         if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
1141           isTypedEvent(event, 'bpmn:TerminateEventDefinition', {
1142             parallelMultiple: false
1143           })) {
1144           return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);
1145         }
1146
1147         if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&
1148           isTypedEvent(event, 'bpmn:TerminateEventDefinition', {
1149             parallelMultiple: true
1150           })) {
1151           return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);
1152         }
1153
1154         if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
1155           return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);
1156         }
1157
1158         if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
1159           return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);
1160         }
1161
1162         if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
1163           return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);
1164         }
1165
1166         if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
1167           return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);
1168         }
1169
1170         if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
1171           return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);
1172         }
1173
1174         if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
1175           return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);
1176         }
1177
1178         return null;
1179       }
1180
1181       function renderLabel(p, label, options) {
1182         return textUtil.createText(p, label || '', options).addClass('djs-label');
1183       }
1184
1185       function renderEmbeddedLabel(p, element, align) {
1186         var semantic = getSemantic(element);
1187         return renderLabel(p, semantic.name, {
1188           box: element,
1189           align: align,
1190           padding: 5
1191         });
1192       }
1193
1194       function renderExternalLabel(p, element, align) {
1195         var semantic = getSemantic(element);
1196
1197         if (!semantic.name) {
1198           element.hidden = true;
1199         }
1200
1201         return renderLabel(p, semantic.name, {
1202           box: element,
1203           align: align,
1204           style: {
1205             fontSize: '11px'
1206           }
1207         });
1208       }
1209
1210       function renderLaneLabel(p, text, element) {
1211         var textBox = renderLabel(p, text, {
1212           box: {
1213             height: 30,
1214             width: element.height
1215           },
1216           align: 'center-middle'
1217         });
1218
1219         var top = -1 * element.height;
1220         textBox.transform(
1221           'rotate(270) ' +
1222           'translate(' + top + ',' + 0 + ')'
1223         );
1224       }
1225
1226       function createPathFromConnection(connection) {
1227         var waypoints = connection.waypoints;
1228
1229         var pathData = 'm  ' + waypoints[0].x + ',' + waypoints[0].y;
1230         for (var i = 1; i < waypoints.length; i++) {
1231           pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
1232         }
1233         return pathData;
1234       }
1235
1236       var handlers = {
1237         'bpmn:Event': function(p, element, attrs) {
1238           return drawCircle(p, element.width, element.height, attrs);
1239         },
1240         'bpmn:StartEvent': function(p, element) {
1241           var attrs = {};
1242           var semantic = getSemantic(element);
1243
1244           if (!semantic.isInterrupting) {
1245             attrs = {
1246               strokeDasharray: '6',
1247               strokeLinecap: 'round'
1248             };
1249           }
1250
1251           var circle = renderer('bpmn:Event')(p, element, attrs);
1252
1253           renderEventContent(element, p);
1254
1255           return circle;
1256         },
1257
1258         'bpmn:MultiBranchConnector': function(p, element) {
1259           var attrs = {};
1260           element.height = 80;
1261           element.width = 80;
1262           var semantic = getSemantic(element);
1263
1264           if (!semantic.isInterrupting) {
1265             attrs = {
1266               strokeDasharray: '6',
1267               strokeLinecap: 'round'
1268             };
1269           }
1270
1271           var circle = renderer('bpmn:Event')(p, element, attrs);
1272           var height = element.height / 2;
1273           var width = element.width / 2;
1274           var value = Math.round((height + width) / 4);
1275           drawLine(p, [{
1276             x: 0,
1277             y: Math.round(element.height / 2)
1278           }, {
1279             x: element.width,
1280             y: Math.round(element.height / 2)
1281           }]);
1282           drawLine(p, [{
1283             x: Math.round(element.width / 2),
1284             y: 0
1285           }, {
1286             x: Math.round(element.width / 2),
1287             y: element.height
1288           }]);
1289           renderEventContent(element, p);
1290
1291           return circle;
1292         },
1293         'bpmn:ParentReturn': function(p, element) {
1294           var attrs = {};
1295           var semantic = getSemantic(element);
1296
1297           if (!semantic.isInterrupting) {
1298             attrs = {
1299               strokeDasharray: '6',
1300               strokeLinecap: 'round'
1301             };
1302           }
1303
1304           // var circle = renderer('bpmn:Event')(p, element, attrs);
1305           drawLine(p, [{
1306             x: 0,
1307             y: 0
1308           }, {
1309             x: 0,
1310             y: element.height / 2
1311           }]);
1312           drawLine(p, [{
1313             x: 0,
1314             y: element.height / 2
1315           }, {
1316             x: element.width / 2,
1317             y: element.height
1318           }]);
1319           drawLine(p, [{
1320             x: 0,
1321             y: 0
1322           }, {
1323             x: element.width,
1324             y: 0
1325           }]);
1326           drawLine(p, [{
1327             x: element.width,
1328             y: 0
1329           }, {
1330             x: element.width,
1331             y: element.height / 2
1332           }]);
1333           drawLine(p, [
1334
1335             {
1336               x: element.width,
1337               y: element.height / 2
1338             }, {
1339               x: element.width / 2,
1340               y: element.height
1341             }
1342           ]);
1343           var text2 = getSemantic(element).name;
1344           renderLabel(p, text2, {
1345             box: element,
1346             align: 'center'
1347           });
1348           renderEventContent(element, p);
1349
1350           return p;
1351         },
1352         'bpmn:SubProcessCall': function(p, element) {
1353           var lane = renderer('bpmn:Lane')(p, element, {
1354             fill: 'White'
1355           });
1356
1357           var expandedPool = DiUtil.isExpanded(element);
1358
1359           if (expandedPool) {
1360             drawLine(p, [{
1361               x: 20,
1362               y: 0
1363             }, {
1364               x: 20,
1365               y: element.height
1366             }]);
1367
1368             drawLine(p, [{
1369               x: element.width - 20,
1370               y: 0
1371             }, {
1372               x: element.width - 20,
1373               y: element.height
1374             }]);
1375
1376             var text2 = getSemantic(element).name;
1377             renderLabel(p, text2, {
1378               box: element,
1379               align: 'center-middle'
1380             });
1381
1382             /*
1383              * var text = getSemantic(element).name; renderLaneLabel(p,
1384              * text, element);
1385              */
1386           } else {
1387             // Collapsed pool draw text inline
1388             var text2 = getSemantic(element).name;
1389             renderLabel(p, text2, {
1390               box: element,
1391               align: 'center-middle'
1392             });
1393           }
1394
1395           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1396
1397           if (participantMultiplicity) {
1398             renderer('ParticipantMultiplicityMarker')(p, element);
1399           }
1400
1401           return lane;
1402
1403
1404         },
1405         'bpmn:InitiateProcess': function(p, element) {
1406           var lane = renderer('bpmn:Lane')(p, element, {
1407             fill: 'White'
1408           });
1409
1410           var expandedPool = DiUtil.isExpanded(element);
1411           openDiagram(newDiagramXML);
1412           if (expandedPool) {
1413             drawLine(p, [{
1414               x: 0,
1415               y: 20
1416             }, {
1417               x: element.width,
1418               y: 20
1419             }]);
1420
1421             drawLine(p, [{
1422               x: 20,
1423               y: 0
1424             }, {
1425               x: 20,
1426               y: element.height
1427             }]);
1428             var text2 = getSemantic(element).name;
1429             renderLabel(p, text2, {
1430               box: element,
1431               align: 'center-middle'
1432             });
1433
1434           } else {
1435             // Collapsed pool draw text inline
1436             var text2 = getSemantic(element).name;
1437             renderLabel(p, text2, {
1438               box: element,
1439               align: 'center-middle'
1440             });
1441           }
1442
1443           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1444
1445           if (participantMultiplicity) {
1446             renderer('ParticipantMultiplicityMarker')(p, element);
1447           }
1448
1449           return lane;
1450
1451
1452         },
1453         'bpmn:Collector': function(p, element) {
1454           var lane = renderer('bpmn:Lane')(p, element, {
1455             fill: 'White'
1456           });
1457
1458           var expandedPool = DiUtil.isExpanded(element);
1459
1460           if (expandedPool) {
1461             drawLine(p, [{
1462               x: element.width,
1463               y: 80
1464             }, {
1465               x: element.width,
1466               y: 20
1467             }]);
1468
1469             drawLine(p, [{
1470               x: 20,
1471               y: 0
1472             }, {
1473               x: 20,
1474               y: element.height
1475             }]);
1476             var text2 = getSemantic(element).name;
1477             if (text2 == undefined) {
1478               text2 = 'Collector';
1479             }
1480
1481             renderLabel(p, text2, {
1482               box: element,
1483               align: 'center-middle'
1484             });
1485
1486           } else {
1487             // Collapsed pool draw text inline
1488             var text2 = getSemantic(element).name;
1489             renderLabel(p, text2, {
1490               box: element,
1491               align: 'center-middle'
1492             });
1493           }
1494
1495           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1496
1497           if (participantMultiplicity) {
1498             renderer('ParticipantMultiplicityMarker')(p, element);
1499           }
1500
1501           return lane;
1502
1503
1504         },
1505         'bpmn:VesCollector': function(p, element) {
1506           var lane = renderer('bpmn:Lane')(p, element, {
1507             fill: 'White'
1508           });
1509
1510           var expandedPool = DiUtil.isExpanded(element);
1511
1512           if (expandedPool) {
1513             drawLine(p, [{
1514               x: element.width,
1515               y: 80
1516             }, {
1517               x: element.width,
1518               y: 20
1519             }]);
1520
1521             drawLine(p, [{
1522               x: 20,
1523               y: 0
1524             }, {
1525               x: 20,
1526               y: element.height
1527             }]);
1528
1529             textUtil.createText(p, "V", {
1530               align: 'left-top',
1531               'padding': {
1532                 top: 0,
1533                 left: 5,
1534                 right: element.width - 20,
1535                 bottom: 0
1536               }
1537             });
1538             textUtil.createText(p, "E", {
1539               align: 'left-top',
1540               'padding': {
1541                 top: 12,
1542                 left: 5,
1543                 right: element.width - 20,
1544                 bottom: 0
1545               }
1546             });
1547             textUtil.createText(p, "S", {
1548               align: 'left-top',
1549               'padding': {
1550                 top: 24,
1551                 left: 5,
1552                 right: element.width - 20,
1553                 bottom: 0
1554               }
1555             });
1556
1557             var text2 = getSemantic(element).name;
1558             if (text2 == undefined) {
1559               text2 = 'VesCollector';
1560             }
1561
1562             renderLabel(p, text2, {
1563               box: element,
1564               align: 'center-middle'
1565             });
1566
1567           } else {
1568             // Collapsed pool draw text inline
1569             var text2 = getSemantic(element).name;
1570             renderLabel(p, text2, {
1571               box: element,
1572               align: 'center-middle'
1573             });
1574           }
1575
1576           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1577
1578           if (participantMultiplicity) {
1579             renderer('ParticipantMultiplicityMarker')(p, element);
1580           }
1581
1582           return lane;
1583         },
1584
1585         'bpmn:Holmes': function(p, element) {
1586           var lane = renderer('bpmn:Lane')(p, element, {
1587             fill: 'White'
1588           });
1589
1590           var expandedPool = DiUtil.isExpanded(element);
1591
1592           var instanceName = getSemantic(element).name;
1593           if (expandedPool) {
1594
1595             if (instanceName == undefined) {
1596               instanceName = 'Holmes';
1597             }
1598
1599             // add holmes 'icon'
1600             var attrs = computeStyle({}, {
1601               stroke: 'black',
1602               strokeWidth: 1,
1603               fill: 'white'
1604             });
1605             p.circle(15, 15, 10).attr(attrs)
1606             textUtil.createText(p, "H", {
1607               align: 'left-top',
1608               'padding': {
1609                 top: 6,
1610                 left: 11
1611               }
1612             });
1613           }
1614
1615           renderLabel(p, instanceName, {
1616             box: element,
1617             align: 'center-middle'
1618           });
1619
1620           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1621
1622           if (participantMultiplicity) {
1623             renderer('ParticipantMultiplicityMarker')(p, element);
1624           }
1625
1626           return lane;
1627         },
1628
1629
1630         'bpmn:StringMatch': function(p, element) {
1631           var lane = renderer('bpmn:Lane')(p, element, {
1632             fill: 'White'
1633           });
1634
1635           var expandedPool = DiUtil.isExpanded(element);
1636
1637           if (expandedPool) {
1638
1639             drawLine(p, [{
1640               x: 0,
1641               y: 20
1642             }, {
1643               x: element.width,
1644               y: 20
1645             }]);
1646             var text2 = getSemantic(element).name;
1647             if (text2 == undefined) {
1648               text2 = 'StringMatch';
1649             }
1650             renderLabel(p, text2, {
1651               box: element,
1652               align: 'center-middle'
1653             });
1654
1655           } else {
1656             // Collapsed pool draw text inline
1657             var text2 = getSemantic(element).name;
1658             renderLabel(p, text2, {
1659               box: element,
1660               align: 'center-middle'
1661             });
1662           }
1663
1664           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1665
1666           if (participantMultiplicity) {
1667             renderer('ParticipantMultiplicityMarker')(p, element);
1668           }
1669
1670           return lane;
1671
1672
1673         },
1674
1675         'bpmn:TCA': function(p, element) {
1676           var lane = renderer('bpmn:Lane')(p, element, {
1677             fill: 'White'
1678           });
1679
1680           var expandedPool = DiUtil.isExpanded(element);
1681
1682           if (expandedPool) {
1683
1684
1685             drawLine(p, [{
1686               x: 0,
1687               y: element.height - 20
1688             }, {
1689               x: element.width,
1690               y: element.height - 20
1691             }]);
1692             var text2 = getSemantic(element).name;
1693             if (text2 == undefined) {
1694               text2 = 'TCA';
1695             }
1696             renderLabel(p, text2, {
1697               box: element,
1698               align: 'center-middle'
1699             });
1700
1701           } else {
1702             // Collapsed pool draw text inline
1703             var text2 = getSemantic(element).name;
1704             renderLabel(p, text2, {
1705               box: element,
1706               align: 'center-middle'
1707             });
1708           }
1709
1710           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1711
1712           if (participantMultiplicity) {
1713             renderer('ParticipantMultiplicityMarker')(p, element);
1714           }
1715
1716           return lane;
1717
1718
1719         },
1720         'bpmn:GOC': function(p, element) {
1721           var lane = renderer('bpmn:Lane')(p, element, {
1722             fill: 'White'
1723           });
1724
1725           var expandedPool = DiUtil.isExpanded(element);
1726
1727           if (expandedPool) {
1728
1729
1730
1731             drawLine(p, [{
1732               x: element.width / 2,
1733               y: element.height
1734             }, {
1735               x: element.width,
1736               y: element.height / 2
1737             }]);
1738             var text2 = getSemantic(element).name;
1739             if (text2 == undefined) {
1740               text2 = 'GOC';
1741             }
1742             renderLabel(p, text2, {
1743               box: element,
1744               align: 'center-middle'
1745             });
1746
1747           } else {
1748             // Collapsed pool draw text inline
1749             var text2 = getSemantic(element).name;
1750             renderLabel(p, text2, {
1751               box: element,
1752               align: 'center-middle'
1753             });
1754           }
1755
1756           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1757
1758           if (participantMultiplicity) {
1759             renderer('ParticipantMultiplicityMarker')(p, element);
1760           }
1761
1762           return lane;
1763
1764
1765         },
1766         'bpmn:Policy': function(p, element) {
1767           var lane = renderer('bpmn:Lane')(p, element, {
1768             fill: 'White'
1769           });
1770
1771           var expandedPool = DiUtil.isExpanded(element);
1772
1773           if (expandedPool) {
1774
1775
1776
1777             drawLine(p, [{
1778               x: 0,
1779               y: element.height / 2
1780             }, {
1781               x: element.width / 2,
1782               y: 0
1783             }]);
1784             var text2 = getSemantic(element).name;
1785             if (text2 == undefined) {
1786               text2 = 'Policy';
1787             }
1788             renderLabel(p, text2, {
1789               box: element,
1790               align: 'center-middle'
1791             });
1792
1793           } else {
1794             // Collapsed pool draw text inline
1795             var text2 = getSemantic(element).name;
1796             renderLabel(p, text2, {
1797               box: element,
1798               align: 'center-middle'
1799             });
1800           }
1801
1802           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1803
1804           if (participantMultiplicity) {
1805             renderer('ParticipantMultiplicityMarker')(p, element);
1806           }
1807
1808           return lane;
1809
1810
1811         },
1812         'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
1813           var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
1814             xScaleFactor: 0.9,
1815             yScaleFactor: 0.9,
1816             containerWidth: element.width,
1817             containerHeight: element.height,
1818             position: {
1819               mx: 0.235,
1820               my: 0.315
1821             }
1822           });
1823
1824           var fill = isThrowing ? 'black' : 'white';
1825           var stroke = isThrowing ? 'white' : 'black';
1826
1827           var messagePath = drawPath(p, pathData, {
1828             strokeWidth: 1,
1829             fill: fill,
1830             stroke: stroke
1831           });
1832
1833           return messagePath;
1834         },
1835         'bpmn:TimerEventDefinition': function(p, element) {
1836
1837           var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
1838             strokeWidth: 2
1839           });
1840
1841           var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
1842             xScaleFactor: 0.75,
1843             yScaleFactor: 0.75,
1844             containerWidth: element.width,
1845             containerHeight: element.height,
1846             position: {
1847               mx: 0.5,
1848               my: 0.5
1849             }
1850           });
1851
1852           drawPath(p, pathData, {
1853             strokeWidth: 2,
1854             strokeLinecap: 'square'
1855           });
1856
1857           for (var i = 0; i < 12; i++) {
1858
1859             var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
1860               xScaleFactor: 0.75,
1861               yScaleFactor: 0.75,
1862               containerWidth: element.width,
1863               containerHeight: element.height,
1864               position: {
1865                 mx: 0.5,
1866                 my: 0.5
1867               }
1868             });
1869
1870             var width = element.width / 2;
1871             var height = element.height / 2;
1872
1873             drawPath(p, linePathData, {
1874               strokeWidth: 1,
1875               strokeLinecap: 'square',
1876               transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
1877             });
1878           }
1879
1880           return circle;
1881         },
1882         'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
1883           var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
1884             xScaleFactor: 1,
1885             yScaleFactor: 1,
1886             containerWidth: event.width,
1887             containerHeight: event.height,
1888             position: {
1889               mx: 0.5,
1890               my: 0.555
1891             }
1892           });
1893
1894           var fill = isThrowing ? 'black' : 'none';
1895
1896           return drawPath(p, pathData, {
1897             strokeWidth: 1,
1898             fill: fill
1899           });
1900         },
1901         'bpmn:ConditionalEventDefinition': function(p, event) {
1902           var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
1903             xScaleFactor: 1,
1904             yScaleFactor: 1,
1905             containerWidth: event.width,
1906             containerHeight: event.height,
1907             position: {
1908               mx: 0.5,
1909               my: 0.222
1910             }
1911           });
1912
1913           return drawPath(p, pathData, {
1914             strokeWidth: 1
1915           });
1916         },
1917         'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
1918           var pathData = pathMap.getScaledPath('EVENT_LINK', {
1919             xScaleFactor: 1,
1920             yScaleFactor: 1,
1921             containerWidth: event.width,
1922             containerHeight: event.height,
1923             position: {
1924               mx: 0.57,
1925               my: 0.263
1926             }
1927           });
1928
1929           var fill = isThrowing ? 'black' : 'none';
1930
1931           return drawPath(p, pathData, {
1932             strokeWidth: 1,
1933             fill: fill
1934           });
1935         },
1936         'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
1937           var pathData = pathMap.getScaledPath('EVENT_ERROR', {
1938             xScaleFactor: 1.1,
1939             yScaleFactor: 1.1,
1940             containerWidth: event.width,
1941             containerHeight: event.height,
1942             position: {
1943               mx: 0.2,
1944               my: 0.722
1945             }
1946           });
1947
1948           var fill = isThrowing ? 'black' : 'none';
1949
1950           return drawPath(p, pathData, {
1951             strokeWidth: 1,
1952             fill: fill
1953           });
1954         },
1955         'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
1956           var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
1957             xScaleFactor: 1.0,
1958             yScaleFactor: 1.0,
1959             containerWidth: event.width,
1960             containerHeight: event.height,
1961             position: {
1962               mx: 0.638,
1963               my: -0.055
1964             }
1965           });
1966
1967           var fill = isThrowing ? 'black' : 'none';
1968
1969           return drawPath(p, pathData, {
1970             strokeWidth: 1,
1971             fill: fill
1972           }).transform('rotate(45)');
1973         },
1974         'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
1975           var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
1976             xScaleFactor: 1,
1977             yScaleFactor: 1,
1978             containerWidth: event.width,
1979             containerHeight: event.height,
1980             position: {
1981               mx: 0.201,
1982               my: 0.472
1983             }
1984           });
1985
1986           var fill = isThrowing ? 'black' : 'none';
1987
1988           return drawPath(p, pathData, {
1989             strokeWidth: 1,
1990             fill: fill
1991           });
1992         },
1993         'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
1994           var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
1995             xScaleFactor: 0.9,
1996             yScaleFactor: 0.9,
1997             containerWidth: event.width,
1998             containerHeight: event.height,
1999             position: {
2000               mx: 0.5,
2001               my: 0.2
2002             }
2003           });
2004
2005           var fill = isThrowing ? 'black' : 'none';
2006
2007           return drawPath(p, pathData, {
2008             strokeWidth: 1,
2009             fill: fill
2010           });
2011         },
2012         'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
2013           var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
2014             xScaleFactor: 1.1,
2015             yScaleFactor: 1.1,
2016             containerWidth: event.width,
2017             containerHeight: event.height,
2018             position: {
2019               mx: 0.222,
2020               my: 0.36
2021             }
2022           });
2023
2024           var fill = isThrowing ? 'black' : 'none';
2025
2026           return drawPath(p, pathData, {
2027             strokeWidth: 1,
2028             fill: fill
2029           });
2030         },
2031         'bpmn:ParallelMultipleEventDefinition': function(p, event) {
2032           var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
2033             xScaleFactor: 1.2,
2034             yScaleFactor: 1.2,
2035             containerWidth: event.width,
2036             containerHeight: event.height,
2037             position: {
2038               mx: 0.458,
2039               my: 0.194
2040             }
2041           });
2042
2043           return drawPath(p, pathData, {
2044             strokeWidth: 1
2045           });
2046         },
2047         'bpmn:EndEvent': function(p, element) {
2048           var circle = renderer('bpmn:Event')(p, element, {
2049             strokeWidth: 4
2050           });
2051
2052           renderEventContent(element, p, true);
2053
2054           return circle;
2055         },
2056         'bpmn:TerminateEventDefinition': function(p, element) {
2057           var circle = drawCircle(p, element.width, element.height, 8, {
2058             strokeWidth: 4,
2059             fill: 'black'
2060           });
2061
2062           return circle;
2063         },
2064         'bpmn:IntermediateEvent': function(p, element) {
2065           var outer = renderer('bpmn:Event')(p, element, {
2066             strokeWidth: 1
2067           });
2068           /* inner */
2069           drawCircle(p, element.width, element.height, INNER_OUTER_DIST, {
2070             strokeWidth: 1,
2071             fill: 'none'
2072           });
2073
2074           renderEventContent(element, p);
2075
2076           return outer;
2077         },
2078         'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
2079         'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
2080
2081         'bpmn:Activity': function(p, element, attrs) {
2082           return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
2083         },
2084
2085         'bpmn:Task': function(p, element, attrs) {
2086           var rect = renderer('bpmn:Activity')(p, element, attrs);
2087           renderEmbeddedLabel(p, element, 'center-middle');
2088           attachTaskMarkers(p, element);
2089           return rect;
2090         },
2091         'bpmn:ServiceTask': function(p, element) {
2092           var task = renderer('bpmn:Task')(p, element);
2093
2094           var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2095             abspos: {
2096               x: 12,
2097               y: 18
2098             }
2099           });
2100
2101           /* service bg */
2102           drawPath(p, pathDataBG, {
2103             strokeWidth: 1,
2104             fill: 'none'
2105           });
2106
2107           var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
2108             abspos: {
2109               x: 17.2,
2110               y: 18
2111             }
2112           });
2113
2114           /* service fill */
2115           drawPath(p, fillPathData, {
2116             strokeWidth: 0,
2117             stroke: 'none',
2118             fill: 'white'
2119           });
2120
2121           var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2122             abspos: {
2123               x: 17,
2124               y: 22
2125             }
2126           });
2127
2128           /* service */
2129           drawPath(p, pathData, {
2130             strokeWidth: 1,
2131             fill: 'white'
2132           });
2133
2134           return task;
2135         },
2136         'bpmn:UserTask': function(p, element) {
2137           var task = renderer('bpmn:Task')(p, element);
2138
2139           var x = 15;
2140           var y = 12;
2141
2142           var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
2143             abspos: {
2144               x: x,
2145               y: y
2146             }
2147           });
2148
2149           /* user path */
2150           drawPath(p, pathData, {
2151             strokeWidth: 0.5,
2152             fill: 'none'
2153           });
2154
2155           var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
2156             abspos: {
2157               x: x,
2158               y: y
2159             }
2160           });
2161
2162           /* user2 path */
2163           drawPath(p, pathData2, {
2164             strokeWidth: 0.5,
2165             fill: 'none'
2166           });
2167
2168           var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
2169             abspos: {
2170               x: x,
2171               y: y
2172             }
2173           });
2174
2175           /* user3 path */
2176           drawPath(p, pathData3, {
2177             strokeWidth: 0.5,
2178             fill: 'black'
2179           });
2180
2181           return task;
2182         },
2183         'bpmn:ManualTask': function(p, element) {
2184           var task = renderer('bpmn:Task')(p, element);
2185
2186           var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
2187             abspos: {
2188               x: 17,
2189               y: 15
2190             }
2191           });
2192
2193           /* manual path */
2194           drawPath(p, pathData, {
2195             strokeWidth: 0.25,
2196             fill: 'white',
2197             stroke: 'black'
2198           });
2199
2200           return task;
2201         },
2202         'bpmn:SendTask': function(p, element) {
2203           var task = renderer('bpmn:Task')(p, element);
2204
2205           var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2206             xScaleFactor: 1,
2207             yScaleFactor: 1,
2208             containerWidth: 21,
2209             containerHeight: 14,
2210             position: {
2211               mx: 0.285,
2212               my: 0.357
2213             }
2214           });
2215
2216           /* send path */
2217           drawPath(p, pathData, {
2218             strokeWidth: 1,
2219             fill: 'black',
2220             stroke: 'white'
2221           });
2222
2223           return task;
2224         },
2225         'bpmn:ReceiveTask': function(p, element) {
2226           var semantic = getSemantic(element);
2227
2228           var task = renderer('bpmn:Task')(p, element);
2229           var pathData;
2230
2231           if (semantic.instantiate) {
2232             drawCircle(p, 28, 28, 20 * 0.22, {
2233               strokeWidth: 1
2234             });
2235
2236             pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
2237               abspos: {
2238                 x: 7.77,
2239                 y: 9.52
2240               }
2241             });
2242           } else {
2243
2244             pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2245               xScaleFactor: 0.9,
2246               yScaleFactor: 0.9,
2247               containerWidth: 21,
2248               containerHeight: 14,
2249               position: {
2250                 mx: 0.3,
2251                 my: 0.4
2252               }
2253             });
2254           }
2255
2256           /* receive path */
2257           drawPath(p, pathData, {
2258             strokeWidth: 1
2259           });
2260
2261           return task;
2262         },
2263         'bpmn:ScriptTask': function(p, element) {
2264           var task = renderer('bpmn:Task')(p, element);
2265
2266           var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
2267             abspos: {
2268               x: 15,
2269               y: 20
2270             }
2271           });
2272
2273           /* script path */
2274           drawPath(p, pathData, {
2275             strokeWidth: 1
2276           });
2277
2278           return task;
2279         },
2280         'bpmn:BusinessRuleTask': function(p, element) {
2281           var task = renderer('bpmn:Task')(p, element);
2282
2283           var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
2284             abspos: {
2285               x: 8,
2286               y: 8
2287             }
2288           });
2289
2290           var businessHeaderPath = drawPath(p, headerPathData);
2291           businessHeaderPath.attr({
2292             strokeWidth: 1,
2293             fill: 'AAA'
2294           });
2295
2296           var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
2297             abspos: {
2298               x: 8,
2299               y: 8
2300             }
2301           });
2302
2303           var businessPath = drawPath(p, headerData);
2304           businessPath.attr({
2305             strokeWidth: 1
2306           });
2307
2308           return task;
2309         },
2310         'bpmn:SubProcess': function(p, element, attrs) {
2311           var rect = renderer('bpmn:Activity')(p, element, attrs);
2312
2313           var semantic = getSemantic(element);
2314
2315           var expanded = DiUtil.isExpanded(semantic);
2316
2317           var isEventSubProcess = !!semantic.triggeredByEvent;
2318           if (isEventSubProcess) {
2319             rect.attr({
2320               strokeDasharray: '1,2'
2321             });
2322           }
2323
2324           renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
2325
2326           if (expanded) {
2327             attachTaskMarkers(p, element);
2328           } else {
2329             attachTaskMarkers(p, element, ['SubProcessMarker']);
2330           }
2331
2332           return rect;
2333         },
2334         'bpmn:AdHocSubProcess': function(p, element) {
2335           return renderer('bpmn:SubProcess')(p, element);
2336         },
2337         'bpmn:Transaction': function(p, element) {
2338           var outer = renderer('bpmn:SubProcess')(p, element);
2339
2340           var innerAttrs = styles.style(['no-fill', 'no-events']);
2341
2342           /* inner path */
2343           drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
2344
2345           return outer;
2346         },
2347         'bpmn:CallActivity': function(p, element) {
2348           return renderer('bpmn:Task')(p, element, {
2349             strokeWidth: 5
2350           });
2351         },
2352         'bpmn:Participant': function(p, element) {
2353
2354           var lane = renderer('bpmn:Lane')(p, element, {
2355             fill: 'White'
2356           });
2357
2358           var expandedPool = DiUtil.isExpanded(element);
2359
2360           if (expandedPool) {
2361             drawLine(p, [{
2362               x: 30,
2363               y: 0
2364             }, {
2365               x: 30,
2366               y: element.height
2367             }]);
2368             var text = getSemantic(element).name;
2369             renderLaneLabel(p, text, element);
2370           } else {
2371             // Collapsed pool draw text inline
2372             var text2 = getSemantic(element).name;
2373             renderLabel(p, text2, {
2374               box: element,
2375               align: 'center-middle'
2376             });
2377           }
2378
2379           var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
2380
2381           if (participantMultiplicity) {
2382             renderer('ParticipantMultiplicityMarker')(p, element);
2383           }
2384
2385           return lane;
2386         },
2387         'bpmn:Lane': function(p, element, attrs) {
2388           var rect = drawRect(p, element.width, element.height, 0, attrs || {
2389             fill: 'none'
2390           });
2391
2392           var semantic = getSemantic(element);
2393
2394           if (semantic.$type === 'bpmn:Lane') {
2395             var text = semantic.name;
2396             renderLaneLabel(p, text, element);
2397           }
2398
2399           return rect;
2400         },
2401         'bpmn:InclusiveGateway': function(p, element) {
2402           var diamond = drawDiamond(p, element.width, element.height);
2403
2404           /* circle path */
2405           drawCircle(p, element.width, element.height, element.height * 0.24, {
2406             strokeWidth: 2.5,
2407             fill: 'none'
2408           });
2409
2410           return diamond;
2411         },
2412         'bpmn:ExclusiveGateway': function(p, element) {
2413           var diamond = drawDiamond(p, element.width, element.height);
2414           renderEmbeddedLabel(p, element, 'center-middle');
2415
2416           var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
2417             xScaleFactor: 0.4,
2418             yScaleFactor: 0.4,
2419             containerWidth: element.width,
2420             containerHeight: element.height,
2421             position: {
2422               mx: 0.32,
2423               my: 0.3
2424             }
2425           });
2426
2427           if (!!(getDi(element).isMarkerVisible)) {
2428             drawPath(p, pathData, {
2429               strokeWidth: 1,
2430               fill: 'black'
2431             });
2432           }
2433
2434           return diamond;
2435         },
2436         'bpmn:ComplexGateway': function(p, element) {
2437           var diamond = drawDiamond(p, element.width, element.height);
2438
2439           var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
2440             xScaleFactor: 0.5,
2441             yScaleFactor: 0.5,
2442             containerWidth: element.width,
2443             containerHeight: element.height,
2444             position: {
2445               mx: 0.46,
2446               my: 0.26
2447             }
2448           });
2449
2450           /* complex path */
2451           drawPath(p, pathData, {
2452             strokeWidth: 1,
2453             fill: 'black'
2454           });
2455
2456           return diamond;
2457         },
2458         'bpmn:ParallelGateway': function(p, element) {
2459           var diamond = drawDiamond(p, element.width, element.height);
2460
2461           var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2462             xScaleFactor: 0.6,
2463             yScaleFactor: 0.6,
2464             containerWidth: element.width,
2465             containerHeight: element.height,
2466             position: {
2467               mx: 0.46,
2468               my: 0.2
2469             }
2470           });
2471
2472           /* parallel path */
2473           drawPath(p, pathData, {
2474             strokeWidth: 1,
2475             fill: 'black'
2476           });
2477
2478           return diamond;
2479         },
2480         'bpmn:EventBasedGateway': function(p, element) {
2481
2482           var semantic = getSemantic(element);
2483
2484           var diamond = drawDiamond(p, element.width, element.height);
2485
2486           /* outer circle path */
2487           drawCircle(p, element.width, element.height, element.height * 0.20, {
2488             strokeWidth: 1,
2489             fill: 'none'
2490           });
2491
2492           var type = semantic.eventGatewayType;
2493           var instantiate = !!semantic.instantiate;
2494
2495           function drawEvent() {
2496
2497             var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
2498               xScaleFactor: 0.18,
2499               yScaleFactor: 0.18,
2500               containerWidth: element.width,
2501               containerHeight: element.height,
2502               position: {
2503                 mx: 0.36,
2504                 my: 0.44
2505               }
2506             });
2507
2508             /* event path */
2509             drawPath(p, pathData, {
2510               strokeWidth: 2,
2511               fill: 'none'
2512             });
2513           }
2514
2515           if (type === 'Parallel') {
2516
2517             var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2518               xScaleFactor: 0.4,
2519               yScaleFactor: 0.4,
2520               containerWidth: element.width,
2521               containerHeight: element.height,
2522               position: {
2523                 mx: 0.474,
2524                 my: 0.296
2525               }
2526             });
2527
2528             var parallelPath = drawPath(p, pathData);
2529             parallelPath.attr({
2530               strokeWidth: 1,
2531               fill: 'none'
2532             });
2533           } else if (type === 'Exclusive') {
2534
2535             if (!instantiate) {
2536               var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
2537               innerCircle.attr({
2538                 strokeWidth: 1,
2539                 fill: 'none'
2540               });
2541             }
2542
2543             drawEvent();
2544           }
2545
2546
2547           return diamond;
2548         },
2549         'bpmn:Gateway': function(p, element) {
2550           var diamond = drawDiamond(p, element.width, element.height);
2551           renderEmbeddedLabel(p, element, 'center-middle');
2552
2553           return diamond;
2554         },
2555         'bpmn:SequenceFlow': function(p, element) {
2556           var pathData = createPathFromConnection(element);
2557           var path = drawPath(p, pathData, {
2558             strokeLinejoin: 'round',
2559             markerEnd: marker('sequenceflow-end')
2560           });
2561
2562           var sequenceFlow = getSemantic(element);
2563           var source = element.source.businessObject;
2564
2565           // conditional flow marker
2566           if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
2567             path.attr({
2568               markerStart: marker('conditional-flow-marker')
2569             });
2570           }
2571
2572           // default marker
2573           if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
2574             path.attr({
2575               markerStart: marker('conditional-default-flow-marker')
2576             });
2577           }
2578
2579           return path;
2580         },
2581         'bpmn:Association': function(p, element, attrs) {
2582
2583           attrs = assign({
2584             strokeDasharray: '1,6',
2585             strokeLinecap: 'round',
2586             strokeLinejoin: 'round'
2587           }, attrs || {});
2588
2589           // TODO(nre): style according to directed state
2590           return drawLine(p, element.waypoints, attrs);
2591         },
2592         'bpmn:DataInputAssociation': function(p, element) {
2593           return renderer('bpmn:Association')(p, element, {
2594             markerEnd: marker('data-association-end')
2595           });
2596         },
2597         'bpmn:DataOutputAssociation': function(p, element) {
2598           return renderer('bpmn:Association')(p, element, {
2599             markerEnd: marker('data-association-end')
2600           });
2601         },
2602         'bpmn:MessageFlow': function(p, element) {
2603
2604           var semantic = getSemantic(element),
2605             di = getDi(element);
2606
2607           var pathData = createPathFromConnection(element);
2608           var path = drawPath(p, pathData, {
2609             markerEnd: marker('messageflow-end'),
2610             markerStart: marker('messageflow-start'),
2611             strokeDasharray: '10, 12',
2612             strokeLinecap: 'round',
2613             strokeLinejoin: 'round',
2614             strokeWidth: '1.5px'
2615           });
2616
2617           if (semantic.messageRef) {
2618             var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
2619
2620             var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
2621               abspos: {
2622                 x: midPoint.x,
2623                 y: midPoint.y
2624               }
2625             });
2626
2627             var messageAttrs = {
2628               strokeWidth: 1
2629             };
2630
2631             if (di.messageVisibleKind === 'initiating') {
2632               messageAttrs.fill = 'white';
2633               messageAttrs.stroke = 'black';
2634             } else {
2635               messageAttrs.fill = '#888';
2636               messageAttrs.stroke = 'white';
2637             }
2638
2639             drawPath(p, markerPathData, messageAttrs);
2640           }
2641
2642           return path;
2643         },
2644         'bpmn:DataObject': function(p, element) {
2645           var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
2646             xScaleFactor: 1,
2647             yScaleFactor: 1,
2648             containerWidth: element.width,
2649             containerHeight: element.height,
2650             position: {
2651               mx: 0.474,
2652               my: 0.296
2653             }
2654           });
2655
2656           var elementObject = drawPath(p, pathData, {
2657             fill: 'white'
2658           });
2659
2660           var semantic = getSemantic(element);
2661
2662           if (isCollection(semantic)) {
2663             renderDataItemCollection(p, element);
2664           }
2665
2666           return elementObject;
2667         },
2668         'bpmn:DataObjectReference': as('bpmn:DataObject'),
2669         'bpmn:DataInput': function(p, element) {
2670
2671           var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2672
2673           // page
2674           var elementObject = renderer('bpmn:DataObject')(p, element);
2675
2676           /* input arrow path */
2677           drawPath(p, arrowPathData, {
2678             strokeWidth: 1
2679           });
2680
2681           return elementObject;
2682         },
2683         'bpmn:DataOutput': function(p, element) {
2684           var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2685
2686           // page
2687           var elementObject = renderer('bpmn:DataObject')(p, element);
2688
2689           /* output arrow path */
2690           drawPath(p, arrowPathData, {
2691             strokeWidth: 1,
2692             fill: 'black'
2693           });
2694
2695           return elementObject;
2696         },
2697         'bpmn:DataStoreReference': function(p, element) {
2698           var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
2699             xScaleFactor: 1,
2700             yScaleFactor: 1,
2701             containerWidth: element.width,
2702             containerHeight: element.height,
2703             position: {
2704               mx: 0,
2705               my: 0.133
2706             }
2707           });
2708
2709           var elementStore = drawPath(p, DATA_STORE_PATH, {
2710             strokeWidth: 2,
2711             fill: 'white'
2712           });
2713
2714           return elementStore;
2715         },
2716         'bpmn:BoundaryEvent': function(p, element) {
2717
2718           var semantic = getSemantic(element),
2719             cancel = semantic.cancelActivity;
2720
2721           var attrs = {
2722             strokeLinecap: 'round',
2723             strokeWidth: 1
2724           };
2725
2726           if (!cancel) {
2727             attrs.strokeDasharray = '6';
2728           }
2729
2730           var outer = renderer('bpmn:Event')(p, element, attrs);
2731           /* inner path */
2732           drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
2733
2734           renderEventContent(element, p);
2735
2736           return outer;
2737         },
2738         'bpmn:Group': function(p, element) {
2739           return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
2740             strokeWidth: 1,
2741             strokeDasharray: '8,3,1,3',
2742             fill: 'none',
2743             pointerEvents: 'none'
2744           });
2745         },
2746         'label': function(p, element) {
2747           return renderExternalLabel(p, element, '');
2748         },
2749         'bpmn:TextAnnotation': function(p, element) {
2750           var style = {
2751             'fill': 'none',
2752             'stroke': 'none'
2753           };
2754           var textElement = drawRect(p, element.width, element.height, 0, 0, style);
2755           var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
2756             xScaleFactor: 1,
2757             yScaleFactor: 1,
2758             containerWidth: element.width,
2759             containerHeight: element.height,
2760             position: {
2761               mx: 0.0,
2762               my: 0.0
2763             }
2764           });
2765           drawPath(p, textPathData);
2766
2767           var text = getSemantic(element).text || '';
2768           renderLabel(p, text, {
2769             box: element,
2770             align: 'left-middle',
2771             padding: 5
2772           });
2773
2774           return textElement;
2775         },
2776         'ParticipantMultiplicityMarker': function(p, element) {
2777           var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2778             xScaleFactor: 1,
2779             yScaleFactor: 1,
2780             containerWidth: element.width,
2781             containerHeight: element.height,
2782             position: {
2783               mx: ((element.width / 2) / element.width),
2784               my: (element.height - 15) / element.height
2785             }
2786           });
2787
2788           drawPath(p, subProcessPath);
2789         },
2790         'SubProcessMarker': function(p, element) {
2791           var markerRect = drawRect(p, 14, 14, 0, {
2792             strokeWidth: 1
2793           });
2794
2795           // Process marker is placed in the middle of the box
2796           // therefore fixed values can be used here
2797           markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
2798
2799           var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
2800             xScaleFactor: 1.5,
2801             yScaleFactor: 1.5,
2802             containerWidth: element.width,
2803             containerHeight: element.height,
2804             position: {
2805               mx: (element.width / 2 - 7.5) / element.width,
2806               my: (element.height - 20) / element.height
2807             }
2808           });
2809
2810           drawPath(p, subProcessPath);
2811         },
2812         'ParallelMarker': function(p, element, position) {
2813           var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2814             xScaleFactor: 1,
2815             yScaleFactor: 1,
2816             containerWidth: element.width,
2817             containerHeight: element.height,
2818             position: {
2819               mx: ((element.width / 2 + position.parallel) / element.width),
2820               my: (element.height - 20) / element.height
2821             }
2822           });
2823           drawPath(p, subProcessPath);
2824         },
2825         'SequentialMarker': function(p, element, position) {
2826           var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
2827             xScaleFactor: 1,
2828             yScaleFactor: 1,
2829             containerWidth: element.width,
2830             containerHeight: element.height,
2831             position: {
2832               mx: ((element.width / 2 + position.seq) / element.width),
2833               my: (element.height - 19) / element.height
2834             }
2835           });
2836           drawPath(p, sequentialPath);
2837         },
2838         'CompensationMarker': function(p, element, position) {
2839           var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
2840             xScaleFactor: 1,
2841             yScaleFactor: 1,
2842             containerWidth: element.width,
2843             containerHeight: element.height,
2844             position: {
2845               mx: ((element.width / 2 + position.compensation) / element.width),
2846               my: (element.height - 13) / element.height
2847             }
2848           });
2849           drawPath(p, compensationPath, {
2850             strokeWidth: 1
2851           });
2852         },
2853         'LoopMarker': function(p, element, position) {
2854           var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
2855             xScaleFactor: 1,
2856             yScaleFactor: 1,
2857             containerWidth: element.width,
2858             containerHeight: element.height,
2859             position: {
2860               mx: ((element.width / 2 + position.loop) / element.width),
2861               my: (element.height - 7) / element.height
2862             }
2863           });
2864
2865           drawPath(p, loopPath, {
2866             strokeWidth: 1,
2867             fill: 'none',
2868             strokeLinecap: 'round',
2869             strokeMiterlimit: 0.5
2870           });
2871         },
2872         'AdhocMarker': function(p, element, position) {
2873           var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
2874             xScaleFactor: 1,
2875             yScaleFactor: 1,
2876             containerWidth: element.width,
2877             containerHeight: element.height,
2878             position: {
2879               mx: ((element.width / 2 + position.adhoc) / element.width),
2880               my: (element.height - 15) / element.height
2881             }
2882           });
2883
2884           drawPath(p, loopPath, {
2885             strokeWidth: 1,
2886             fill: 'black'
2887           });
2888         }
2889       };
2890
2891       function attachTaskMarkers(p, element, taskMarkers) {
2892         var obj = getSemantic(element);
2893
2894         var subprocess = includes(taskMarkers, 'SubProcessMarker');
2895         var position;
2896
2897         if (subprocess) {
2898           position = {
2899             seq: -21,
2900             parallel: -22,
2901             compensation: -42,
2902             loop: -18,
2903             adhoc: 10
2904           };
2905         } else {
2906           position = {
2907             seq: -3,
2908             parallel: -6,
2909             compensation: -27,
2910             loop: 0,
2911             adhoc: 10
2912           };
2913         }
2914
2915         forEach(taskMarkers, function(marker) {
2916           renderer(marker)(p, element, position);
2917         });
2918
2919         if (obj.$type === 'bpmn:AdHocSubProcess') {
2920           renderer('AdhocMarker')(p, element, position);
2921         }
2922         if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
2923           renderer('LoopMarker')(p, element, position);
2924           return;
2925         }
2926         if (obj.loopCharacteristics &&
2927           obj.loopCharacteristics.isSequential !== undefined &&
2928           !obj.loopCharacteristics.isSequential) {
2929           renderer('ParallelMarker')(p, element, position);
2930         }
2931         if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
2932           renderer('SequentialMarker')(p, element, position);
2933         }
2934         if (!!obj.isForCompensation) {
2935           renderer('CompensationMarker')(p, element, position);
2936         }
2937       }
2938
2939       function drawShape(parent, element) {
2940         var type = element.type;
2941         var h = handlers[type];
2942
2943         /* jshint -W040 */
2944         if (!h) {
2945           return DefaultRenderer.prototype.drawShape.apply(this, [parent, element]);
2946         } else {
2947           return h(parent, element);
2948         }
2949       }
2950
2951       function drawConnection(parent, element) {
2952         var type = element.type;
2953         var h = handlers[type];
2954
2955         /* jshint -W040 */
2956         if (!h) {
2957           return DefaultRenderer.prototype.drawConnection.apply(this, [parent, element]);
2958         } else {
2959           return h(parent, element);
2960         }
2961       }
2962
2963       function renderDataItemCollection(p, element) {
2964
2965         var yPosition = (element.height - 16) / element.height;
2966
2967         var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
2968           xScaleFactor: 1,
2969           yScaleFactor: 1,
2970           containerWidth: element.width,
2971           containerHeight: element.height,
2972           position: {
2973             mx: 0.451,
2974             my: yPosition
2975           }
2976         });
2977
2978         /* collection path */
2979         drawPath(p, pathData, {
2980           strokeWidth: 2
2981         });
2982       }
2983
2984       function isCollection(element, filter) {
2985         return element.isCollection ||
2986           (element.elementObjectRef && element.elementObjectRef.isCollection);
2987       }
2988
2989       function getDi(element) {
2990         return element.businessObject.di;
2991       }
2992
2993       function getSemantic(element) {
2994         return element.businessObject;
2995       }
2996
2997       /**
2998        * Checks if eventDefinition of the given element matches with semantic
2999        * type.
3000        *
3001        * @return {boolean} true if element is of the given semantic type
3002        */
3003       function isTypedEvent(event, eventDefinitionType, filter) {
3004
3005         function matches(definition, filter) {
3006           return every(filter, function(val, key) {
3007
3008             // we want a == conversion here, to be able to catch
3009             // undefined == false and friends
3010             /* jshint -W116 */
3011             return definition[key] == val;
3012           });
3013         }
3014
3015         return some(event.eventDefinitions, function(definition) {
3016           return definition.$type === eventDefinitionType && matches(event, filter);
3017         });
3018       }
3019
3020       function isThrowEvent(event) {
3021         return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
3022       }
3023
3024
3025       // ///// cropping path customizations /////////////////////////
3026
3027       function componentsToPath(elements) {
3028         return elements.join(',').replace(/,?([A-z]),?/g, '$1');
3029       }
3030
3031       function getCirclePath(shape) {
3032
3033         var cx = shape.x + shape.width / 2,
3034           cy = shape.y + shape.height / 2,
3035           radius = shape.width / 2;
3036
3037         var circlePath = [
3038           ['M', cx, cy],
3039           ['m', 0, -radius],
3040           ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
3041           ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
3042           ['z']
3043         ];
3044
3045         return componentsToPath(circlePath);
3046       }
3047
3048       function getRoundRectPath(shape) {
3049
3050         var radius = TASK_BORDER_RADIUS,
3051           x = shape.x,
3052           y = shape.y,
3053           width = shape.width,
3054           height = shape.height;
3055
3056         var roundRectPath = [
3057           ['M', x + radius, y],
3058           ['l', width - radius * 2, 0],
3059           ['a', radius, radius, 0, 0, 1, radius, radius],
3060           ['l', 0, height - radius * 2],
3061           ['a', radius, radius, 0, 0, 1, -radius, radius],
3062           ['l', radius * 2 - width, 0],
3063           ['a', radius, radius, 0, 0, 1, -radius, -radius],
3064           ['l', 0, radius * 2 - height],
3065           ['a', radius, radius, 0, 0, 1, radius, -radius],
3066           ['z']
3067         ];
3068
3069         return componentsToPath(roundRectPath);
3070       }
3071
3072       function getDiamondPath(shape) {
3073
3074         var width = shape.width,
3075           height = shape.height,
3076           x = shape.x,
3077           y = shape.y,
3078           halfWidth = width / 2,
3079           halfHeight = height / 2;
3080
3081         var diamondPath = [
3082           ['M', x + halfWidth, y],
3083           ['l', halfWidth, halfHeight],
3084           ['l', -halfWidth, halfHeight],
3085           ['l', -halfWidth, -halfHeight],
3086           ['z']
3087         ];
3088
3089         return componentsToPath(diamondPath);
3090       }
3091
3092       function getRectPath(shape) {
3093         var x = shape.x,
3094           y = shape.y,
3095           width = shape.width,
3096           height = shape.height;
3097
3098         var rectPath = [
3099           ['M', x, y],
3100           ['l', width, 0],
3101           ['l', 0, height],
3102           ['l', -width, 0],
3103           ['z']
3104         ];
3105
3106         return componentsToPath(rectPath);
3107       }
3108
3109       function getShapePath(element) {
3110         var obj = getSemantic(element);
3111
3112         if (obj.$instanceOf('bpmn:Event')) {
3113           return getCirclePath(element);
3114         }
3115
3116         if (obj.$instanceOf('bpmn:Activity')) {
3117           return getRoundRectPath(element);
3118         }
3119
3120         if (obj.$instanceOf('bpmn:Gateway')) {
3121           return getDiamondPath(element);
3122         }
3123
3124         return getRectPath(element);
3125       }
3126
3127
3128       // hook onto canvas init event to initialize
3129       // connection start/end markers on svg
3130       events.on('canvas.init', function(event) {
3131         initMarkers(event.svg);
3132       });
3133
3134       this.drawShape = drawShape;
3135       this.drawConnection = drawConnection;
3136
3137       this.getShapePath = getShapePath;
3138     }
3139
3140     inherits(BpmnRenderer, DefaultRenderer);
3141
3142
3143     BpmnRenderer.$inject = ['eventBus', 'styles', 'pathMap'];
3144
3145     module.exports = BpmnRenderer;
3146
3147   }, {
3148     "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
3149     "diagram-js/lib/draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
3150     "diagram-js/lib/util/Text": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js",
3151     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
3152     "lodash/collection/every": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js",
3153     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3154     "lodash/collection/includes": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js",
3155     "lodash/collection/some": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js",
3156     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
3157     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
3158     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3159   }],
3160   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js": [function(require, module, exports) {
3161     'use strict';
3162
3163     var Snap = require('diagram-js/vendor/snapsvg');
3164
3165     /**
3166      * Map containing SVG paths needed by BpmnRenderer.
3167      */
3168
3169     function PathMap() {
3170
3171       /**
3172        * Contains a map of path elements
3173        *
3174        * <h1>Path definition</h1>
3175        * A parameterized path is defined like this:
3176        *
3177        * <pre>
3178        * 'GATEWAY_PARALLEL': {
3179        *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3180        *           '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3181        *   height: 17.5,
3182        *   width:  17.5,
3183        *   heightElements: [2.5, 7.5],
3184        *   widthElements: [2.5, 7.5]
3185        * }
3186        * </pre>
3187        *
3188        * <p>
3189        * It's important to specify a correct <b>height and width</b> for the path
3190        * as the scaling is based on the ratio between the specified height and
3191        * width in this object and the height and width that is set as scale target
3192        * (Note x,y coordinates will be scaled with individual ratios).
3193        * </p>
3194        * <p>
3195        * The '<b>heightElements</b>' and '<b>widthElements</b>' array must
3196        * contain the values that will be scaled. The scaling is based on the
3197        * computed ratios. Coordinates on the y axis should be in the
3198        * <b>heightElement</b>'s array, they will be scaled using the computed
3199        * ratio coefficient. In the parameterized path the scaled values can be
3200        * accessed through the 'e' object in {} brackets.
3201        * <ul>
3202        * <li>The values for the y axis can be accessed in the path string using
3203        * {e.y0}, {e.y1}, ....</li>
3204        * <li>The values for the x axis can be accessed in the path string using
3205        * {e.x0}, {e.x1}, ....</li>
3206        * </ul>
3207        * The numbers x0, x1 respectively y0, y1, ... map to the corresponding
3208        * array index.
3209        * </p>
3210        */
3211       this.pathMap = {
3212         'EVENT_MESSAGE': {
3213           d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
3214           height: 36,
3215           width: 36,
3216           heightElements: [6, 14],
3217           widthElements: [10.5, 21]
3218         },
3219         'EVENT_SIGNAL': {
3220           d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
3221           height: 36,
3222           width: 36,
3223           heightElements: [18],
3224           widthElements: [10, 20]
3225         },
3226         'EVENT_ESCALATION': {
3227           d: 'm {mx},{my} c -{e.x1},{e.y0} -{e.x3},{e.y1} -{e.x5},{e.y4} {e.x1},-{e.y3} {e.x3},-{e.y5} {e.x5},-{e.y6} ' +
3228             '{e.x0},{e.y3} {e.x2},{e.y5} {e.x4},{e.y6} -{e.x0},-{e.y0} -{e.x2},-{e.y1} -{e.x4},-{e.y4} z',
3229           height: 36,
3230           width: 36,
3231           heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
3232           widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
3233         },
3234         'EVENT_CONDITIONAL': {
3235           d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
3236             'M {e.x2},{e.y3} l {e.x0},0 ' +
3237             'M {e.x2},{e.y4} l {e.x0},0 ' +
3238             'M {e.x2},{e.y5} l {e.x0},0 ' +
3239             'M {e.x2},{e.y6} l {e.x0},0 ' +
3240             'M {e.x2},{e.y7} l {e.x0},0 ' +
3241             'M {e.x2},{e.y8} l {e.x0},0 ',
3242           height: 36,
3243           width: 36,
3244           heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
3245           widthElements: [10.5, 14.5, 12.5]
3246         },
3247         'EVENT_LINK': {
3248           d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
3249           height: 36,
3250           width: 36,
3251           heightElements: [4.4375, 6.75, 7.8125],
3252           widthElements: [9.84375, 13.5]
3253         },
3254         'EVENT_ERROR': {
3255           d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z',
3256           height: 36,
3257           width: 36,
3258           heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
3259           widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
3260         },
3261         'EVENT_CANCEL_45': {
3262           d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3263             '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3264           height: 36,
3265           width: 36,
3266           heightElements: [4.75, 8.5],
3267           widthElements: [4.75, 8.5]
3268         },
3269         'EVENT_COMPENSATION': {
3270           d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
3271           height: 36,
3272           width: 36,
3273           heightElements: [5, 10],
3274           widthElements: [10]
3275         },
3276         'EVENT_TIMER_WH': {
3277           d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
3278           height: 36,
3279           width: 36,
3280           heightElements: [10, 2],
3281           widthElements: [3, 7]
3282         },
3283         'EVENT_TIMER_LINE': {
3284           d: 'M {mx},{my} ' +
3285             'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
3286           height: 36,
3287           width: 36,
3288           heightElements: [10, 3],
3289           widthElements: [0, 0]
3290         },
3291         'EVENT_MULTIPLE': {
3292           d: 'm {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
3293           height: 36,
3294           width: 36,
3295           heightElements: [6.28099, 12.56199],
3296           widthElements: [3.1405, 9.42149, 12.56198]
3297         },
3298         'EVENT_PARALLEL_MULTIPLE': {
3299           d: 'm {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3300             '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3301           height: 36,
3302           width: 36,
3303           heightElements: [2.56228, 7.68683],
3304           widthElements: [2.56228, 7.68683]
3305         },
3306         'GATEWAY_EXCLUSIVE': {
3307           d: 'm {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
3308             '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
3309             '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
3310           height: 17.5,
3311           width: 17.5,
3312           heightElements: [8.5, 6.5312, -6.5312, -8.5],
3313           widthElements: [6.5, -6.5, 3, -3, 5, -5]
3314         },
3315         'GATEWAY_PARALLEL': {
3316           d: 'm {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3317             '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3318           height: 30,
3319           width: 30,
3320           heightElements: [5, 12.5],
3321           widthElements: [5, 12.5]
3322         },
3323         'GATEWAY_EVENT_BASED': {
3324           d: 'm {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
3325           height: 11,
3326           width: 11,
3327           heightElements: [-6, 6, 12, -12],
3328           widthElements: [9, -3, -12]
3329         },
3330         'GATEWAY_COMPLEX': {
3331           d: 'm {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
3332             '{e.x2},0  -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} ' +
3333             '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
3334             '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
3335           height: 17.125,
3336           width: 17.125,
3337           heightElements: [4.875, 3.4375, 2.125, 3],
3338           widthElements: [3.4375, 2.125, 4.875, 3]
3339         },
3340         'DATA_OBJECT_PATH': {
3341           d: 'm 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
3342           height: 61,
3343           width: 51,
3344           heightElements: [10, 50, 60],
3345           widthElements: [10, 40, 50, 60]
3346         },
3347         'DATA_OBJECT_COLLECTION_PATH': {
3348           d: 'm {mx}, {my} ' +
3349             'm  0 15  l 0 -15 ' +
3350             'm  4 15  l 0 -15 ' +
3351             'm  4 15  l 0 -15 ',
3352           height: 61,
3353           width: 51,
3354           heightElements: [12],
3355           widthElements: [1, 6, 12, 15]
3356         },
3357         'DATA_ARROW': {
3358           d: 'm 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
3359           height: 61,
3360           width: 51,
3361           heightElements: [],
3362           widthElements: []
3363         },
3364         'DATA_STORE': {
3365           d: 'm  {mx},{my} ' +
3366             'l  0,{e.y2} ' +
3367             'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3368             'l  0,-{e.y2} ' +
3369             'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
3370             'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3371             'm  -{e.x2},{e.y0}' +
3372             'c  {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
3373             'm  -{e.x2},{e.y0}' +
3374             'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0',
3375           height: 61,
3376           width: 61,
3377           heightElements: [7, 10, 45],
3378           widthElements: [2, 58, 60]
3379         },
3380         'TEXT_ANNOTATION': {
3381           d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
3382           height: 30,
3383           width: 10,
3384           heightElements: [30],
3385           widthElements: [10]
3386         },
3387         'MARKER_SUB_PROCESS': {
3388           d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
3389           height: 10,
3390           width: 10,
3391           heightElements: [],
3392           widthElements: []
3393         },
3394         'MARKER_PARALLEL': {
3395           d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
3396           height: 10,
3397           width: 10,
3398           heightElements: [],
3399           widthElements: []
3400         },
3401         'MARKER_SEQUENTIAL': {
3402           d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
3403           height: 10,
3404           width: 10,
3405           heightElements: [],
3406           widthElements: []
3407         },
3408         'MARKER_COMPENSATION': {
3409           d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
3410           height: 10,
3411           width: 21,
3412           heightElements: [],
3413           widthElements: []
3414         },
3415         'MARKER_LOOP': {
3416           d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
3417             '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
3418             '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
3419             'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
3420           height: 13.9,
3421           width: 13.7,
3422           heightElements: [],
3423           widthElements: []
3424         },
3425         'MARKER_ADHOC': {
3426           d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 ' +
3427             '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
3428             '1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 ' +
3429             '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
3430             '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
3431           height: 4,
3432           width: 15,
3433           heightElements: [],
3434           widthElements: []
3435         },
3436         'TASK_TYPE_SEND': {
3437           d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
3438           height: 14,
3439           width: 21,
3440           heightElements: [6, 14],
3441           widthElements: [10.5, 21]
3442         },
3443         'TASK_TYPE_SCRIPT': {
3444           d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
3445             'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
3446             'm -7,-12 l 5,0 ' +
3447             'm -4.5,3 l 4.5,0 ' +
3448             'm -3,3 l 5,0' +
3449             'm -4,3 l 5,0',
3450           height: 15,
3451           width: 12.6,
3452           heightElements: [6, 14],
3453           widthElements: [10.5, 21]
3454         },
3455         'TASK_TYPE_USER_1': {
3456           d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
3457             '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
3458             '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
3459             'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
3460             'm -8,6 l 0,5.5 m 11,0 l 0,-5'
3461         },
3462         'TASK_TYPE_USER_2': {
3463           d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
3464             '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
3465         },
3466         'TASK_TYPE_USER_3': {
3467           d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
3468             '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
3469             '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
3470         },
3471         'TASK_TYPE_MANUAL': {
3472           d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 ' +
3473             '-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 ' +
3474             '0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 ' +
3475             '-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 ' +
3476             '0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
3477             '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
3478             '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
3479             '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
3480             '-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 ' +
3481             '-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 ' +
3482             '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
3483             '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
3484         },
3485         'TASK_TYPE_INSTANTIATING_SEND': {
3486           d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
3487         },
3488         'TASK_TYPE_SERVICE': {
3489           d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
3490             '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
3491             '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
3492             'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
3493             '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
3494             '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
3495             'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 ' +
3496             '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
3497             'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
3498             'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
3499             '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
3500             'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
3501             'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3502             '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3503             '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3504         },
3505         'TASK_TYPE_SERVICE_FILL': {
3506           d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3507             '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3508             '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3509         },
3510         'TASK_TYPE_BUSINESS_RULE_HEADER': {
3511           d: 'm {mx},{my} 0,4 20,0 0,-4 z'
3512         },
3513         'TASK_TYPE_BUSINESS_RULE_MAIN': {
3514           d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
3515             'm 0,8 l 20,0 ' +
3516             'm -13,-4 l 0,8'
3517         },
3518         'MESSAGE_FLOW_MARKER': {
3519           d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
3520         }
3521       };
3522
3523       this.getRawPath = function getRawPath(pathId) {
3524         return this.pathMap[pathId].d;
3525       };
3526
3527       /**
3528        * Scales the path to the given height and width.
3529        * <h1>Use case</h1>
3530        * <p>
3531        * Use case is to scale the content of elements (event, gateways) based on
3532        * the element bounding box's size.
3533        * </p>
3534        * <h1>Why not transform</h1>
3535        * <p>
3536        * Scaling a path with transform() will also scale the stroke and IE does
3537        * not support the option 'non-scaling-stroke' to prevent this. Also there
3538        * are use cases where only some parts of a path should be scaled.
3539        * </p>
3540        *
3541        * @param {String}
3542        *            pathId The ID of the path.
3543        * @param {Object}
3544        *            param
3545        *            <p>
3546        *            Example param object scales the path to 60% size of the
3547        *            container (data.width, data.height).
3548        *
3549        * <pre>
3550        * {
3551        *    xScaleFactor : 0.6,
3552        *    yScaleFactor : 0.6,
3553        *    containerWidth : data.width,
3554        *    containerHeight : data.height,
3555        *    position : {
3556        *      mx : 0.46,
3557        *      my : 0.2,
3558        *    }
3559        * }
3560        * </pre>
3561        *
3562        * <ul>
3563        *            <li>targetpathwidth = xScaleFactor * containerWidth</li>
3564        *            <li>targetpathheight = yScaleFactor * containerHeight</li>
3565        *            <li>Position is used to set the starting coordinate of the
3566        *            path. M is computed:
3567        *            <ul>
3568        *            <li>position.x * containerWidth</li>
3569        *            <li>position.y * containerHeight</li>
3570        *            </ul>
3571        *            Center of the container
3572        *
3573        * <pre>
3574        *  position: {
3575        *       mx: 0.5,
3576        *       my: 0.5,
3577        *     }
3578        * </pre>
3579        *
3580        * Upper left corner of the container
3581        *
3582        * <pre>
3583        *  position: {
3584        *       mx: 0.0,
3585        *       my: 0.0,
3586        *     }
3587        * </pre>
3588        *
3589        * </li>
3590        *            </ul>
3591        *            </p>
3592        *
3593        */
3594       this.getScaledPath = function getScaledPath(pathId, param) {
3595         var rawPath = this.pathMap[pathId];
3596
3597         // positioning
3598         // compute the start point of the path
3599         var mx, my;
3600
3601         if (!!param.abspos) {
3602           mx = param.abspos.x;
3603           my = param.abspos.y;
3604         } else {
3605           mx = param.containerWidth * param.position.mx;
3606           my = param.containerHeight * param.position.my;
3607         }
3608
3609         var coordinates = {}; // map for the scaled coordinates
3610         if (param.position) {
3611
3612           // path
3613           var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
3614           var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
3615
3616
3617           // Apply height ratio
3618           for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
3619             coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
3620           }
3621
3622           // Apply width ratio
3623           for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
3624             coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
3625           }
3626         }
3627
3628         // Apply value to raw path
3629         var path = Snap.format(
3630           rawPath.d, {
3631             mx: mx,
3632             my: my,
3633             e: coordinates
3634           }
3635         );
3636         return path;
3637       };
3638     }
3639
3640     module.exports = PathMap;
3641
3642   }, {
3643     "diagram-js/vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
3644   }],
3645   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js": [function(require, module, exports) {
3646     module.exports = {
3647       renderer: ['type', require('./BpmnRenderer')],
3648       pathMap: ['type', require('./PathMap')]
3649     };
3650   }, {
3651     "./BpmnRenderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js",
3652     "./PathMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js"
3653   }],
3654   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js": [function(require, module, exports) {
3655     'use strict';
3656
3657
3658     var assign = require('lodash/object/assign'),
3659       forEach = require('lodash/collection/forEach');
3660
3661
3662     /**
3663      * A provider for BPMN 2.0 elements context pad
3664      */
3665     function ContextPadProvider(contextPad, modeling, elementFactory,
3666       connect, create, bpmnReplace,
3667       canvas) {
3668
3669       contextPad.registerProvider(this);
3670
3671       this._contextPad = contextPad;
3672
3673       this._modeling = modeling;
3674
3675       this._elementFactory = elementFactory;
3676       this._connect = connect;
3677       this._create = create;
3678       this._bpmnReplace = bpmnReplace;
3679       this._canvas = canvas;
3680     }
3681
3682     ContextPadProvider.$inject = [
3683       'contextPad',
3684       'modeling',
3685       'elementFactory',
3686       'connect',
3687       'create',
3688       'bpmnReplace',
3689       'canvas'
3690     ];
3691
3692     ContextPadProvider.prototype.getContextPadEntries = function(element) {
3693
3694       var contextPad = this._contextPad,
3695         modeling = this._modeling,
3696
3697         elementFactory = this._elementFactory,
3698         connect = this._connect,
3699         create = this._create,
3700         bpmnReplace = this._bpmnReplace,
3701         canvas = this._canvas;
3702
3703       var actions = {};
3704
3705       if (element.type === 'label') {
3706         return actions;
3707       }
3708
3709       var bpmnElement = element.businessObject;
3710
3711       function startConnect(event, element, autoActivate) {
3712         connect.start(event, element, autoActivate);
3713       }
3714
3715       function removeElement(e) {
3716         console.log(e);
3717         if (element.waypoints) {
3718           modeling.removeConnection(element);
3719         } else {
3720           modeling.removeShape(element);
3721
3722         }
3723         if (element.id == selected_decison_element) {
3724
3725           invisiblepropertyExplorer();
3726         }
3727       }
3728
3729       function getReplaceMenuPosition(element) {
3730
3731         var Y_OFFSET = 5;
3732
3733         var diagramContainer = canvas.getContainer(),
3734           pad = contextPad.getPad(element).html;
3735
3736         var diagramRect = diagramContainer.getBoundingClientRect(),
3737           padRect = pad.getBoundingClientRect();
3738
3739         var top = padRect.top - diagramRect.top;
3740         var left = padRect.left - diagramRect.left;
3741
3742         var pos = {
3743           x: left,
3744           y: top + padRect.height + Y_OFFSET
3745         };
3746
3747         return pos;
3748       }
3749
3750
3751       var change_color = function(par1, par2) {
3752         if (isImportSchema == true) {
3753
3754           return par2 /*'define-schema'*/ ;
3755         } else {
3756           return par1 /*'define-modify-schema'*/ ;
3757         }
3758       }
3759
3760       function appendAction(type, className, options) {
3761
3762         function appendListener(event, element) {
3763
3764           var shape = elementFactory.createShape(assign({
3765             type: type
3766           }, options));
3767           create.start(event, shape, element);
3768         }
3769
3770         var shortType = type.replace(/^bpmn\:/, '');
3771
3772         return {
3773           group: 'model',
3774           className: className,
3775           title: 'Append ' + shortType,
3776           action: {
3777             dragstart: appendListener,
3778             click: appendListener
3779           }
3780         };
3781       }
3782
3783
3784       if (bpmnElement.$instanceOf('bpmn:Gateway') || bpmnElement.$instanceOf('bpmn:MultiBranchConnector')) {
3785         assign(actions, {
3786           'define-path': {
3787             group: 'DefinePath',
3788             className: 'define-path',
3789             title: 'Define/View Path',
3790             action: {
3791               click: function(event) {
3792
3793                 if (bpmnElement.name) {
3794                   var bpmnElementID = bpmnElement.id;
3795                   selected_decison_element = bpmnElementID;
3796                   var bpmnElementName = bpmnElement.name;
3797                   selected_element_name = bpmnElementName;
3798                   var pathIdentifiers = [];
3799
3800                   if (bpmnElement.outgoing) {
3801
3802                     var check_outgoing_names = true;
3803                     forEach(bpmnElement.outgoing, function(og) {
3804
3805                       if (og.name && og.name.length != 0) {
3806
3807                         pathIdentifiers.push(og.name);
3808
3809                       } else {
3810
3811                         errorProperty(bpmnElement.name + " out going path name was not entered");
3812                         check_outgoing_names = false;
3813                       }
3814
3815                     });
3816                     if (check_outgoing_names) {
3817
3818                       pathDetails(bpmnElementID, bpmnElementName, pathIdentifiers);
3819                     }
3820
3821
3822
3823                   } else {
3824                     errorProperty(bpmnElement.name + ' should atleast one output path was required');
3825                   }
3826
3827                 } else {
3828                   errorProperty('Enter Valid Decision Name');
3829                 }
3830               }
3831             }
3832           }
3833         });
3834       }
3835
3836
3837
3838       if (bpmnElement.$instanceOf('bpmn:InitiateProcess')) {}
3839
3840       if (bpmnElement.$instanceOf('bpmn:StartEvent')) {}
3841       if (bpmnElement.$instanceOf('bpmn:Collector')) {
3842         assign(actions, {
3843           'Properties': {
3844             group: 'clds',
3845             label: 'Edit Properties',
3846             className: 'clds-edit-properties',
3847             title: 'Properties',
3848             action: {
3849               click: function(event) {
3850                 lastElementSelected = bpmnElement.id
3851                 CollectorsWindow(bpmnElement);
3852               }
3853             }
3854           }
3855         });
3856
3857       }
3858       if (bpmnElement.$instanceOf('bpmn:StringMatch')) {
3859         assign(actions, {
3860           'Properties': {
3861             group: 'clds',
3862             label: 'Edit Properties',
3863             className: 'clds-edit-properties',
3864             title: 'Properties',
3865             action: {
3866               click: function(event) {
3867                 lastElementSelected = bpmnElement.id
3868                 StringMatchWindow(bpmnElement);
3869               }
3870             }
3871           }
3872         });
3873       }
3874       if (bpmnElement.$instanceOf('bpmn:Holmes')) {
3875         assign(actions, {
3876           'Properties': {
3877             group: 'clds',
3878             label: 'Edit Properties',
3879             className: 'clds-edit-properties',
3880             title: 'Properties',
3881             action: {
3882               click: function(event) {
3883                 lastElementSelected = bpmnElement.id
3884                 HolmesWindow(bpmnElement);
3885               }
3886             }
3887           }
3888         });
3889       }
3890       if (bpmnElement.$instanceOf('bpmn:TCA')) {
3891         assign(actions, {
3892           'Properties': {
3893             group: 'clds',
3894             label: 'Edit Properties',
3895             className: 'clds-edit-properties',
3896             title: 'Properties',
3897             action: {
3898               click: function(event) {
3899                 console.log(event);
3900                 lastElementSelected = bpmnElement.id
3901               }
3902             }
3903           }
3904         });
3905       }
3906       if (bpmnElement.$instanceOf('bpmn:GOC')) {
3907         assign(actions, {
3908           'Properties': {
3909             group: 'clds',
3910             label: 'Edit Properties',
3911             className: 'clds-edit-properties',
3912             title: 'Properties',
3913             action: {
3914               click: function(event) {
3915                 lastElementSelected = bpmnElement.id
3916                 GOCWindow();
3917               }
3918             }
3919           }
3920         });
3921       }
3922       if (bpmnElement.$instanceOf('bpmn:Policy')) {
3923         assign(actions, {
3924           'Properties': {
3925             group: 'clds',
3926             label: 'Edit Properties',
3927             className: 'clds-edit-properties',
3928             title: 'Properties',
3929             action: {
3930               click: function(event) {
3931                 lastElementSelected = bpmnElement.id
3932                 PolicyWindow(bpmnElement);
3933               }
3934             }
3935           }
3936         });
3937       }
3938
3939       if (bpmnElement.$instanceOf('bpmn:FlowNode') ||
3940         bpmnElement.$instanceOf('bpmn:InteractionNode')) {
3941
3942         assign(actions, {
3943           'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),
3944
3945           'connect': {
3946             group: 'connect',
3947             className: 'icon-connection',
3948             title: 'Connector',
3949             action: {
3950               click: startConnect,
3951               dragstart: startConnect
3952             }
3953           }
3954         });
3955       }
3956
3957       // Delete Element Entry
3958       assign(actions, {
3959         'delete': {
3960           group: 'edits',
3961           className: 'icon-trash',
3962           title: 'Remove',
3963           action: {
3964             click: removeElement,
3965             dragstart: removeElement
3966           }
3967         }
3968
3969
3970
3971       });
3972
3973       return actions;
3974     };
3975
3976     function isEventType(eventBo, type, definition) {
3977
3978       var isType = eventBo.$instanceOf(type);
3979       var isDefinition = false;
3980
3981       var definitions = eventBo.eventDefinitions || [];
3982       forEach(definitions, function(def) {
3983         if (def.$type === definition) {
3984           isDefinition = true;
3985         }
3986       });
3987
3988       return isType && isDefinition;
3989     }
3990
3991
3992     module.exports = ContextPadProvider;
3993
3994   }, {
3995     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3996     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3997   }],
3998   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
3999     module.exports = {
4000       __depends__: [
4001         require('diagram-js-direct-editing'),
4002         require('diagram-js/lib/features/context-pad'),
4003         require('diagram-js/lib/features/selection'),
4004         require('diagram-js/lib/features/connect'),
4005         require('diagram-js/lib/features/create'),
4006         require('../replace')
4007       ],
4008       __init__: ['contextPadProvider'],
4009       contextPadProvider: ['type', require('./ContextPadProvider')]
4010     };
4011   }, {
4012     "../replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js",
4013     "./ContextPadProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js",
4014     "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4015     "diagram-js/lib/features/connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js",
4016     "diagram-js/lib/features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js",
4017     "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
4018     "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
4019   }],
4020   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js": [function(require, module, exports) {
4021     'use strict';
4022
4023
4024     function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
4025
4026       keyboard.addListener(function(key, modifiers) {
4027
4028         if (keyboard.hasModifier(modifiers)) {
4029           return;
4030         }
4031
4032         // S -> activate space tool
4033         if (key === 83) {
4034           spaceTool.activateSelection();
4035
4036           return true;
4037         }
4038
4039         // L -> activate lasso tool
4040         if (key === 108) {
4041           lassoTool.activateSelection();
4042
4043           return true;
4044         }
4045
4046         var currentSelection = selection.get();
4047
4048         // E -> activate direct editing
4049         if (key === 69) {
4050           if (currentSelection.length) {
4051             directEditing.activate(currentSelection[0]);
4052           }
4053
4054           return true;
4055         }
4056       });
4057     }
4058
4059     BpmnKeyBindings.$inject = ['keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection'];
4060
4061     module.exports = BpmnKeyBindings;
4062   }, {}],
4063   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
4064     module.exports = {
4065       __depends__: [
4066         require('diagram-js/lib/features/keyboard')
4067       ],
4068       __init__: ['bpmnKeyBindings'],
4069       bpmnKeyBindings: ['type', require('./BpmnKeyBindings')]
4070     };
4071   }, {
4072     "./BpmnKeyBindings": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js",
4073     "diagram-js/lib/features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js"
4074   }],
4075   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js": [function(require, module, exports) {
4076     'use strict';
4077
4078     var UpdateLabelHandler = require('./cmd/UpdateLabelHandler');
4079
4080     var LabelUtil = require('./LabelUtil');
4081
4082     var is = require('../../util/ModelUtil').is,
4083       isExpanded = require('../../util/DiUtil').isExpanded;
4084
4085     var daOriginalLabel = '';
4086
4087     var MIN_BOUNDS = {
4088       width: 150,
4089       height: 50
4090     };
4091
4092
4093     function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {
4094
4095       directEditing.registerProvider(this);
4096       commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);
4097
4098       // listen to dblclick on non-root elements
4099       eventBus.on('element.dblclick', function(event) {
4100
4101         directEditing.activate(event.element);
4102       });
4103
4104
4105       // complete on followup canvas operation
4106       eventBus.on(['element.mousedown', 'drag.activate', 'canvas.viewbox.changed'], function(event) {
4107         directEditing.complete();
4108       });
4109
4110       // cancel on command stack changes
4111       eventBus.on(['commandStack.changed'], function() {
4112         directEditing.cancel();
4113       });
4114
4115
4116       // activate direct editing for activities and text annotations
4117
4118
4119       if ('ontouchstart' in document.documentElement) {
4120         // we deactivate automatic label editing on mobile devices
4121         // as it breaks the user interaction workflow
4122
4123         // TODO(nre): we should temporarily focus the edited element here
4124         // and release the focused viewport after the direct edit operation is
4125         // finished
4126       } else {
4127         eventBus.on('create.end', 500, function(e) {
4128
4129           var element = e.shape,
4130             canExecute = e.context.canExecute;
4131
4132           if (!canExecute) {
4133             return;
4134           }
4135
4136           if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||
4137             (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {
4138
4139             directEditing.activate(element);
4140           }
4141         });
4142       }
4143
4144       this._canvas = canvas;
4145       this._commandStack = commandStack;
4146     }
4147
4148     LabelEditingProvider.$inject = ['eventBus', 'canvas', 'directEditing', 'commandStack', 'injector'];
4149
4150     module.exports = LabelEditingProvider;
4151
4152
4153     LabelEditingProvider.prototype.activate = function(element) {
4154
4155       var text = LabelUtil.getLabel(element);
4156
4157       if (text === undefined) {
4158         return;
4159       }
4160
4161       daOriginalLabel = text;
4162
4163       var bbox = this.getEditingBBox(element);
4164
4165       // adjust for expanded pools AND lanes
4166       if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {
4167
4168         bbox.width = MIN_BOUNDS.width;
4169         bbox.height = MIN_BOUNDS.height;
4170
4171         bbox.x = bbox.x + 10 - bbox.width / 2;
4172         bbox.y = bbox.mid.y - bbox.height / 2;
4173       }
4174
4175       // adjust for expanded sub processes
4176       if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {
4177
4178         bbox.height = MIN_BOUNDS.height;
4179
4180         bbox.x = bbox.mid.x - bbox.width / 2;
4181         bbox.y = bbox.y + 10 - bbox.height / 2;
4182       }
4183
4184       return {
4185         bounds: bbox,
4186         text: text
4187       };
4188     };
4189
4190
4191     LabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {
4192
4193       var target = element.label || element;
4194
4195       var bbox = this._canvas.getAbsoluteBBox(target);
4196
4197       var mid = {
4198         x: bbox.x + bbox.width / 2,
4199         y: bbox.y + bbox.height / 2
4200       };
4201
4202       // external label
4203       if (target.labelTarget) {
4204         bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);
4205         bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);
4206
4207         bbox.x = mid.x - bbox.width / 2;
4208       }
4209
4210       bbox.mid = mid;
4211
4212       return bbox;
4213     };
4214
4215
4216     LabelEditingProvider.prototype.update = function(element, newLabel) {
4217       //update conditional node
4218       if (is(element, 'bpmn:ExclusiveGateway') || is(element, 'bpmn:MultiBranchConnector')) {
4219         updateDecisionLabel(daOriginalLabel, newLabel);
4220       }
4221
4222       this._commandStack.execute('element.updateLabel', {
4223         element: element,
4224         newLabel: newLabel
4225       });
4226     };
4227   }, {
4228     "../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
4229     "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4230     "./LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js",
4231     "./cmd/UpdateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js"
4232   }],
4233   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js": [function(require, module, exports) {
4234     'use strict';
4235
4236     function getLabelAttr(semantic) {
4237       if (semantic.$instanceOf('bpmn:FlowElement') ||
4238         semantic.$instanceOf('bpmn:Participant') ||
4239         semantic.$instanceOf('bpmn:Lane') ||
4240         semantic.$instanceOf('bpmn:SequenceFlow') ||
4241         semantic.$instanceOf('bpmn:MessageFlow')) {
4242         return 'name';
4243       }
4244
4245       if (semantic.$instanceOf('bpmn:TextAnnotation')) {
4246         return 'text';
4247       }
4248     }
4249
4250     module.exports.getLabel = function(element) {
4251       var semantic = element.businessObject,
4252         attr = getLabelAttr(semantic);
4253
4254       if (attr) {
4255         return semantic[attr] || '';
4256       }
4257     };
4258
4259
4260     module.exports.setLabel = function(element, text) {
4261       var semantic = element.businessObject,
4262         attr = getLabelAttr(semantic);
4263
4264       if (attr) {
4265         semantic[attr] = text;
4266       }
4267
4268       var label = element.label || element;
4269
4270       // show label
4271       label.hidden = false;
4272
4273       return label;
4274     };
4275   }, {}],
4276   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js": [function(require, module, exports) {
4277     'use strict';
4278
4279     var LabelUtil = require('../LabelUtil');
4280
4281
4282     /**
4283      * A handler that updates the text of a BPMN element.
4284      *
4285      * @param {EventBus}
4286      *            eventBus
4287      */
4288     function UpdateTextHandler(eventBus) {
4289
4290       function setText(element, text) {
4291         var label = LabelUtil.setLabel(element, text);
4292
4293         eventBus.fire('element.changed', {
4294           element: label
4295         });
4296       }
4297
4298       function execute(ctx) {
4299         ctx.oldLabel = LabelUtil.getLabel(ctx.element);
4300         return setText(ctx.element, ctx.newLabel);
4301       }
4302
4303       function revert(ctx) {
4304         return setText(ctx.element, ctx.oldLabel);
4305       }
4306
4307
4308       function canExecute(ctx) {
4309         return true;
4310       }
4311
4312       // API
4313
4314       this.execute = execute;
4315       this.revert = revert;
4316
4317       this.canExecute = canExecute;
4318     }
4319
4320
4321     UpdateTextHandler.$inject = ['eventBus'];
4322
4323     module.exports = UpdateTextHandler;
4324   }, {
4325     "../LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js"
4326   }],
4327   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js": [function(require, module, exports) {
4328     module.exports = {
4329       __depends__: [
4330         require('diagram-js/lib/command'),
4331         require('diagram-js/lib/features/change-support'),
4332         require('diagram-js-direct-editing')
4333       ],
4334       __init__: ['labelEditingProvider'],
4335       labelEditingProvider: ['type', require('./LabelEditingProvider')]
4336     };
4337   }, {
4338     "./LabelEditingProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js",
4339     "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4340     "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
4341     "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js"
4342   }],
4343   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js": [function(require, module, exports) {
4344     'use strict';
4345
4346     var map = require('lodash/collection/map'),
4347       assign = require('lodash/object/assign'),
4348       pick = require('lodash/object/pick');
4349
4350
4351     function BpmnFactory(moddle) {
4352       this._model = moddle;
4353     }
4354
4355     BpmnFactory.$inject = ['moddle'];
4356
4357
4358     BpmnFactory.prototype._needsId = function(element) {
4359       return element.$instanceOf('bpmn:RootElement') ||
4360         element.$instanceOf('bpmn:FlowElement') ||
4361         element.$instanceOf('bpmn:MessageFlow') ||
4362         element.$instanceOf('bpmn:Artifact') ||
4363         element.$instanceOf('bpmn:Participant') ||
4364         element.$instanceOf('bpmn:Process') ||
4365         element.$instanceOf('bpmn:Collaboration') ||
4366         element.$instanceOf('bpmndi:BPMNShape') ||
4367         element.$instanceOf('bpmndi:BPMNEdge') ||
4368         element.$instanceOf('bpmndi:BPMNDiagram') ||
4369         element.$instanceOf('bpmndi:BPMNPlane');
4370     };
4371
4372     BpmnFactory.prototype._ensureId = function(element) {
4373
4374       // generate semantic ids for elements
4375       // bpmn:SequenceFlow -> SequenceFlow_ID
4376       var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';
4377
4378       if (!element.id && this._needsId(element)) {
4379         element.id = this._model.ids.nextPrefixed(prefix, element);
4380       }
4381     };
4382
4383
4384     BpmnFactory.prototype.create = function(type, attrs) {
4385       var element = this._model.create(type, attrs || {});
4386
4387       this._ensureId(element);
4388
4389       return element;
4390     };
4391
4392
4393     BpmnFactory.prototype.createDiLabel = function() {
4394       return this.create('bpmndi:BPMNLabel', {
4395         bounds: this.createDiBounds()
4396       });
4397     };
4398
4399
4400     BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
4401
4402       return this.create('bpmndi:BPMNShape', assign({
4403         bpmnElement: semantic,
4404         bounds: this.createDiBounds(bounds)
4405       }, attrs));
4406     };
4407
4408
4409     BpmnFactory.prototype.createDiBounds = function(bounds) {
4410       return this.create('dc:Bounds', bounds);
4411     };
4412
4413
4414     BpmnFactory.prototype.createDiWaypoints = function(waypoints) {
4415       return map(waypoints, function(pos) {
4416         return this.createDiWaypoint(pos);
4417       }, this);
4418     };
4419
4420     BpmnFactory.prototype.createDiWaypoint = function(point) {
4421       return this.create('dc:Point', pick(point, ['x', 'y']));
4422     };
4423
4424
4425     BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
4426       return this.create('bpmndi:BPMNEdge', assign({
4427         bpmnElement: semantic
4428       }, attrs));
4429     };
4430
4431     BpmnFactory.prototype.createDiPlane = function(semantic) {
4432       return this.create('bpmndi:BPMNPlane', {
4433         bpmnElement: semantic
4434       });
4435     };
4436
4437     module.exports = BpmnFactory;
4438
4439   }, {
4440     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
4441     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
4442     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
4443   }],
4444   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js": [function(require, module, exports) {
4445     'use strict';
4446
4447     var inherits = require('inherits');
4448
4449     var assign = require('lodash/object/assign');
4450
4451     var BaseLayouter = require('diagram-js/lib/layout/BaseLayouter'),
4452       LayoutUtil = require('diagram-js/lib/layout/LayoutUtil'),
4453       ManhattanLayout = require('diagram-js/lib/layout/ManhattanLayout');
4454
4455     var is = require('../../util/ModelUtil').is;
4456
4457
4458     function BpmnLayouter() {}
4459
4460     inherits(BpmnLayouter, BaseLayouter);
4461
4462     module.exports = BpmnLayouter;
4463
4464
4465     function getAttachment(waypoints, idx, shape) {
4466       var point = waypoints && waypoints[idx];
4467
4468       return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);
4469     }
4470
4471
4472     BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
4473       var source = connection.source,
4474         target = connection.target,
4475         waypoints = connection.waypoints,
4476         start,
4477         end;
4478
4479       var layoutManhattan,
4480         updatedWaypoints;
4481
4482       start = getAttachment(waypoints, 0, source);
4483       end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);
4484
4485       // manhattan layout sequence / message flows
4486       if (is(connection, 'bpmn:MessageFlow')) {
4487         layoutManhattan = {
4488           preferStraight: true,
4489           preferVertical: true
4490         };
4491       }
4492
4493       if (is(connection, 'bpmn:SequenceFlow')) {
4494         layoutManhattan = {};
4495       }
4496
4497       if (layoutManhattan) {
4498
4499         layoutManhattan = assign(layoutManhattan, hints);
4500
4501         updatedWaypoints =
4502           ManhattanLayout.repairConnection(
4503             source, target, start, end,
4504             waypoints,
4505             layoutManhattan);
4506       }
4507
4508       return updatedWaypoints || [start, end];
4509     };
4510   }, {
4511     "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4512     "diagram-js/lib/layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
4513     "diagram-js/lib/layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
4514     "diagram-js/lib/layout/ManhattanLayout": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js",
4515     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4516     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4517   }],
4518   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js": [function(require, module, exports) {
4519     'use strict';
4520
4521     var assign = require('lodash/object/assign'),
4522       forEach = require('lodash/collection/forEach'),
4523       inherits = require('inherits');
4524
4525     var Collections = require('diagram-js/lib/util/Collections'),
4526       Model = require('diagram-js/lib/model');
4527
4528     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
4529
4530
4531     /**
4532      * A handler responsible for updating the underlying BPMN 2.0 XML + DI once
4533      * changes on the diagram happen
4534      */
4535     function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
4536
4537       CommandInterceptor.call(this, eventBus);
4538
4539       this._bpmnFactory = bpmnFactory;
4540
4541       var self = this;
4542
4543
4544
4545       // //// connection cropping /////////////////////////
4546
4547       // crop connection ends during create/update
4548       function cropConnection(e) {
4549         var context = e.context,
4550           connection;
4551
4552         if (!context.cropped) {
4553           connection = context.connection;
4554           connection.waypoints = connectionDocking.getCroppedWaypoints(connection);
4555           context.cropped = true;
4556         }
4557       }
4558
4559       this.executed([
4560         'connection.layout',
4561         'connection.create',
4562         'connection.reconnectEnd',
4563         'connection.reconnectStart'
4564       ], cropConnection);
4565
4566       this.reverted(['connection.layout'], function(e) {
4567         delete e.context.cropped;
4568       });
4569
4570
4571
4572       // //// BPMN + DI update /////////////////////////
4573
4574
4575       // update parent
4576       function updateParent(e) {
4577         self.updateParent(e.context.shape || e.context.connection);
4578       }
4579
4580       this.executed(['shape.move',
4581         'shape.create',
4582         'shape.delete',
4583         'connection.create',
4584         'connection.move',
4585         'connection.delete'
4586       ], updateParent);
4587       this.reverted(['shape.move',
4588         'shape.create',
4589         'shape.delete',
4590         'connection.create',
4591         'connection.move',
4592         'connection.delete'
4593       ], updateParent);
4594
4595       /*
4596        * ## Updating Parent
4597        *
4598        * When morphing a Process into a Collaboration or vice-versa, make sure
4599        * that both the *semantic* and *di* parent of each element is updated.
4600        *
4601        */
4602       function updateRoot(event) {
4603         var context = event.context,
4604           oldRoot = context.oldRoot,
4605           children = oldRoot.children;
4606
4607         forEach(children, function(child) {
4608           self.updateParent(child);
4609         });
4610       }
4611
4612       this.executed(['canvas.updateRoot'], updateRoot);
4613       this.reverted(['canvas.updateRoot'], updateRoot);
4614
4615
4616       // update bounds
4617       function updateBounds(e) {
4618         self.updateBounds(e.context.shape);
4619       }
4620
4621       this.executed(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4622       this.reverted(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4623
4624
4625       // attach / detach connection
4626       function updateConnection(e) {
4627         self.updateConnection(e.context.connection);
4628       }
4629
4630       this.executed([
4631         'connection.create',
4632         'connection.move',
4633         'connection.delete',
4634         'connection.reconnectEnd',
4635         'connection.reconnectStart'
4636       ], updateConnection);
4637
4638       this.reverted([
4639         'connection.create',
4640         'connection.move',
4641         'connection.delete',
4642         'connection.reconnectEnd',
4643         'connection.reconnectStart'
4644       ], updateConnection);
4645
4646
4647       // update waypoints
4648       function updateConnectionWaypoints(e) {
4649         self.updateConnectionWaypoints(e.context.connection);
4650       }
4651
4652       this.executed([
4653         'connection.layout',
4654         'connection.move',
4655         'connection.updateWaypoints',
4656         'connection.reconnectEnd',
4657         'connection.reconnectStart'
4658       ], updateConnectionWaypoints);
4659
4660       this.reverted([
4661         'connection.layout',
4662         'connection.move',
4663         'connection.updateWaypoints',
4664         'connection.reconnectEnd',
4665         'connection.reconnectStart'
4666       ], updateConnectionWaypoints);
4667     }
4668
4669     inherits(BpmnUpdater, CommandInterceptor);
4670
4671     module.exports = BpmnUpdater;
4672
4673     BpmnUpdater.$inject = ['eventBus', 'bpmnFactory', 'connectionDocking'];
4674
4675
4676     // ///// implementation //////////////////////////////////
4677
4678
4679     BpmnUpdater.prototype.updateParent = function(element) {
4680
4681       // do not update BPMN 2.0 label parent
4682       if (element instanceof Model.Label) {
4683         return;
4684       }
4685
4686       var parentShape = element.parent;
4687
4688       var businessObject = element.businessObject,
4689         parentBusinessObject = parentShape && parentShape.businessObject,
4690         parentDi = parentBusinessObject && parentBusinessObject.di;
4691
4692       this.updateSemanticParent(businessObject, parentBusinessObject);
4693
4694       this.updateDiParent(businessObject.di, parentDi);
4695     };
4696
4697
4698     BpmnUpdater.prototype.updateBounds = function(shape) {
4699
4700       var di = shape.businessObject.di;
4701
4702       var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;
4703
4704       assign(bounds, {
4705         x: shape.x,
4706         y: shape.y,
4707         width: shape.width,
4708         height: shape.height
4709       });
4710     };
4711
4712
4713     BpmnUpdater.prototype.updateDiParent = function(di, parentDi) {
4714
4715       if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {
4716         parentDi = parentDi.$parent;
4717       }
4718
4719       if (di.$parent === parentDi) {
4720         return;
4721       }
4722
4723       var planeElements = (parentDi || di.$parent).get('planeElement');
4724
4725       if (parentDi) {
4726         planeElements.push(di);
4727         di.$parent = parentDi;
4728       } else {
4729         Collections.remove(planeElements, di);
4730         di.$parent = null;
4731       }
4732     };
4733
4734     function getDefinitions(element) {
4735       while (element && !element.$instanceOf('bpmn:Definitions')) {
4736         element = element.$parent;
4737       }
4738
4739       return element;
4740     }
4741
4742     BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {
4743
4744       var containment;
4745
4746       if (businessObject.$parent === newParent) {
4747         return;
4748       }
4749
4750       if (businessObject.$instanceOf('bpmn:FlowElement')) {
4751
4752         if (newParent && newParent.$instanceOf('bpmn:Participant')) {
4753           newParent = newParent.processRef;
4754         }
4755
4756         containment = 'flowElements';
4757
4758       } else
4759
4760       if (businessObject.$instanceOf('bpmn:Artifact')) {
4761
4762         while (newParent &&
4763           !newParent.$instanceOf('bpmn:Process') &&
4764           !newParent.$instanceOf('bpmn:SubProcess') &&
4765           !newParent.$instanceOf('bpmn:Collaboration')) {
4766
4767           if (newParent.$instanceOf('bpmn:Participant')) {
4768             newParent = newParent.processRef;
4769             break;
4770           } else {
4771             newParent = newParent.$parent;
4772           }
4773         }
4774
4775         containment = 'artifacts';
4776       } else
4777
4778       if (businessObject.$instanceOf('bpmn:MessageFlow')) {
4779         containment = 'messageFlows';
4780
4781       } else
4782
4783       if (businessObject.$instanceOf('bpmn:Participant')) {
4784         containment = 'participants';
4785
4786         // make sure the participants process is properly attached / detached
4787         // from the XML document
4788
4789         var process = businessObject.processRef,
4790           definitions;
4791
4792         if (process) {
4793           definitions = getDefinitions(businessObject.$parent || newParent);
4794
4795           if (businessObject.$parent) {
4796             Collections.remove(definitions.get('rootElements'), process);
4797             process.$parent = null;
4798           }
4799
4800           if (newParent) {
4801             Collections.add(definitions.get('rootElements'), process);
4802             process.$parent = definitions;
4803           }
4804         }
4805       }
4806
4807       if (!containment) {
4808         throw new Error('no parent for ', businessObject, newParent);
4809       }
4810
4811       var children;
4812
4813       if (businessObject.$parent) {
4814         // remove from old parent
4815         children = businessObject.$parent.get(containment);
4816         Collections.remove(children, businessObject);
4817       }
4818
4819       if (!newParent) {
4820         businessObject.$parent = null;
4821       } else {
4822         // add to new parent
4823         children = newParent.get(containment);
4824         children.push(businessObject);
4825         businessObject.$parent = newParent;
4826       }
4827     };
4828
4829
4830     BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {
4831
4832       connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4833     };
4834
4835
4836     BpmnUpdater.prototype.updateConnection = function(connection) {
4837
4838       var businessObject = connection.businessObject,
4839         newSource = connection.source && connection.source.businessObject,
4840         newTarget = connection.target && connection.target.businessObject;
4841
4842       var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');
4843
4844       if (businessObject.sourceRef !== newSource) {
4845         if (inverseSet) {
4846           Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);
4847
4848           if (newSource) {
4849             newSource.get('outgoing').push(businessObject);
4850           }
4851         }
4852
4853         businessObject.sourceRef = newSource;
4854       }
4855       if (businessObject.targetRef !== newTarget) {
4856         if (inverseSet) {
4857           Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);
4858
4859           if (newTarget) {
4860             newTarget.get('incoming').push(businessObject);
4861           }
4862         }
4863
4864         businessObject.targetRef = newTarget;
4865       }
4866
4867       businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4868     };
4869
4870
4871     // ///// helpers /////////////////////////////////////////
4872
4873     BpmnUpdater.prototype._getLabel = function(di) {
4874       if (!di.label) {
4875         di.label = this._bpmnFactory.createDiLabel();
4876       }
4877
4878       return di.label;
4879     };
4880   }, {
4881     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
4882     "diagram-js/lib/model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
4883     "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
4884     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4885     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
4886     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4887   }],
4888   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js": [function(require, module, exports) {
4889     'use strict';
4890
4891     var assign = require('lodash/object/assign'),
4892       inherits = require('inherits');
4893
4894     var BaseElementFactory = require('diagram-js/lib/core/ElementFactory'),
4895       LabelUtil = require('../../util/LabelUtil');
4896
4897
4898     /**
4899      * A bpmn-aware factory for diagram-js shapes
4900      */
4901     function ElementFactory(bpmnFactory, moddle) {
4902       BaseElementFactory.call(this);
4903
4904       this._bpmnFactory = bpmnFactory;
4905       this._moddle = moddle;
4906     }
4907
4908     inherits(ElementFactory, BaseElementFactory);
4909
4910
4911     ElementFactory.$inject = ['bpmnFactory', 'moddle'];
4912
4913     module.exports = ElementFactory;
4914
4915     ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;
4916
4917     ElementFactory.prototype.create = function(elementType, attrs) {
4918
4919       // no special magic for labels,
4920       // we assume their businessObjects have already been created
4921       // and wired via attrs
4922       if (elementType === 'label') {
4923         return this.baseCreate(elementType, assign({
4924           type: 'label'
4925         }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
4926       }
4927
4928       attrs = attrs || {};
4929
4930       var businessObject = attrs.businessObject,
4931         size;
4932
4933       if (!businessObject) {
4934         if (!attrs.type) {
4935           throw new Error('no shape type specified');
4936         }
4937
4938         businessObject = this._bpmnFactory.create(attrs.type);
4939       }
4940
4941       if (!businessObject.di) {
4942         if (elementType === 'root') {
4943           businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
4944             id: businessObject.id + '_di'
4945           });
4946         } else
4947         if (elementType === 'connection') {
4948           businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
4949             id: businessObject.id + '_di'
4950           });
4951         } else {
4952           businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {
4953             id: businessObject.id + '_di'
4954           });
4955         }
4956       }
4957
4958       if (!!attrs.isExpanded) {
4959         businessObject.di.isExpanded = attrs.isExpanded;
4960       }
4961
4962       /*
4963        * if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {
4964        * businessObject.di.isMarkerVisible = true; }
4965        */
4966
4967       if (attrs._eventDefinitionType) {
4968         var eventDefinitions = businessObject.get('eventDefinitions') || [],
4969           newEventDefinition = this._moddle.create(attrs._eventDefinitionType);
4970
4971         eventDefinitions.push(newEventDefinition);
4972         businessObject.eventDefinitions = eventDefinitions;
4973       }
4974
4975       size = this._getDefaultSize(businessObject);
4976
4977       attrs = assign({
4978         businessObject: businessObject,
4979         id: businessObject.id
4980       }, size, attrs);
4981
4982       return this.baseCreate(elementType, attrs);
4983     };
4984
4985
4986     ElementFactory.prototype._getDefaultSize = function(semantic) {
4987
4988       if (semantic.$instanceOf('bpmn:SubProcess')) {
4989         var isExpanded = semantic.di.isExpanded === true;
4990
4991         if (isExpanded) {
4992           return {
4993             width: 350,
4994             height: 200
4995           };
4996         } else {
4997           return {
4998             width: 100,
4999             height: 80
5000           };
5001         }
5002       }
5003
5004       if (semantic.$instanceOf('bpmn:InitiateProcess')) {
5005         return {
5006           width: 120,
5007           height: 80
5008         };
5009       }
5010       if (semantic.$instanceOf('bpmn:Collector')) {
5011         return {
5012           width: 120,
5013           height: 80
5014         };
5015       }
5016
5017       if (semantic.$instanceOf('bpmn:StringMatch')) {
5018         return {
5019           width: 120,
5020           height: 80
5021         };
5022       }
5023       if (semantic.$instanceOf('bpmn:VesCollector')) {
5024         return {
5025           width: 120,
5026           height: 80
5027         };
5028       }
5029       if (semantic.$instanceOf('bpmn:Holmes')) {
5030         return {
5031           width: 120,
5032           height: 80
5033         };
5034       }
5035       if (semantic.$instanceOf('bpmn:TCA')) {
5036         return {
5037           width: 120,
5038           height: 80
5039         };
5040       }
5041
5042       if (semantic.$instanceOf('bpmn:Policy')) {
5043         return {
5044           width: 120,
5045           height: 80
5046         };
5047       }
5048
5049       if (semantic.$instanceOf('bpmn:GOC')) {
5050         return {
5051           width: 120,
5052           height: 80
5053         };
5054       }
5055       if (semantic.$instanceOf('bpmn:ParentReturn')) {
5056         return {
5057           width: 100,
5058           height: 80
5059         };
5060       }
5061       if (semantic.$instanceOf('bpmn:SubProcessCall')) {
5062         return {
5063           width: 100,
5064           height: 80
5065         };
5066       }
5067
5068       if (semantic.$instanceOf('bpmn:ExclusiveGateway')) {
5069         return {
5070           width: 100,
5071           height: 80
5072         };
5073       }
5074
5075       if (semantic.$instanceOf('bpmn:Task')) {
5076         return {
5077           width: 100,
5078           height: 80
5079         };
5080       }
5081
5082       if (semantic.$instanceOf('bpmn:Gateway')) {
5083         return {
5084           width: 100,
5085           height: 100
5086         };
5087       }
5088
5089       if (semantic.$instanceOf('bpmn:Event')) {
5090         return {
5091           width: 36,
5092           height: 36
5093         };
5094       }
5095
5096       if (semantic.$instanceOf('bpmn:Participant')) {
5097         return {
5098           width: 100,
5099           height: 80
5100         };
5101       }
5102
5103       return {
5104         width: 100,
5105         height: 80
5106       };
5107     };
5108
5109
5110     ElementFactory.prototype.createParticipantShape = function(collapsed) {
5111       // alert("entering createParticipantShape");
5112       var participantShape = this.createShape({
5113         type: 'bpmn:Participant'
5114       });
5115
5116       if (!collapsed) {
5117         participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
5118       }
5119
5120       return participantShape;
5121     };
5122   }, {
5123     "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5124     "diagram-js/lib/core/ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
5125     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5126     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5127   }],
5128   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js": [function(require, module, exports) {
5129     'use strict';
5130
5131     var assign = require('lodash/object/assign'),
5132       forEach = require('lodash/collection/forEach');
5133
5134     var LabelUtil = require('../../util/LabelUtil');
5135
5136     var hasExternalLabel = LabelUtil.hasExternalLabel,
5137       getExternalLabelMid = LabelUtil.getExternalLabelMid;
5138
5139
5140     function LabelSupport(eventBus, modeling, bpmnFactory) {
5141
5142       // create external labels on shape creation
5143
5144       eventBus.on([
5145         'commandStack.shape.create.postExecute',
5146         'commandStack.connection.create.postExecute'
5147       ], function(e) {
5148         var context = e.context;
5149
5150         var element = context.shape || context.connection,
5151           businessObject = element.businessObject;
5152
5153         var position;
5154
5155         if (hasExternalLabel(businessObject)) {
5156           position = getExternalLabelMid(element);
5157           modeling.createLabel(element, position, {
5158             id: businessObject.id + '_label',
5159             businessObject: businessObject
5160           });
5161         }
5162       });
5163
5164
5165       //move label when connection/shape is being moved
5166       //if shape is being moved, get connection as element
5167
5168       eventBus.on(['commandStack.connection.create.postExecute',
5169         'commandStack.connection.move.postExecute',
5170         //'commandStack.connection.delete.postExecute',
5171         'commandStack.connection.reconnectEnd.postExecute',
5172         'commandStack.connection.reconnectStart.postExecute',
5173         'commandStack.connection.updateWaypoints.postExecute',
5174         'shape.move.end'
5175       ], function(e) {
5176
5177         var context = e.context;
5178         var element;
5179
5180         if (context.allDraggedElements != null) {
5181           if (context.allDraggedElements.length > 0) {
5182             element = context.allDraggedElements[1];
5183           }
5184         } else {
5185           element = context.connection;
5186         }
5187
5188         if (element == null) {
5189           return;
5190         }
5191
5192         var businessObject = element.businessObject;
5193
5194         if (businessObject.$type != 'bpmn:SequenceFlow') {
5195           return;
5196         }
5197
5198         var position;
5199
5200         if (hasExternalLabel(businessObject)) {
5201           position = getExternalLabelMid(element);
5202           modeling.removeShape(element.label);
5203           modeling.createLabel(element, position, {
5204             id: businessObject.id + '_label',
5205             businessObject: businessObject
5206           });
5207         }
5208
5209       });
5210
5211
5212       // indicate label is dragged during move
5213
5214       // we need to add labels to the list of selected
5215       // shapes before the visuals get drawn.
5216       //
5217       // Hence this awesome magic number.
5218       //
5219       eventBus.on('shape.move.start', function(e) {
5220
5221         var context = e.context,
5222           shapes = context.shapes;
5223
5224         var labels = [];
5225
5226         forEach(shapes, function(element) {
5227           var label = element.label;
5228
5229           if (label && !label.hidden && context.shapes.indexOf(label) === -1) {
5230             labels.push(label);
5231           }
5232         });
5233
5234         forEach(labels, function(label) {
5235           shapes.push(label);
5236         });
5237       });
5238
5239
5240       // move labels with shapes
5241
5242       eventBus.on([
5243         'commandStack.shapes.move.postExecute'
5244       ], function(e) {
5245
5246         var context = e.context,
5247           closure = context.closure,
5248           enclosedElements = closure.enclosedElements;
5249
5250         // ensure we move all labels with their respective elements
5251         // if they have not been moved already
5252
5253         forEach(enclosedElements, function(e) {
5254           if (e.label && !enclosedElements[e.label.id]) {
5255             modeling.moveShape(e.label, context.delta, e.parent);
5256           }
5257         });
5258       });
5259
5260
5261       // update di information on label movement and creation
5262
5263       eventBus.on([
5264         'commandStack.label.create.executed',
5265         'commandStack.shape.moved.executed'
5266       ], function(e) {
5267
5268         var element = e.context.shape,
5269           businessObject = element.businessObject,
5270           di = businessObject.di;
5271
5272         // we want to trigger on real labels only
5273         if (!element.labelTarget) {
5274           return;
5275         }
5276
5277         if (!di.label) {
5278           di.label = bpmnFactory.create('bpmndi:BPMNLabel', {
5279             bounds: bpmnFactory.create('dc:Bounds')
5280           });
5281         }
5282
5283         assign(di.label.bounds, {
5284           x: element.x,
5285           y: element.y,
5286           width: element.width,
5287           height: element.height
5288         });
5289       });
5290     }
5291
5292     LabelSupport.$inject = ['eventBus', 'modeling', 'bpmnFactory'];
5293
5294     module.exports = LabelSupport;
5295
5296   }, {
5297     "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5298     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
5299     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5300   }],
5301   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
5302     'use strict';
5303
5304     var inherits = require('inherits');
5305
5306     var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
5307
5308     var UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler'),
5309       UpdateCanvasRootHandler = require('./cmd/UpdateCanvasRootHandler');
5310
5311
5312     /**
5313      * BPMN 2.0 modeling features activator
5314      *
5315      * @param {EventBus}
5316      *            eventBus
5317      * @param {ElementFactory}
5318      *            elementFactory
5319      * @param {CommandStack}
5320      *            commandStack
5321      * @param {BpmnRules}
5322      *            bpmnRules
5323      */
5324     function Modeling(eventBus, elementFactory, commandStack, bpmnRules) {
5325       BaseModeling.call(this, eventBus, elementFactory, commandStack);
5326
5327       this._bpmnRules = bpmnRules;
5328     }
5329
5330     inherits(Modeling, BaseModeling);
5331
5332     Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack', 'bpmnRules'];
5333
5334     module.exports = Modeling;
5335
5336
5337     Modeling.prototype.getHandlers = function() {
5338       var handlers = BaseModeling.prototype.getHandlers.call(this);
5339
5340       handlers['element.updateProperties'] = UpdatePropertiesHandler;
5341       handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;
5342
5343       return handlers;
5344     };
5345
5346
5347     Modeling.prototype.updateLabel = function(element, newLabel) {
5348       this._commandStack.execute('element.updateLabel', {
5349         element: element,
5350         newLabel: newLabel
5351       });
5352     };
5353
5354
5355     var getSharedParent = require('./ModelingUtil').getSharedParent;
5356
5357     Modeling.prototype.connect = function(source, target, attrs) {
5358
5359       var bpmnRules = this._bpmnRules;
5360
5361       if (!attrs) {
5362         if (bpmnRules.canConnectMessageFlow(source, target)) {
5363           attrs = {
5364             type: 'bpmn:MessageFlow'
5365           };
5366         } else
5367         if (bpmnRules.canConnectSequenceFlow(source, target)) {
5368           attrs = {
5369             type: 'bpmn:SequenceFlow'
5370           };
5371         } else {
5372           attrs = {
5373             type: 'bpmn:Association'
5374           };
5375         }
5376       }
5377
5378       return this.createConnection(source, target, attrs, getSharedParent(source, target));
5379     };
5380
5381
5382     Modeling.prototype.updateProperties = function(element, properties) {
5383       this._commandStack.execute('element.updateProperties', {
5384         element: element,
5385         properties: properties
5386       });
5387     };
5388
5389
5390     /**
5391      * Transform the current diagram into a collaboration.
5392      *
5393      * @return {djs.model.Root} the new root element
5394      */
5395     Modeling.prototype.makeCollaboration = function() {
5396
5397       var collaborationElement = this._create('root', {
5398         type: 'bpmn:Collaboration'
5399       });
5400
5401       var context = {
5402         newRoot: collaborationElement
5403       };
5404
5405       this._commandStack.execute('canvas.updateRoot', context);
5406
5407       return collaborationElement;
5408     };
5409
5410     /**
5411      * Transform the current diagram into a process.
5412      *
5413      * @return {djs.model.Root} the new root element
5414      */
5415     Modeling.prototype.makeProcess = function() {
5416
5417       var processElement = this._create('root', {
5418         type: 'bpmn:Process'
5419       });
5420
5421       var context = {
5422         newRoot: processElement
5423       };
5424
5425       this._commandStack.execute('canvas.updateRoot', context);
5426     };
5427   }, {
5428     "./ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5429     "./cmd/UpdateCanvasRootHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js",
5430     "./cmd/UpdatePropertiesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js",
5431     "diagram-js/lib/features/modeling/Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js",
5432     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5433   }],
5434   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js": [function(require, module, exports) {
5435     'use strict';
5436
5437     var find = require('lodash/collection/find');
5438
5439
5440     function getParents(element) {
5441
5442       var parents = [];
5443
5444       while (element) {
5445         element = element.parent;
5446
5447         if (element) {
5448           parents.push(element);
5449         }
5450       }
5451
5452       return parents;
5453     }
5454
5455     module.exports.getParents = getParents;
5456
5457
5458     function getSharedParent(a, b) {
5459
5460       var parentsA = getParents(a),
5461         parentsB = getParents(b);
5462
5463       return find(parentsA, function(parent) {
5464         return parentsB.indexOf(parent) !== -1;
5465       });
5466     }
5467
5468     module.exports.getSharedParent = getSharedParent;
5469   }, {
5470     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js"
5471   }],
5472   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js": [function(require, module, exports) {
5473     'use strict';
5474
5475     var inherits = require('inherits');
5476
5477     var is = require('../../../util/ModelUtil').is;
5478
5479     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5480
5481
5482     function AppendBehavior(eventBus, elementFactory, bpmnRules) {
5483
5484       CommandInterceptor.call(this, eventBus);
5485
5486       // assign correct shape position unless already set
5487
5488       this.preExecute('shape.append', function(context) {
5489
5490         var source = context.source,
5491           shape = context.shape;
5492
5493         if (!context.position) {
5494
5495           if (is(shape, 'bpmn:TextAnnotation')) {
5496             context.position = {
5497               x: source.x + source.width / 2 + 75,
5498               y: source.y - (50) - shape.height / 2
5499             };
5500           } else {
5501             context.position = {
5502               x: source.x + source.width + 80 + shape.width / 2,
5503               y: source.y + source.height / 2
5504             };
5505           }
5506         }
5507       }, true);
5508     }
5509
5510
5511     AppendBehavior.$inject = ['eventBus', 'elementFactory', 'bpmnRules'];
5512
5513     inherits(AppendBehavior, CommandInterceptor);
5514
5515     module.exports = AppendBehavior;
5516   }, {
5517     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5518     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5519     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5520   }],
5521   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js": [function(require, module, exports) {
5522     'use strict';
5523
5524     var inherits = require('inherits');
5525
5526     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5527
5528     var is = require('../../../util/ModelUtil').is;
5529
5530     /**
5531      * BPMN specific create behavior
5532      */
5533     function CreateBehavior(eventBus, modeling) {
5534
5535       CommandInterceptor.call(this, eventBus);
5536
5537
5538       /**
5539        * morph process into collaboration before adding participant onto
5540        * collaboration
5541        */
5542
5543       this.preExecute('shape.create', function(context) {
5544
5545         var parent = context.parent,
5546           shape = context.shape,
5547           position = context.position;
5548
5549         if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {
5550
5551           // this is going to detach the process root
5552           // and set the returned collaboration element
5553           // as the new root element
5554           var collaborationElement = modeling.makeCollaboration();
5555
5556           // monkey patch the create context
5557           // so that the participant is being dropped
5558           // onto the new collaboration root instead
5559           context.position = position;
5560           context.parent = collaborationElement;
5561
5562           context.processRoot = parent;
5563         }
5564       }, true);
5565
5566       this.execute('shape.create', function(context) {
5567
5568         var processRoot = context.processRoot,
5569           shape = context.shape;
5570
5571         if (processRoot) {
5572           context.oldProcessRef = shape.businessObject.processRef;
5573
5574           // assign the participant processRef
5575           shape.businessObject.processRef = processRoot.businessObject;
5576         }
5577       }, true);
5578
5579       this.revert('shape.create', function(context) {
5580         var processRoot = context.processRoot,
5581           shape = context.shape;
5582
5583         if (processRoot) {
5584           // assign the participant processRef
5585           shape.businessObject.processRef = context.oldProcessRef;
5586         }
5587       }, true);
5588
5589       this.postExecute('shape.create', function(context) {
5590
5591         var processRoot = context.processRoot,
5592           shape = context.shape;
5593
5594         if (processRoot) {
5595           // process root is already detached at this point
5596           var processChildren = processRoot.children.slice();
5597           modeling.moveShapes(processChildren, {
5598             x: 0,
5599             y: 0
5600           }, shape);
5601         }
5602         //console.log(context.shape.id);
5603         //newElementProcessor(context.shape.id);
5604         //console.log(context)
5605       }, true);
5606
5607     }
5608
5609     CreateBehavior.$inject = ['eventBus', 'modeling'];
5610
5611     inherits(CreateBehavior, CommandInterceptor);
5612
5613     module.exports = CreateBehavior;
5614   }, {
5615     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5616     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5617     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5618   }],
5619   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js": [function(require, module, exports) {
5620     'use strict';
5621
5622     var forEach = require('lodash/collection/forEach'),
5623       inherits = require('inherits');
5624
5625     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5626
5627     var is = require('../../../util/ModelUtil').is,
5628       getSharedParent = require('../ModelingUtil').getSharedParent;
5629
5630
5631     function DropBehavior(eventBus, modeling, bpmnRules) {
5632
5633       CommandInterceptor.call(this, eventBus);
5634
5635       // remove sequence flows that should not be allowed
5636       // after a move operation
5637
5638       this.postExecute('shapes.move', function(context) {
5639
5640         var closure = context.closure,
5641           allConnections = closure.allConnections;
5642
5643         forEach(allConnections, function(c) {
5644
5645           var source = c.source,
5646             target = c.target;
5647
5648           var replacementType,
5649             remove;
5650
5651           /**
5652            * Check if incoming or outgoing connections can stay or could be
5653            * substituted with an appropriate replacement.
5654            *
5655            * This holds true for SequenceFlow <> MessageFlow.
5656            */
5657
5658           if (is(c, 'bpmn:SequenceFlow')) {
5659             if (!bpmnRules.canConnectSequenceFlow(source, target)) {
5660               remove = true;
5661             }
5662
5663             if (bpmnRules.canConnectMessageFlow(source, target)) {
5664               replacementType = 'bpmn:MessageFlow';
5665             }
5666           }
5667
5668           // transform message flows into sequence flows, if possible
5669
5670           if (is(c, 'bpmn:MessageFlow')) {
5671
5672             if (!bpmnRules.canConnectMessageFlow(source, target)) {
5673               remove = true;
5674             }
5675
5676             if (bpmnRules.canConnectSequenceFlow(source, target)) {
5677               replacementType = 'bpmn:SequenceFlow';
5678             }
5679           }
5680
5681           if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
5682             remove = true;
5683           }
5684
5685
5686           // remove invalid connection
5687           if (remove) {
5688             modeling.removeConnection(c);
5689           }
5690
5691           // replace SequenceFlow <> MessageFlow
5692
5693           if (replacementType) {
5694             modeling.createConnection(source, target, {
5695               type: replacementType,
5696               waypoints: c.waypoints.slice()
5697             }, getSharedParent(source, target));
5698           }
5699         });
5700       }, true);
5701     }
5702
5703     inherits(DropBehavior, CommandInterceptor);
5704
5705     DropBehavior.$inject = ['eventBus', 'modeling', 'bpmnRules'];
5706
5707     module.exports = DropBehavior;
5708   }, {
5709     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5710     "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5711     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5712     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5713     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
5714   }],
5715   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js": [function(require, module, exports) {
5716     'use strict';
5717
5718     var is = require('../../../util/ModelUtil').is;
5719
5720
5721     function ModelingFeedback(eventBus, tooltips) {
5722
5723       function showError(position, message) {
5724         tooltips.add({
5725           position: {
5726             x: position.x + 5,
5727             y: position.y + 5
5728           },
5729           type: 'error',
5730           timeout: 2000,
5731           html: '<div>' + message + '</div>'
5732         });
5733       }
5734
5735       eventBus.on(['shape.move.rejected', 'create.rejected'], function(event) {
5736
5737         var context = event.context,
5738           shape = context.shape,
5739           target = context.target;
5740
5741         if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {
5742           showError(event, 'flow elements must be children of pools/participants');
5743         }
5744       });
5745
5746     }
5747
5748
5749     ModelingFeedback.$inject = ['eventBus', 'tooltips'];
5750
5751     module.exports = ModelingFeedback;
5752   }, {
5753     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
5754   }],
5755   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js": [function(require, module, exports) {
5756     'use strict';
5757
5758     var inherits = require('inherits');
5759
5760     var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5761
5762     var is = require('../../../util/ModelUtil').is;
5763
5764
5765     /**
5766      * BPMN specific remove behavior
5767      */
5768     function RemoveBehavior(eventBus, modeling) {
5769
5770       CommandInterceptor.call(this, eventBus);
5771
5772
5773       /**
5774        * morph collaboration diagram into process diagram after the last
5775        * participant has been removed
5776        */
5777
5778       this.preExecute('shape.delete', function(context) {
5779         //delete elementMap[context.shape.id];
5780         //console.log(context.shape.id);
5781         var shape = context.shape,
5782           parent = shape.parent;
5783
5784         // activate the behavior if the shape to be removed
5785         // is a participant
5786         if (is(shape, 'bpmn:Participant')) {
5787           context.collaborationRoot = parent;
5788         }
5789       }, true);
5790
5791       this.postExecute('shape.delete', function(context) {
5792
5793         var collaborationRoot = context.collaborationRoot;
5794
5795         if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
5796           // replace empty collaboration with process diagram
5797           modeling.makeProcess();
5798         }
5799       }, true);
5800
5801     }
5802
5803     RemoveBehavior.$inject = ['eventBus', 'modeling'];
5804
5805     inherits(RemoveBehavior, CommandInterceptor);
5806
5807     module.exports = RemoveBehavior;
5808   }, {
5809     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5810     "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5811     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5812   }],
5813   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js": [function(require, module, exports) {
5814     module.exports = {
5815       __init__: [
5816         'appendBehavior',
5817         'createBehavior',
5818         'dropBehavior',
5819         'removeBehavior',
5820         'modelingFeedback'
5821       ],
5822       appendBehavior: ['type', require('./AppendBehavior')],
5823       dropBehavior: ['type', require('./DropBehavior')],
5824       createBehavior: ['type', require('./CreateBehavior')],
5825       removeBehavior: ['type', require('./RemoveBehavior')],
5826       modelingFeedback: ['type', require('./ModelingFeedback')]
5827     };
5828   }, {
5829     "./AppendBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js",
5830     "./CreateBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js",
5831     "./DropBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js",
5832     "./ModelingFeedback": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js",
5833     "./RemoveBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js"
5834   }],
5835   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js": [function(require, module, exports) {
5836     'use strict';
5837
5838     var Collections = require('diagram-js/lib/util/Collections');
5839
5840
5841     function UpdateCanvasRootHandler(canvas, modeling) {
5842       this._canvas = canvas;
5843       this._modeling = modeling;
5844     }
5845
5846     UpdateCanvasRootHandler.$inject = ['canvas', 'modeling'];
5847
5848     module.exports = UpdateCanvasRootHandler;
5849
5850
5851     UpdateCanvasRootHandler.prototype.execute = function(context) {
5852
5853       var canvas = this._canvas;
5854
5855       var newRoot = context.newRoot,
5856         newRootBusinessObject = newRoot.businessObject,
5857         oldRoot = canvas.getRootElement(),
5858         oldRootBusinessObject = oldRoot.businessObject,
5859         bpmnDefinitions = oldRootBusinessObject.$parent,
5860         diPlane = oldRootBusinessObject.di;
5861
5862       // (1) replace process old <> new root
5863       canvas.setRootElement(newRoot, true);
5864
5865       // (2) update root elements
5866       Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);
5867       newRootBusinessObject.$parent = bpmnDefinitions;
5868
5869       Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);
5870       oldRootBusinessObject.$parent = null;
5871
5872       // (3) wire di
5873       oldRootBusinessObject.di = null;
5874
5875       diPlane.bpmnElement = newRootBusinessObject;
5876       newRootBusinessObject.di = diPlane;
5877
5878       context.oldRoot = oldRoot;
5879     };
5880
5881
5882     UpdateCanvasRootHandler.prototype.revert = function(context) {
5883
5884       var canvas = this._canvas;
5885
5886       var newRoot = context.newRoot,
5887         newRootBusinessObject = newRoot.businessObject,
5888         oldRoot = context.oldRoot,
5889         oldRootBusinessObject = oldRoot.businessObject,
5890         bpmnDefinitions = newRootBusinessObject.$parent,
5891         diPlane = newRootBusinessObject.di;
5892
5893       // (1) replace process old <> new root
5894       canvas.setRootElement(oldRoot, true);
5895
5896       // (2) update root elements
5897       Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);
5898       newRootBusinessObject.$parent = null;
5899
5900       Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);
5901       oldRootBusinessObject.$parent = bpmnDefinitions;
5902
5903       // (3) wire di
5904       newRootBusinessObject.di = null;
5905
5906       diPlane.bpmnElement = oldRootBusinessObject;
5907       oldRootBusinessObject.di = diPlane;
5908     };
5909   }, {
5910     "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
5911   }],
5912   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js": [function(require, module, exports) {
5913     'use strict';
5914
5915     var assign = require('lodash/object/assign'),
5916       pick = require('lodash/object/pick'),
5917       keys = require('lodash/object/keys');
5918
5919     var DEFAULT_FLOW = 'default',
5920       NAME = 'name',
5921       ID = 'id';
5922
5923
5924     /**
5925      * A handler that implements a BPMN 2.0 property update.
5926      *
5927      * This should be used to set simple properties on elements with an underlying
5928      * BPMN business object.
5929      *
5930      * Use respective diagram-js provided handlers if you would like to perform
5931      * automated modeling.
5932      */
5933     function UpdatePropertiesHandler(elementRegistry) {
5934       this._elementRegistry = elementRegistry;
5935     }
5936
5937     UpdatePropertiesHandler.$inject = ['elementRegistry'];
5938
5939     module.exports = UpdatePropertiesHandler;
5940
5941
5942     // //// api /////////////////////////////////////////////
5943
5944     /**
5945      * Updates a BPMN element with a list of new properties
5946      *
5947      * @param {Object}
5948      *            context
5949      * @param {djs.model.Base}
5950      *            context.element the element to update
5951      * @param {Object}
5952      *            context.properties a list of properties to set on the element's
5953      *            businessObject (the BPMN model element)
5954      *
5955      * @return {Array<djs.mode.Base>} the updated element
5956      */
5957     UpdatePropertiesHandler.prototype.execute = function(context) {
5958
5959       var element = context.element,
5960         changed = [element];
5961
5962       if (!element) {
5963         throw new Error('element required');
5964       }
5965
5966       var elementRegistry = this._elementRegistry;
5967
5968       var businessObject = element.businessObject,
5969         properties = context.properties,
5970         oldProperties = context.oldProperties || pick(businessObject, keys(properties));
5971
5972       if (ID in properties) {
5973         elementRegistry.updateId(element, properties[ID]);
5974       }
5975
5976       // correctly indicate visual changes on default flow updates
5977       if (DEFAULT_FLOW in properties) {
5978
5979         if (properties[DEFAULT_FLOW]) {
5980           changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));
5981         }
5982
5983         if (businessObject[DEFAULT_FLOW]) {
5984           changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));
5985         }
5986       }
5987
5988       if (NAME in properties && element.label) {
5989         changed.push(element.label);
5990       }
5991
5992       // update properties
5993       assign(businessObject, properties);
5994
5995
5996       // store old values
5997       context.oldProperties = oldProperties;
5998       context.changed = changed;
5999
6000       // indicate changed on objects affected by the update
6001       return changed;
6002     };
6003
6004     /**
6005      * Reverts the update on a BPMN elements properties.
6006      *
6007      * @param {Object}
6008      *            context
6009      *
6010      * @return {djs.mode.Base} the updated element
6011      */
6012     UpdatePropertiesHandler.prototype.revert = function(context) {
6013
6014       var element = context.element,
6015         oldProperties = context.oldProperties,
6016         businessObject = element.businessObject,
6017         elementRegistry = this._elementRegistry;
6018
6019       assign(businessObject, context.oldProperties);
6020
6021       if (ID in oldProperties) {
6022         elementRegistry.updateId(element, oldProperties[ID]);
6023       }
6024
6025       return context.changed;
6026     };
6027   }, {
6028     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
6029     "lodash/object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
6030     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
6031   }],
6032   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
6033     module.exports = {
6034       __init__: ['modeling', 'bpmnUpdater', 'labelSupport'],
6035       __depends__: [
6036         require('../label-editing'),
6037         require('./rules'),
6038         require('./behavior'),
6039         require('diagram-js/lib/command'),
6040         require('diagram-js/lib/features/tooltips'),
6041         require('diagram-js/lib/features/change-support')
6042       ],
6043       bpmnFactory: ['type', require('./BpmnFactory')],
6044       bpmnUpdater: ['type', require('./BpmnUpdater')],
6045       elementFactory: ['type', require('./ElementFactory')],
6046       modeling: ['type', require('./Modeling')],
6047       labelSupport: ['type', require('./LabelSupport')],
6048       layouter: ['type', require('./BpmnLayouter')],
6049       connectionDocking: ['type', require('diagram-js/lib/layout/CroppingConnectionDocking')]
6050     };
6051
6052   }, {
6053     "../label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
6054     "./BpmnFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js",
6055     "./BpmnLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js",
6056     "./BpmnUpdater": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js",
6057     "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js",
6058     "./LabelSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js",
6059     "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js",
6060     "./behavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js",
6061     "./rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js",
6062     "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
6063     "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
6064     "diagram-js/lib/features/tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js",
6065     "diagram-js/lib/layout/CroppingConnectionDocking": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js"
6066   }],
6067   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js": [function(require, module, exports) {
6068     'use strict';
6069
6070     var groupBy = require('lodash/collection/groupBy'),
6071       size = require('lodash/collection/size'),
6072       find = require('lodash/collection/find'),
6073       inherits = require('inherits');
6074
6075     var getParents = require('../ModelingUtil').getParents,
6076       is = require('../../../util/ModelUtil').is,
6077       getBusinessObject = require('../../../util/ModelUtil').getBusinessObject,
6078       isExpanded = require('../../../util/DiUtil').isExpanded;
6079
6080
6081     var RuleProvider = require('diagram-js/lib/features/rules/RuleProvider');
6082
6083     /**
6084      * BPMN specific modeling rule
6085      */
6086     function BpmnRules(eventBus) {
6087       RuleProvider.call(this, eventBus);
6088     }
6089
6090     inherits(BpmnRules, RuleProvider);
6091
6092     BpmnRules.$inject = ['eventBus'];
6093
6094     module.exports = BpmnRules;
6095
6096     BpmnRules.prototype.init = function() {
6097
6098       this.addRule('connection.create', function(context) {
6099         var source = context.source,
6100           target = context.target;
6101
6102         return canConnect(source, target);
6103       });
6104
6105       this.addRule('connection.reconnectStart', function(context) {
6106
6107         var connection = context.connection,
6108           source = context.hover || context.source,
6109           target = connection.target;
6110
6111         return canConnect(source, target, connection);
6112       });
6113
6114       this.addRule('connection.reconnectEnd', function(context) {
6115
6116         var connection = context.connection,
6117           source = connection.source,
6118           target = context.hover || context.target;
6119
6120         return canConnect(source, target, connection);
6121       });
6122
6123       this.addRule('connection.updateWaypoints', function(context) {
6124         // OK! but visually ignore
6125         return null;
6126       });
6127
6128       this.addRule('shape.resize', function(context) {
6129
6130         var shape = context.shape,
6131           newBounds = context.newBounds;
6132
6133         return canResize(shape, newBounds);
6134       });
6135
6136       this.addRule('shapes.move', function(context) {
6137
6138         var target = context.newParent,
6139           shapes = context.shapes;
6140
6141         return canMove(shapes, target);
6142       });
6143
6144       this.addRule(['shape.create', 'shape.append'], function(context) {
6145         var target = context.parent,
6146           shape = context.shape,
6147           source = context.source;
6148
6149         return canCreate(shape, target, source);
6150       });
6151
6152     };
6153
6154     BpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;
6155
6156     BpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;
6157
6158     BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
6159
6160     BpmnRules.prototype.canMove = canMove;
6161
6162     BpmnRules.prototype.canDrop = canDrop;
6163
6164     BpmnRules.prototype.canCreate = canCreate;
6165
6166     BpmnRules.prototype.canConnect = canConnect;
6167
6168     BpmnRules.prototype.canResize = canResize;
6169
6170     /**
6171      * Utility functions for rule checking
6172      */
6173
6174     function nonExistantOrLabel(element) {
6175       return !element || isLabel(element);
6176     }
6177
6178     function isSame(a, b) {
6179       return a === b;
6180     }
6181
6182     function getOrganizationalParent(element) {
6183
6184       var bo = getBusinessObject(element);
6185
6186       while (bo && !is(bo, 'bpmn:Process')) {
6187         if (is(bo, 'bpmn:Participant')) {
6188           return bo.processRef || bo;
6189         }
6190
6191         bo = bo.$parent;
6192       }
6193
6194       return bo;
6195     }
6196
6197     function isSameOrganization(a, b) {
6198       var parentA = getOrganizationalParent(a),
6199         parentB = getOrganizationalParent(b);
6200
6201       return parentA === parentB;
6202     }
6203
6204     function isMessageFlowSource(element) {
6205       return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6206         is(element, 'bpmn:ThrowEvent') &&
6207         hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6208       ));
6209     }
6210
6211     function isMessageFlowTarget(element) {
6212       return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6213         is(element, 'bpmn:CatchEvent') &&
6214         hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6215       ));
6216     }
6217
6218     function getScopeParent(element) {
6219
6220       var bo = getBusinessObject(element);
6221
6222       if (is(bo, 'bpmn:Participant')) {
6223         return null;
6224       }
6225
6226       while (bo) {
6227         bo = bo.$parent;
6228
6229         if (is(bo, 'bpmn:FlowElementsContainer')) {
6230           return bo;
6231         }
6232       }
6233
6234       return bo;
6235     }
6236
6237     function isSameScope(a, b) {
6238       var scopeParentA = getScopeParent(a),
6239         scopeParentB = getScopeParent(b);
6240
6241       return scopeParentA && (scopeParentA === scopeParentB);
6242     }
6243
6244     function hasEventDefinition(element, eventDefinition) {
6245       var bo = getBusinessObject(element);
6246
6247       return !!find(bo.eventDefinitions || [], function(definition) {
6248         return is(definition, eventDefinition);
6249       });
6250     }
6251
6252     function hasEventDefinitionOrNone(element, eventDefinition) {
6253       var bo = getBusinessObject(element);
6254
6255       return (bo.eventDefinitions || []).every(function(definition) {
6256         return is(definition, eventDefinition);
6257       });
6258     }
6259
6260     function isSequenceFlowSource(element) {
6261       return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(
6262         is(element, 'bpmn:IntermediateThrowEvent') &&
6263         hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6264       );
6265     }
6266
6267     function isSequenceFlowTarget(element) {
6268       return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(
6269         is(element, 'bpmn:IntermediateCatchEvent') &&
6270         hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6271       );
6272     }
6273
6274     function isEventBasedTarget(element) {
6275       return is(element, 'bpmn:ReceiveTask') || (
6276         is(element, 'bpmn:IntermediateCatchEvent') && (
6277           hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
6278           hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
6279           hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
6280           hasEventDefinition(element, 'bpmn:SignalEventDefinition')
6281         )
6282       );
6283     }
6284
6285     function isLabel(element) {
6286       return element.labelTarget;
6287     }
6288
6289     function isConnection(element) {
6290       return element.waypoints;
6291     }
6292
6293     function isParent(possibleParent, element) {
6294       var allParents = getParents(element);
6295       return allParents.indexOf(possibleParent) !== -1;
6296     }
6297
6298     function canConnect(source, target, connection) {
6299
6300       if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {
6301         return null;
6302       }
6303
6304       // See https://github.com/bpmn-io/bpmn-js/issues/178
6305       // as a workround we disallow connections with same
6306       // target and source element.
6307       // This rule must be removed if a auto layout for this
6308       // connections is implemented.
6309       if (isSame(source, target)) {
6310         return false;
6311       }
6312
6313       if (canConnectMessageFlow(source, target) ||
6314         canConnectSequenceFlow(source, target)) {
6315
6316         return true;
6317       }
6318
6319       if (is(connection, 'bpmn:Association')) {
6320         return canConnectAssociation(source, target);
6321       }
6322
6323       return false;
6324     }
6325
6326     /**
6327      * Can an element be dropped into the target element
6328      *
6329      * @return {Boolean}
6330      */
6331     function canDrop(element, target) {
6332
6333       // can move labels everywhere
6334       if (isLabel(element) && !isConnection(target)) {
6335         return true;
6336       }
6337
6338       // allow to create new participants on
6339       // on existing collaboration and process diagrams
6340       if (is(element, 'bpmn:Participant')) {
6341         return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
6342       }
6343
6344       // drop flow elements onto flow element containers
6345       // and participants
6346       if (is(element, 'bpmn:FlowElement')) {
6347         if (is(target, 'bpmn:FlowElementsContainer')) {
6348           return isExpanded(target) !== false;
6349         }
6350
6351         return is(target, 'bpmn:Participant');
6352       }
6353
6354       if (is(element, 'bpmn:Artifact')) {
6355         return is(target, 'bpmn:Collaboration') ||
6356           is(target, 'bpmn:Participant') ||
6357           is(target, 'bpmn:Process');
6358       }
6359
6360       if (is(element, 'bpmn:MessageFlow')) {
6361         return is(target, 'bpmn:Collaboration');
6362       }
6363
6364       return false;
6365     }
6366
6367     function canMove(elements, target) {
6368
6369       // only move if they have the same parent
6370       var sameParent = size(groupBy(elements, function(s) {
6371         return s.parent && s.parent.id;
6372       })) === 1;
6373
6374       if (!sameParent) {
6375         return false;
6376       }
6377
6378       if (!target) {
6379         return true;
6380       }
6381
6382       return elements.every(function(element) {
6383         return canDrop(element, target);
6384       });
6385     }
6386
6387     function canCreate(shape, target, source) {
6388
6389       if (!target) {
6390         return false;
6391       }
6392
6393       if (isLabel(target)) {
6394         return null;
6395       }
6396
6397       if (isSame(source, target)) {
6398         return false;
6399       }
6400
6401       // ensure we do not drop the element
6402       // into source
6403       if (source && isParent(source, target)) {
6404         return false;
6405       }
6406
6407       return canDrop(shape, target);
6408     }
6409
6410     function canResize(shape, newBounds) {
6411       if (is(shape, 'bpmn:SubProcess')) {
6412         return isExpanded(shape) && (!newBounds || (newBounds.width >= 100 && newBounds.height >= 80));
6413       }
6414
6415       if (is(shape, 'bpmn:Participant')) {
6416         return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);
6417       }
6418
6419       if (is(shape, 'bpmn:TextAnnotation')) {
6420         return true;
6421       }
6422       if (is(shape, 'bpmn:MultiBranchConnector')) {
6423         return false;
6424       }
6425
6426       return true;
6427     }
6428
6429     function canConnectAssociation(source, target) {
6430
6431       // do not connect connections
6432       if (isConnection(source) || isConnection(target)) {
6433         return false;
6434       }
6435
6436       // connect if different parent
6437       return !isParent(target, source) &&
6438         !isParent(source, target);
6439     }
6440
6441     function canConnectMessageFlow(source, target) {
6442
6443       return isMessageFlowSource(source) &&
6444         isMessageFlowTarget(target) &&
6445         !isSameOrganization(source, target);
6446     }
6447
6448     function canConnectSequenceFlow(source, target) {
6449
6450       return isSequenceFlowSource(source) &&
6451         isSequenceFlowTarget(target) &&
6452         isSameScope(source, target) &&
6453         !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
6454     }
6455   }, {
6456     "../../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
6457     "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
6458     "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
6459     "diagram-js/lib/features/rules/RuleProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js",
6460     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
6461     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
6462     "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
6463     "lodash/collection/size": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js"
6464   }],
6465   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js": [function(require, module, exports) {
6466     module.exports = {
6467       __depends__: [
6468         require('diagram-js/lib/features/rules')
6469       ],
6470       __init__: ['bpmnRules'],
6471       bpmnRules: ['type', require('./BpmnRules')]
6472     };
6473
6474   }, {
6475     "./BpmnRules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js",
6476     "diagram-js/lib/features/rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js"
6477   }],
6478   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js": [function(require, module, exports) {
6479     'use strict';
6480
6481     var assign = require('lodash/object/assign');
6482
6483     /**
6484      * A palette provider for BPMN 2.0 elements.
6485      */
6486     function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
6487
6488       this._create = create;
6489       this._elementFactory = elementFactory;
6490       this._spaceTool = spaceTool;
6491       this._lassoTool = lassoTool;
6492
6493       palette.registerProvider(this);
6494     }
6495
6496     module.exports = PaletteProvider;
6497
6498     PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool'];
6499
6500
6501     PaletteProvider.prototype.getPaletteEntries = function(element) {
6502
6503       var actions = {},
6504         create = this._create,
6505         elementFactory = this._elementFactory,
6506         spaceTool = this._spaceTool,
6507         lassoTool = this._lassoTool;
6508
6509
6510       function createAction(type, group, className, title, options) {
6511         function createListener(event) {
6512           var shape = elementFactory.createShape(assign({
6513             type: type
6514           }, options));
6515
6516           if (options) {
6517             shape.businessObject.di.isExpanded = options.isExpanded;
6518           }
6519
6520           create.start(event, shape);
6521         }
6522
6523         var shortType = type.replace(/^bpmn\:/, '');
6524
6525         return {
6526           group: group,
6527           className: className,
6528           title: title || 'Create ' + shortType,
6529           action: {
6530             dragstart: createListener,
6531             click: createListener
6532           }
6533         };
6534       }
6535
6536       function createParticipant(event, collapsed) {
6537         create.start(event, elementFactory.createParticipantShape(collapsed));
6538       }
6539
6540       assign(actions, {
6541         'create.start-event': createAction(
6542           'bpmn:StartEvent', 'event', 'icon-start-event-none', "Start"
6543         ),
6544         'create.collector': createAction(
6545           'bpmn:Collector', 'event', 'icon-collector-node', 'Collector'
6546         ),
6547         'create.String-Match': createAction(
6548           'bpmn:StringMatch', 'event', 'icon-stringmatch-node', 'String Match'
6549         ),
6550         'create.ves-collector': createAction(
6551           'bpmn:VesCollector', 'event', 'icon-ves-collector-node', 'Ves Collector'
6552         ),
6553         'create.holmes': createAction(
6554           'bpmn:Holmes', 'event', 'icon-holmes-node', 'Holmes'
6555         ),
6556
6557
6558         'create.TCA': createAction(
6559           'bpmn:TCA', 'event', 'icon-tca-node', 'TCA'
6560         ),
6561         'create.Aand-AI': createAction(
6562           'bpmn:Policy', 'event', 'icon-policy-node', 'Policy'
6563         ),
6564         'create.end-event': createAction(
6565           'bpmn:EndEvent', 'event', 'icon-end-event-none', "End"
6566         )
6567       });
6568
6569       return actions;
6570     };
6571
6572   }, {
6573     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
6574   }],
6575   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
6576     module.exports = {
6577       __depends__: [
6578         require('diagram-js/lib/features/palette'),
6579         require('diagram-js/lib/features/create')
6580       ],
6581       __init__: ['paletteProvider'],
6582       paletteProvider: ['type', require('./PaletteProvider')]
6583     };
6584
6585   }, {
6586     "./PaletteProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js",
6587     "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
6588     "diagram-js/lib/features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js"
6589   }],
6590   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js": [function(require, module, exports) {
6591     'use strict';
6592
6593     var forEach = require('lodash/collection/forEach'),
6594       filter = require('lodash/collection/filter');
6595
6596     var REPLACE_OPTIONS = require('./ReplaceOptions');
6597
6598     var startEventReplace = REPLACE_OPTIONS.START_EVENT,
6599       intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,
6600       endEventReplace = REPLACE_OPTIONS.END_EVENT,
6601       gatewayReplace = REPLACE_OPTIONS.GATEWAY,
6602       taskReplace = REPLACE_OPTIONS.TASK;
6603
6604
6605     /**
6606      * A replace menu provider that gives users the controls to choose and replace
6607      * BPMN elements with each other.
6608      *
6609      * @param {BpmnFactory}
6610      *            bpmnFactory
6611      * @param {Moddle}
6612      *            moddle
6613      * @param {PopupMenu}
6614      *            popupMenu
6615      * @param {Replace}
6616      *            replace
6617      */
6618     function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {
6619
6620       /**
6621        * Prepares a new business object for the replacement element and triggers
6622        * the replace operation.
6623        *
6624        * @param {djs.model.Base}
6625        *            element
6626        * @param {Object}
6627        *            target
6628        * @return {djs.model.Base} the newly created element
6629        */
6630       function replaceElement(element, target) {
6631
6632         var type = target.type,
6633           oldBusinessObject = element.businessObject,
6634           businessObject = bpmnFactory.create(type);
6635
6636         var newElement = {
6637           type: type,
6638           businessObject: businessObject
6639         };
6640
6641         // initialize custom BPMN extensions
6642
6643         if (target.eventDefinition) {
6644           var eventDefinitions = businessObject.get('eventDefinitions'),
6645             eventDefinition = moddle.create(target.eventDefinition);
6646
6647           eventDefinitions.push(eventDefinition);
6648         }
6649
6650         if (target.instantiate !== undefined) {
6651           businessObject.instantiate = target.instantiate;
6652         }
6653
6654         if (target.eventGatewayType !== undefined) {
6655           businessObject.eventGatewayType = target.eventGatewayType;
6656         }
6657
6658         // copy size (for activities only)
6659         if (oldBusinessObject.$instanceOf('bpmn:Activity')) {
6660
6661           // TODO: need also to respect min/max Size
6662
6663           newElement.width = element.width;
6664           newElement.height = element.height;
6665         }
6666
6667         // TODO: copy other elligable properties from old business object
6668         businessObject.name = oldBusinessObject.name;
6669
6670         newElement = replace.replaceElement(element, newElement);
6671
6672         selection.select(newElement);
6673
6674         return newElement;
6675       }
6676
6677
6678       function getReplaceOptions(element) {
6679
6680         var menuEntries = [];
6681         var businessObject = element.businessObject;
6682
6683         if (businessObject.$instanceOf('bpmn:StartEvent')) {
6684           addEntries(startEventReplace, filterEvents);
6685         } else
6686
6687         if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||
6688           businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {
6689
6690           addEntries(intermediateEventReplace, filterEvents);
6691         } else
6692
6693         if (businessObject.$instanceOf('bpmn:EndEvent')) {
6694
6695           addEntries(endEventReplace, filterEvents);
6696         } else
6697
6698         if (businessObject.$instanceOf('bpmn:Gateway')) {
6699
6700           addEntries(gatewayReplace, function(entry) {
6701
6702             return entry.target.type !== businessObject.$type;
6703           });
6704         } else
6705
6706         if (businessObject.$instanceOf('bpmn:FlowNode')) {
6707           addEntries(taskReplace, function(entry) {
6708             return entry.target.type !== businessObject.$type;
6709           });
6710         }
6711
6712         function filterEvents(entry) {
6713
6714           var target = entry.target;
6715
6716           var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;
6717           var isEventDefinitionEqual = target.eventDefinition == eventDefinition;
6718           var isEventTypeEqual = businessObject.$type == target.type;
6719
6720           return ((!isEventDefinitionEqual && isEventTypeEqual) ||
6721               !isEventTypeEqual) ||
6722             !(isEventDefinitionEqual && isEventTypeEqual);
6723         }
6724
6725         function addEntries(entries, filterFun) {
6726           // Filter selected type from the array
6727           var filteredEntries = filter(entries, filterFun);
6728
6729           // Add entries to replace menu
6730           forEach(filteredEntries, function(definition) {
6731
6732             var entry = addMenuEntry(definition);
6733             menuEntries.push(entry);
6734           });
6735         }
6736
6737         function addMenuEntry(definition) {
6738
6739           return {
6740             label: definition.label,
6741             className: definition.className,
6742             action: {
6743               name: definition.actionName,
6744               handler: function() {
6745                 replaceElement(element, definition.target);
6746               }
6747             }
6748           };
6749         }
6750
6751         return menuEntries;
6752       }
6753
6754
6755       // API
6756
6757       this.openChooser = function(position, element) {
6758         var entries = this.getReplaceOptions(element);
6759
6760         popupMenu.open('replace-menu', position, entries);
6761       };
6762
6763       this.getReplaceOptions = getReplaceOptions;
6764
6765       this.replaceElement = replaceElement;
6766     }
6767
6768     BpmnReplace.$inject = ['bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection'];
6769
6770     module.exports = BpmnReplace;
6771   }, {
6772     "./ReplaceOptions": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js",
6773     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
6774     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
6775   }],
6776   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js": [function(require, module, exports) {
6777     'use strict';
6778
6779     module.exports.START_EVENT = [{
6780       label: 'Start Event',
6781       actionName: 'replace-with-none-start',
6782       className: 'icon-start-event-none',
6783       target: {
6784         type: 'bpmn:StartEvent'
6785       }
6786     }, {
6787       label: 'Intermediate Throw Event',
6788       actionName: 'replace-with-intermediate-throwing',
6789       className: 'icon-intermediate-event-none',
6790       target: {
6791         type: 'bpmn:IntermediateThrowEvent'
6792       }
6793     }, {
6794       label: 'End Event',
6795       actionName: 'replace-with-message-end',
6796       className: 'icon-end-event-none',
6797       target: {
6798         type: 'bpmn:EndEvent'
6799       }
6800     }, {
6801       label: 'Message Start Event',
6802       actionName: 'replace-with-message-start',
6803       className: 'icon-start-event-message',
6804       target: {
6805         type: 'bpmn:StartEvent',
6806         eventDefinition: 'bpmn:MessageEventDefinition'
6807       }
6808     }, {
6809       label: 'Timer Start Event',
6810       actionName: 'replace-with-timer-start',
6811       className: 'icon-start-event-timer',
6812       target: {
6813         type: 'bpmn:StartEvent',
6814         eventDefinition: 'bpmn:TimerEventDefinition'
6815       }
6816     }, {
6817       label: 'Conditional Start Event',
6818       actionName: 'replace-with-conditional-start',
6819       className: 'icon-start-event-condition',
6820       target: {
6821         type: 'bpmn:StartEvent',
6822         eventDefinition: 'bpmn:ConditionalEventDefinition'
6823       }
6824     }, {
6825       label: 'Signal Start Event',
6826       actionName: 'replace-with-signal-start',
6827       className: 'icon-start-event-signal',
6828       target: {
6829         type: 'bpmn:StartEvent',
6830         eventDefinition: 'bpmn:SignalEventDefinition'
6831       }
6832     }];
6833
6834     module.exports.INTERMEDIATE_EVENT = [{
6835       label: 'Start Event',
6836       actionName: 'replace-with-none-start',
6837       className: 'icon-start-event-none',
6838       target: {
6839         type: 'bpmn:StartEvent'
6840       }
6841     }, {
6842       label: 'Intermediate Throw Event',
6843       actionName: 'replace-with-message-intermediate-throw',
6844       className: 'icon-intermediate-event-none',
6845       target: {
6846         type: 'bpmn:IntermediateThrowEvent'
6847       }
6848     }, {
6849       label: 'End Event',
6850       actionName: 'replace-with-message-end',
6851       className: 'icon-end-event-none',
6852       target: {
6853         type: 'bpmn:EndEvent'
6854       }
6855     }, {
6856       label: 'Message Intermediate Catch Event',
6857       actionName: 'replace-with-intermediate-catch',
6858       className: 'icon-intermediate-event-catch-message',
6859       target: {
6860         type: 'bpmn:IntermediateCatchEvent',
6861         eventDefinition: 'bpmn:MessageEventDefinition'
6862       }
6863     }, {
6864       label: 'Message Intermediate Throw Event',
6865       actionName: 'replace-with-intermediate-throw',
6866       className: 'icon-intermediate-event-throw-message',
6867       target: {
6868         type: 'bpmn:IntermediateThrowEvent',
6869         eventDefinition: 'bpmn:MessageEventDefinition'
6870       }
6871     }, {
6872       label: 'Timer Intermediate Catch Event',
6873       actionName: 'replace-with-timer-intermediate-catch',
6874       className: 'icon-intermediate-event-catch-timer',
6875       target: {
6876         type: 'bpmn:IntermediateCatchEvent',
6877         eventDefinition: 'bpmn:TimerEventDefinition'
6878       }
6879     }, {
6880       label: 'Escalation Intermediate Catch Event',
6881       actionName: 'replace-with-escalation-catch',
6882       className: 'icon-intermediate-event-catch-escalation',
6883       target: {
6884         type: 'bpmn:IntermediateCatchEvent',
6885         eventDefinition: 'bpmn:EscalationEventDefinition'
6886       }
6887     }, {
6888       label: 'Conditional Intermediate Catch Event',
6889       actionName: 'replace-with-conditional-intermediate-catch',
6890       className: 'icon-intermediate-event-catch-condition',
6891       target: {
6892         type: 'bpmn:IntermediateCatchEvent',
6893         eventDefinition: 'bpmn:ConditionalEventDefinition'
6894       }
6895     }, {
6896       label: 'Link Intermediate Catch Event',
6897       actionName: 'replace-with-link-intermediate-catch',
6898       className: 'icon-intermediate-event-catch-link',
6899       target: {
6900         type: 'bpmn:IntermediateCatchEvent',
6901         eventDefinition: 'bpmn:LinkEventDefinition'
6902       }
6903     }, {
6904       label: 'Link Intermediate Throw Event',
6905       actionName: 'replace-with-link-intermediate-throw',
6906       className: 'icon-intermediate-event-throw-link',
6907       target: {
6908         type: 'bpmn:IntermediateThrowEvent',
6909         eventDefinition: 'bpmn:LinkEventDefinition'
6910       }
6911     }, {
6912       label: 'Compensation Intermediate Throw Event',
6913       actionName: 'replace-with-compensation-intermediate-throw',
6914       className: 'icon-intermediate-event-throw-compensation',
6915       target: {
6916         type: 'bpmn:IntermediateThrowEvent',
6917         eventDefinition: 'bpmn:CompensateEventDefinition'
6918       }
6919     }, {
6920       label: 'Signal Throw Catch Event',
6921       actionName: 'replace-with-throw-intermediate-catch',
6922       className: 'icon-intermediate-event-catch-signal',
6923       target: {
6924         type: 'bpmn:IntermediateCatchEvent',
6925         eventDefinition: 'bpmn:SignalEventDefinition'
6926       }
6927     }, {
6928       label: 'Signal Intermediate Throw Event',
6929       actionName: 'replace-with-signal-intermediate-throw',
6930       className: 'icon-intermediate-event-throw-signal',
6931       target: {
6932         type: 'bpmn:IntermediateThrowEvent',
6933         eventDefinition: 'bpmn:SignalEventDefinition'
6934       }
6935     }];
6936
6937     module.exports.END_EVENT = [{
6938       label: 'Start Event',
6939       actionName: 'replace-with-none-start',
6940       className: 'icon-start-event-none',
6941       target: {
6942         type: 'bpmn:StartEvent'
6943       }
6944     }, {
6945       label: 'Intermediate Throw Event',
6946       actionName: 'replace-with-message-intermediate-throw',
6947       className: 'icon-intermediate-event-none',
6948       target: {
6949         type: 'bpmn:IntermediateThrowEvent'
6950       }
6951     }, {
6952       label: 'End Event',
6953       actionName: 'replace-with-none-end',
6954       className: 'icon-end-event-none',
6955       target: {
6956         type: 'bpmn:EndEvent'
6957       }
6958     }, {
6959       label: 'Message End Event',
6960       actionName: 'replace-with-message-end',
6961       className: 'icon-end-event-message',
6962       target: {
6963         type: 'bpmn:EndEvent',
6964         eventDefinition: 'bpmn:MessageEventDefinition'
6965       }
6966     }, {
6967       label: 'Escalation End Event',
6968       actionName: 'replace-with-escalation-end',
6969       className: 'icon-end-event-escalation',
6970       target: {
6971         type: 'bpmn:EndEvent',
6972         eventDefinition: 'bpmn:EscalationEventDefinition'
6973       }
6974     }, {
6975       label: 'Error End Event',
6976       actionName: 'replace-with-error-end',
6977       className: 'icon-end-event-error',
6978       target: {
6979         type: 'bpmn:EndEvent',
6980         eventDefinition: 'bpmn:ErrorEventDefinition'
6981       }
6982     }, {
6983       label: 'Cancel End Event',
6984       actionName: 'replace-with-cancel-end',
6985       className: 'icon-end-event-cancel',
6986       target: {
6987         type: 'bpmn:EndEvent',
6988         eventDefinition: 'bpmn:CancelEventDefinition'
6989       }
6990     }, {
6991       label: 'Compensation End Event',
6992       actionName: 'replace-with-compensation-end',
6993       className: 'icon-end-event-compensation',
6994       target: {
6995         type: 'bpmn:EndEvent',
6996         eventDefinition: 'bpmn:CompensateEventDefinition'
6997       }
6998     }, {
6999       label: 'Signal End Event',
7000       actionName: 'replace-with-signal-end',
7001       className: 'icon-end-event-signal',
7002       target: {
7003         type: 'bpmn:EndEvent',
7004         eventDefinition: 'bpmn:SignalEventDefinition'
7005       }
7006     }, {
7007       label: 'Terminate End Event',
7008       actionName: 'replace-with-terminate-end',
7009       className: 'icon-end-event-terminate',
7010       target: {
7011         type: 'bpmn:EndEvent',
7012         eventDefinition: 'bpmn:TerminateEventDefinition'
7013       }
7014     }];
7015
7016     module.exports.GATEWAY = [{
7017         label: 'Exclusive Gateway',
7018         actionName: 'replace-with-exclusive-gateway',
7019         className: 'icon-gateway-xor',
7020         target: {
7021           type: 'bpmn:ExclusiveGateway'
7022         }
7023       }, {
7024         label: 'Parallel Gateway',
7025         actionName: 'replace-with-parallel-gateway',
7026         className: 'icon-gateway-parallel',
7027         target: {
7028           type: 'bpmn:ParallelGateway'
7029         }
7030       }, {
7031         label: 'Inclusive Gateway',
7032         actionName: 'replace-with-inclusive-gateway',
7033         className: 'icon-gateway-or',
7034         target: {
7035           type: 'bpmn:InclusiveGateway'
7036         }
7037       }, {
7038         label: 'Complex Gateway',
7039         actionName: 'replace-with-complex-gateway',
7040         className: 'icon-gateway-complex',
7041         target: {
7042           type: 'bpmn:ComplexGateway'
7043         }
7044       }, {
7045         label: 'Event based Gateway',
7046         actionName: 'replace-with-event-based-gateway',
7047         className: 'icon-gateway-eventbased',
7048         target: {
7049           type: 'bpmn:EventBasedGateway',
7050           instantiate: false,
7051           eventGatewayType: 'Exclusive'
7052         }
7053       }
7054       // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
7055       // {
7056       // label: 'Event based instantiating Gateway',
7057       // actionName: 'replace-with-exclusive-event-based-gateway',
7058       // className: 'icon-exclusive-event-based',
7059       // target: {
7060       // type: 'bpmn:EventBasedGateway'
7061       // },
7062       // options: {
7063       // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }
7064       // }
7065       // },
7066       // {
7067       // label: 'Parallel Event based instantiating Gateway',
7068       // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
7069       // className: 'icon-parallel-event-based-instantiate-gateway',
7070       // target: {
7071       // type: 'bpmn:EventBasedGateway'
7072       // },
7073       // options: {
7074       // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }
7075       // }
7076       // }
7077     ];
7078
7079
7080     module.exports.TASK = [{
7081       label: 'Task',
7082       actionName: 'replace-with-task',
7083       className: 'icon-task',
7084       target: {
7085         type: 'bpmn:Task'
7086       }
7087     }, {
7088       label: 'Send Task',
7089       actionName: 'replace-with-send-task',
7090       className: 'icon-send',
7091       target: {
7092         type: 'bpmn:SendTask'
7093       }
7094     }, {
7095       label: 'Receive Task',
7096       actionName: 'replace-with-receive-task',
7097       className: 'icon-receive',
7098       target: {
7099         type: 'bpmn:ReceiveTask'
7100       }
7101     }, {
7102       label: 'User Task',
7103       actionName: 'replace-with-user-task',
7104       className: 'icon-user',
7105       target: {
7106         type: 'bpmn:UserTask'
7107       }
7108     }, {
7109       label: 'Manual Task',
7110       actionName: 'replace-with-manual-task',
7111       className: 'icon-manual',
7112       target: {
7113         type: 'bpmn:ManualTask'
7114       }
7115     }, {
7116       label: 'Business Rule Task',
7117       actionName: 'replace-with-rule-task',
7118       className: 'icon-business-rule',
7119       target: {
7120         type: 'bpmn:BusinessRuleTask'
7121       }
7122     }, {
7123       label: 'Service Task',
7124       actionName: 'replace-with-service-task',
7125       className: 'icon-service',
7126       target: {
7127         type: 'bpmn:ServiceTask'
7128       }
7129     }, {
7130       label: 'Script Task',
7131       actionName: 'replace-with-script-task',
7132       className: 'icon-script',
7133       target: {
7134         type: 'bpmn:ScriptTask'
7135       }
7136     }];
7137   }, {}],
7138   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
7139     module.exports = {
7140       __depends__: [
7141         require('diagram-js/lib/features/popup-menu'),
7142         require('diagram-js/lib/features/replace'),
7143         require('diagram-js/lib/features/selection')
7144       ],
7145       bpmnReplace: ['type', require('./BpmnReplace')]
7146     };
7147   }, {
7148     "./BpmnReplace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js",
7149     "diagram-js/lib/features/popup-menu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js",
7150     "diagram-js/lib/features/replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js",
7151     "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
7152   }],
7153   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js": [function(require, module, exports) {
7154     'use strict';
7155
7156     var inherits = require('inherits');
7157
7158     var forEach = require('lodash/collection/forEach');
7159
7160     var getBoundingBox = require('diagram-js/lib/util/Elements').getBBox;
7161     var is = require('../modeling/ModelingUtil').is;
7162
7163     var Snapping = require('diagram-js/lib/features/snapping/Snapping'),
7164       SnapUtil = require('diagram-js/lib/features/snapping/SnapUtil');
7165
7166     var is = require('../../util/ModelUtil').is;
7167
7168     var mid = SnapUtil.mid,
7169       topLeft = SnapUtil.topLeft,
7170       bottomRight = SnapUtil.bottomRight;
7171
7172     var round = Math.round;
7173
7174
7175     /**
7176      * BPMN specific snapping functionality
7177      *  * snap on process elements if a pool is created inside a process diagram
7178      *
7179      * @param {EventBus}
7180      *            eventBus
7181      * @param {Canvas}
7182      *            canvas
7183      */
7184     function BpmnSnapping(eventBus, canvas) {
7185
7186       // instantiate super
7187       Snapping.call(this, eventBus, canvas);
7188
7189
7190       /**
7191        * Drop participant on process <> process elements snapping
7192        */
7193
7194       function initParticipantSnapping(context, shape, elements) {
7195
7196         if (!elements.length) {
7197           return;
7198         }
7199
7200         var snapBox = getBoundingBox(elements.filter(function(e) {
7201           return !e.labelTarget && !e.waypoints;
7202         }));
7203
7204         snapBox.x -= 50;
7205         snapBox.y -= 20;
7206         snapBox.width += 70;
7207         snapBox.height += 40;
7208
7209         // adjust shape height to include bounding box
7210         shape.width = Math.max(shape.width, snapBox.width);
7211         shape.height = Math.max(shape.height, snapBox.height);
7212
7213         context.participantSnapBox = snapBox;
7214       }
7215
7216       function snapParticipant(snapBox, shape, event) {
7217
7218         var shapeHalfWidth = shape.width / 2 - 30,
7219           shapeHalfHeight = shape.height / 2;
7220
7221         var currentTopLeft = {
7222           x: event.x - shapeHalfWidth - 30,
7223           y: event.y - shapeHalfHeight
7224         };
7225
7226         var currentBottomRight = {
7227           x: event.x + shapeHalfWidth + 30,
7228           y: event.y + shapeHalfHeight
7229         };
7230
7231         var snapTopLeft = snapBox,
7232           snapBottomRight = bottomRight(snapBox);
7233
7234         if (currentTopLeft.x >= snapTopLeft.x) {
7235           event.x = snapTopLeft.x + 30 + shapeHalfWidth;
7236           event.snapped = true;
7237         } else
7238         if (currentBottomRight.x <= snapBottomRight.x) {
7239           event.x = snapBottomRight.x - 30 - shapeHalfWidth;
7240           event.snapped = true;
7241         }
7242
7243         if (currentTopLeft.y >= snapTopLeft.y) {
7244           event.y = snapTopLeft.y + shapeHalfHeight;
7245           event.snapped = true;
7246         } else
7247         if (currentBottomRight.y <= snapBottomRight.y) {
7248           event.y = snapBottomRight.y - shapeHalfHeight;
7249           event.snapped = true;
7250         }
7251       }
7252
7253       eventBus.on('create.start', function(event) {
7254
7255         var context = event.context,
7256           shape = context.shape,
7257           rootElement = canvas.getRootElement();
7258
7259         // snap participant around existing elements (if any)
7260         if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {
7261
7262           initParticipantSnapping(context, shape, rootElement.children);
7263         }
7264       });
7265
7266       eventBus.on(['create.move', 'create.end'], 1500, function(event) {
7267
7268         var context = event.context,
7269           shape = context.shape,
7270           participantSnapBox = context.participantSnapBox;
7271
7272         if (!event.snapped && participantSnapBox) {
7273           snapParticipant(participantSnapBox, shape, event);
7274         }
7275       });
7276
7277       eventBus.on('resize.start', 1500, function(event) {
7278         var context = event.context,
7279           shape = context.shape;
7280
7281         if (is(shape, 'bpmn:SubProcess')) {
7282           context.minDimensions = {
7283             width: 140,
7284             height: 120
7285           };
7286         }
7287
7288         if (is(shape, 'bpmn:Participant')) {
7289           context.minDimensions = {
7290             width: 400,
7291             height: 200
7292           };
7293         }
7294
7295         if (is(shape, 'bpmn:TextAnnotation')) {
7296           context.minDimensions = {
7297             width: 50,
7298             height: 50
7299           };
7300         }
7301       });
7302
7303     }
7304
7305     inherits(BpmnSnapping, Snapping);
7306
7307     BpmnSnapping.$inject = ['eventBus', 'canvas'];
7308
7309     module.exports = BpmnSnapping;
7310
7311
7312     BpmnSnapping.prototype.initSnap = function(event) {
7313
7314       var context = event.context,
7315         shape = context.shape,
7316         shapeMid,
7317         shapeBounds,
7318         shapeTopLeft,
7319         shapeBottomRight,
7320         snapContext;
7321
7322
7323       snapContext = Snapping.prototype.initSnap.call(this, event);
7324
7325       if (is(shape, 'bpmn:Participant')) {
7326         // assign higher priority for outer snaps on participants
7327         snapContext.setSnapLocations(['top-left', 'bottom-right', 'mid']);
7328       }
7329
7330
7331       if (shape) {
7332
7333         shapeMid = mid(shape, event);
7334
7335         shapeBounds = {
7336           width: shape.width,
7337           height: shape.height,
7338           x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,
7339           y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,
7340         };
7341
7342         shapeTopLeft = topLeft(shapeBounds);
7343         shapeBottomRight = bottomRight(shapeBounds);
7344
7345         snapContext.setSnapOrigin('top-left', {
7346           x: shapeTopLeft.x - event.x,
7347           y: shapeTopLeft.y - event.y
7348         });
7349
7350         snapContext.setSnapOrigin('bottom-right', {
7351           x: shapeBottomRight.x - event.x,
7352           y: shapeBottomRight.y - event.y
7353         });
7354
7355
7356         forEach(shape.outgoing, function(c) {
7357           var docking = c.waypoints[0];
7358
7359           docking = docking.original || docking;
7360
7361           snapContext.setSnapOrigin(c.id + '-docking', {
7362             x: docking.x - event.x,
7363             y: docking.y - event.y
7364           });
7365         });
7366
7367         forEach(shape.incoming, function(c) {
7368           var docking = c.waypoints[c.waypoints.length - 1];
7369
7370           docking = docking.original || docking;
7371
7372           snapContext.setSnapOrigin(c.id + '-docking', {
7373             x: docking.x - event.x,
7374             y: docking.y - event.y
7375           });
7376         });
7377
7378       }
7379
7380       var source = context.source;
7381
7382       if (source) {
7383         snapContext.addDefaultSnap('mid', mid(source));
7384       }
7385     };
7386
7387
7388     BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
7389
7390       var siblings = this.getSiblings(shape, target);
7391
7392
7393       forEach(siblings, function(s) {
7394         snapPoints.add('mid', mid(s));
7395
7396         if (is(s, 'bpmn:Participant')) {
7397           snapPoints.add('top-left', topLeft(s));
7398           snapPoints.add('bottom-right', bottomRight(s));
7399         }
7400       });
7401
7402       forEach(shape.incoming, function(c) {
7403
7404         if (siblings.indexOf(c.source) === -1) {
7405           snapPoints.add('mid', mid(c.source));
7406
7407           var docking = c.waypoints[0];
7408           snapPoints.add(c.id + '-docking', docking.original || docking);
7409         }
7410       });
7411
7412
7413       forEach(shape.outgoing, function(c) {
7414
7415         if (siblings.indexOf(c.target) === -1) {
7416           snapPoints.add('mid', mid(c.target));
7417
7418           var docking = c.waypoints[c.waypoints.length - 1];
7419           snapPoints.add(c.id + '-docking', docking.original || docking);
7420         }
7421       });
7422
7423     };
7424   }, {
7425     "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
7426     "../modeling/ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
7427     "diagram-js/lib/features/snapping/SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
7428     "diagram-js/lib/features/snapping/Snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js",
7429     "diagram-js/lib/util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
7430     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
7431     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
7432   }],
7433   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js": [function(require, module, exports) {
7434     module.exports = {
7435       __init__: ['snapping'],
7436       snapping: ['type', require('./BpmnSnapping')]
7437     };
7438   }, {
7439     "./BpmnSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js"
7440   }],
7441   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js": [function(require, module, exports) {
7442     'use strict';
7443
7444     var assign = require('lodash/object/assign'),
7445       map = require('lodash/collection/map');
7446
7447     var LabelUtil = require('../util/LabelUtil');
7448
7449     var hasExternalLabel = LabelUtil.hasExternalLabel,
7450       getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
7451       isExpanded = require('../util/DiUtil').isExpanded,
7452       elementToString = require('./Util').elementToString;
7453
7454
7455     function elementData(semantic, attrs) {
7456       return assign({
7457         id: semantic.id,
7458         type: semantic.$type,
7459         businessObject: semantic
7460       }, attrs);
7461     }
7462
7463     function collectWaypoints(waypoints) {
7464       return map(waypoints, function(p) {
7465         return {
7466           x: p.x,
7467           y: p.y
7468         };
7469       });
7470     }
7471
7472
7473     /**
7474      * An importer that adds bpmn elements to the canvas
7475      *
7476      * @param {EventBus}
7477      *            eventBus
7478      * @param {Canvas}
7479      *            canvas
7480      * @param {ElementFactory}
7481      *            elementFactory
7482      * @param {ElementRegistry}
7483      *            elementRegistry
7484      */
7485     function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
7486       this._eventBus = eventBus;
7487       this._canvas = canvas;
7488
7489       this._elementFactory = elementFactory;
7490       this._elementRegistry = elementRegistry;
7491     }
7492
7493     BpmnImporter.$inject = ['eventBus', 'canvas', 'elementFactory', 'elementRegistry'];
7494
7495     module.exports = BpmnImporter;
7496
7497
7498     /**
7499      * Add bpmn element (semantic) to the canvas onto the specified parent shape.
7500      */
7501     BpmnImporter.prototype.add = function(semantic, parentElement) {
7502
7503       var di = semantic.di,
7504         element;
7505
7506       // ROOT ELEMENT
7507       // handle the special case that we deal with a
7508       // invisible root element (process or collaboration)
7509       if (di.$instanceOf('bpmndi:BPMNPlane')) {
7510
7511         // add a virtual element (not being drawn)
7512         element = this._elementFactory.createRoot(elementData(semantic));
7513
7514         this._canvas.setRootElement(element);
7515       }
7516
7517       // SHAPE
7518       else if (di.$instanceOf('bpmndi:BPMNShape')) {
7519
7520         var collapsed = !isExpanded(semantic);
7521         var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
7522
7523         var bounds = semantic.di.bounds;
7524
7525         element = this._elementFactory.createShape(elementData(semantic, {
7526           collapsed: collapsed,
7527           hidden: hidden,
7528           x: Math.round(bounds.x),
7529           y: Math.round(bounds.y),
7530           width: Math.round(bounds.width),
7531           height: Math.round(bounds.height)
7532         }));
7533
7534         this._canvas.addShape(element, parentElement);
7535       }
7536
7537       // CONNECTION
7538       else if (di.$instanceOf('bpmndi:BPMNEdge')) {
7539
7540         var source = this._getSource(semantic),
7541           target = this._getTarget(semantic);
7542
7543         element = this._elementFactory.createConnection(elementData(semantic, {
7544           source: source,
7545           target: target,
7546           waypoints: collectWaypoints(semantic.di.waypoint)
7547         }));
7548
7549         this._canvas.addConnection(element, parentElement);
7550       } else {
7551         throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
7552       }
7553
7554       // (optional) LABEL
7555       if (hasExternalLabel(semantic)) {
7556         this.addLabel(semantic, element);
7557       }
7558
7559
7560       this._eventBus.fire('bpmnElement.added', {
7561         element: element
7562       });
7563
7564       return element;
7565     };
7566
7567
7568     /**
7569      * add label for an element
7570      */
7571     BpmnImporter.prototype.addLabel = function(semantic, element) {
7572       var bounds = getExternalLabelBounds(semantic, element);
7573
7574       var label = this._elementFactory.createLabel(elementData(semantic, {
7575         id: semantic.id + '_label',
7576         labelTarget: element,
7577         type: 'label',
7578         hidden: element.hidden,
7579         x: Math.round(bounds.x),
7580         y: Math.round(bounds.y),
7581         width: Math.round(bounds.width),
7582         height: Math.round(bounds.height)
7583       }));
7584
7585       return this._canvas.addShape(label, element.parent);
7586     };
7587
7588     /**
7589      * Return the drawn connection end based on the given side.
7590      *
7591      * @throws {Error}
7592      *             if the end is not yet drawn
7593      */
7594     BpmnImporter.prototype._getEnd = function(semantic, side) {
7595
7596       var element,
7597         refSemantic,
7598         type = semantic.$type;
7599
7600       refSemantic = semantic[side + 'Ref'];
7601
7602       // handle mysterious isMany DataAssociation#sourceRef
7603       if (side === 'source' && type === 'bpmn:DataInputAssociation') {
7604         refSemantic = refSemantic && refSemantic[0];
7605       }
7606
7607       // fix source / target for DataInputAssociation / DataOutputAssociation
7608       if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
7609         side === 'target' && type === 'bpmn:DataInputAssociation') {
7610
7611         refSemantic = semantic.$parent;
7612       }
7613
7614       element = refSemantic && this._getElement(refSemantic);
7615
7616       if (element) {
7617         return element;
7618       }
7619
7620       if (refSemantic) {
7621         throw new Error(
7622           'element ' + elementToString(refSemantic) + ' referenced by ' +
7623           elementToString(semantic) + '#' + side + 'Ref not yet drawn');
7624       } else {
7625         throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
7626       }
7627     };
7628
7629     BpmnImporter.prototype._getSource = function(semantic) {
7630       return this._getEnd(semantic, 'source');
7631     };
7632
7633     BpmnImporter.prototype._getTarget = function(semantic) {
7634       return this._getEnd(semantic, 'target');
7635     };
7636
7637
7638     BpmnImporter.prototype._getElement = function(semantic) {
7639       return this._elementRegistry.get(semantic.id);
7640     };
7641
7642   }, {
7643     "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
7644     "../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
7645     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7646     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
7647     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
7648   }],
7649   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js": [function(require, module, exports) {
7650     'use strict';
7651
7652     var filter = require('lodash/collection/filter'),
7653       find = require('lodash/collection/find'),
7654       forEach = require('lodash/collection/forEach');
7655
7656     var Refs = require('object-refs');
7657
7658     var elementToString = require('./Util').elementToString;
7659
7660     var diRefs = new Refs({
7661       name: 'bpmnElement',
7662       enumerable: true
7663     }, {
7664       name: 'di'
7665     });
7666
7667     /**
7668      * Returns true if an element has the given meta-model type
7669      *
7670      * @param {ModdleElement}
7671      *            element
7672      * @param {String}
7673      *            type
7674      *
7675      * @return {Boolean}
7676      */
7677     function is(element, type) {
7678       return element.$instanceOf(type);
7679     }
7680
7681
7682     /**
7683      * Find a suitable display candidate for definitions where the DI does not
7684      * correctly specify one.
7685      */
7686     function findDisplayCandidate(definitions) {
7687       return find(definitions.rootElements, function(e) {
7688         return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
7689       });
7690     }
7691
7692
7693     function BpmnTreeWalker(handler) {
7694
7695       // list of containers already walked
7696       var handledProcesses = [];
7697
7698       // list of elements to handle deferred to ensure
7699       // prerequisites are drawn
7700       var deferred = [];
7701
7702       // /// Helpers /////////////////////////////////
7703
7704       function contextual(fn, ctx) {
7705         return function(e) {
7706           fn(e, ctx);
7707         };
7708       }
7709
7710       function visit(element, ctx) {
7711
7712         var gfx = element.gfx;
7713
7714         // avoid multiple rendering of elements
7715         if (gfx) {
7716           throw new Error('already rendered ' + elementToString(element));
7717         }
7718
7719         // call handler
7720         return handler.element(element, ctx);
7721       }
7722
7723       function visitRoot(element, diagram) {
7724         return handler.root(element, diagram);
7725       }
7726
7727       function visitIfDi(element, ctx) {
7728         try {
7729           return element.di && visit(element, ctx);
7730         } catch (e) {
7731           logError(e.message, {
7732             element: element,
7733             error: e
7734           });
7735
7736           console.error('failed to import ' + elementToString(element));
7737           console.error(e);
7738         }
7739       }
7740
7741       function logError(message, context) {
7742         handler.error(message, context);
7743       }
7744
7745       // //// DI handling ////////////////////////////
7746
7747       function registerDi(di) {
7748         var bpmnElement = di.bpmnElement;
7749
7750         if (bpmnElement) {
7751           if (bpmnElement.di) {
7752             logError('multiple DI elements defined for ' + elementToString(bpmnElement), {
7753               element: bpmnElement
7754             });
7755           } else {
7756             diRefs.bind(bpmnElement, 'di');
7757             bpmnElement.di = di;
7758           }
7759         } else {
7760           logError('no bpmnElement referenced in ' + elementToString(di), {
7761             element: di
7762           });
7763         }
7764       }
7765
7766       function handleDiagram(diagram) {
7767         handlePlane(diagram.plane);
7768       }
7769
7770       function handlePlane(plane) {
7771         registerDi(plane);
7772
7773         forEach(plane.planeElement, handlePlaneElement);
7774       }
7775
7776       function handlePlaneElement(planeElement) {
7777         registerDi(planeElement);
7778       }
7779
7780
7781       // //// Semantic handling //////////////////////
7782
7783       function handleDefinitions(definitions, diagram) {
7784         // make sure we walk the correct bpmnElement
7785
7786         var diagrams = definitions.diagrams;
7787
7788         if (diagram && diagrams.indexOf(diagram) === -1) {
7789           throw new Error('diagram not part of bpmn:Definitions');
7790         }
7791
7792         if (!diagram && diagrams && diagrams.length) {
7793           diagram = diagrams[0];
7794         }
7795
7796         // no diagram -> nothing to import
7797         if (!diagram) {
7798           return;
7799         }
7800
7801         // load DI from selected diagram only
7802         handleDiagram(diagram);
7803
7804
7805         var plane = diagram.plane;
7806
7807         if (!plane) {
7808           throw new Error('no plane for ' + elementToString(diagram));
7809         }
7810
7811
7812         var rootElement = plane.bpmnElement;
7813
7814         // ensure we default to a suitable display candidate (process or
7815         // collaboration),
7816         // even if non is specified in DI
7817         if (!rootElement) {
7818           rootElement = findDisplayCandidate(definitions);
7819
7820           if (!rootElement) {
7821             return logError('no process or collaboration present to display');
7822           } else {
7823
7824             logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
7825
7826             // correct DI on the fly
7827             plane.bpmnElement = rootElement;
7828             registerDi(plane);
7829           }
7830         }
7831
7832
7833         var ctx = visitRoot(rootElement, plane);
7834
7835         if (is(rootElement, 'bpmn:Process')) {
7836           handleProcess(rootElement, ctx);
7837         } else if (is(rootElement, 'bpmn:Collaboration')) {
7838           handleCollaboration(rootElement, ctx);
7839
7840           // force drawing of everything not yet drawn that is part of the target
7841           // DI
7842           handleUnhandledProcesses(definitions.rootElements, ctx);
7843         } else {
7844           throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
7845         }
7846
7847         // handle all deferred elements
7848         handleDeferred(deferred);
7849       }
7850
7851       function handleDeferred(deferred) {
7852         forEach(deferred, function(d) {
7853           d();
7854         });
7855       }
7856
7857       function handleProcess(process, context) {
7858         handleFlowElementsContainer(process, context);
7859         handleIoSpecification(process.ioSpecification, context);
7860
7861         handleArtifacts(process.artifacts, context);
7862
7863         // log process handled
7864         handledProcesses.push(process);
7865       }
7866
7867       function handleUnhandledProcesses(rootElements) {
7868
7869         // walk through all processes that have not yet been drawn and draw them
7870         // if they contain lanes with DI information.
7871         // we do this to pass the free-floating lane test cases in the MIWG test
7872         // suite
7873         var processes = filter(rootElements, function(e) {
7874           return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
7875         });
7876
7877         processes.forEach(contextual(handleProcess));
7878       }
7879
7880       function handleMessageFlow(messageFlow, context) {
7881         visitIfDi(messageFlow, context);
7882       }
7883
7884       function handleMessageFlows(messageFlows, context) {
7885         forEach(messageFlows, contextual(handleMessageFlow, context));
7886       }
7887
7888       function handleDataAssociation(association, context) {
7889         visitIfDi(association, context);
7890       }
7891
7892       function handleDataInput(dataInput, context) {
7893         visitIfDi(dataInput, context);
7894       }
7895
7896       function handleDataOutput(dataOutput, context) {
7897         visitIfDi(dataOutput, context);
7898       }
7899
7900       function handleArtifact(artifact, context) {
7901
7902         // bpmn:TextAnnotation
7903         // bpmn:Group
7904         // bpmn:Association
7905
7906         visitIfDi(artifact, context);
7907       }
7908
7909       function handleArtifacts(artifacts, context) {
7910
7911         forEach(artifacts, function(e) {
7912           if (is(e, 'bpmn:Association')) {
7913             deferred.push(function() {
7914               handleArtifact(e, context);
7915             });
7916           } else {
7917             handleArtifact(e, context);
7918           }
7919         });
7920       }
7921
7922       function handleIoSpecification(ioSpecification, context) {
7923
7924         if (!ioSpecification) {
7925           return;
7926         }
7927
7928         forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
7929         forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
7930       }
7931
7932       function handleSubProcess(subProcess, context) {
7933         handleFlowElementsContainer(subProcess, context);
7934         handleArtifacts(subProcess.artifacts, context);
7935       }
7936
7937       function handleFlowNode(flowNode, context) {
7938         var childCtx = visitIfDi(flowNode, context);
7939
7940         if (is(flowNode, 'bpmn:SubProcess')) {
7941           handleSubProcess(flowNode, childCtx || context);
7942         }
7943       }
7944
7945       function handleSequenceFlow(sequenceFlow, context) {
7946         visitIfDi(sequenceFlow, context);
7947       }
7948
7949       function handleDataElement(dataObject, context) {
7950         visitIfDi(dataObject, context);
7951       }
7952
7953       function handleBoundaryEvent(dataObject, context) {
7954         visitIfDi(dataObject, context);
7955       }
7956
7957       function handleLane(lane, context) {
7958         var newContext = visitIfDi(lane, context);
7959
7960         if (lane.childLaneSet) {
7961           handleLaneSet(lane.childLaneSet, newContext || context);
7962         } else {
7963           var filterList = filter(lane.flowNodeRef, function(e) {
7964             return e.$type !== 'bpmn:BoundaryEvent';
7965           });
7966           handleFlowElements(filterList, newContext || context);
7967         }
7968       }
7969
7970       function handleLaneSet(laneSet, context) {
7971         forEach(laneSet.lanes, contextual(handleLane, context));
7972       }
7973
7974       function handleLaneSets(laneSets, context) {
7975         forEach(laneSets, contextual(handleLaneSet, context));
7976       }
7977
7978       function handleFlowElementsContainer(container, context) {
7979
7980         if (container.laneSets) {
7981           handleLaneSets(container.laneSets, context);
7982           handleNonFlowNodes(container.flowElements);
7983         } else {
7984           handleFlowElements(container.flowElements, context);
7985         }
7986       }
7987
7988       function handleNonFlowNodes(flowElements, context) {
7989         forEach(flowElements, function(e) {
7990           if (is(e, 'bpmn:SequenceFlow')) {
7991             deferred.push(function() {
7992               handleSequenceFlow(e, context);
7993             });
7994           } else if (is(e, 'bpmn:BoundaryEvent')) {
7995             deferred.unshift(function() {
7996               handleBoundaryEvent(e, context);
7997             });
7998           } else if (is(e, 'bpmn:DataObject')) {
7999             // SKIP (assume correct referencing via DataObjectReference)
8000           } else if (is(e, 'bpmn:DataStoreReference')) {
8001             handleDataElement(e, context);
8002           } else if (is(e, 'bpmn:DataObjectReference')) {
8003             handleDataElement(e, context);
8004           }
8005         });
8006       }
8007
8008       function handleFlowElements(flowElements, context) {
8009         forEach(flowElements, function(e) {
8010           if (is(e, 'bpmn:SequenceFlow')) {
8011             deferred.push(function() {
8012               handleSequenceFlow(e, context);
8013             });
8014           } else if (is(e, 'bpmn:BoundaryEvent')) {
8015             deferred.unshift(function() {
8016               handleBoundaryEvent(e, context);
8017             });
8018           } else if (is(e, 'bpmn:FlowNode')) {
8019             handleFlowNode(e, context);
8020
8021             if (is(e, 'bpmn:Activity')) {
8022
8023               handleIoSpecification(e.ioSpecification, context);
8024
8025               // defer handling of associations
8026               deferred.push(function() {
8027                 forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
8028                 forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
8029               });
8030             }
8031           } else if (is(e, 'bpmn:DataObject')) {
8032             // SKIP (assume correct referencing via DataObjectReference)
8033           } else if (is(e, 'bpmn:DataStoreReference')) {
8034             handleDataElement(e, context);
8035           } else if (is(e, 'bpmn:DataObjectReference')) {
8036             handleDataElement(e, context);
8037           } else {
8038             logError(
8039               'unrecognized flowElement ' + elementToString(e) + ' in context ' +
8040               (context ? elementToString(context.businessObject) : null), {
8041                 element: e,
8042                 context: context
8043               });
8044           }
8045         });
8046       }
8047
8048       function handleParticipant(participant, context) {
8049         var newCtx = visitIfDi(participant, context);
8050
8051         var process = participant.processRef;
8052         if (process) {
8053           handleProcess(process, newCtx || context);
8054         }
8055       }
8056
8057       function handleCollaboration(collaboration) {
8058
8059         forEach(collaboration.participants, contextual(handleParticipant));
8060
8061         handleArtifacts(collaboration.artifacts);
8062
8063         // handle message flows latest in the process
8064         deferred.push(function() {
8065           handleMessageFlows(collaboration.messageFlows);
8066         });
8067       }
8068
8069
8070       // /// API ////////////////////////////////
8071
8072       return {
8073         handleDefinitions: handleDefinitions
8074       };
8075     }
8076
8077     module.exports = BpmnTreeWalker;
8078   }, {
8079     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
8080     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
8081     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
8082     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
8083     "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"
8084   }],
8085   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js": [function(require, module, exports) {
8086     'use strict';
8087
8088     var BpmnTreeWalker = require('./BpmnTreeWalker');
8089
8090
8091     /**
8092      * Import the definitions into a diagram.
8093      *
8094      * Errors and warnings are reported through the specified callback.
8095      *
8096      * @param {Diagram}
8097      *            diagram
8098      * @param {ModdleElement}
8099      *            definitions
8100      * @param {Function}
8101      *            done the callback, invoked with (err, [ warning ]) once the import
8102      *            is done
8103      */
8104     function importBpmnDiagram(diagram, definitions, done) {
8105
8106       var importer = diagram.get('bpmnImporter'),
8107         eventBus = diagram.get('eventBus');
8108
8109       var error,
8110         warnings = [];
8111
8112       function parse(definitions) {
8113
8114         var visitor = {
8115
8116           root: function(element) {
8117             return importer.add(element);
8118           },
8119
8120           element: function(element, parentShape) {
8121             return importer.add(element, parentShape);
8122           },
8123
8124           error: function(message, context) {
8125             warnings.push({
8126               message: message,
8127               context: context
8128             });
8129           }
8130         };
8131
8132         var walker = new BpmnTreeWalker(visitor);
8133
8134         // import
8135         walker.handleDefinitions(definitions);
8136       }
8137
8138       eventBus.fire('import.start');
8139
8140       try {
8141         parse(definitions);
8142       } catch (e) {
8143         error = e;
8144       }
8145
8146       eventBus.fire(error ? 'import.error' : 'import.success', {
8147         error: error,
8148         warnings: warnings
8149       });
8150       done(error, warnings);
8151     }
8152
8153     module.exports.importBpmnDiagram = importBpmnDiagram;
8154   }, {
8155     "./BpmnTreeWalker": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js"
8156   }],
8157   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js": [function(require, module, exports) {
8158     'use strict';
8159
8160     module.exports.elementToString = function(e) {
8161       if (!e) {
8162         return '<null>';
8163       }
8164
8165       return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
8166     };
8167   }, {}],
8168   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js": [function(require, module, exports) {
8169     module.exports = {
8170       bpmnImporter: ['type', require('./BpmnImporter')]
8171     };
8172   }, {
8173     "./BpmnImporter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js"
8174   }],
8175   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js": [function(require, module, exports) {
8176     'use strict';
8177
8178     var is = require('./ModelUtil').is,
8179       getBusinessObject = require('./ModelUtil').getBusinessObject;
8180
8181     module.exports.isExpanded = function(element) {
8182
8183       if (is(element, 'bpmn:CallActivity')) {
8184         return false;
8185       }
8186
8187       if (is(element, 'bpmn:SubProcess')) {
8188         return getBusinessObject(element).di.isExpanded;
8189       }
8190
8191       if (is(element, 'bpmn:Participant')) {
8192         return !!getBusinessObject(element).processRef;
8193       }
8194
8195       return true;
8196     };
8197
8198   }, {
8199     "./ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
8200   }],
8201   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js": [function(require, module, exports) {
8202     'use strict';
8203
8204     var assign = require('lodash/object/assign');
8205
8206
8207     var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
8208       width: 90,
8209       height: 20
8210     };
8211
8212
8213     /**
8214      * Returns true if the given semantic has an external label
8215      *
8216      * @param {BpmnElement}
8217      *            semantic
8218      * @return {Boolean} true if has label
8219      */
8220     module.exports.hasExternalLabel = function(semantic) {
8221
8222       return semantic.$instanceOf('bpmn:Event') ||
8223         // semantic.$instanceOf('bpmn:Gateway') ||
8224         semantic.$instanceOf('bpmn:DataStoreReference') ||
8225         semantic.$instanceOf('bpmn:DataObjectReference') ||
8226         semantic.$instanceOf('bpmn:SequenceFlow') ||
8227         semantic.$instanceOf('bpmn:MessageFlow');
8228     };
8229
8230
8231     /**
8232      * Get the middle of a number of waypoints
8233      *
8234      * @param {Array
8235      *            <Point>} waypoints
8236      * @return {Point} the mid point
8237      */
8238     var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
8239
8240       var mid = waypoints.length / 2 - 1;
8241
8242       var first = waypoints[Math.floor(mid)];
8243       var second = waypoints[Math.ceil(mid + 0.01)];
8244
8245       return {
8246         x: first.x + (second.x - first.x) / 2,
8247         y: first.y + (second.y - first.y) / 2
8248       };
8249     };
8250
8251
8252     var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
8253
8254       if (element.waypoints) {
8255         return getWaypointsMid(element.waypoints);
8256       } else {
8257         return {
8258           x: element.x + element.width / 2,
8259           y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
8260         };
8261       }
8262     };
8263
8264     /**
8265      * Returns the bounds of an elements label, parsed from the elements DI or
8266      * generated from its bounds.
8267      *
8268      * @param {BpmnElement}
8269      *            semantic
8270      * @param {djs.model.Base}
8271      *            element
8272      */
8273     module.exports.getExternalLabelBounds = function(semantic, element) {
8274
8275       var mid,
8276         size,
8277         bounds,
8278         di = semantic.di,
8279         label = di.label;
8280
8281       if (label && label.bounds) {
8282         bounds = label.bounds;
8283
8284         size = {
8285           width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
8286           height: bounds.height
8287         };
8288
8289         mid = {
8290           x: bounds.x + bounds.width / 2,
8291           y: bounds.y + bounds.height / 2
8292         };
8293       } else {
8294
8295         mid = getExternalLabelMid(element);
8296
8297         size = DEFAULT_LABEL_SIZE;
8298       }
8299
8300       return assign({
8301         x: mid.x - size.width / 2,
8302         y: mid.y - size.height / 2
8303       }, size);
8304     };
8305   }, {
8306     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8307   }],
8308   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js": [function(require, module, exports) {
8309     'use strict';
8310
8311     /**
8312      * Is an element of the given BPMN type?
8313      *
8314      * @param {djs.model.Base|ModdleElement}
8315      *            element
8316      * @param {String}
8317      *            type
8318      *
8319      * @return {Boolean}
8320      */
8321     function is(element, type) {
8322       var bo = getBusinessObject(element);
8323
8324       return bo && bo.$instanceOf(type);
8325     }
8326
8327     module.exports.is = is;
8328
8329
8330     /**
8331      * Return the business object for a given element.
8332      *
8333      * @param {djs.model.Base|ModdleElement}
8334      *            element
8335      *
8336      * @return {ModdleElement}
8337      */
8338     function getBusinessObject(element) {
8339       return (element && element.businessObject) || element;
8340     }
8341
8342     module.exports.getBusinessObject = getBusinessObject;
8343
8344   }, {}],
8345   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js": [function(require, module, exports) {
8346     module.exports = require('./lib/simple');
8347   }, {
8348     "./lib/simple": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js"
8349   }],
8350   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js": [function(require, module, exports) {
8351     'use strict';
8352
8353     var isString = require('lodash/lang/isString'),
8354       isFunction = require('lodash/lang/isFunction'),
8355       assign = require('lodash/object/assign');
8356
8357     var Moddle = require('moddle'),
8358       XmlReader = require('moddle-xml/lib/reader'),
8359       XmlWriter = require('moddle-xml/lib/writer');
8360
8361     /**
8362      * A sub class of {@link Moddle} with support for import and export of BPMN 2.0
8363      * xml files.
8364      *
8365      * @class BpmnModdle
8366      * @extends Moddle
8367      *
8368      * @param {Object|Array}
8369      *            packages to use for instantiating the model
8370      * @param {Object}
8371      *            [options] additional options to pass over
8372      */
8373     function BpmnModdle(packages, options) {
8374       Moddle.call(this, packages, options);
8375     }
8376
8377     BpmnModdle.prototype = Object.create(Moddle.prototype);
8378
8379     module.exports = BpmnModdle;
8380
8381
8382     /**
8383      * Instantiates a BPMN model tree from a given xml string.
8384      *
8385      * @param {String}
8386      *            xmlStr
8387      * @param {String}
8388      *            [typeName='bpmn:Definitions'] name of the root element
8389      * @param {Object}
8390      *            [options] options to pass to the underlying reader
8391      * @param {Function}
8392      *            done callback that is invoked with (err, result, parseContext)
8393      *            once the import completes
8394      */
8395     BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
8396
8397       if (!isString(typeName)) {
8398         done = options;
8399         options = typeName;
8400         typeName = 'bpmn:Definitions';
8401       }
8402
8403       if (isFunction(options)) {
8404         done = options;
8405         options = {};
8406       }
8407
8408       var reader = new XmlReader(assign({
8409         model: this,
8410         lax: true
8411       }, options));
8412       var rootHandler = reader.handler(typeName);
8413
8414       reader.fromXML(xmlStr, rootHandler, done);
8415     };
8416
8417
8418     /**
8419      * Serializes a BPMN 2.0 object tree to XML.
8420      *
8421      * @param {String}
8422      *            element the root element, typically an instance of
8423      *            `bpmn:Definitions`
8424      * @param {Object}
8425      *            [options] to pass to the underlying writer
8426      * @param {Function}
8427      *            done callback invoked with (err, xmlStr) once the import completes
8428      */
8429
8430
8431
8432
8433     BpmnModdle.prototype.toXML = function(element, options, done) {
8434
8435       if (isFunction(options)) {
8436         done = options;
8437         options = {};
8438       }
8439
8440       var writer = new XmlWriter(options);
8441       try {
8442         var result = writer.toXML(element);
8443         modelXML = result;
8444         list_models[selected_model] = result;
8445         done(null, result);
8446       } catch (e) {
8447         done(e);
8448       }
8449     };
8450
8451   }, {
8452     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
8453     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
8454     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
8455     "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
8456     "moddle-xml/lib/reader": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js",
8457     "moddle-xml/lib/writer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js"
8458   }],
8459   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js": [function(require, module, exports) {
8460     'use strict';
8461
8462     var ID_PATTERN = /^(.*:)?id$/;
8463
8464     /**
8465      * Extends the bpmn instance with id support.
8466      *
8467      * @example
8468      *
8469      * var moddle, ids;
8470      *
8471      * require('id-support').extend(moddle, ids);
8472      *
8473      * moddle.ids.next(); // create a next id moddle.ids; // ids instance
8474      *  // claims id as used moddle.create('foo:Bar', { id: 'fooobar1' });
8475      *
8476      *
8477      * @param {Moddle}
8478      *            model
8479      * @param {Ids}
8480      *            ids
8481      *
8482      * @return {Moddle} the extended moddle instance
8483      */
8484     module.exports.extend = function(model, ids) {
8485
8486       var set = model.properties.set;
8487
8488       // do not reinitialize setter
8489       // unless it is already initialized
8490       if (!model.ids) {
8491
8492         model.properties.set = function(target, property, value) {
8493
8494           // ensure we log used ids once they are assigned
8495           // to model elements
8496           if (ID_PATTERN.test(property)) {
8497
8498             var assigned = model.ids.assigned(value);
8499             if (assigned && assigned !== target) {
8500               throw new Error('id <' + value + '> already used');
8501             }
8502
8503             model.ids.claim(value, target);
8504           }
8505
8506           set.call(this, target, property, value);
8507         };
8508       }
8509
8510       model.ids = ids;
8511
8512       return model;
8513     };
8514   }, {}],
8515   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js": [function(require, module, exports) {
8516     'use strict';
8517
8518     var assign = require('lodash/object/assign');
8519
8520     var BpmnModdle = require('./bpmn-moddle');
8521
8522     var packages = {
8523       bpmn: require('../resources/bpmn/json/bpmn.json'),
8524       bpmndi: require('../resources/bpmn/json/bpmndi.json'),
8525       dc: require('../resources/bpmn/json/dc.json'),
8526       di: require('../resources/bpmn/json/di.json')
8527     };
8528
8529     module.exports = function(additionalPackages, options) {
8530       return new BpmnModdle(assign({}, packages, additionalPackages), options);
8531     };
8532   }, {
8533     "../resources/bpmn/json/bpmn.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json",
8534     "../resources/bpmn/json/bpmndi.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json",
8535     "../resources/bpmn/json/dc.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json",
8536     "../resources/bpmn/json/di.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json",
8537     "./bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js",
8538     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8539   }],
8540   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js": [function(require, module, exports) {
8541     'use strict';
8542
8543     function capitalize(string) {
8544       return string.charAt(0).toUpperCase() + string.slice(1);
8545     }
8546
8547     function lower(string) {
8548       return string.charAt(0).toLowerCase() + string.slice(1);
8549     }
8550
8551     function hasLowerCaseAlias(pkg) {
8552       return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
8553     }
8554
8555
8556     module.exports.aliasToName = function(alias, pkg) {
8557       if (hasLowerCaseAlias(pkg)) {
8558         return capitalize(alias);
8559       } else {
8560         return alias;
8561       }
8562     };
8563
8564     module.exports.nameToAlias = function(name, pkg) {
8565       if (hasLowerCaseAlias(pkg)) {
8566         return lower(name);
8567       } else {
8568         return name;
8569       }
8570     };
8571
8572     module.exports.DEFAULT_NS_MAP = {
8573       'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
8574     };
8575
8576     module.exports.XSI_TYPE = 'xsi:type';
8577   }, {}],
8578   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js": [function(require, module, exports) {
8579     'use strict';
8580
8581     var reduce = require('lodash/collection/reduce'),
8582       forEach = require('lodash/collection/forEach'),
8583       find = require('lodash/collection/find'),
8584       assign = require('lodash/object/assign'),
8585       defer = require('lodash/function/defer');
8586
8587     var Stack = require('tiny-stack'),
8588       SaxParser = require('sax').parser,
8589       Moddle = require('moddle'),
8590       parseNameNs = require('moddle/lib/ns').parseName,
8591       Types = require('moddle/lib/types'),
8592       coerceType = Types.coerceType,
8593       isSimpleType = Types.isSimple,
8594       common = require('./common'),
8595       XSI_TYPE = common.XSI_TYPE,
8596       XSI_URI = common.DEFAULT_NS_MAP.xsi,
8597       aliasToName = common.aliasToName;
8598
8599     function parseNodeAttributes(node) {
8600       var nodeAttrs = node.attributes;
8601
8602       return reduce(nodeAttrs, function(result, v, k) {
8603         var name, ns;
8604
8605         if (!v.local) {
8606           name = v.prefix;
8607         } else {
8608           ns = parseNameNs(v.name, v.prefix);
8609           name = ns.name;
8610         }
8611
8612         result[name] = v.value;
8613         return result;
8614       }, {});
8615     }
8616
8617     function normalizeType(node, attr, model) {
8618       var nameNs = parseNameNs(attr.value);
8619
8620       var uri = node.ns[nameNs.prefix || ''],
8621         localName = nameNs.localName,
8622         pkg = uri && model.getPackage(uri),
8623         typePrefix;
8624
8625       if (pkg) {
8626         typePrefix = pkg.xml && pkg.xml.typePrefix;
8627
8628         if (typePrefix && localName.indexOf(typePrefix) === 0) {
8629           localName = localName.slice(typePrefix.length);
8630         }
8631
8632         attr.value = pkg.prefix + ':' + localName;
8633       }
8634     }
8635
8636     /**
8637      * Normalizes namespaces for a node given an optional default namespace and a
8638      * number of mappings from uris to default prefixes.
8639      *
8640      * @param {XmlNode}
8641      *            node
8642      * @param {Model}
8643      *            model the model containing all registered namespaces
8644      * @param {Uri}
8645      *            defaultNsUri
8646      */
8647     function normalizeNamespaces(node, model, defaultNsUri) {
8648       var uri, prefix;
8649
8650       uri = node.uri || defaultNsUri;
8651
8652       if (uri) {
8653         var pkg = model.getPackage(uri);
8654
8655         if (pkg) {
8656           prefix = pkg.prefix;
8657         } else {
8658           prefix = node.prefix;
8659         }
8660
8661         node.prefix = prefix;
8662         node.uri = uri;
8663       }
8664
8665       forEach(node.attributes, function(attr) {
8666
8667         // normalize xsi:type attributes because the
8668         // assigned type may or may not be namespace prefixed
8669         if (attr.uri === XSI_URI && attr.local === 'type') {
8670           normalizeType(node, attr, model);
8671         }
8672
8673         normalizeNamespaces(attr, model, null);
8674       });
8675     }
8676
8677
8678     /**
8679      * A parse context.
8680      *
8681      * @class
8682      *
8683      * @param {Object}
8684      *            options
8685      * @param {ElementHandler}
8686      *            options.parseRoot the root handler for parsing a document
8687      * @param {boolean}
8688      *            [options.lax=false] whether or not to ignore invalid elements
8689      */
8690     function Context(options) {
8691
8692       /**
8693        * @property {ElementHandler} parseRoot
8694        */
8695
8696       /**
8697        * @property {Boolean} lax
8698        */
8699
8700       assign(this, options);
8701
8702       var elementsById = this.elementsById = {};
8703       var references = this.references = [];
8704       var warnings = this.warnings = [];
8705
8706       this.addReference = function(reference) {
8707         references.push(reference);
8708       };
8709
8710       this.addElement = function(id, element) {
8711
8712         if (!id || !element) {
8713           throw new Error('[xml-reader] id or ctx must not be null');
8714         }
8715
8716         elementsById[id] = element;
8717       };
8718
8719       this.addWarning = function(w) {
8720         warnings.push(w);
8721       };
8722     }
8723
8724     function BaseHandler() {}
8725
8726     BaseHandler.prototype.handleEnd = function() {};
8727     BaseHandler.prototype.handleText = function() {};
8728     BaseHandler.prototype.handleNode = function() {};
8729
8730
8731     /**
8732      * A simple pass through handler that does nothing except for ignoring all input
8733      * it receives.
8734      *
8735      * This is used to ignore unknown elements and attributes.
8736      */
8737     function NoopHandler() {}
8738
8739     NoopHandler.prototype = new BaseHandler();
8740
8741     NoopHandler.prototype.handleNode = function() {
8742       return this;
8743     };
8744
8745     function BodyHandler() {}
8746
8747     BodyHandler.prototype = new BaseHandler();
8748
8749     BodyHandler.prototype.handleText = function(text) {
8750       this.body = (this.body || '') + text;
8751     };
8752
8753     function ReferenceHandler(property, context) {
8754       this.property = property;
8755       this.context = context;
8756     }
8757
8758     ReferenceHandler.prototype = new BodyHandler();
8759
8760     ReferenceHandler.prototype.handleNode = function(node) {
8761
8762       if (this.element) {
8763         throw new Error('expected no sub nodes');
8764       } else {
8765         this.element = this.createReference(node);
8766       }
8767
8768       return this;
8769     };
8770
8771     ReferenceHandler.prototype.handleEnd = function() {
8772       this.element.id = this.body;
8773     };
8774
8775     ReferenceHandler.prototype.createReference = function() {
8776       return {
8777         property: this.property.ns.name,
8778         id: ''
8779       };
8780     };
8781
8782     function ValueHandler(propertyDesc, element) {
8783       this.element = element;
8784       this.propertyDesc = propertyDesc;
8785     }
8786
8787     ValueHandler.prototype = new BodyHandler();
8788
8789     ValueHandler.prototype.handleEnd = function() {
8790
8791       var value = this.body,
8792         element = this.element,
8793         propertyDesc = this.propertyDesc;
8794
8795       value = coerceType(propertyDesc.type, value);
8796
8797       if (propertyDesc.isMany) {
8798         element.get(propertyDesc.name).push(value);
8799       } else {
8800         element.set(propertyDesc.name, value);
8801       }
8802     };
8803
8804
8805     function BaseElementHandler() {}
8806
8807     BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
8808
8809     BaseElementHandler.prototype.handleNode = function(node) {
8810       var parser = this,
8811         element = this.element,
8812         id;
8813
8814       if (!element) {
8815         element = this.element = this.createElement(node);
8816         id = element.id;
8817
8818         if (id) {
8819           this.context.addElement(id, element);
8820         }
8821       } else {
8822         parser = this.handleChild(node);
8823       }
8824
8825       return parser;
8826     };
8827
8828     /**
8829      * @class XMLReader.ElementHandler
8830      *
8831      */
8832     function ElementHandler(model, type, context) {
8833       this.model = model;
8834       this.type = model.getType(type);
8835       this.context = context;
8836     }
8837
8838     ElementHandler.prototype = new BaseElementHandler();
8839
8840     ElementHandler.prototype.addReference = function(reference) {
8841       this.context.addReference(reference);
8842     };
8843
8844     ElementHandler.prototype.handleEnd = function() {
8845
8846       var value = this.body,
8847         element = this.element,
8848         descriptor = element.$descriptor,
8849         bodyProperty = descriptor.bodyProperty;
8850
8851       if (bodyProperty && value !== undefined) {
8852         value = coerceType(bodyProperty.type, value);
8853         element.set(bodyProperty.name, value);
8854       }
8855     };
8856
8857     /**
8858      * Create an instance of the model from the given node.
8859      *
8860      * @param {Element}
8861      *            node the xml node
8862      */
8863     ElementHandler.prototype.createElement = function(node) {
8864       var attributes = parseNodeAttributes(node),
8865         Type = this.type,
8866         descriptor = Type.$descriptor,
8867         context = this.context,
8868         instance = new Type({});
8869
8870       forEach(attributes, function(value, name) {
8871
8872         var prop = descriptor.propertiesByName[name];
8873
8874         if (prop && prop.isReference) {
8875           context.addReference({
8876             element: instance,
8877             property: prop.ns.name,
8878             id: value
8879           });
8880         } else {
8881           if (prop) {
8882             value = coerceType(prop.type, value);
8883           }
8884
8885           instance.set(name, value);
8886         }
8887       });
8888
8889       return instance;
8890     };
8891
8892     ElementHandler.prototype.getPropertyForNode = function(node) {
8893
8894       var nameNs = parseNameNs(node.local, node.prefix);
8895
8896       var type = this.type,
8897         model = this.model,
8898         descriptor = type.$descriptor;
8899
8900       var propertyName = nameNs.name,
8901         property = descriptor.propertiesByName[propertyName],
8902         elementTypeName,
8903         elementType,
8904         typeAnnotation;
8905
8906       // search for properties by name first
8907
8908       if (property) {
8909
8910         if (property.serialize === XSI_TYPE) {
8911           typeAnnotation = node.attributes[XSI_TYPE];
8912
8913           // xsi type is optional, if it does not exists the
8914           // default type is assumed
8915           if (typeAnnotation) {
8916
8917             elementTypeName = typeAnnotation.value;
8918
8919             // TODO: extract real name from attribute
8920             elementType = model.getType(elementTypeName);
8921
8922             return assign({}, property, {
8923               effectiveType: elementType.$descriptor.name
8924             });
8925           }
8926         }
8927
8928         // search for properties by name first
8929         return property;
8930       }
8931
8932
8933       var pkg = model.getPackage(nameNs.prefix);
8934
8935       if (pkg) {
8936         elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
8937         elementType = model.getType(elementTypeName);
8938
8939         // search for collection members later
8940         property = find(descriptor.properties, function(p) {
8941           return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
8942         });
8943
8944         if (property) {
8945           return assign({}, property, {
8946             effectiveType: elementType.$descriptor.name
8947           });
8948         }
8949       } else {
8950         // parse unknown element (maybe extension)
8951         property = find(descriptor.properties, function(p) {
8952           return !p.isReference && !p.isAttribute && p.type === 'Element';
8953         });
8954
8955         if (property) {
8956           return property;
8957         }
8958       }
8959
8960       throw new Error('unrecognized element <' + nameNs.name + '>');
8961     };
8962
8963     ElementHandler.prototype.toString = function() {
8964       return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
8965     };
8966
8967     ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
8968       return new ValueHandler(propertyDesc, element);
8969     };
8970
8971     ElementHandler.prototype.referenceHandler = function(propertyDesc) {
8972       return new ReferenceHandler(propertyDesc, this.context);
8973     };
8974
8975     ElementHandler.prototype.handler = function(type) {
8976       if (type === 'Element') {
8977         return new GenericElementHandler(this.model, type, this.context);
8978       } else {
8979         return new ElementHandler(this.model, type, this.context);
8980       }
8981     };
8982
8983     /**
8984      * Handle the child element parsing
8985      *
8986      * @param {Element}
8987      *            node the xml node
8988      */
8989     ElementHandler.prototype.handleChild = function(node) {
8990       var propertyDesc, type, element, childHandler;
8991
8992       propertyDesc = this.getPropertyForNode(node);
8993       element = this.element;
8994
8995       type = propertyDesc.effectiveType || propertyDesc.type;
8996
8997       if (isSimpleType(type)) {
8998         return this.valueHandler(propertyDesc, element);
8999       }
9000
9001       if (propertyDesc.isReference) {
9002         childHandler = this.referenceHandler(propertyDesc).handleNode(node);
9003       } else {
9004         childHandler = this.handler(type).handleNode(node);
9005       }
9006
9007       var newElement = childHandler.element;
9008
9009       // child handles may decide to skip elements
9010       // by not returning anything
9011       if (newElement !== undefined) {
9012
9013         if (propertyDesc.isMany) {
9014           element.get(propertyDesc.name).push(newElement);
9015         } else {
9016           element.set(propertyDesc.name, newElement);
9017         }
9018
9019         if (propertyDesc.isReference) {
9020           assign(newElement, {
9021             element: element
9022           });
9023
9024           this.context.addReference(newElement);
9025         } else {
9026           // establish child -> parent relationship
9027           newElement.$parent = element;
9028         }
9029       }
9030
9031       return childHandler;
9032     };
9033
9034
9035     function GenericElementHandler(model, type, context) {
9036       this.model = model;
9037       this.context = context;
9038     }
9039
9040     GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
9041
9042     GenericElementHandler.prototype.createElement = function(node) {
9043
9044       var name = node.name,
9045         prefix = node.prefix,
9046         uri = node.ns[prefix],
9047         attributes = node.attributes;
9048
9049       return this.model.createAny(name, uri, attributes);
9050     };
9051
9052     GenericElementHandler.prototype.handleChild = function(node) {
9053
9054       var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
9055         element = this.element;
9056
9057       var newElement = handler.element,
9058         children;
9059
9060       if (newElement !== undefined) {
9061         children = element.$children = element.$children || [];
9062         children.push(newElement);
9063
9064         // establish child -> parent relationship
9065         newElement.$parent = element;
9066       }
9067
9068       return handler;
9069     };
9070
9071     GenericElementHandler.prototype.handleText = function(text) {
9072       this.body = this.body || '' + text;
9073     };
9074
9075     GenericElementHandler.prototype.handleEnd = function() {
9076       if (this.body) {
9077         this.element.$body = this.body;
9078       }
9079     };
9080
9081     /**
9082      * A reader for a meta-model
9083      *
9084      * @param {Object}
9085      *            options
9086      * @param {Model}
9087      *            options.model used to read xml files
9088      * @param {Boolean}
9089      *            options.lax whether to make parse errors warnings
9090      */
9091     function XMLReader(options) {
9092
9093       if (options instanceof Moddle) {
9094         options = {
9095           model: options
9096         };
9097       }
9098
9099       assign(this, {
9100         lax: false
9101       }, options);
9102     }
9103
9104
9105     XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
9106
9107       var model = this.model,
9108         lax = this.lax,
9109         context = new Context({
9110           parseRoot: rootHandler
9111         });
9112
9113       var parser = new SaxParser(true, {
9114           xmlns: true,
9115           trim: true
9116         }),
9117         stack = new Stack();
9118
9119       rootHandler.context = context;
9120
9121       // push root handler
9122       stack.push(rootHandler);
9123
9124
9125       function resolveReferences() {
9126
9127         var elementsById = context.elementsById;
9128         var references = context.references;
9129
9130         var i, r;
9131
9132         for (i = 0; !!(r = references[i]); i++) {
9133           var element = r.element;
9134           var reference = elementsById[r.id];
9135           var property = element.$descriptor.propertiesByName[r.property];
9136
9137           if (!reference) {
9138             context.addWarning({
9139               message: 'unresolved reference <' + r.id + '>',
9140               element: r.element,
9141               property: r.property,
9142               value: r.id
9143             });
9144           }
9145
9146           if (property.isMany) {
9147             var collection = element.get(property.name),
9148               idx = collection.indexOf(r);
9149
9150             if (!reference) {
9151               // remove unresolvable reference
9152               collection.splice(idx, 1);
9153             } else {
9154               // update reference
9155               collection[idx] = reference;
9156             }
9157           } else {
9158             element.set(property.name, reference);
9159           }
9160         }
9161       }
9162
9163       function handleClose(tagName) {
9164         stack.pop().handleEnd();
9165       }
9166
9167       function handleOpen(node) {
9168         var handler = stack.peek();
9169
9170         normalizeNamespaces(node, model);
9171
9172         try {
9173           stack.push(handler.handleNode(node));
9174         } catch (e) {
9175
9176           var line = this.line,
9177             column = this.column;
9178
9179           var message =
9180             'unparsable content <' + node.name + '> detected\n\t' +
9181             'line: ' + line + '\n\t' +
9182             'column: ' + column + '\n\t' +
9183             'nested error: ' + e.message;
9184
9185           if (lax) {
9186             context.addWarning({
9187               message: message,
9188               error: e
9189             });
9190
9191             console.warn('could not parse node');
9192             console.warn(e);
9193
9194             stack.push(new NoopHandler());
9195           } else {
9196             console.error('could not parse document');
9197             console.error(e);
9198
9199             throw new Error(message);
9200           }
9201         }
9202       }
9203
9204       function handleText(text) {
9205         stack.peek().handleText(text);
9206       }
9207
9208       parser.onopentag = handleOpen;
9209       parser.oncdata = parser.ontext = handleText;
9210       parser.onclosetag = handleClose;
9211       parser.onend = resolveReferences;
9212
9213       // deferred parse XML to make loading really ascnchronous
9214       // this ensures the execution environment (node or browser)
9215       // is kept responsive and that certain optimization strategies
9216       // can kick in
9217       defer(function() {
9218         var error;
9219
9220         try {
9221           parser.write(xml).close();
9222         } catch (e) {
9223           error = e;
9224         }
9225
9226         done(error, error ? undefined : rootHandler.element, context);
9227       });
9228     };
9229
9230     XMLReader.prototype.handler = function(name) {
9231       return new ElementHandler(this.model, name);
9232     };
9233
9234     module.exports = XMLReader;
9235     module.exports.ElementHandler = ElementHandler;
9236   }, {
9237     "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9238     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
9239     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9240     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
9241     "lodash/function/defer": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js",
9242     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9243     "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
9244     "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9245     "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
9246     "sax": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js",
9247     "tiny-stack": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\tiny-stack\\lib\\tiny-stack.js"
9248   }],
9249   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js": [function(require, module, exports) {
9250     'use strict';
9251
9252     var map = require('lodash/collection/map'),
9253       forEach = require('lodash/collection/forEach'),
9254       isString = require('lodash/lang/isString'),
9255       filter = require('lodash/collection/filter'),
9256       assign = require('lodash/object/assign');
9257
9258     var Types = require('moddle/lib/types'),
9259       parseNameNs = require('moddle/lib/ns').parseName,
9260       common = require('./common'),
9261       nameToAlias = common.nameToAlias;
9262
9263     var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
9264       ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
9265       DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
9266       XSI_TYPE = common.XSI_TYPE;
9267
9268
9269     function nsName(ns) {
9270       if (isString(ns)) {
9271         return ns;
9272       } else {
9273         return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
9274       }
9275     }
9276
9277     function getElementNs(ns, descriptor) {
9278       if (descriptor.isGeneric) {
9279         return descriptor.name;
9280       } else {
9281         return assign({
9282           localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg)
9283         }, ns);
9284       }
9285     }
9286
9287     function getPropertyNs(ns, descriptor) {
9288       return assign({
9289         localName: descriptor.ns.localName
9290       }, ns);
9291     }
9292
9293     function getSerializableProperties(element) {
9294       var descriptor = element.$descriptor;
9295
9296       return filter(descriptor.properties, function(p) {
9297         var name = p.name;
9298
9299         // do not serialize defaults
9300         if (!element.hasOwnProperty(name)) {
9301           return false;
9302         }
9303
9304         var value = element[name];
9305
9306         // do not serialize default equals
9307         if (value === p.default) {
9308           return false;
9309         }
9310
9311         return p.isMany ? value.length : true;
9312       });
9313     }
9314
9315     var ESCAPE_MAP = {
9316       '\n': '10',
9317       '\n\r': '10',
9318       '"': '34',
9319       '\'': '39',
9320       '<': '60',
9321       '>': '62',
9322       '&': '38'
9323     };
9324
9325     /**
9326      * Escape a string attribute to not contain any bad values (line breaks, '"',
9327      * ...)
9328      *
9329      * @param {String}
9330      *            str the string to escape
9331      * @return {String} the escaped string
9332      */
9333     function escapeAttr(str) {
9334
9335       // ensure we are handling strings here
9336       str = isString(str) ? str : '' + str;
9337
9338       return str.replace(ESCAPE_CHARS, function(str) {
9339         return '&#' + ESCAPE_MAP[str] + ';';
9340       });
9341     }
9342
9343     function filterAttributes(props) {
9344       return filter(props, function(p) {
9345         return p.isAttr;
9346       });
9347     }
9348
9349     function filterContained(props) {
9350       return filter(props, function(p) {
9351         return !p.isAttr;
9352       });
9353     }
9354
9355
9356     function ReferenceSerializer(parent, ns) {
9357       this.ns = ns;
9358     }
9359
9360     ReferenceSerializer.prototype.build = function(element) {
9361       this.element = element;
9362       return this;
9363     };
9364
9365     ReferenceSerializer.prototype.serializeTo = function(writer) {
9366       writer
9367         .appendIndent()
9368         .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
9369         .appendNewLine();
9370     };
9371
9372     function BodySerializer() {}
9373
9374     BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
9375       var escape = this.escape;
9376
9377       if (escape) {
9378         writer.append('<![CDATA[');
9379       }
9380
9381       writer.append(this.value);
9382
9383       if (escape) {
9384         writer.append(']]>');
9385       }
9386     };
9387
9388     BodySerializer.prototype.build = function(prop, value) {
9389       this.value = value;
9390
9391       if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
9392         this.escape = true;
9393       }
9394
9395       return this;
9396     };
9397
9398     function ValueSerializer(ns) {
9399       this.ns = ns;
9400     }
9401
9402     ValueSerializer.prototype = new BodySerializer();
9403
9404     ValueSerializer.prototype.serializeTo = function(writer) {
9405
9406       writer
9407         .appendIndent()
9408         .append('<' + nsName(this.ns) + '>');
9409
9410       this.serializeValue(writer);
9411
9412       writer
9413         .append('</' + nsName(this.ns) + '>')
9414         .appendNewLine();
9415     };
9416
9417     function ElementSerializer(parent, ns) {
9418       this.body = [];
9419       this.attrs = [];
9420
9421       this.parent = parent;
9422       this.ns = ns;
9423     }
9424
9425     ElementSerializer.prototype.build = function(element) {
9426       this.element = element;
9427
9428       var otherAttrs = this.parseNsAttributes(element);
9429
9430       if (!this.ns) {
9431         this.ns = this.nsTagName(element.$descriptor);
9432       }
9433
9434       if (element.$descriptor.isGeneric) {
9435         this.parseGeneric(element);
9436       } else {
9437         var properties = getSerializableProperties(element);
9438
9439         this.parseAttributes(filterAttributes(properties));
9440         this.parseContainments(filterContained(properties));
9441
9442         this.parseGenericAttributes(element, otherAttrs);
9443       }
9444
9445       return this;
9446     };
9447
9448     ElementSerializer.prototype.nsTagName = function(descriptor) {
9449       var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9450       return getElementNs(effectiveNs, descriptor);
9451     };
9452
9453     ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
9454       var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9455       return getPropertyNs(effectiveNs, descriptor);
9456     };
9457
9458     ElementSerializer.prototype.isLocalNs = function(ns) {
9459       return ns.uri === this.ns.uri;
9460     };
9461
9462     ElementSerializer.prototype.nsAttributeName = function(element) {
9463
9464       var ns;
9465
9466       if (isString(element)) {
9467         ns = parseNameNs(element);
9468       } else
9469       if (element.ns) {
9470         ns = element.ns;
9471       }
9472
9473       var effectiveNs = this.logNamespaceUsed(ns);
9474
9475       // strip prefix if same namespace like parent
9476       if (this.isLocalNs(effectiveNs)) {
9477         return {
9478           localName: ns.localName
9479         };
9480       } else {
9481         return assign({
9482           localName: ns.localName
9483         }, effectiveNs);
9484       }
9485     };
9486
9487     ElementSerializer.prototype.parseGeneric = function(element) {
9488
9489       var self = this,
9490         body = this.body,
9491         attrs = this.attrs;
9492
9493       forEach(element, function(val, key) {
9494
9495         if (key === '$body') {
9496           body.push(new BodySerializer().build({
9497             type: 'String'
9498           }, val));
9499         } else
9500         if (key === '$children') {
9501           forEach(val, function(child) {
9502             body.push(new ElementSerializer(self).build(child));
9503           });
9504         } else
9505         if (key.indexOf('$') !== 0) {
9506           attrs.push({
9507             name: key,
9508             value: escapeAttr(val)
9509           });
9510         }
9511       });
9512     };
9513
9514     /**
9515      * Parse namespaces and return a list of left over generic attributes
9516      *
9517      * @param {Object}
9518      *            element
9519      * @return {Array<Object>}
9520      */
9521     ElementSerializer.prototype.parseNsAttributes = function(element) {
9522       var self = this;
9523
9524       var genericAttrs = element.$attrs;
9525
9526       var attributes = [];
9527
9528       // parse namespace attributes first
9529       // and log them. push non namespace attributes to a list
9530       // and process them later
9531       forEach(genericAttrs, function(value, name) {
9532         var nameNs = parseNameNs(name);
9533
9534         if (nameNs.prefix === 'xmlns') {
9535           self.logNamespace({
9536             prefix: nameNs.localName,
9537             uri: value
9538           });
9539         } else
9540         if (!nameNs.prefix && nameNs.localName === 'xmlns') {
9541           self.logNamespace({
9542             uri: value
9543           });
9544         } else {
9545           attributes.push({
9546             name: name,
9547             value: value
9548           });
9549         }
9550       });
9551
9552       return attributes;
9553     };
9554
9555     ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
9556
9557       var self = this;
9558
9559       forEach(attributes, function(attr) {
9560
9561         // do not serialize xsi:type attribute
9562         // it is set manually based on the actual implementation type
9563         if (attr.name === XSI_TYPE) {
9564           return;
9565         }
9566
9567         try {
9568           self.addAttribute(self.nsAttributeName(attr.name), attr.value);
9569         } catch (e) {
9570           console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
9571         }
9572       });
9573     };
9574
9575     ElementSerializer.prototype.parseContainments = function(properties) {
9576
9577       var self = this,
9578         body = this.body,
9579         element = this.element;
9580
9581       forEach(properties, function(p) {
9582         var value = element.get(p.name),
9583           isReference = p.isReference,
9584           isMany = p.isMany;
9585
9586         var ns = self.nsPropertyTagName(p);
9587
9588         if (!isMany) {
9589           value = [value];
9590         }
9591
9592         if (p.isBody) {
9593           body.push(new BodySerializer().build(p, value[0]));
9594         } else
9595         if (Types.isSimple(p.type)) {
9596           forEach(value, function(v) {
9597             body.push(new ValueSerializer(ns).build(p, v));
9598           });
9599         } else
9600         if (isReference) {
9601           forEach(value, function(v) {
9602             body.push(new ReferenceSerializer(self, ns).build(v));
9603           });
9604         } else {
9605           // allow serialization via type
9606           // rather than element name
9607           var asType = p.serialize === XSI_TYPE;
9608
9609           forEach(value, function(v) {
9610             var serializer;
9611
9612             if (asType) {
9613               serializer = new TypeSerializer(self, ns);
9614             } else {
9615               serializer = new ElementSerializer(self);
9616             }
9617
9618             body.push(serializer.build(v));
9619           });
9620         }
9621       });
9622     };
9623
9624     ElementSerializer.prototype.getNamespaces = function() {
9625       if (!this.parent) {
9626         if (!this.namespaces) {
9627           this.namespaces = {
9628             prefixMap: {},
9629             uriMap: {},
9630             used: {}
9631           };
9632         }
9633       } else {
9634         this.namespaces = this.parent.getNamespaces();
9635       }
9636
9637       return this.namespaces;
9638     };
9639
9640     ElementSerializer.prototype.logNamespace = function(ns) {
9641       var namespaces = this.getNamespaces();
9642
9643       var existing = namespaces.uriMap[ns.uri];
9644
9645       if (!existing) {
9646         namespaces.uriMap[ns.uri] = ns;
9647       }
9648
9649       namespaces.prefixMap[ns.prefix] = ns.uri;
9650
9651       return ns;
9652     };
9653
9654     ElementSerializer.prototype.logNamespaceUsed = function(ns) {
9655       var element = this.element,
9656         model = element.$model,
9657         namespaces = this.getNamespaces();
9658
9659       // ns may be
9660       //
9661       // * prefix only
9662       // * prefix:uri
9663
9664       var prefix = ns.prefix;
9665       var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
9666         namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
9667
9668       if (!uri) {
9669         throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
9670       }
9671
9672       ns = namespaces.uriMap[uri];
9673
9674       if (!ns) {
9675         ns = this.logNamespace({
9676           prefix: prefix,
9677           uri: uri
9678         });
9679       }
9680
9681       if (!namespaces.used[ns.uri]) {
9682         namespaces.used[ns.uri] = ns;
9683       }
9684
9685       return ns;
9686     };
9687
9688     ElementSerializer.prototype.parseAttributes = function(properties) {
9689       var self = this,
9690         element = this.element;
9691
9692       forEach(properties, function(p) {
9693         self.logNamespaceUsed(p.ns);
9694
9695         var value = element.get(p.name);
9696
9697         if (p.isReference) {
9698           value = value.id;
9699         }
9700
9701         self.addAttribute(self.nsAttributeName(p), value);
9702       });
9703     };
9704
9705     ElementSerializer.prototype.addAttribute = function(name, value) {
9706       var attrs = this.attrs;
9707
9708       if (isString(value)) {
9709         value = escapeAttr(value);
9710       }
9711
9712       attrs.push({
9713         name: name,
9714         value: value
9715       });
9716     };
9717
9718     ElementSerializer.prototype.serializeAttributes = function(writer) {
9719       var attrs = this.attrs,
9720         root = !this.parent,
9721         namespaces = this.namespaces;
9722
9723       function collectNsAttrs() {
9724         return map(namespaces.used, function(ns) {
9725           var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
9726           return {
9727             name: name,
9728             value: ns.uri
9729           };
9730         });
9731       }
9732
9733       if (root) {
9734         attrs = collectNsAttrs().concat(attrs);
9735       }
9736
9737       forEach(attrs, function(a) {
9738         writer
9739           .append(' ')
9740           .append(nsName(a.name)).append('="').append(a.value).append('"');
9741       });
9742     };
9743
9744     ElementSerializer.prototype.serializeTo = function(writer) {
9745       var hasBody = this.body.length,
9746         indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
9747
9748       writer
9749         .appendIndent()
9750         .append('<' + nsName(this.ns));
9751
9752       this.serializeAttributes(writer);
9753
9754       writer.append(hasBody ? '>' : ' />');
9755
9756       if (hasBody) {
9757
9758         if (indent) {
9759           writer
9760             .appendNewLine()
9761             .indent();
9762         }
9763
9764         forEach(this.body, function(b) {
9765           b.serializeTo(writer);
9766         });
9767
9768         if (indent) {
9769           writer
9770             .unindent()
9771             .appendIndent();
9772         }
9773
9774         writer.append('</' + nsName(this.ns) + '>');
9775       }
9776
9777       writer.appendNewLine();
9778     };
9779
9780     /**
9781      * A serializer for types that handles serialization of data types
9782      */
9783     function TypeSerializer(parent, ns) {
9784       ElementSerializer.call(this, parent, ns);
9785     }
9786
9787     TypeSerializer.prototype = new ElementSerializer();
9788
9789     TypeSerializer.prototype.build = function(element) {
9790       var descriptor = element.$descriptor;
9791
9792       this.element = element;
9793
9794       this.typeNs = this.nsTagName(descriptor);
9795
9796       // add xsi:type attribute to represent the elements
9797       // actual type
9798
9799       var typeNs = this.typeNs,
9800         pkg = element.$model.getPackage(typeNs.uri),
9801         typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
9802
9803       this.addAttribute(this.nsAttributeName(XSI_TYPE), (typeNs.prefix ? typeNs.prefix + ':' : '') +
9804         typePrefix + descriptor.ns.localName);
9805
9806       // do the usual stuff
9807       return ElementSerializer.prototype.build.call(this, element);
9808     };
9809
9810     TypeSerializer.prototype.isLocalNs = function(ns) {
9811       return ns.uri === this.typeNs.uri;
9812     };
9813
9814     function SavingWriter() {
9815       this.value = '';
9816
9817       this.write = function(str) {
9818         this.value += str;
9819       };
9820     }
9821
9822     function FormatingWriter(out, format) {
9823
9824       var indent = [''];
9825
9826       this.append = function(str) {
9827         out.write(str);
9828
9829         return this;
9830       };
9831
9832       this.appendNewLine = function() {
9833         if (format) {
9834           out.write('\n');
9835         }
9836
9837         return this;
9838       };
9839
9840       this.appendIndent = function() {
9841         if (format) {
9842           out.write(indent.join('  '));
9843         }
9844
9845         return this;
9846       };
9847
9848       this.indent = function() {
9849         indent.push('');
9850         return this;
9851       };
9852
9853       this.unindent = function() {
9854         indent.pop();
9855         return this;
9856       };
9857     }
9858
9859     /**
9860      * A writer for meta-model backed document trees
9861      *
9862      * @param {Object}
9863      *            options output options to pass into the writer
9864      */
9865     function XMLWriter(options) {
9866
9867       options = assign({
9868         format: false,
9869         preamble: true
9870       }, options || {});
9871
9872       function toXML(tree, writer) {
9873         var internalWriter = writer || new SavingWriter();
9874         var formatingWriter = new FormatingWriter(internalWriter, options.format);
9875
9876         if (options.preamble) {
9877           formatingWriter.append(XML_PREAMBLE);
9878         }
9879
9880         new ElementSerializer().build(tree).serializeTo(formatingWriter);
9881
9882         if (!writer) {
9883           return internalWriter.value;
9884         }
9885       }
9886
9887       return {
9888         toXML: toXML
9889       };
9890     }
9891
9892     module.exports = XMLWriter;
9893   }, {
9894     "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9895     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
9896     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9897     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
9898     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
9899     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9900     "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9901     "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js"
9902   }],
9903   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js": [function(require, module, exports) {
9904     (function(Buffer) {
9905       // wrapper for non-node envs
9906       ;
9907       (function(sax) {
9908
9909         sax.parser = function(strict, opt) {
9910           return new SAXParser(strict, opt)
9911         }
9912         sax.SAXParser = SAXParser
9913         sax.SAXStream = SAXStream
9914         sax.createStream = createStream
9915
9916         // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer
9917         // overruns.
9918         // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer
9919         // lengths)),
9920         // since that's the earliest that a buffer overrun could occur. This way, checks
9921         // are
9922         // as rare as required, but as often as necessary to ensure never crossing this
9923         // bound.
9924         // Furthermore, buffers are only tested at most once per write(), so passing a
9925         // very
9926         // large string into write() might have undesirable effects, but this is
9927         // manageable by
9928         // the caller, so it is assumed to be safe. Thus, a call to write() may, in the
9929         // extreme
9930         // edge case, result in creating at most one complete copy of the string passed
9931         // in.
9932         // Set to Infinity to have unlimited buffers.
9933         sax.MAX_BUFFER_LENGTH = 64 * 1024
9934
9935         var buffers = [
9936           "comment", "sgmlDecl", "textNode", "tagName", "doctype",
9937           "procInstName", "procInstBody", "entity", "attribName",
9938           "attribValue", "cdata", "script"
9939         ]
9940
9941         sax.EVENTS = // for discoverability.
9942           ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"]
9943
9944         function SAXParser(strict, opt) {
9945           if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
9946
9947           var parser = this
9948           clearBuffers(parser)
9949           parser.q = parser.c = ""
9950           parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
9951           parser.opt = opt || {}
9952           parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
9953           parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
9954           parser.tags = []
9955           parser.closed = parser.closedRoot = parser.sawRoot = false
9956           parser.tag = parser.error = null
9957           parser.strict = !!strict
9958           parser.noscript = !!(strict || parser.opt.noscript)
9959           parser.state = S.BEGIN
9960           parser.ENTITIES = Object.create(sax.ENTITIES)
9961           parser.attribList = []
9962
9963           // namespaces form a prototype chain.
9964           // it always points at the current tag,
9965           // which protos to its parent tag.
9966           if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
9967
9968           // mostly just for error reporting
9969           parser.trackPosition = parser.opt.position !== false
9970           if (parser.trackPosition) {
9971             parser.position = parser.line = parser.column = 0
9972           }
9973           emit(parser, "onready")
9974         }
9975
9976         if (!Object.create) Object.create = function(o) {
9977           function f() {
9978             this.__proto__ = o
9979           }
9980           f.prototype = o
9981           return new f
9982         }
9983
9984         if (!Object.getPrototypeOf) Object.getPrototypeOf = function(o) {
9985           return o.__proto__
9986         }
9987
9988         if (!Object.keys) Object.keys = function(o) {
9989           var a = []
9990           for (var i in o)
9991             if (o.hasOwnProperty(i)) a.push(i)
9992           return a
9993         }
9994
9995         function checkBufferLength(parser) {
9996           var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10),
9997             maxActual = 0
9998           for (var i = 0, l = buffers.length; i < l; i++) {
9999             var len = parser[buffers[i]].length
10000             if (len > maxAllowed) {
10001               // Text/cdata nodes can get big, and since they're buffered,
10002               // we can get here under normal conditions.
10003               // Avoid issues by emitting the text node now,
10004               // so at least it won't get any bigger.
10005               switch (buffers[i]) {
10006                 case "textNode":
10007                   closeText(parser)
10008                   break
10009
10010                 case "cdata":
10011                   emitNode(parser, "oncdata", parser.cdata)
10012                   parser.cdata = ""
10013                   break
10014
10015                 case "script":
10016                   emitNode(parser, "onscript", parser.script)
10017                   parser.script = ""
10018                   break
10019
10020                 default:
10021                   error(parser, "Max buffer length exceeded: " + buffers[i])
10022               }
10023             }
10024             maxActual = Math.max(maxActual, len)
10025           }
10026           // schedule the next check for the earliest possible buffer overrun.
10027           parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + parser.position
10028         }
10029
10030         function clearBuffers(parser) {
10031           for (var i = 0, l = buffers.length; i < l; i++) {
10032             parser[buffers[i]] = ""
10033           }
10034         }
10035
10036         function flushBuffers(parser) {
10037           closeText(parser)
10038           if (parser.cdata !== "") {
10039             emitNode(parser, "oncdata", parser.cdata)
10040             parser.cdata = ""
10041           }
10042           if (parser.script !== "") {
10043             emitNode(parser, "onscript", parser.script)
10044             parser.script = ""
10045           }
10046         }
10047
10048         SAXParser.prototype = {
10049           end: function() {
10050             end(this)
10051           },
10052           write: write,
10053           resume: function() {
10054             this.error = null;
10055             return this
10056           },
10057           close: function() {
10058             return this.write(null)
10059           },
10060           flush: function() {
10061             flushBuffers(this)
10062           }
10063         }
10064
10065         try {
10066           var Stream = require("stream").Stream
10067         } catch (ex) {
10068           var Stream = function() {}
10069         }
10070
10071
10072         var streamWraps = sax.EVENTS.filter(function(ev) {
10073           return ev !== "error" && ev !== "end"
10074         })
10075
10076         function createStream(strict, opt) {
10077           return new SAXStream(strict, opt)
10078         }
10079
10080         function SAXStream(strict, opt) {
10081           if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
10082
10083           Stream.apply(this)
10084
10085           this._parser = new SAXParser(strict, opt)
10086           this.writable = true
10087           this.readable = true
10088
10089
10090           var me = this
10091
10092           this._parser.onend = function() {
10093             me.emit("end")
10094           }
10095
10096           this._parser.onerror = function(er) {
10097             me.emit("error", er)
10098
10099             // if didn't throw, then means error was handled.
10100             // go ahead and clear error, so we can write again.
10101             me._parser.error = null
10102           }
10103
10104           this._decoder = null;
10105
10106           streamWraps.forEach(function(ev) {
10107             Object.defineProperty(me, "on" + ev, {
10108               get: function() {
10109                 return me._parser["on" + ev]
10110               },
10111               set: function(h) {
10112                 if (!h) {
10113                   me.removeAllListeners(ev)
10114                   return me._parser["on" + ev] = h
10115                 }
10116                 me.on(ev, h)
10117               },
10118               enumerable: true,
10119               configurable: false
10120             })
10121           })
10122         }
10123
10124         SAXStream.prototype = Object.create(Stream.prototype, {
10125           constructor: {
10126             value: SAXStream
10127           }
10128         })
10129
10130         SAXStream.prototype.write = function(data) {
10131           if (typeof Buffer === 'function' &&
10132             typeof Buffer.isBuffer === 'function' &&
10133             Buffer.isBuffer(data)) {
10134             if (!this._decoder) {
10135               var SD = require('string_decoder').StringDecoder
10136               this._decoder = new SD('utf8')
10137             }
10138             data = this._decoder.write(data);
10139           }
10140
10141           this._parser.write(data.toString())
10142           this.emit("data", data)
10143           return true
10144         }
10145
10146         SAXStream.prototype.end = function(chunk) {
10147           if (chunk && chunk.length) this.write(chunk)
10148           this._parser.end()
10149           return true
10150         }
10151
10152         SAXStream.prototype.on = function(ev, handler) {
10153           var me = this
10154           if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
10155             me._parser["on" + ev] = function() {
10156               var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
10157               args.splice(0, 0, ev)
10158               me.emit.apply(me, args)
10159             }
10160           }
10161
10162           return Stream.prototype.on.call(me, ev, handler)
10163         }
10164
10165
10166
10167         // character classes and tokens
10168         var whitespace = "\r\n\t "
10169           // this really needs to be replaced with character classes.
10170           // XML allows all manner of ridiculous numbers and digits.
10171           ,
10172           number = "0124356789",
10173           letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
10174           // (Letter | "_" | ":")
10175           ,
10176           quote = "'\"",
10177           entity = number + letter + "#",
10178           attribEnd = whitespace + ">",
10179           CDATA = "[CDATA[",
10180           DOCTYPE = "DOCTYPE",
10181           XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace",
10182           XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/",
10183           rootNS = {
10184             xml: XML_NAMESPACE,
10185             xmlns: XMLNS_NAMESPACE
10186           }
10187
10188         // turn all the string character sets into character class objects.
10189         whitespace = charClass(whitespace)
10190         number = charClass(number)
10191         letter = charClass(letter)
10192
10193         // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
10194         // This implementation works on strings, a single character at a time
10195         // as such, it cannot ever support astral-plane characters (10000-EFFFF)
10196         // without a significant breaking change to either this parser, or the
10197         // JavaScript language. Implementation of an emoji-capable xml parser
10198         // is left as an exercise for the reader.
10199         var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
10200
10201         var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/
10202
10203         quote = charClass(quote)
10204         entity = charClass(entity)
10205         attribEnd = charClass(attribEnd)
10206
10207         function charClass(str) {
10208           return str.split("").reduce(function(s, c) {
10209             s[c] = true
10210             return s
10211           }, {})
10212         }
10213
10214         function isRegExp(c) {
10215           return Object.prototype.toString.call(c) === '[object RegExp]'
10216         }
10217
10218         function is(charclass, c) {
10219           return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
10220         }
10221
10222         function not(charclass, c) {
10223           return !is(charclass, c)
10224         }
10225
10226         var S = 0
10227         sax.STATE = {
10228           BEGIN: S++,
10229           TEXT: S++ // general stuff
10230             ,
10231           TEXT_ENTITY: S++ // &amp and such.
10232             ,
10233           OPEN_WAKA: S++ // <
10234             ,
10235           SGML_DECL: S++ // <!BLARG
10236             ,
10237           SGML_DECL_QUOTED: S++ // <!BLARG foo "bar
10238             ,
10239           DOCTYPE: S++ // <!DOCTYPE
10240             ,
10241           DOCTYPE_QUOTED: S++ // <!DOCTYPE "//blah
10242             ,
10243           DOCTYPE_DTD: S++ // <!DOCTYPE "//blah" [ ...
10244             ,
10245           DOCTYPE_DTD_QUOTED: S++ // <!DOCTYPE "//blah" [ "foo
10246             ,
10247           COMMENT_STARTING: S++ // <!-
10248             ,
10249           COMMENT: S++ // <!--
10250             ,
10251           COMMENT_ENDING: S++ // <!-- blah -
10252             ,
10253           COMMENT_ENDED: S++ // <!-- blah --
10254             ,
10255           CDATA: S++ // <![CDATA[ something
10256             ,
10257           CDATA_ENDING: S++ // ]
10258             ,
10259           CDATA_ENDING_2: S++ // ]]
10260             ,
10261           PROC_INST: S++ // <?hi
10262             ,
10263           PROC_INST_BODY: S++ // <?hi there
10264             ,
10265           PROC_INST_ENDING: S++ // <?hi "there" ?
10266             ,
10267           OPEN_TAG: S++ // <strong
10268             ,
10269           OPEN_TAG_SLASH: S++ // <strong /
10270             ,
10271           ATTRIB: S++ // <a
10272             ,
10273           ATTRIB_NAME: S++ // <a foo
10274             ,
10275           ATTRIB_NAME_SAW_WHITE: S++ // <a foo _
10276             ,
10277           ATTRIB_VALUE: S++ // <a foo=
10278             ,
10279           ATTRIB_VALUE_QUOTED: S++ // <a foo="bar
10280             ,
10281           ATTRIB_VALUE_CLOSED: S++ // <a foo="bar"
10282             ,
10283           ATTRIB_VALUE_UNQUOTED: S++ // <a foo=bar
10284             ,
10285           ATTRIB_VALUE_ENTITY_Q: S++ // <foo bar="&quot;"
10286             ,
10287           ATTRIB_VALUE_ENTITY_U: S++ // <foo bar=&quot;
10288             ,
10289           CLOSE_TAG: S++ // </a
10290             ,
10291           CLOSE_TAG_SAW_WHITE: S++ // </a >
10292             ,
10293           SCRIPT: S++ // <script> ...
10294             ,
10295           SCRIPT_ENDING: S++ // <script> ... <
10296         }
10297
10298         sax.ENTITIES = {
10299           "amp": "&",
10300           "gt": ">",
10301           "lt": "<",
10302           "quot": "\"",
10303           "apos": "'",
10304           "AElig": 198,
10305           "Aacute": 193,
10306           "Acirc": 194,
10307           "Agrave": 192,
10308           "Aring": 197,
10309           "Atilde": 195,
10310           "Auml": 196,
10311           "Ccedil": 199,
10312           "ETH": 208,
10313           "Eacute": 201,
10314           "Ecirc": 202,
10315           "Egrave": 200,
10316           "Euml": 203,
10317           "Iacute": 205,
10318           "Icirc": 206,
10319           "Igrave": 204,
10320           "Iuml": 207,
10321           "Ntilde": 209,
10322           "Oacute": 211,
10323           "Ocirc": 212,
10324           "Ograve": 210,
10325           "Oslash": 216,
10326           "Otilde": 213,
10327           "Ouml": 214,
10328           "THORN": 222,
10329           "Uacute": 218,
10330           "Ucirc": 219,
10331           "Ugrave": 217,
10332           "Uuml": 220,
10333           "Yacute": 221,
10334           "aacute": 225,
10335           "acirc": 226,
10336           "aelig": 230,
10337           "agrave": 224,
10338           "aring": 229,
10339           "atilde": 227,
10340           "auml": 228,
10341           "ccedil": 231,
10342           "eacute": 233,
10343           "ecirc": 234,
10344           "egrave": 232,
10345           "eth": 240,
10346           "euml": 235,
10347           "iacute": 237,
10348           "icirc": 238,
10349           "igrave": 236,
10350           "iuml": 239,
10351           "ntilde": 241,
10352           "oacute": 243,
10353           "ocirc": 244,
10354           "ograve": 242,
10355           "oslash": 248,
10356           "otilde": 245,
10357           "ouml": 246,
10358           "szlig": 223,
10359           "thorn": 254,
10360           "uacute": 250,
10361           "ucirc": 251,
10362           "ugrave": 249,
10363           "uuml": 252,
10364           "yacute": 253,
10365           "yuml": 255,
10366           "copy": 169,
10367           "reg": 174,
10368           "nbsp": 160,
10369           "iexcl": 161,
10370           "cent": 162,
10371           "pound": 163,
10372           "curren": 164,
10373           "yen": 165,
10374           "brvbar": 166,
10375           "sect": 167,
10376           "uml": 168,
10377           "ordf": 170,
10378           "laquo": 171,
10379           "not": 172,
10380           "shy": 173,
10381           "macr": 175,
10382           "deg": 176,
10383           "plusmn": 177,
10384           "sup1": 185,
10385           "sup2": 178,
10386           "sup3": 179,
10387           "acute": 180,
10388           "micro": 181,
10389           "para": 182,
10390           "middot": 183,
10391           "cedil": 184,
10392           "ordm": 186,
10393           "raquo": 187,
10394           "frac14": 188,
10395           "frac12": 189,
10396           "frac34": 190,
10397           "iquest": 191,
10398           "times": 215,
10399           "divide": 247,
10400           "OElig": 338,
10401           "oelig": 339,
10402           "Scaron": 352,
10403           "scaron": 353,
10404           "Yuml": 376,
10405           "fnof": 402,
10406           "circ": 710,
10407           "tilde": 732,
10408           "Alpha": 913,
10409           "Beta": 914,
10410           "Gamma": 915,
10411           "Delta": 916,
10412           "Epsilon": 917,
10413           "Zeta": 918,
10414           "Eta": 919,
10415           "Theta": 920,
10416           "Iota": 921,
10417           "Kappa": 922,
10418           "Lambda": 923,
10419           "Mu": 924,
10420           "Nu": 925,
10421           "Xi": 926,
10422           "Omicron": 927,
10423           "Pi": 928,
10424           "Rho": 929,
10425           "Sigma": 931,
10426           "Tau": 932,
10427           "Upsilon": 933,
10428           "Phi": 934,
10429           "Chi": 935,
10430           "Psi": 936,
10431           "Omega": 937,
10432           "alpha": 945,
10433           "beta": 946,
10434           "gamma": 947,
10435           "delta": 948,
10436           "epsilon": 949,
10437           "zeta": 950,
10438           "eta": 951,
10439           "theta": 952,
10440           "iota": 953,
10441           "kappa": 954,
10442           "lambda": 955,
10443           "mu": 956,
10444           "nu": 957,
10445           "xi": 958,
10446           "omicron": 959,
10447           "pi": 960,
10448           "rho": 961,
10449           "sigmaf": 962,
10450           "sigma": 963,
10451           "tau": 964,
10452           "upsilon": 965,
10453           "phi": 966,
10454           "chi": 967,
10455           "psi": 968,
10456           "omega": 969,
10457           "thetasym": 977,
10458           "upsih": 978,
10459           "piv": 982,
10460           "ensp": 8194,
10461           "emsp": 8195,
10462           "thinsp": 8201,
10463           "zwnj": 8204,
10464           "zwj": 8205,
10465           "lrm": 8206,
10466           "rlm": 8207,
10467           "ndash": 8211,
10468           "mdash": 8212,
10469           "lsquo": 8216,
10470           "rsquo": 8217,
10471           "sbquo": 8218,
10472           "ldquo": 8220,
10473           "rdquo": 8221,
10474           "bdquo": 8222,
10475           "dagger": 8224,
10476           "Dagger": 8225,
10477           "bull": 8226,
10478           "hellip": 8230,
10479           "permil": 8240,
10480           "prime": 8242,
10481           "Prime": 8243,
10482           "lsaquo": 8249,
10483           "rsaquo": 8250,
10484           "oline": 8254,
10485           "frasl": 8260,
10486           "euro": 8364,
10487           "image": 8465,
10488           "weierp": 8472,
10489           "real": 8476,
10490           "trade": 8482,
10491           "alefsym": 8501,
10492           "larr": 8592,
10493           "uarr": 8593,
10494           "rarr": 8594,
10495           "darr": 8595,
10496           "harr": 8596,
10497           "crarr": 8629,
10498           "lArr": 8656,
10499           "uArr": 8657,
10500           "rArr": 8658,
10501           "dArr": 8659,
10502           "hArr": 8660,
10503           "forall": 8704,
10504           "part": 8706,
10505           "exist": 8707,
10506           "empty": 8709,
10507           "nabla": 8711,
10508           "isin": 8712,
10509           "notin": 8713,
10510           "ni": 8715,
10511           "prod": 8719,
10512           "sum": 8721,
10513           "minus": 8722,
10514           "lowast": 8727,
10515           "radic": 8730,
10516           "prop": 8733,
10517           "infin": 8734,
10518           "ang": 8736,
10519           "and": 8743,
10520           "or": 8744,
10521           "cap": 8745,
10522           "cup": 8746,
10523           "int": 8747,
10524           "there4": 8756,
10525           "sim": 8764,
10526           "cong": 8773,
10527           "asymp": 8776,
10528           "ne": 8800,
10529           "equiv": 8801,
10530           "le": 8804,
10531           "ge": 8805,
10532           "sub": 8834,
10533           "sup": 8835,
10534           "nsub": 8836,
10535           "sube": 8838,
10536           "supe": 8839,
10537           "oplus": 8853,
10538           "otimes": 8855,
10539           "perp": 8869,
10540           "sdot": 8901,
10541           "lceil": 8968,
10542           "rceil": 8969,
10543           "lfloor": 8970,
10544           "rfloor": 8971,
10545           "lang": 9001,
10546           "rang": 9002,
10547           "loz": 9674,
10548           "spades": 9824,
10549           "clubs": 9827,
10550           "hearts": 9829,
10551           "diams": 9830
10552         }
10553
10554         Object.keys(sax.ENTITIES).forEach(function(key) {
10555           var e = sax.ENTITIES[key]
10556           var s = typeof e === 'number' ? String.fromCharCode(e) : e
10557           sax.ENTITIES[key] = s
10558         })
10559
10560         for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
10561
10562         // shorthand
10563         S = sax.STATE
10564
10565         function emit(parser, event, data) {
10566           parser[event] && parser[event](data)
10567         }
10568
10569         function emitNode(parser, nodeType, data) {
10570           if (parser.textNode) closeText(parser)
10571           emit(parser, nodeType, data)
10572         }
10573
10574         function closeText(parser) {
10575           parser.textNode = textopts(parser.opt, parser.textNode)
10576           if (parser.textNode) emit(parser, "ontext", parser.textNode)
10577           parser.textNode = ""
10578         }
10579
10580         function textopts(opt, text) {
10581           if (opt.trim) text = text.trim()
10582           if (opt.normalize) text = text.replace(/\s+/g, " ")
10583           return text
10584         }
10585
10586         function error(parser, er) {
10587           closeText(parser)
10588           if (parser.trackPosition) {
10589             er += "\nLine: " + parser.line +
10590               "\nColumn: " + parser.column +
10591               "\nChar: " + parser.c
10592           }
10593           er = new Error(er)
10594           parser.error = er
10595           emit(parser, "onerror", er)
10596           return parser
10597         }
10598
10599         function end(parser) {
10600           if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
10601           if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
10602           closeText(parser)
10603           parser.c = ""
10604           parser.closed = true
10605           emit(parser, "onend")
10606           SAXParser.call(parser, parser.strict, parser.opt)
10607           return parser
10608         }
10609
10610         function strictFail(parser, message) {
10611           if (typeof parser !== 'object' || !(parser instanceof SAXParser))
10612             throw new Error('bad call to strictFail');
10613           if (parser.strict) error(parser, message)
10614         }
10615
10616         function newTag(parser) {
10617           if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
10618           var parent = parser.tags[parser.tags.length - 1] || parser,
10619             tag = parser.tag = {
10620               name: parser.tagName,
10621               attributes: {}
10622             }
10623
10624           // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
10625           if (parser.opt.xmlns) tag.ns = parent.ns
10626           parser.attribList.length = 0
10627         }
10628
10629         function qname(name, attribute) {
10630           var i = name.indexOf(":"),
10631             qualName = i < 0 ? ["", name] : name.split(":"),
10632             prefix = qualName[0],
10633             local = qualName[1]
10634
10635           // <x "xmlns"="http://foo">
10636           if (attribute && name === "xmlns") {
10637             prefix = "xmlns"
10638             local = ""
10639           }
10640
10641           return {
10642             prefix: prefix,
10643             local: local
10644           }
10645         }
10646
10647         function attrib(parser) {
10648           if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
10649
10650           if (parser.attribList.indexOf(parser.attribName) !== -1 ||
10651             parser.tag.attributes.hasOwnProperty(parser.attribName)) {
10652             return parser.attribName = parser.attribValue = ""
10653           }
10654
10655           if (parser.opt.xmlns) {
10656             var qn = qname(parser.attribName, true),
10657               prefix = qn.prefix,
10658               local = qn.local
10659
10660             if (prefix === "xmlns") {
10661               // namespace binding attribute; push the binding into scope
10662               if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
10663                 strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10664               } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
10665                 strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10666               } else {
10667                 var tag = parser.tag,
10668                   parent = parser.tags[parser.tags.length - 1] || parser
10669                 if (tag.ns === parent.ns) {
10670                   tag.ns = Object.create(parent.ns)
10671                 }
10672                 tag.ns[local] = parser.attribValue
10673               }
10674             }
10675
10676             // defer onattribute events until all attributes have been seen
10677             // so any new bindings can take effect; preserve attribute order
10678             // so deferred events can be emitted in document order
10679             parser.attribList.push([parser.attribName, parser.attribValue])
10680           } else {
10681             // in non-xmlns mode, we can emit the event right away
10682             parser.tag.attributes[parser.attribName] = parser.attribValue
10683             emitNode(parser, "onattribute", {
10684               name: parser.attribName,
10685               value: parser.attribValue
10686             })
10687           }
10688
10689           parser.attribName = parser.attribValue = ""
10690         }
10691
10692         function openTag(parser, selfClosing) {
10693           if (parser.opt.xmlns) {
10694             // emit namespace binding events
10695             var tag = parser.tag
10696
10697             // add namespace info to tag
10698             var qn = qname(parser.tagName)
10699             tag.prefix = qn.prefix
10700             tag.local = qn.local
10701             tag.uri = tag.ns[qn.prefix] || ""
10702
10703             if (tag.prefix && !tag.uri) {
10704               strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName))
10705               tag.uri = qn.prefix
10706             }
10707
10708             var parent = parser.tags[parser.tags.length - 1] || parser
10709             if (tag.ns && parent.ns !== tag.ns) {
10710               Object.keys(tag.ns).forEach(function(p) {
10711                 emitNode(parser, "onopennamespace", {
10712                   prefix: p,
10713                   uri: tag.ns[p]
10714                 })
10715               })
10716             }
10717
10718             // handle deferred onattribute events
10719             // Note: do not apply default ns to attributes:
10720             // http://www.w3.org/TR/REC-xml-names/#defaulting
10721             for (var i = 0, l = parser.attribList.length; i < l; i++) {
10722               var nv = parser.attribList[i]
10723               var name = nv[0],
10724                 value = nv[1],
10725                 qualName = qname(name, true),
10726                 prefix = qualName.prefix,
10727                 local = qualName.local,
10728                 uri = prefix == "" ? "" : (tag.ns[prefix] || ""),
10729                 a = {
10730                   name: name,
10731                   value: value,
10732                   prefix: prefix,
10733                   local: local,
10734                   uri: uri
10735                 }
10736
10737               // if there's any attributes with an undefined namespace,
10738               // then fail on them now.
10739               if (prefix && prefix != "xmlns" && !uri) {
10740                 strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix))
10741                 a.uri = prefix
10742               }
10743               parser.tag.attributes[name] = a
10744               emitNode(parser, "onattribute", a)
10745             }
10746             parser.attribList.length = 0
10747           }
10748
10749           parser.tag.isSelfClosing = !!selfClosing
10750
10751           // process the tag
10752           parser.sawRoot = true
10753           parser.tags.push(parser.tag)
10754           emitNode(parser, "onopentag", parser.tag)
10755           if (!selfClosing) {
10756             // special case for <script> in non-strict mode.
10757             if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
10758               parser.state = S.SCRIPT
10759             } else {
10760               parser.state = S.TEXT
10761             }
10762             parser.tag = null
10763             parser.tagName = ""
10764           }
10765           parser.attribName = parser.attribValue = ""
10766           parser.attribList.length = 0
10767         }
10768
10769         function closeTag(parser) {
10770           if (!parser.tagName) {
10771             strictFail(parser, "Weird empty close tag.")
10772             parser.textNode += "</>"
10773             parser.state = S.TEXT
10774             return
10775           }
10776
10777           if (parser.script) {
10778             if (parser.tagName !== "script") {
10779               parser.script += "</" + parser.tagName + ">"
10780               parser.tagName = ""
10781               parser.state = S.SCRIPT
10782               return
10783             }
10784             emitNode(parser, "onscript", parser.script)
10785             parser.script = ""
10786           }
10787
10788           // first make sure that the closing tag actually exists.
10789           // <a><b></c></b></a> will close everything, otherwise.
10790           var t = parser.tags.length
10791           var tagName = parser.tagName
10792           if (!parser.strict) tagName = tagName[parser.looseCase]()
10793           var closeTo = tagName
10794           while (t--) {
10795             var close = parser.tags[t]
10796             if (close.name !== closeTo) {
10797               // fail the first time in strict mode
10798               strictFail(parser, "Unexpected close tag")
10799             } else break
10800           }
10801
10802           // didn't find it. we already failed for strict, so just abort.
10803           if (t < 0) {
10804             strictFail(parser, "Unmatched closing tag: " + parser.tagName)
10805             parser.textNode += "</" + parser.tagName + ">"
10806             parser.state = S.TEXT
10807             return
10808           }
10809           parser.tagName = tagName
10810           var s = parser.tags.length
10811           while (s-- > t) {
10812             var tag = parser.tag = parser.tags.pop()
10813             parser.tagName = parser.tag.name
10814             emitNode(parser, "onclosetag", parser.tagName)
10815
10816             var x = {}
10817             for (var i in tag.ns) x[i] = tag.ns[i]
10818
10819             var parent = parser.tags[parser.tags.length - 1] || parser
10820             if (parser.opt.xmlns && tag.ns !== parent.ns) {
10821               // remove namespace bindings introduced by tag
10822               Object.keys(tag.ns).forEach(function(p) {
10823                 var n = tag.ns[p]
10824                 emitNode(parser, "onclosenamespace", {
10825                   prefix: p,
10826                   uri: n
10827                 })
10828               })
10829             }
10830           }
10831           if (t === 0) parser.closedRoot = true
10832           parser.tagName = parser.attribValue = parser.attribName = ""
10833           parser.attribList.length = 0
10834           parser.state = S.TEXT
10835         }
10836
10837         function parseEntity(parser) {
10838           var entity = parser.entity,
10839             entityLC = entity.toLowerCase(),
10840             num, numStr = ""
10841           if (parser.ENTITIES[entity])
10842             return parser.ENTITIES[entity]
10843           if (parser.ENTITIES[entityLC])
10844             return parser.ENTITIES[entityLC]
10845           entity = entityLC
10846           if (entity.charAt(0) === "#") {
10847             if (entity.charAt(1) === "x") {
10848               entity = entity.slice(2)
10849               num = parseInt(entity, 16)
10850               numStr = num.toString(16)
10851             } else {
10852               entity = entity.slice(1)
10853               num = parseInt(entity, 10)
10854               numStr = num.toString(10)
10855             }
10856           }
10857           entity = entity.replace(/^0+/, "")
10858           if (numStr.toLowerCase() !== entity) {
10859             strictFail(parser, "Invalid character entity")
10860             return "&" + parser.entity + ";"
10861           }
10862
10863           return String.fromCodePoint(num)
10864         }
10865
10866         function write(chunk) {
10867           var parser = this
10868           if (this.error) throw this.error
10869           if (parser.closed) return error(parser,
10870             "Cannot write after close. Assign an onready handler.")
10871           if (chunk === null) return end(parser)
10872           var i = 0,
10873             c = ""
10874           while (parser.c = c = chunk.charAt(i++)) {
10875             if (parser.trackPosition) {
10876               parser.position++
10877                 if (c === "\n") {
10878                   parser.line++
10879                     parser.column = 0
10880                 } else parser.column++
10881             }
10882             switch (parser.state) {
10883
10884               case S.BEGIN:
10885                 if (c === "<") {
10886                   parser.state = S.OPEN_WAKA
10887                   parser.startTagPosition = parser.position
10888                 } else if (not(whitespace, c)) {
10889                   // have to process this as a text node.
10890                   // weird, but happens.
10891                   strictFail(parser, "Non-whitespace before first tag.")
10892                   parser.textNode = c
10893                   parser.state = S.TEXT
10894                 }
10895                 continue
10896
10897               case S.TEXT:
10898                 if (parser.sawRoot && !parser.closedRoot) {
10899                   var starti = i - 1
10900                   while (c && c !== "<" && c !== "&") {
10901                     c = chunk.charAt(i++)
10902                     if (c && parser.trackPosition) {
10903                       parser.position++
10904                         if (c === "\n") {
10905                           parser.line++
10906                             parser.column = 0
10907                         } else parser.column++
10908                     }
10909                   }
10910                   parser.textNode += chunk.substring(starti, i - 1)
10911                 }
10912                 if (c === "<") {
10913                   parser.state = S.OPEN_WAKA
10914                   parser.startTagPosition = parser.position
10915                 } else {
10916                   if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
10917                     strictFail(parser, "Text data outside of root node.")
10918                   if (c === "&") parser.state = S.TEXT_ENTITY
10919                   else parser.textNode += c
10920                 }
10921                 continue
10922
10923               case S.SCRIPT:
10924                 // only non-strict
10925                 if (c === "<") {
10926                   parser.state = S.SCRIPT_ENDING
10927                 } else parser.script += c
10928                 continue
10929
10930               case S.SCRIPT_ENDING:
10931                 if (c === "/") {
10932                   parser.state = S.CLOSE_TAG
10933                 } else {
10934                   parser.script += "<" + c
10935                   parser.state = S.SCRIPT
10936                 }
10937                 continue
10938
10939               case S.OPEN_WAKA:
10940                 // either a /, ?, !, or text is coming next.
10941                 if (c === "!") {
10942                   parser.state = S.SGML_DECL
10943                   parser.sgmlDecl = ""
10944                 } else if (is(whitespace, c)) {
10945                   // wait for it...
10946                 } else if (is(nameStart, c)) {
10947                   parser.state = S.OPEN_TAG
10948                   parser.tagName = c
10949                 } else if (c === "/") {
10950                   parser.state = S.CLOSE_TAG
10951                   parser.tagName = ""
10952                 } else if (c === "?") {
10953                   parser.state = S.PROC_INST
10954                   parser.procInstName = parser.procInstBody = ""
10955                 } else {
10956                   strictFail(parser, "Unencoded <")
10957                   // if there was some whitespace, then add that in.
10958                   if (parser.startTagPosition + 1 < parser.position) {
10959                     var pad = parser.position - parser.startTagPosition
10960                     c = new Array(pad).join(" ") + c
10961                   }
10962                   parser.textNode += "<" + c
10963                   parser.state = S.TEXT
10964                 }
10965                 continue
10966
10967               case S.SGML_DECL:
10968                 if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
10969                   emitNode(parser, "onopencdata")
10970                   parser.state = S.CDATA
10971                   parser.sgmlDecl = ""
10972                   parser.cdata = ""
10973                 } else if (parser.sgmlDecl + c === "--") {
10974                   parser.state = S.COMMENT
10975                   parser.comment = ""
10976                   parser.sgmlDecl = ""
10977                 } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
10978                   parser.state = S.DOCTYPE
10979                   if (parser.doctype || parser.sawRoot) strictFail(parser,
10980                     "Inappropriately located doctype declaration")
10981                   parser.doctype = ""
10982                   parser.sgmlDecl = ""
10983                 } else if (c === ">") {
10984                   emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
10985                   parser.sgmlDecl = ""
10986                   parser.state = S.TEXT
10987                 } else if (is(quote, c)) {
10988                   parser.state = S.SGML_DECL_QUOTED
10989                   parser.sgmlDecl += c
10990                 } else parser.sgmlDecl += c
10991                 continue
10992
10993               case S.SGML_DECL_QUOTED:
10994                 if (c === parser.q) {
10995                   parser.state = S.SGML_DECL
10996                   parser.q = ""
10997                 }
10998                 parser.sgmlDecl += c
10999                 continue
11000
11001               case S.DOCTYPE:
11002                 if (c === ">") {
11003                   parser.state = S.TEXT
11004                   emitNode(parser, "ondoctype", parser.doctype)
11005                   parser.doctype = true // just remember that we saw it.
11006                 } else {
11007                   parser.doctype += c
11008                   if (c === "[") parser.state = S.DOCTYPE_DTD
11009                   else if (is(quote, c)) {
11010                     parser.state = S.DOCTYPE_QUOTED
11011                     parser.q = c
11012                   }
11013                 }
11014                 continue
11015
11016               case S.DOCTYPE_QUOTED:
11017                 parser.doctype += c
11018                 if (c === parser.q) {
11019                   parser.q = ""
11020                   parser.state = S.DOCTYPE
11021                 }
11022                 continue
11023
11024               case S.DOCTYPE_DTD:
11025                 parser.doctype += c
11026                 if (c === "]") parser.state = S.DOCTYPE
11027                 else if (is(quote, c)) {
11028                   parser.state = S.DOCTYPE_DTD_QUOTED
11029                   parser.q = c
11030                 }
11031                 continue
11032
11033               case S.DOCTYPE_DTD_QUOTED:
11034                 parser.doctype += c
11035                 if (c === parser.q) {
11036                   parser.state = S.DOCTYPE_DTD
11037                   parser.q = ""
11038                 }
11039                 continue
11040
11041               case S.COMMENT:
11042                 if (c === "-") parser.state = S.COMMENT_ENDING
11043                 else parser.comment += c
11044                 continue
11045
11046               case S.COMMENT_ENDING:
11047                 if (c === "-") {
11048                   parser.state = S.COMMENT_ENDED
11049                   parser.comment = textopts(parser.opt, parser.comment)
11050                   if (parser.comment) emitNode(parser, "oncomment", parser.comment)
11051                   parser.comment = ""
11052                 } else {
11053                   parser.comment += "-" + c
11054                   parser.state = S.COMMENT
11055                 }
11056                 continue
11057
11058               case S.COMMENT_ENDED:
11059                 if (c !== ">") {
11060                   strictFail(parser, "Malformed comment")
11061                   // allow <!-- blah -- bloo --> in non-strict mode,
11062                   // which is a comment of " blah -- bloo "
11063                   parser.comment += "--" + c
11064                   parser.state = S.COMMENT
11065                 } else parser.state = S.TEXT
11066                 continue
11067
11068               case S.CDATA:
11069                 if (c === "]") parser.state = S.CDATA_ENDING
11070                 else parser.cdata += c
11071                 continue
11072
11073               case S.CDATA_ENDING:
11074                 if (c === "]") parser.state = S.CDATA_ENDING_2
11075                 else {
11076                   parser.cdata += "]" + c
11077                   parser.state = S.CDATA
11078                 }
11079                 continue
11080
11081               case S.CDATA_ENDING_2:
11082                 if (c === ">") {
11083                   if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
11084                   emitNode(parser, "onclosecdata")
11085                   parser.cdata = ""
11086                   parser.state = S.TEXT
11087                 } else if (c === "]") {
11088                   parser.cdata += "]"
11089                 } else {
11090                   parser.cdata += "]]" + c
11091                   parser.state = S.CDATA
11092                 }
11093                 continue
11094
11095               case S.PROC_INST:
11096                 if (c === "?") parser.state = S.PROC_INST_ENDING
11097                 else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
11098                 else parser.procInstName += c
11099                 continue
11100
11101               case S.PROC_INST_BODY:
11102                 if (!parser.procInstBody && is(whitespace, c)) continue
11103                 else if (c === "?") parser.state = S.PROC_INST_ENDING
11104                 else parser.procInstBody += c
11105                 continue
11106
11107               case S.PROC_INST_ENDING:
11108                 if (c === ">") {
11109                   emitNode(parser, "onprocessinginstruction", {
11110                     name: parser.procInstName,
11111                     body: parser.procInstBody
11112                   })
11113                   parser.procInstName = parser.procInstBody = ""
11114                   parser.state = S.TEXT
11115                 } else {
11116                   parser.procInstBody += "?" + c
11117                   parser.state = S.PROC_INST_BODY
11118                 }
11119                 continue
11120
11121               case S.OPEN_TAG:
11122                 if (is(nameBody, c)) parser.tagName += c
11123                 else {
11124                   newTag(parser)
11125                   if (c === ">") openTag(parser)
11126                   else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11127                   else {
11128                     if (not(whitespace, c)) strictFail(
11129                       parser, "Invalid character in tag name")
11130                     parser.state = S.ATTRIB
11131                   }
11132                 }
11133                 continue
11134
11135               case S.OPEN_TAG_SLASH:
11136                 if (c === ">") {
11137                   openTag(parser, true)
11138                   closeTag(parser)
11139                 } else {
11140                   strictFail(parser, "Forward-slash in opening tag not followed by >")
11141                   parser.state = S.ATTRIB
11142                 }
11143                 continue
11144
11145               case S.ATTRIB:
11146                 // haven't read the attribute name yet.
11147                 if (is(whitespace, c)) continue
11148                 else if (c === ">") openTag(parser)
11149                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11150                 else if (is(nameStart, c)) {
11151                   parser.attribName = c
11152                   parser.attribValue = ""
11153                   parser.state = S.ATTRIB_NAME
11154                 } else strictFail(parser, "Invalid attribute name")
11155                 continue
11156
11157               case S.ATTRIB_NAME:
11158                 if (c === "=") parser.state = S.ATTRIB_VALUE
11159                 else if (c === ">") {
11160                   strictFail(parser, "Attribute without value")
11161                   parser.attribValue = parser.attribName
11162                   attrib(parser)
11163                   openTag(parser)
11164                 } else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
11165                 else if (is(nameBody, c)) parser.attribName += c
11166                 else strictFail(parser, "Invalid attribute name")
11167                 continue
11168
11169               case S.ATTRIB_NAME_SAW_WHITE:
11170                 if (c === "=") parser.state = S.ATTRIB_VALUE
11171                 else if (is(whitespace, c)) continue
11172                 else {
11173                   strictFail(parser, "Attribute without value")
11174                   parser.tag.attributes[parser.attribName] = ""
11175                   parser.attribValue = ""
11176                   emitNode(parser, "onattribute", {
11177                     name: parser.attribName,
11178                     value: ""
11179                   })
11180                   parser.attribName = ""
11181                   if (c === ">") openTag(parser)
11182                   else if (is(nameStart, c)) {
11183                     parser.attribName = c
11184                     parser.state = S.ATTRIB_NAME
11185                   } else {
11186                     strictFail(parser, "Invalid attribute name")
11187                     parser.state = S.ATTRIB
11188                   }
11189                 }
11190                 continue
11191
11192               case S.ATTRIB_VALUE:
11193                 if (is(whitespace, c)) continue
11194                 else if (is(quote, c)) {
11195                   parser.q = c
11196                   parser.state = S.ATTRIB_VALUE_QUOTED
11197                 } else {
11198                   strictFail(parser, "Unquoted attribute value")
11199                   parser.state = S.ATTRIB_VALUE_UNQUOTED
11200                   parser.attribValue = c
11201                 }
11202                 continue
11203
11204               case S.ATTRIB_VALUE_QUOTED:
11205                 if (c !== parser.q) {
11206                   if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
11207                   else parser.attribValue += c
11208                   continue
11209                 }
11210                 attrib(parser)
11211                 parser.q = ""
11212                 parser.state = S.ATTRIB_VALUE_CLOSED
11213                 continue
11214
11215               case S.ATTRIB_VALUE_CLOSED:
11216                 if (is(whitespace, c)) {
11217                   parser.state = S.ATTRIB
11218                 } else if (c === ">") openTag(parser)
11219                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11220                 else if (is(nameStart, c)) {
11221                   strictFail(parser, "No whitespace between attributes")
11222                   parser.attribName = c
11223                   parser.attribValue = ""
11224                   parser.state = S.ATTRIB_NAME
11225                 } else strictFail(parser, "Invalid attribute name")
11226                 continue
11227
11228               case S.ATTRIB_VALUE_UNQUOTED:
11229                 if (not(attribEnd, c)) {
11230                   if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
11231                   else parser.attribValue += c
11232                   continue
11233                 }
11234                 attrib(parser)
11235                 if (c === ">") openTag(parser)
11236                 else parser.state = S.ATTRIB
11237                 continue
11238
11239               case S.CLOSE_TAG:
11240                 if (!parser.tagName) {
11241                   if (is(whitespace, c)) continue
11242                   else if (not(nameStart, c)) {
11243                     if (parser.script) {
11244                       parser.script += "</" + c
11245                       parser.state = S.SCRIPT
11246                     } else {
11247                       strictFail(parser, "Invalid tagname in closing tag.")
11248                     }
11249                   } else parser.tagName = c
11250                 } else if (c === ">") closeTag(parser)
11251                 else if (is(nameBody, c)) parser.tagName += c
11252                 else if (parser.script) {
11253                   parser.script += "</" + parser.tagName
11254                   parser.tagName = ""
11255                   parser.state = S.SCRIPT
11256                 } else {
11257                   if (not(whitespace, c)) strictFail(parser,
11258                     "Invalid tagname in closing tag")
11259                   parser.state = S.CLOSE_TAG_SAW_WHITE
11260                 }
11261                 continue
11262
11263               case S.CLOSE_TAG_SAW_WHITE:
11264                 if (is(whitespace, c)) continue
11265                 if (c === ">") closeTag(parser)
11266                 else strictFail(parser, "Invalid characters in closing tag")
11267                 continue
11268
11269               case S.TEXT_ENTITY:
11270               case S.ATTRIB_VALUE_ENTITY_Q:
11271               case S.ATTRIB_VALUE_ENTITY_U:
11272                 switch (parser.state) {
11273                   case S.TEXT_ENTITY:
11274                     var returnState = S.TEXT,
11275                       buffer = "textNode"
11276                     break
11277
11278                   case S.ATTRIB_VALUE_ENTITY_Q:
11279                     var returnState = S.ATTRIB_VALUE_QUOTED,
11280                       buffer = "attribValue"
11281                     break
11282
11283                   case S.ATTRIB_VALUE_ENTITY_U:
11284                     var returnState = S.ATTRIB_VALUE_UNQUOTED,
11285                       buffer = "attribValue"
11286                     break
11287                 }
11288                 if (c === ";") {
11289                   parser[buffer] += parseEntity(parser)
11290                   parser.entity = ""
11291                   parser.state = returnState
11292                 } else if (is(entity, c)) parser.entity += c
11293                 else {
11294                   strictFail(parser, "Invalid character entity")
11295                   parser[buffer] += "&" + parser.entity + c
11296                   parser.entity = ""
11297                   parser.state = returnState
11298                 }
11299                 continue
11300
11301               default:
11302                 throw new Error(parser, "Unknown state: " + parser.state)
11303             }
11304           } // while
11305           // cdata blocks can get very big under normal conditions. emit and move on.
11306           // if (parser.state === S.CDATA && parser.cdata) {
11307           // emitNode(parser, "oncdata", parser.cdata)
11308           // parser.cdata = ""
11309           // }
11310           if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
11311           return parser
11312         }
11313
11314         /* ! http://mths.be/fromcodepoint v0.1.0 by @mathias */
11315         if (!String.fromCodePoint) {
11316           (function() {
11317             var stringFromCharCode = String.fromCharCode;
11318             var floor = Math.floor;
11319             var fromCodePoint = function() {
11320               var MAX_SIZE = 0x4000;
11321               var codeUnits = [];
11322               var highSurrogate;
11323               var lowSurrogate;
11324               var index = -1;
11325               var length = arguments.length;
11326               if (!length) {
11327                 return '';
11328               }
11329               var result = '';
11330               while (++index < length) {
11331                 var codePoint = Number(arguments[index]);
11332                 if (!isFinite(codePoint) || // `NaN`,
11333                   // `+Infinity`,
11334                   // or
11335                   // `-Infinity`
11336                   codePoint < 0 || // not a valid
11337                   // Unicode code
11338                   // point
11339                   codePoint > 0x10FFFF || // not a valid
11340                   // Unicode code
11341                   // point
11342                   floor(codePoint) != codePoint // not
11343                   // an
11344                   // integer
11345                 ) {
11346                   throw RangeError('Invalid code point: ' + codePoint);
11347                 }
11348                 if (codePoint <= 0xFFFF) { // BMP code point
11349                   codeUnits.push(codePoint);
11350                 } else { // Astral code point; split in
11351                   // surrogate halves
11352                   // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
11353                   codePoint -= 0x10000;
11354                   highSurrogate = (codePoint >> 10) + 0xD800;
11355                   lowSurrogate = (codePoint % 0x400) + 0xDC00;
11356                   codeUnits.push(highSurrogate, lowSurrogate);
11357                 }
11358                 if (index + 1 == length || codeUnits.length > MAX_SIZE) {
11359                   result += stringFromCharCode.apply(null, codeUnits);
11360                   codeUnits.length = 0;
11361                 }
11362               }
11363               return result;
11364             };
11365             if (Object.defineProperty) {
11366               Object.defineProperty(String, 'fromCodePoint', {
11367                 'value': fromCodePoint,
11368                 'configurable': true,
11369                 'writable': true
11370               });
11371             } else {
11372               String.fromCodePoint = fromCodePoint;
11373             }
11374           }());
11375         }
11376
11377       })(typeof exports === "undefined" ? sax = {} : exports);
11378
11379     }).call(this, undefined)
11380   }, {
11381     "stream": false,
11382     "string_decoder": false
11383   }],
11384   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\tiny-stack\\lib\\tiny-stack.js": [function(require, module, exports) {
11385     /**
11386      * Tiny stack for browser or server
11387      *
11388      * @author Jason Mulligan <jason.mulligan@avoidwork.com>
11389      * @copyright 2014 Jason Mulligan
11390      * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
11391      * @link http://avoidwork.github.io/tiny-stack
11392      * @module tiny-stack
11393      * @version 0.1.0
11394      */
11395
11396     (function(global) {
11397
11398       "use strict";
11399
11400       /**
11401        * TinyStack
11402        *
11403        * @constructor
11404        */
11405       function TinyStack() {
11406         this.data = [null];
11407         this.top = 0;
11408       }
11409
11410       /**
11411        * Clears the stack
11412        *
11413        * @method clear
11414        * @memberOf TinyStack
11415        * @return {Object} {@link TinyStack}
11416        */
11417       TinyStack.prototype.clear = function clear() {
11418         this.data = [null];
11419         this.top = 0;
11420
11421         return this;
11422       };
11423
11424       /**
11425        * Gets the size of the stack
11426        *
11427        * @method length
11428        * @memberOf TinyStack
11429        * @return {Number} Size of stack
11430        */
11431       TinyStack.prototype.length = function length() {
11432         return this.top;
11433       };
11434
11435       /**
11436        * Gets the item at the top of the stack
11437        *
11438        * @method peek
11439        * @memberOf TinyStack
11440        * @return {Mixed} Item at the top of the stack
11441        */
11442       TinyStack.prototype.peek = function peek() {
11443         return this.data[this.top];
11444       };
11445
11446       /**
11447        * Gets & removes the item at the top of the stack
11448        *
11449        * @method pop
11450        * @memberOf TinyStack
11451        * @return {Mixed} Item at the top of the stack
11452        */
11453       TinyStack.prototype.pop = function pop() {
11454         if (this.top > 0) {
11455           this.top--;
11456
11457           return this.data.pop();
11458         } else {
11459           return undefined;
11460         }
11461       };
11462
11463       /**
11464        * Pushes an item onto the stack
11465        *
11466        * @method push
11467        * @memberOf TinyStack
11468        * @return {Object} {@link TinyStack}
11469        */
11470       TinyStack.prototype.push = function push(arg) {
11471         this.data[++this.top] = arg;
11472
11473         return this;
11474       };
11475
11476       /**
11477        * TinyStack factory
11478        *
11479        * @method factory
11480        * @return {Object} {@link TinyStack}
11481        */
11482       function factory() {
11483         return new TinyStack();
11484       }
11485
11486       // Node, AMD & window supported
11487       if (typeof exports != "undefined") {
11488         module.exports = factory;
11489       } else if (typeof define == "function") {
11490         define(function() {
11491           return factory;
11492         });
11493       } else {
11494         global.stack = factory;
11495       }
11496     })(this);
11497
11498   }, {}],
11499   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js": [function(require, module, exports) {
11500     module.exports = require('./lib/moddle');
11501   }, {
11502     "./lib/moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js"
11503   }],
11504   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js": [function(require, module, exports) {
11505     'use strict';
11506
11507     function Base() {}
11508
11509     Base.prototype.get = function(name) {
11510       return this.$model.properties.get(this, name);
11511     };
11512
11513     Base.prototype.set = function(name, value) {
11514       this.$model.properties.set(this, name, value);
11515     };
11516
11517
11518     module.exports = Base;
11519   }, {}],
11520   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js": [function(require, module, exports) {
11521     'use strict';
11522
11523     var pick = require('lodash/object/pick'),
11524       assign = require('lodash/object/assign'),
11525       forEach = require('lodash/collection/forEach');
11526
11527     var parseNameNs = require('./ns').parseName;
11528
11529
11530     function DescriptorBuilder(nameNs) {
11531       this.ns = nameNs;
11532       this.name = nameNs.name;
11533       this.allTypes = [];
11534       this.properties = [];
11535       this.propertiesByName = {};
11536     }
11537
11538     module.exports = DescriptorBuilder;
11539
11540
11541     DescriptorBuilder.prototype.build = function() {
11542       return pick(this, ['ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty']);
11543     };
11544
11545     DescriptorBuilder.prototype.addProperty = function(p, idx) {
11546       this.addNamedProperty(p, true);
11547
11548       var properties = this.properties;
11549
11550       if (idx !== undefined) {
11551         properties.splice(idx, 0, p);
11552       } else {
11553         properties.push(p);
11554       }
11555     };
11556
11557
11558     DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
11559       var oldNameNs = oldProperty.ns;
11560
11561       var props = this.properties,
11562         propertiesByName = this.propertiesByName,
11563         rename = oldProperty.name !== newProperty.name;
11564
11565       if (oldProperty.isBody) {
11566
11567         if (!newProperty.isBody) {
11568           throw new Error(
11569             'property <' + newProperty.ns.name + '> must be body property ' +
11570             'to refine <' + oldProperty.ns.name + '>');
11571         }
11572
11573         // TODO: Check compatibility
11574         this.setBodyProperty(newProperty, false);
11575       }
11576
11577       // replacing the named property is intentional
11578       // thus, validate only if this is a "rename" operation
11579       this.addNamedProperty(newProperty, rename);
11580
11581       // replace old property at index with new one
11582       var idx = props.indexOf(oldProperty);
11583       if (idx === -1) {
11584         throw new Error('property <' + oldNameNs.name + '> not found in property list');
11585       }
11586
11587       props[idx] = newProperty;
11588
11589       // replace propertiesByName entry with new property
11590       propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
11591     };
11592
11593
11594     DescriptorBuilder.prototype.redefineProperty = function(p) {
11595
11596       var nsPrefix = p.ns.prefix;
11597       var parts = p.redefines.split('#');
11598
11599       var name = parseNameNs(parts[0], nsPrefix);
11600       var attrName = parseNameNs(parts[1], name.prefix).name;
11601
11602       var redefinedProperty = this.propertiesByName[attrName];
11603       if (!redefinedProperty) {
11604         throw new Error('refined property <' + attrName + '> not found');
11605       } else {
11606         this.replaceProperty(redefinedProperty, p);
11607       }
11608
11609       delete p.redefines;
11610     };
11611
11612     DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
11613       var ns = p.ns,
11614         propsByName = this.propertiesByName;
11615
11616       if (validate) {
11617         this.assertNotDefined(p, ns.name);
11618         this.assertNotDefined(p, ns.localName);
11619       }
11620
11621       propsByName[ns.name] = propsByName[ns.localName] = p;
11622     };
11623
11624     DescriptorBuilder.prototype.removeNamedProperty = function(p) {
11625       var ns = p.ns,
11626         propsByName = this.propertiesByName;
11627
11628       delete propsByName[ns.name];
11629       delete propsByName[ns.localName];
11630     };
11631
11632     DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
11633
11634       if (validate && this.bodyProperty) {
11635         throw new Error(
11636           'body property defined multiple times ' +
11637           '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
11638       }
11639
11640       this.bodyProperty = p;
11641     };
11642
11643     DescriptorBuilder.prototype.addIdProperty = function(name) {
11644       var nameNs = parseNameNs(name, this.ns.prefix);
11645
11646       var p = {
11647         name: nameNs.localName,
11648         type: 'String',
11649         isAttr: true,
11650         ns: nameNs
11651       };
11652
11653       // ensure that id is always the first attribute (if present)
11654       this.addProperty(p, 0);
11655     };
11656
11657     DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
11658       var propertyName = p.name,
11659         definedProperty = this.propertiesByName[propertyName];
11660
11661       if (definedProperty) {
11662         throw new Error(
11663           'property <' + propertyName + '> already defined; ' +
11664           'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
11665           '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
11666       }
11667     };
11668
11669     DescriptorBuilder.prototype.hasProperty = function(name) {
11670       return this.propertiesByName[name];
11671     };
11672
11673     DescriptorBuilder.prototype.addTrait = function(t) {
11674
11675       var allTypes = this.allTypes;
11676
11677       if (allTypes.indexOf(t) !== -1) {
11678         return;
11679       }
11680
11681       forEach(t.properties, function(p) {
11682
11683         // clone property to allow extensions
11684         p = assign({}, p, {
11685           name: p.ns.localName
11686         });
11687
11688         Object.defineProperty(p, 'definedBy', {
11689           value: t
11690         });
11691
11692         // add redefine support
11693         if (p.redefines) {
11694           this.redefineProperty(p);
11695         } else {
11696           if (p.isBody) {
11697             this.setBodyProperty(p);
11698           }
11699           this.addProperty(p);
11700         }
11701       }, this);
11702
11703       allTypes.push(t);
11704     };
11705
11706   }, {
11707     "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11708     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11709     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
11710     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
11711   }],
11712   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js": [function(require, module, exports) {
11713     'use strict';
11714
11715     var forEach = require('lodash/collection/forEach');
11716
11717     var Base = require('./base');
11718
11719
11720     function Factory(model, properties) {
11721       this.model = model;
11722       this.properties = properties;
11723     }
11724
11725     module.exports = Factory;
11726
11727
11728     Factory.prototype.createType = function(descriptor) {
11729
11730       var model = this.model;
11731
11732       var props = this.properties,
11733         prototype = Object.create(Base.prototype);
11734
11735       // initialize default values
11736       forEach(descriptor.properties, function(p) {
11737         if (!p.isMany && p.default !== undefined) {
11738           prototype[p.name] = p.default;
11739         }
11740       });
11741
11742       props.defineModel(prototype, model);
11743       props.defineDescriptor(prototype, descriptor);
11744
11745       var name = descriptor.ns.name;
11746
11747       /**
11748        * The new type constructor
11749        */
11750       function ModdleElement(attrs) {
11751         props.define(this, '$type', {
11752           value: name,
11753           enumerable: true
11754         });
11755         props.define(this, '$attrs', {
11756           value: {}
11757         });
11758         props.define(this, '$parent', {
11759           writable: true
11760         });
11761
11762         forEach(attrs, function(val, key) {
11763           this.set(key, val);
11764         }, this);
11765       }
11766
11767       ModdleElement.prototype = prototype;
11768
11769       ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
11770
11771       // static links
11772       props.defineModel(ModdleElement, model);
11773       props.defineDescriptor(ModdleElement, descriptor);
11774
11775       return ModdleElement;
11776     };
11777   }, {
11778     "./base": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js",
11779     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
11780   }],
11781   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js": [function(require, module, exports) {
11782     'use strict';
11783
11784     var isString = require('lodash/lang/isString'),
11785       isObject = require('lodash/lang/isObject'),
11786       forEach = require('lodash/collection/forEach'),
11787       find = require('lodash/collection/find');
11788
11789
11790     var Factory = require('./factory'),
11791       Registry = require('./registry'),
11792       Properties = require('./properties');
11793
11794     var parseNameNs = require('./ns').parseName;
11795
11796
11797     // // Moddle implementation /////////////////////////////////////////////////
11798
11799     /**
11800      * @class Moddle
11801      *
11802      * A model that can be used to create elements of a specific type.
11803      *
11804      * @example
11805      *
11806      * var Moddle = require('moddle');
11807      *
11808      * var pkg = { name: 'mypackage', prefix: 'my', types: [ { name: 'Root' } ] };
11809      *
11810      * var moddle = new Moddle([pkg]);
11811      *
11812      * @param {Array
11813      *            <Package>} packages the packages to contain
11814      * @param {Object}
11815      *            options additional options to pass to the model
11816      */
11817     function Moddle(packages, options) {
11818
11819       options = options || {};
11820
11821       this.properties = new Properties(this);
11822
11823       this.factory = new Factory(this, this.properties);
11824       this.registry = new Registry(packages, this.properties, options);
11825
11826       this.typeCache = {};
11827     }
11828
11829     module.exports = Moddle;
11830
11831
11832     /**
11833      * Create an instance of the specified type.
11834      *
11835      * @method Moddle#create
11836      *
11837      * @example
11838      *
11839      * var foo = moddle.create('my:Foo'); var bar = moddle.create('my:Bar', { id:
11840      * 'BAR_1' });
11841      *
11842      * @param {String|Object}
11843      *            descriptor the type descriptor or name know to the model
11844      * @param {Object}
11845      *            attrs a number of attributes to initialize the model instance with
11846      * @return {Object} model instance
11847      */
11848     Moddle.prototype.create = function(descriptor, attrs) {
11849       var Type = this.getType(descriptor);
11850
11851       if (!Type) {
11852         throw new Error('unknown type <' + descriptor + '>');
11853       }
11854
11855       return new Type(attrs);
11856     };
11857
11858
11859     /**
11860      * Returns the type representing a given descriptor
11861      *
11862      * @method Moddle#getType
11863      *
11864      * @example
11865      *
11866      * var Foo = moddle.getType('my:Foo'); var foo = new Foo({ 'id' : 'FOO_1' });
11867      *
11868      * @param {String|Object}
11869      *            descriptor the type descriptor or name know to the model
11870      * @return {Object} the type representing the descriptor
11871      */
11872     Moddle.prototype.getType = function(descriptor) {
11873
11874       var cache = this.typeCache;
11875
11876       var name = isString(descriptor) ? descriptor : descriptor.ns.name;
11877
11878       var type = cache[name];
11879
11880       if (!type) {
11881         descriptor = this.registry.getEffectiveDescriptor(name);
11882         type = cache[name] = this.factory.createType(descriptor);
11883       }
11884
11885       return type;
11886     };
11887
11888
11889     /**
11890      * Creates an any-element type to be used within model instances.
11891      *
11892      * This can be used to create custom elements that lie outside the meta-model.
11893      * The created element contains all the meta-data required to serialize it as
11894      * part of meta-model elements.
11895      *
11896      * @method Moddle#createAny
11897      *
11898      * @example
11899      *
11900      * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { value: 'bar' });
11901      *
11902      * var container = moddle.create('my:Container', 'http://my', { any: [ foo ] });
11903      *  // go ahead and serialize the stuff
11904      *
11905      *
11906      * @param {String}
11907      *            name the name of the element
11908      * @param {String}
11909      *            nsUri the namespace uri of the element
11910      * @param {Object}
11911      *            [properties] a map of properties to initialize the instance with
11912      * @return {Object} the any type instance
11913      */
11914     Moddle.prototype.createAny = function(name, nsUri, properties) {
11915
11916       var nameNs = parseNameNs(name);
11917
11918       var element = {
11919         $type: name
11920       };
11921
11922       var descriptor = {
11923         name: name,
11924         isGeneric: true,
11925         ns: {
11926           prefix: nameNs.prefix,
11927           localName: nameNs.localName,
11928           uri: nsUri
11929         }
11930       };
11931
11932       this.properties.defineDescriptor(element, descriptor);
11933       this.properties.defineModel(element, this);
11934       this.properties.define(element, '$parent', {
11935         enumerable: false,
11936         writable: true
11937       });
11938
11939       forEach(properties, function(a, key) {
11940         if (isObject(a) && a.value !== undefined) {
11941           element[a.name] = a.value;
11942         } else {
11943           element[key] = a;
11944         }
11945       });
11946
11947       return element;
11948     };
11949
11950     /**
11951      * Returns a registered package by uri or prefix
11952      *
11953      * @return {Object} the package
11954      */
11955     Moddle.prototype.getPackage = function(uriOrPrefix) {
11956       return this.registry.getPackage(uriOrPrefix);
11957     };
11958
11959     /**
11960      * Returns a snapshot of all known packages
11961      *
11962      * @return {Object} the package
11963      */
11964     Moddle.prototype.getPackages = function() {
11965       return this.registry.getPackages();
11966     };
11967
11968     /**
11969      * Returns the descriptor for an element
11970      */
11971     Moddle.prototype.getElementDescriptor = function(element) {
11972       return element.$descriptor;
11973     };
11974
11975     /**
11976      * Returns true if the given descriptor or instance represents the given type.
11977      *
11978      * May be applied to this, if element is omitted.
11979      */
11980     Moddle.prototype.hasType = function(element, type) {
11981       if (type === undefined) {
11982         type = element;
11983         element = this;
11984       }
11985
11986       var descriptor = element.$model.getElementDescriptor(element);
11987
11988       return !!find(descriptor.allTypes, function(t) {
11989         return t.name === type;
11990       });
11991     };
11992
11993
11994     /**
11995      * Returns the descriptor of an elements named property
11996      */
11997     Moddle.prototype.getPropertyDescriptor = function(element, property) {
11998       return this.getElementDescriptor(element).propertiesByName[property];
11999     };
12000
12001   }, {
12002     "./factory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js",
12003     "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
12004     "./properties": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js",
12005     "./registry": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js",
12006     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
12007     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
12008     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
12009     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js"
12010   }],
12011   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js": [function(require, module, exports) {
12012     'use strict';
12013
12014     /**
12015      * Parses a namespaced attribute name of the form (ns:)localName to an object,
12016      * given a default prefix to assume in case no explicit namespace is given.
12017      *
12018      * @param {String}
12019      *            name
12020      * @param {String}
12021      *            [defaultPrefix] the default prefix to take, if none is present.
12022      *
12023      * @return {Object} the parsed name
12024      */
12025     module.exports.parseName = function(name, defaultPrefix) {
12026       var parts = name.split(/:/),
12027         localName, prefix;
12028
12029       // no prefix (i.e. only local name)
12030       if (parts.length === 1) {
12031         localName = name;
12032         prefix = defaultPrefix;
12033       } else
12034         // prefix + local name
12035         if (parts.length === 2) {
12036           localName = parts[1];
12037           prefix = parts[0];
12038         } else {
12039           throw new Error('expected <prefix:localName> or <localName>, got ' + name);
12040         }
12041
12042       name = (prefix ? prefix + ':' : '') + localName;
12043
12044       return {
12045         name: name,
12046         prefix: prefix,
12047         localName: localName
12048       };
12049     };
12050   }, {}],
12051   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js": [function(require, module, exports) {
12052     'use strict';
12053
12054
12055     /**
12056      * A utility that gets and sets properties of model elements.
12057      *
12058      * @param {Model}
12059      *            model
12060      */
12061     function Properties(model) {
12062       this.model = model;
12063     }
12064
12065     module.exports = Properties;
12066
12067
12068     /**
12069      * Sets a named property on the target element
12070      *
12071      * @param {Object}
12072      *            target
12073      * @param {String}
12074      *            name
12075      * @param {Object}
12076      *            value
12077      */
12078     Properties.prototype.set = function(target, name, value) {
12079
12080       var property = this.model.getPropertyDescriptor(target, name);
12081
12082       if (!property) {
12083         target.$attrs[name] = value;
12084       } else {
12085         Object.defineProperty(target, property.name, {
12086           enumerable: !property.isReference,
12087           writable: true,
12088           value: value
12089         });
12090       }
12091     };
12092
12093     /**
12094      * Returns the named property of the given element
12095      *
12096      * @param {Object}
12097      *            target
12098      * @param {String}
12099      *            name
12100      *
12101      * @return {Object}
12102      */
12103     Properties.prototype.get = function(target, name) {
12104
12105       var property = this.model.getPropertyDescriptor(target, name);
12106
12107       if (!property) {
12108         return target.$attrs[name];
12109       }
12110
12111       var propertyName = property.name;
12112
12113       // check if access to collection property and lazily initialize it
12114       if (!target[propertyName] && property.isMany) {
12115         Object.defineProperty(target, propertyName, {
12116           enumerable: !property.isReference,
12117           writable: true,
12118           value: []
12119         });
12120       }
12121
12122       return target[propertyName];
12123     };
12124
12125
12126     /**
12127      * Define a property on the target element
12128      *
12129      * @param {Object}
12130      *            target
12131      * @param {String}
12132      *            name
12133      * @param {Object}
12134      *            options
12135      */
12136     Properties.prototype.define = function(target, name, options) {
12137       Object.defineProperty(target, name, options);
12138     };
12139
12140
12141     /**
12142      * Define the descriptor for an element
12143      */
12144     Properties.prototype.defineDescriptor = function(target, descriptor) {
12145       this.define(target, '$descriptor', {
12146         value: descriptor
12147       });
12148     };
12149
12150     /**
12151      * Define the model for an element
12152      */
12153     Properties.prototype.defineModel = function(target, model) {
12154       this.define(target, '$model', {
12155         value: model
12156       });
12157     };
12158   }, {}],
12159   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js": [function(require, module, exports) {
12160     'use strict';
12161
12162     var assign = require('lodash/object/assign'),
12163       forEach = require('lodash/collection/forEach');
12164
12165     var Types = require('./types'),
12166       DescriptorBuilder = require('./descriptor-builder');
12167
12168     var parseNameNs = require('./ns').parseName,
12169       isBuiltInType = Types.isBuiltIn;
12170
12171
12172     function Registry(packages, properties, options) {
12173
12174       this.options = assign({
12175         generateId: 'id'
12176       }, options || {});
12177
12178       this.packageMap = {};
12179       this.typeMap = {};
12180
12181       this.packages = [];
12182
12183       this.properties = properties;
12184
12185       forEach(packages, this.registerPackage, this);
12186     }
12187
12188     module.exports = Registry;
12189
12190
12191     Registry.prototype.getPackage = function(uriOrPrefix) {
12192       return this.packageMap[uriOrPrefix];
12193     };
12194
12195     Registry.prototype.getPackages = function() {
12196       return this.packages;
12197     };
12198
12199
12200     Registry.prototype.registerPackage = function(pkg) {
12201       // alert("pkg :: " + pkg);
12202       // copy package
12203       pkg = assign({}, pkg);
12204
12205       // register types
12206       forEach(pkg.types, function(descriptor) {
12207         this.registerType(descriptor, pkg);
12208       }, this);
12209
12210       this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
12211       this.packages.push(pkg);
12212     };
12213
12214
12215     /**
12216      * Register a type from a specific package with us
12217      */
12218     Registry.prototype.registerType = function(type, pkg) {
12219
12220       type = assign({}, type, {
12221         superClass: (type.superClass || []).slice(),
12222         extends: (type.extends || []).slice(),
12223         properties: (type.properties || []).slice()
12224       });
12225
12226       var ns = parseNameNs(type.name, pkg.prefix),
12227         name = ns.name,
12228         propertiesByName = {};
12229
12230       // parse properties
12231       forEach(type.properties, function(p) {
12232
12233         // namespace property names
12234         var propertyNs = parseNameNs(p.name, ns.prefix),
12235           propertyName = propertyNs.name;
12236
12237         // namespace property types
12238         if (!isBuiltInType(p.type)) {
12239           p.type = parseNameNs(p.type, propertyNs.prefix).name;
12240         }
12241
12242         assign(p, {
12243           ns: propertyNs,
12244           name: propertyName
12245         });
12246
12247         propertiesByName[propertyName] = p;
12248       });
12249
12250       // update ns + name
12251       assign(type, {
12252         ns: ns,
12253         name: name,
12254         propertiesByName: propertiesByName
12255       });
12256
12257       forEach(type.extends, function(extendsName) {
12258         var extended = this.typeMap[extendsName];
12259
12260         extended.traits = extended.traits || [];
12261         extended.traits.push(name);
12262       }, this);
12263
12264       // link to package
12265       this.definePackage(type, pkg);
12266
12267       // register
12268       this.typeMap[name] = type;
12269     };
12270
12271
12272     /**
12273      * Traverse the type hierarchy from bottom to top.
12274      */
12275     Registry.prototype.mapTypes = function(nsName, iterator) {
12276
12277       // alert("nsName :: " + nsName.name);
12278       var type = isBuiltInType(nsName.name) ? {
12279         name: nsName.name
12280       } : this.typeMap[nsName.name];
12281       // alert("Type :: " + type);
12282
12283       var self = this;
12284
12285       /**
12286        * Traverse the selected super type or trait
12287        *
12288        * @param {String}
12289        *            cls
12290        */
12291       function traverseSuper(cls) {
12292         var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
12293         self.mapTypes(parentNs, iterator);
12294       }
12295
12296       if (!type) {
12297         throw new Error('unknown type <' + nsName.name + '>');
12298       }
12299
12300       forEach(type.superClass, traverseSuper);
12301
12302       iterator(type);
12303
12304       forEach(type.traits, traverseSuper);
12305     };
12306
12307
12308     /**
12309      * Returns the effective descriptor for a type.
12310      *
12311      * @param {String}
12312      *            type the namespaced name (ns:localName) of the type
12313      *
12314      * @return {Descriptor} the resulting effective descriptor
12315      */
12316     Registry.prototype.getEffectiveDescriptor = function(name) {
12317
12318       var nsName = parseNameNs(name);
12319
12320       var builder = new DescriptorBuilder(nsName);
12321
12322       this.mapTypes(nsName, function(type) {
12323         builder.addTrait(type);
12324       });
12325
12326       // check we have an id assigned
12327       var id = this.options.generateId;
12328       if (id && !builder.hasProperty(id)) {
12329         builder.addIdProperty(id);
12330       }
12331
12332       var descriptor = builder.build();
12333
12334       // define package link
12335       this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
12336
12337       return descriptor;
12338     };
12339
12340
12341     Registry.prototype.definePackage = function(target, pkg) {
12342       this.properties.define(target, '$pkg', {
12343         value: pkg
12344       });
12345     };
12346   }, {
12347     "./descriptor-builder": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js",
12348     "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
12349     "./types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
12350     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
12351     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
12352   }],
12353   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js": [function(require, module, exports) {
12354     'use strict';
12355
12356     /**
12357      * Built-in moddle types
12358      */
12359     var BUILTINS = {
12360       String: true,
12361       Boolean: true,
12362       Integer: true,
12363       Real: true,
12364       Element: true
12365     };
12366
12367     /**
12368      * Converters for built in types from string representations
12369      */
12370     var TYPE_CONVERTERS = {
12371       String: function(s) {
12372         return s;
12373       },
12374       Boolean: function(s) {
12375         return s === 'true';
12376       },
12377       Integer: function(s) {
12378         return parseInt(s, 10);
12379       },
12380       Real: function(s) {
12381         return parseFloat(s, 10);
12382       }
12383     };
12384
12385     /**
12386      * Convert a type to its real representation
12387      */
12388     module.exports.coerceType = function(type, value) {
12389
12390       var converter = TYPE_CONVERTERS[type];
12391
12392       if (converter) {
12393         return converter(value);
12394       } else {
12395         return value;
12396       }
12397     };
12398
12399     /**
12400      * Return whether the given type is built-in
12401      */
12402     module.exports.isBuiltIn = function(type) {
12403       return !!BUILTINS[type];
12404     };
12405
12406     /**
12407      * Return whether the given type is simple
12408      */
12409     module.exports.isSimple = function(type) {
12410       return !!TYPE_CONVERTERS[type];
12411     };
12412   }, {}],
12413   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json": [function(require, module, exports) {
12414     module.exports = {
12415       "name": "BPMN20",
12416       "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
12417       "associations": [],
12418       "types": [{
12419           "name": "Interface",
12420           "superClass": [
12421             "RootElement"
12422           ],
12423           "properties": [{
12424             "name": "name",
12425             "isAttr": true,
12426             "type": "String"
12427           }, {
12428             "name": "operations",
12429             "type": "Operation",
12430             "isMany": true
12431           }, {
12432             "name": "implementationRef",
12433             "type": "String",
12434             "isAttr": true
12435           }]
12436         }, {
12437           "name": "Operation",
12438           "superClass": [
12439             "BaseElement"
12440           ],
12441           "properties": [{
12442             "name": "name",
12443             "isAttr": true,
12444             "type": "String"
12445           }, {
12446             "name": "inMessageRef",
12447             "type": "Message",
12448             "isAttr": true,
12449             "isReference": true
12450           }, {
12451             "name": "outMessageRef",
12452             "type": "Message",
12453             "isAttr": true,
12454             "isReference": true
12455           }, {
12456             "name": "errorRefs",
12457             "type": "Error",
12458             "isMany": true,
12459             "isReference": true
12460           }, {
12461             "name": "implementationRef",
12462             "type": "String",
12463             "isAttr": true
12464           }]
12465         }, {
12466           "name": "EndPoint",
12467           "superClass": [
12468             "RootElement"
12469           ]
12470         }, {
12471           "name": "Auditing",
12472           "superClass": [
12473             "BaseElement"
12474           ]
12475         }, {
12476           "name": "GlobalTask",
12477           "superClass": [
12478             "CallableElement"
12479           ],
12480           "properties": [{
12481             "name": "resources",
12482             "type": "ResourceRole",
12483             "isMany": true
12484           }]
12485         }, {
12486           "name": "Monitoring",
12487           "superClass": [
12488             "BaseElement"
12489           ]
12490         }, {
12491           "name": "Performer",
12492           "superClass": [
12493             "ResourceRole"
12494           ]
12495         }, {
12496           "name": "Process",
12497           "superClass": [
12498             "FlowElementsContainer",
12499             "CallableElement"
12500           ],
12501           "properties": [{
12502             "name": "processType",
12503             "type": "ProcessType",
12504             "isAttr": true
12505           }, {
12506             "name": "isClosed",
12507             "isAttr": true,
12508             "type": "Boolean"
12509           }, {
12510             "name": "auditing",
12511             "type": "Auditing"
12512           }, {
12513             "name": "monitoring",
12514             "type": "Monitoring"
12515           }, {
12516             "name": "properties",
12517             "type": "Property",
12518             "isMany": true
12519           }, {
12520             "name": "supports",
12521             "type": "Process",
12522             "isMany": true,
12523             "isReference": true
12524           }, {
12525             "name": "definitionalCollaborationRef",
12526             "type": "Collaboration",
12527             "isAttr": true,
12528             "isReference": true
12529           }, {
12530             "name": "isExecutable",
12531             "isAttr": true,
12532             "type": "Boolean"
12533           }, {
12534             "name": "resources",
12535             "type": "ResourceRole",
12536             "isMany": true
12537           }, {
12538             "name": "artifacts",
12539             "type": "Artifact",
12540             "isMany": true
12541           }, {
12542             "name": "correlationSubscriptions",
12543             "type": "CorrelationSubscription",
12544             "isMany": true
12545           }]
12546         }, {
12547           "name": "LaneSet",
12548           "superClass": [
12549             "BaseElement"
12550           ],
12551           "properties": [{
12552             "name": "lanes",
12553             "type": "Lane",
12554             "isMany": true
12555           }, {
12556             "name": "name",
12557             "isAttr": true,
12558             "type": "String"
12559           }]
12560         }, {
12561           "name": "Lane",
12562           "superClass": [
12563             "BaseElement"
12564           ],
12565           "properties": [{
12566             "name": "name",
12567             "isAttr": true,
12568             "type": "String"
12569           }, {
12570             "name": "childLaneSet",
12571             "type": "LaneSet",
12572             "serialize": "xsi:type"
12573           }, {
12574             "name": "partitionElementRef",
12575             "type": "BaseElement",
12576             "isAttr": true,
12577             "isReference": true
12578           }, {
12579             "name": "flowNodeRef",
12580             "type": "FlowNode",
12581             "isMany": true,
12582             "isReference": true
12583           }, {
12584             "name": "partitionElement",
12585             "type": "BaseElement"
12586           }]
12587         }, {
12588           "name": "GlobalManualTask",
12589           "superClass": [
12590             "GlobalTask"
12591           ]
12592         }, {
12593           "name": "ManualTask",
12594           "superClass": [
12595             "Task"
12596           ]
12597         }, {
12598           "name": "UserTask",
12599           "superClass": [
12600             "Task"
12601           ],
12602           "properties": [{
12603             "name": "renderings",
12604             "type": "Rendering",
12605             "isMany": true
12606           }, {
12607             "name": "implementation",
12608             "isAttr": true,
12609             "type": "String"
12610           }]
12611         }, {
12612           "name": "Rendering",
12613           "superClass": [
12614             "BaseElement"
12615           ]
12616         }, {
12617           "name": "HumanPerformer",
12618           "superClass": [
12619             "Performer"
12620           ]
12621         }, {
12622           "name": "PotentialOwner",
12623           "superClass": [
12624             "HumanPerformer"
12625           ]
12626         }, {
12627           "name": "GlobalUserTask",
12628           "superClass": [
12629             "GlobalTask"
12630           ],
12631           "properties": [{
12632             "name": "implementation",
12633             "isAttr": true,
12634             "type": "String"
12635           }, {
12636             "name": "renderings",
12637             "type": "Rendering",
12638             "isMany": true
12639           }]
12640         }, {
12641           "name": "Gateway",
12642           "isAbstract": true,
12643           "superClass": [
12644             "FlowNode"
12645           ],
12646           "properties": [{
12647             "name": "gatewayDirection",
12648             "type": "GatewayDirection",
12649             "default": "Unspecified",
12650             "isAttr": true
12651           }]
12652         }, {
12653           "name": "EventBasedGateway",
12654           "superClass": [
12655             "Gateway"
12656           ],
12657           "properties": [{
12658             "name": "instantiate",
12659             "default": false,
12660             "isAttr": true,
12661             "type": "Boolean"
12662           }, {
12663             "name": "eventGatewayType",
12664             "type": "EventBasedGatewayType",
12665             "isAttr": true,
12666             "default": "Exclusive"
12667           }]
12668         }, {
12669           "name": "ComplexGateway",
12670           "superClass": [
12671             "Gateway"
12672           ],
12673           "properties": [{
12674             "name": "activationCondition",
12675             "type": "Expression",
12676             "serialize": "xsi:type"
12677           }, {
12678             "name": "default",
12679             "type": "SequenceFlow",
12680             "isAttr": true,
12681             "isReference": true
12682           }]
12683         }, {
12684           "name": "ExclusiveGateway",
12685           "superClass": [
12686             "Gateway"
12687           ],
12688           "properties": [{
12689             "name": "default",
12690             "type": "SequenceFlow",
12691             "isAttr": true,
12692             "isReference": true
12693           }]
12694         }, {
12695           "name": "InclusiveGateway",
12696           "superClass": [
12697             "Gateway"
12698           ],
12699           "properties": [{
12700             "name": "default",
12701             "type": "SequenceFlow",
12702             "isAttr": true,
12703             "isReference": true
12704           }]
12705         }, {
12706           "name": "ParallelGateway",
12707           "superClass": [
12708             "Gateway"
12709           ]
12710         }, {
12711           "name": "RootElement",
12712           "isAbstract": true,
12713           "superClass": [
12714             "BaseElement"
12715           ]
12716         }, {
12717           "name": "Relationship",
12718           "superClass": [
12719             "BaseElement"
12720           ],
12721           "properties": [{
12722             "name": "type",
12723             "isAttr": true,
12724             "type": "String"
12725           }, {
12726             "name": "direction",
12727             "type": "RelationshipDirection",
12728             "isAttr": true
12729           }, {
12730             "name": "source",
12731             "isMany": true,
12732             "isReference": true,
12733             "type": "Element"
12734           }, {
12735             "name": "target",
12736             "isMany": true,
12737             "isReference": true,
12738             "type": "Element"
12739           }]
12740         }, {
12741           "name": "BaseElement",
12742           "isAbstract": true,
12743           "properties": [{
12744             "name": "id",
12745             "isAttr": true,
12746             "type": "String"
12747           }, {
12748             "name": "documentation",
12749             "type": "Documentation",
12750             "isMany": true
12751           }, {
12752             "name": "extensionDefinitions",
12753             "type": "ExtensionDefinition",
12754             "isMany": true,
12755             "isReference": true
12756           }, {
12757             "name": "extensionElements",
12758             "type": "ExtensionElements"
12759           }]
12760         }, {
12761           "name": "Extension",
12762           "properties": [{
12763             "name": "mustUnderstand",
12764             "default": false,
12765             "isAttr": true,
12766             "type": "Boolean"
12767           }, {
12768             "name": "definition",
12769             "type": "ExtensionDefinition"
12770           }]
12771         }, {
12772           "name": "ExtensionDefinition",
12773           "properties": [{
12774             "name": "name",
12775             "isAttr": true,
12776             "type": "String"
12777           }, {
12778             "name": "extensionAttributeDefinitions",
12779             "type": "ExtensionAttributeDefinition",
12780             "isMany": true
12781           }]
12782         }, {
12783           "name": "ExtensionAttributeDefinition",
12784           "properties": [{
12785             "name": "name",
12786             "isAttr": true,
12787             "type": "String"
12788           }, {
12789             "name": "type",
12790             "isAttr": true,
12791             "type": "String"
12792           }, {
12793             "name": "isReference",
12794             "default": false,
12795             "isAttr": true,
12796             "type": "Boolean"
12797           }, {
12798             "name": "extensionDefinition",
12799             "type": "ExtensionDefinition",
12800             "isAttr": true,
12801             "isReference": true
12802           }]
12803         }, {
12804           "name": "ExtensionElements",
12805           "properties": [{
12806             "name": "valueRef",
12807             "isAttr": true,
12808             "isReference": true,
12809             "type": "Element"
12810           }, {
12811             "name": "values",
12812             "type": "Element",
12813             "isMany": true
12814           }, {
12815             "name": "extensionAttributeDefinition",
12816             "type": "ExtensionAttributeDefinition",
12817             "isAttr": true,
12818             "isReference": true
12819           }]
12820         }, {
12821           "name": "Documentation",
12822           "superClass": [
12823             "BaseElement"
12824           ],
12825           "properties": [{
12826             "name": "text",
12827             "type": "String",
12828             "isBody": true
12829           }, {
12830             "name": "textFormat",
12831             "default": "text/plain",
12832             "isAttr": true,
12833             "type": "String"
12834           }]
12835         }, {
12836           "name": "Event",
12837           "isAbstract": true,
12838           "superClass": [
12839             "FlowNode",
12840             "InteractionNode"
12841           ],
12842           "properties": [{
12843             "name": "properties",
12844             "type": "Property",
12845             "isMany": true
12846           }]
12847         }, {
12848           "name": "IntermediateCatchEvent",
12849           "superClass": [
12850             "CatchEvent"
12851           ]
12852         }, {
12853           "name": "IntermediateThrowEvent",
12854           "superClass": [
12855             "ThrowEvent"
12856           ]
12857         }, {
12858           "name": "EndEvent",
12859           "superClass": [
12860             "ThrowEvent"
12861           ]
12862         }, {
12863           "name": "StartEvent",
12864           "superClass": [
12865             "CatchEvent"
12866           ],
12867           "properties": [{
12868             "name": "isInterrupting",
12869             "default": true,
12870             "isAttr": true,
12871             "type": "Boolean"
12872           }]
12873         }, {
12874           "name": "MultiBranchConnector",
12875           "superClass": [
12876             "CatchEvent"
12877           ],
12878           "properties": [{
12879             "name": "isInterrupting",
12880             "default": true,
12881             "isAttr": true,
12882             "type": "Boolean"
12883           }]
12884         }, {
12885           "name": "ParentReturn",
12886           "superClass": [
12887             "Activity",
12888             "InteractionNode"
12889           ]
12890         }, {
12891           "name": "SubProcessCall",
12892           "superClass": [
12893             "Activity",
12894             "InteractionNode"
12895           ]
12896         }, {
12897           "name": "ThrowEvent",
12898           "isAbstract": true,
12899           "superClass": [
12900             "Event"
12901           ],
12902           "properties": [{
12903             "name": "inputSet",
12904             "type": "InputSet"
12905           }, {
12906             "name": "eventDefinitionRefs",
12907             "type": "EventDefinition",
12908             "isMany": true,
12909             "isReference": true
12910           }, {
12911             "name": "dataInputAssociation",
12912             "type": "DataInputAssociation",
12913             "isMany": true
12914           }, {
12915             "name": "dataInputs",
12916             "type": "DataInput",
12917             "isMany": true
12918           }, {
12919             "name": "eventDefinitions",
12920             "type": "EventDefinition",
12921             "isMany": true
12922           }]
12923         }, {
12924           "name": "CatchEvent",
12925           "isAbstract": true,
12926           "superClass": [
12927             "Event"
12928           ],
12929           "properties": [{
12930             "name": "parallelMultiple",
12931             "isAttr": true,
12932             "type": "Boolean",
12933             "default": false
12934           }, {
12935             "name": "outputSet",
12936             "type": "OutputSet"
12937           }, {
12938             "name": "eventDefinitionRefs",
12939             "type": "EventDefinition",
12940             "isMany": true,
12941             "isReference": true
12942           }, {
12943             "name": "dataOutputAssociation",
12944             "type": "DataOutputAssociation",
12945             "isMany": true
12946           }, {
12947             "name": "dataOutputs",
12948             "type": "DataOutput",
12949             "isMany": true
12950           }, {
12951             "name": "eventDefinitions",
12952             "type": "EventDefinition",
12953             "isMany": true
12954           }]
12955         }, {
12956           "name": "BoundaryEvent",
12957           "superClass": [
12958             "CatchEvent"
12959           ],
12960           "properties": [{
12961             "name": "cancelActivity",
12962             "default": true,
12963             "isAttr": true,
12964             "type": "Boolean"
12965           }, {
12966             "name": "attachedToRef",
12967             "type": "Activity",
12968             "isAttr": true,
12969             "isReference": true
12970           }]
12971         }, {
12972           "name": "EventDefinition",
12973           "isAbstract": true,
12974           "superClass": [
12975             "RootElement"
12976           ]
12977         }, {
12978           "name": "CancelEventDefinition",
12979           "superClass": [
12980             "EventDefinition"
12981           ]
12982         }, {
12983           "name": "ErrorEventDefinition",
12984           "superClass": [
12985             "EventDefinition"
12986           ],
12987           "properties": [{
12988             "name": "errorRef",
12989             "type": "Error",
12990             "isAttr": true,
12991             "isReference": true
12992           }]
12993         }, {
12994           "name": "TerminateEventDefinition",
12995           "superClass": [
12996             "EventDefinition"
12997           ]
12998         }, {
12999           "name": "EscalationEventDefinition",
13000           "superClass": [
13001             "EventDefinition"
13002           ],
13003           "properties": [{
13004             "name": "escalationRef",
13005             "type": "Escalation",
13006             "isAttr": true,
13007             "isReference": true
13008           }]
13009         }, {
13010           "name": "Escalation",
13011           "properties": [{
13012             "name": "structureRef",
13013             "type": "ItemDefinition",
13014             "isAttr": true,
13015             "isReference": true
13016           }, {
13017             "name": "name",
13018             "isAttr": true,
13019             "type": "String"
13020           }, {
13021             "name": "escalationCode",
13022             "isAttr": true,
13023             "type": "String"
13024           }],
13025           "superClass": [
13026             "RootElement"
13027           ]
13028         }, {
13029           "name": "CompensateEventDefinition",
13030           "superClass": [
13031             "EventDefinition"
13032           ],
13033           "properties": [{
13034             "name": "waitForCompletion",
13035             "isAttr": true,
13036             "type": "Boolean"
13037           }, {
13038             "name": "activityRef",
13039             "type": "Activity",
13040             "isAttr": true,
13041             "isReference": true
13042           }]
13043         }, {
13044           "name": "TimerEventDefinition",
13045           "superClass": [
13046             "EventDefinition"
13047           ],
13048           "properties": [{
13049             "name": "timeDate",
13050             "type": "Expression",
13051             "serialize": "xsi:type"
13052           }, {
13053             "name": "timeCycle",
13054             "type": "Expression",
13055             "serialize": "xsi:type"
13056           }, {
13057             "name": "timeDuration",
13058             "type": "Expression",
13059             "serialize": "xsi:type"
13060           }]
13061         }, {
13062           "name": "LinkEventDefinition",
13063           "superClass": [
13064             "EventDefinition"
13065           ],
13066           "properties": [{
13067             "name": "name",
13068             "isAttr": true,
13069             "type": "String"
13070           }, {
13071             "name": "target",
13072             "type": "LinkEventDefinition",
13073             "isAttr": true,
13074             "isReference": true
13075           }, {
13076             "name": "source",
13077             "type": "LinkEventDefinition",
13078             "isMany": true,
13079             "isReference": true
13080           }]
13081         }, {
13082           "name": "MessageEventDefinition",
13083           "superClass": [
13084             "EventDefinition"
13085           ],
13086           "properties": [{
13087             "name": "messageRef",
13088             "type": "Message",
13089             "isAttr": true,
13090             "isReference": true
13091           }, {
13092             "name": "operationRef",
13093             "type": "Operation",
13094             "isAttr": true,
13095             "isReference": true
13096           }]
13097         }, {
13098           "name": "ConditionalEventDefinition",
13099           "superClass": [
13100             "EventDefinition"
13101           ],
13102           "properties": [{
13103             "name": "condition",
13104             "type": "Expression",
13105             "serialize": "xsi:type"
13106           }]
13107         }, {
13108           "name": "SignalEventDefinition",
13109           "superClass": [
13110             "EventDefinition"
13111           ],
13112           "properties": [{
13113             "name": "signalRef",
13114             "type": "Signal",
13115             "isAttr": true,
13116             "isReference": true
13117           }]
13118         }, {
13119           "name": "Signal",
13120           "superClass": [
13121             "RootElement"
13122           ],
13123           "properties": [{
13124             "name": "structureRef",
13125             "type": "ItemDefinition",
13126             "isAttr": true,
13127             "isReference": true
13128           }, {
13129             "name": "name",
13130             "isAttr": true,
13131             "type": "String"
13132           }]
13133         }, {
13134           "name": "ImplicitThrowEvent",
13135           "superClass": [
13136             "ThrowEvent"
13137           ]
13138         }, {
13139           "name": "DataState",
13140           "superClass": [
13141             "BaseElement"
13142           ],
13143           "properties": [{
13144             "name": "name",
13145             "isAttr": true,
13146             "type": "String"
13147           }]
13148         }, {
13149           "name": "ItemAwareElement",
13150           "superClass": [
13151             "BaseElement"
13152           ],
13153           "properties": [{
13154             "name": "itemSubjectRef",
13155             "type": "ItemDefinition",
13156             "isAttr": true,
13157             "isReference": true
13158           }, {
13159             "name": "dataState",
13160             "type": "DataState"
13161           }]
13162         }, {
13163           "name": "DataAssociation",
13164           "superClass": [
13165             "BaseElement"
13166           ],
13167           "properties": [{
13168             "name": "transformation",
13169             "type": "FormalExpression"
13170           }, {
13171             "name": "assignment",
13172             "type": "Assignment",
13173             "isMany": true
13174           }, {
13175             "name": "sourceRef",
13176             "type": "ItemAwareElement",
13177             "isMany": true,
13178             "isReference": true
13179           }, {
13180             "name": "targetRef",
13181             "type": "ItemAwareElement",
13182             "isReference": true
13183           }]
13184         }, {
13185           "name": "DataInput",
13186           "superClass": [
13187             "ItemAwareElement"
13188           ],
13189           "properties": [{
13190             "name": "name",
13191             "isAttr": true,
13192             "type": "String"
13193           }, {
13194             "name": "isCollection",
13195             "default": false,
13196             "isAttr": true,
13197             "type": "Boolean"
13198           }, {
13199             "name": "inputSetRefs",
13200             "type": "InputSet",
13201             "isVirtual": true,
13202             "isMany": true,
13203             "isReference": true
13204           }, {
13205             "name": "inputSetWithOptional",
13206             "type": "InputSet",
13207             "isVirtual": true,
13208             "isMany": true,
13209             "isReference": true
13210           }, {
13211             "name": "inputSetWithWhileExecuting",
13212             "type": "InputSet",
13213             "isVirtual": true,
13214             "isMany": true,
13215             "isReference": true
13216           }]
13217         }, {
13218           "name": "DataOutput",
13219           "superClass": [
13220             "ItemAwareElement"
13221           ],
13222           "properties": [{
13223             "name": "name",
13224             "isAttr": true,
13225             "type": "String"
13226           }, {
13227             "name": "isCollection",
13228             "default": false,
13229             "isAttr": true,
13230             "type": "Boolean"
13231           }, {
13232             "name": "outputSetRefs",
13233             "type": "OutputSet",
13234             "isVirtual": true,
13235             "isMany": true,
13236             "isReference": true
13237           }, {
13238             "name": "outputSetWithOptional",
13239             "type": "OutputSet",
13240             "isVirtual": true,
13241             "isMany": true,
13242             "isReference": true
13243           }, {
13244             "name": "outputSetWithWhileExecuting",
13245             "type": "OutputSet",
13246             "isVirtual": true,
13247             "isMany": true,
13248             "isReference": true
13249           }]
13250         }, {
13251           "name": "InputSet",
13252           "superClass": [
13253             "BaseElement"
13254           ],
13255           "properties": [{
13256             "name": "name",
13257             "isAttr": true,
13258             "type": "String"
13259           }, {
13260             "name": "dataInputRefs",
13261             "type": "DataInput",
13262             "isMany": true,
13263             "isReference": true
13264           }, {
13265             "name": "optionalInputRefs",
13266             "type": "DataInput",
13267             "isMany": true,
13268             "isReference": true
13269           }, {
13270             "name": "whileExecutingInputRefs",
13271             "type": "DataInput",
13272             "isMany": true,
13273             "isReference": true
13274           }, {
13275             "name": "outputSetRefs",
13276             "type": "OutputSet",
13277             "isMany": true,
13278             "isReference": true
13279           }]
13280         }, {
13281           "name": "OutputSet",
13282           "superClass": [
13283             "BaseElement"
13284           ],
13285           "properties": [{
13286             "name": "dataOutputRefs",
13287             "type": "DataOutput",
13288             "isMany": true,
13289             "isReference": true
13290           }, {
13291             "name": "name",
13292             "isAttr": true,
13293             "type": "String"
13294           }, {
13295             "name": "inputSetRefs",
13296             "type": "InputSet",
13297             "isMany": true,
13298             "isReference": true
13299           }, {
13300             "name": "optionalOutputRefs",
13301             "type": "DataOutput",
13302             "isMany": true,
13303             "isReference": true
13304           }, {
13305             "name": "whileExecutingOutputRefs",
13306             "type": "DataOutput",
13307             "isMany": true,
13308             "isReference": true
13309           }]
13310         }, {
13311           "name": "Property",
13312           "superClass": [
13313             "ItemAwareElement"
13314           ],
13315           "properties": [{
13316             "name": "name",
13317             "isAttr": true,
13318             "type": "String"
13319           }]
13320         }, {
13321           "name": "DataInputAssociation",
13322           "superClass": [
13323             "DataAssociation"
13324           ]
13325         }, {
13326           "name": "DataOutputAssociation",
13327           "superClass": [
13328             "DataAssociation"
13329           ]
13330         }, {
13331           "name": "InputOutputSpecification",
13332           "superClass": [
13333             "BaseElement"
13334           ],
13335           "properties": [{
13336             "name": "inputSets",
13337             "type": "InputSet",
13338             "isMany": true
13339           }, {
13340             "name": "outputSets",
13341             "type": "OutputSet",
13342             "isMany": true
13343           }, {
13344             "name": "dataInputs",
13345             "type": "DataInput",
13346             "isMany": true
13347           }, {
13348             "name": "dataOutputs",
13349             "type": "DataOutput",
13350             "isMany": true
13351           }]
13352         }, {
13353           "name": "DataObject",
13354           "superClass": [
13355             "FlowElement",
13356             "ItemAwareElement"
13357           ],
13358           "properties": [{
13359             "name": "isCollection",
13360             "default": false,
13361             "isAttr": true,
13362             "type": "Boolean"
13363           }]
13364         }, {
13365           "name": "InputOutputBinding",
13366           "properties": [{
13367             "name": "inputDataRef",
13368             "type": "InputSet",
13369             "isAttr": true,
13370             "isReference": true
13371           }, {
13372             "name": "outputDataRef",
13373             "type": "OutputSet",
13374             "isAttr": true,
13375             "isReference": true
13376           }, {
13377             "name": "operationRef",
13378             "type": "Operation",
13379             "isAttr": true,
13380             "isReference": true
13381           }]
13382         }, {
13383           "name": "Assignment",
13384           "superClass": [
13385             "BaseElement"
13386           ],
13387           "properties": [{
13388             "name": "from",
13389             "type": "Expression",
13390             "serialize": "xsi:type"
13391           }, {
13392             "name": "to",
13393             "type": "Expression",
13394             "serialize": "xsi:type"
13395           }]
13396         }, {
13397           "name": "DataStore",
13398           "superClass": [
13399             "RootElement",
13400             "ItemAwareElement"
13401           ],
13402           "properties": [{
13403             "name": "name",
13404             "isAttr": true,
13405             "type": "String"
13406           }, {
13407             "name": "capacity",
13408             "isAttr": true,
13409             "type": "Integer"
13410           }, {
13411             "name": "isUnlimited",
13412             "default": true,
13413             "isAttr": true,
13414             "type": "Boolean"
13415           }]
13416         }, {
13417           "name": "DataStoreReference",
13418           "superClass": [
13419             "ItemAwareElement",
13420             "FlowElement"
13421           ],
13422           "properties": [{
13423             "name": "dataStoreRef",
13424             "type": "DataStore",
13425             "isAttr": true,
13426             "isReference": true
13427           }]
13428         }, {
13429           "name": "DataObjectReference",
13430           "superClass": [
13431             "ItemAwareElement",
13432             "FlowElement"
13433           ],
13434           "properties": [{
13435             "name": "dataObjectRef",
13436             "type": "DataObject",
13437             "isAttr": true,
13438             "isReference": true
13439           }]
13440         }, {
13441           "name": "ConversationLink",
13442           "superClass": [
13443             "BaseElement"
13444           ],
13445           "properties": [{
13446             "name": "sourceRef",
13447             "type": "InteractionNode",
13448             "isAttr": true,
13449             "isReference": true
13450           }, {
13451             "name": "targetRef",
13452             "type": "InteractionNode",
13453             "isAttr": true,
13454             "isReference": true
13455           }, {
13456             "name": "name",
13457             "isAttr": true,
13458             "type": "String"
13459           }]
13460         }, {
13461           "name": "ConversationAssociation",
13462           "superClass": [
13463             "BaseElement"
13464           ],
13465           "properties": [{
13466             "name": "innerConversationNodeRef",
13467             "type": "ConversationNode",
13468             "isAttr": true,
13469             "isReference": true
13470           }, {
13471             "name": "outerConversationNodeRef",
13472             "type": "ConversationNode",
13473             "isAttr": true,
13474             "isReference": true
13475           }]
13476         }, {
13477           "name": "CallConversation",
13478           "superClass": [
13479             "ConversationNode"
13480           ],
13481           "properties": [{
13482             "name": "calledCollaborationRef",
13483             "type": "Collaboration",
13484             "isAttr": true,
13485             "isReference": true
13486           }, {
13487             "name": "participantAssociations",
13488             "type": "ParticipantAssociation",
13489             "isMany": true
13490           }]
13491         }, {
13492           "name": "Conversation",
13493           "superClass": [
13494             "ConversationNode"
13495           ]
13496         }, {
13497           "name": "SubConversation",
13498           "superClass": [
13499             "ConversationNode"
13500           ],
13501           "properties": [{
13502             "name": "conversationNodes",
13503             "type": "ConversationNode",
13504             "isMany": true
13505           }]
13506         }, {
13507           "name": "ConversationNode",
13508           "isAbstract": true,
13509           "superClass": [
13510             "InteractionNode",
13511             "BaseElement"
13512           ],
13513           "properties": [{
13514             "name": "name",
13515             "isAttr": true,
13516             "type": "String"
13517           }, {
13518             "name": "participantRefs",
13519             "type": "Participant",
13520             "isMany": true,
13521             "isReference": true
13522           }, {
13523             "name": "messageFlowRefs",
13524             "type": "MessageFlow",
13525             "isMany": true,
13526             "isReference": true
13527           }, {
13528             "name": "correlationKeys",
13529             "type": "CorrelationKey",
13530             "isMany": true
13531           }]
13532         }, {
13533           "name": "GlobalConversation",
13534           "superClass": [
13535             "Collaboration"
13536           ]
13537         }, {
13538           "name": "PartnerEntity",
13539           "superClass": [
13540             "RootElement"
13541           ],
13542           "properties": [{
13543             "name": "name",
13544             "isAttr": true,
13545             "type": "String"
13546           }, {
13547             "name": "participantRef",
13548             "type": "Participant",
13549             "isMany": true,
13550             "isReference": true
13551           }]
13552         }, {
13553           "name": "PartnerRole",
13554           "superClass": [
13555             "RootElement"
13556           ],
13557           "properties": [{
13558             "name": "name",
13559             "isAttr": true,
13560             "type": "String"
13561           }, {
13562             "name": "participantRef",
13563             "type": "Participant",
13564             "isMany": true,
13565             "isReference": true
13566           }]
13567         }, {
13568           "name": "CorrelationProperty",
13569           "superClass": [
13570             "RootElement"
13571           ],
13572           "properties": [{
13573             "name": "correlationPropertyRetrievalExpression",
13574             "type": "CorrelationPropertyRetrievalExpression",
13575             "isMany": true
13576           }, {
13577             "name": "name",
13578             "isAttr": true,
13579             "type": "String"
13580           }, {
13581             "name": "type",
13582             "type": "ItemDefinition",
13583             "isAttr": true,
13584             "isReference": true
13585           }]
13586         }, {
13587           "name": "Error",
13588           "superClass": [
13589             "RootElement"
13590           ],
13591           "properties": [{
13592             "name": "structureRef",
13593             "type": "ItemDefinition",
13594             "isAttr": true,
13595             "isReference": true
13596           }, {
13597             "name": "name",
13598             "isAttr": true,
13599             "type": "String"
13600           }, {
13601             "name": "errorCode",
13602             "isAttr": true,
13603             "type": "String"
13604           }]
13605         }, {
13606           "name": "CorrelationKey",
13607           "superClass": [
13608             "BaseElement"
13609           ],
13610           "properties": [{
13611             "name": "correlationPropertyRef",
13612             "type": "CorrelationProperty",
13613             "isMany": true,
13614             "isReference": true
13615           }, {
13616             "name": "name",
13617             "isAttr": true,
13618             "type": "String"
13619           }]
13620         }, {
13621           "name": "Expression",
13622           "superClass": [
13623             "BaseElement"
13624           ],
13625           "isAbstract": true
13626         }, {
13627           "name": "FormalExpression",
13628           "superClass": [
13629             "Expression"
13630           ],
13631           "properties": [{
13632             "name": "language",
13633             "isAttr": true,
13634             "type": "String"
13635           }, {
13636             "name": "body",
13637             "type": "String",
13638             "isBody": true
13639           }, {
13640             "name": "evaluatesToTypeRef",
13641             "type": "ItemDefinition",
13642             "isAttr": true,
13643             "isReference": true
13644           }]
13645         }, {
13646           "name": "Message",
13647           "superClass": [
13648             "RootElement"
13649           ],
13650           "properties": [{
13651             "name": "name",
13652             "isAttr": true,
13653             "type": "String"
13654           }, {
13655             "name": "itemRef",
13656             "type": "ItemDefinition",
13657             "isAttr": true,
13658             "isReference": true
13659           }]
13660         }, {
13661           "name": "ItemDefinition",
13662           "superClass": [
13663             "RootElement"
13664           ],
13665           "properties": [{
13666             "name": "itemKind",
13667             "type": "ItemKind",
13668             "isAttr": true
13669           }, {
13670             "name": "structureRef",
13671             "type": "String",
13672             "isAttr": true
13673           }, {
13674             "name": "isCollection",
13675             "default": false,
13676             "isAttr": true,
13677             "type": "Boolean"
13678           }, {
13679             "name": "import",
13680             "type": "Import",
13681             "isAttr": true,
13682             "isReference": true
13683           }]
13684         }, {
13685           "name": "FlowElement",
13686           "isAbstract": true,
13687           "superClass": [
13688             "BaseElement"
13689           ],
13690           "properties": [{
13691             "name": "name",
13692             "isAttr": true,
13693             "type": "String"
13694           }, {
13695             "name": "auditing",
13696             "type": "Auditing"
13697           }, {
13698             "name": "monitoring",
13699             "type": "Monitoring"
13700           }, {
13701             "name": "categoryValueRef",
13702             "type": "CategoryValue",
13703             "isMany": true,
13704             "isReference": true
13705           }]
13706         }, {
13707           "name": "SequenceFlow",
13708           "superClass": [
13709             "FlowElement"
13710           ],
13711           "properties": [{
13712             "name": "isImmediate",
13713             "isAttr": true,
13714             "type": "Boolean"
13715           }, {
13716             "name": "conditionExpression",
13717             "type": "Expression",
13718             "serialize": "xsi:type"
13719           }, {
13720             "name": "sourceRef",
13721             "type": "FlowNode",
13722             "isAttr": true,
13723             "isReference": true
13724           }, {
13725             "name": "targetRef",
13726             "type": "FlowNode",
13727             "isAttr": true,
13728             "isReference": true
13729           }]
13730         }, {
13731           "name": "FlowElementsContainer",
13732           "isAbstract": true,
13733           "superClass": [
13734             "BaseElement"
13735           ],
13736           "properties": [{
13737             "name": "laneSets",
13738             "type": "LaneSet",
13739             "isMany": true
13740           }, {
13741             "name": "flowElements",
13742             "type": "FlowElement",
13743             "isMany": true
13744           }]
13745         }, {
13746           "name": "CallableElement",
13747           "isAbstract": true,
13748           "superClass": [
13749             "RootElement"
13750           ],
13751           "properties": [{
13752             "name": "name",
13753             "isAttr": true,
13754             "type": "String"
13755           }, {
13756             "name": "ioSpecification",
13757             "type": "InputOutputSpecification"
13758           }, {
13759             "name": "supportedInterfaceRefs",
13760             "type": "Interface",
13761             "isMany": true,
13762             "isReference": true
13763           }, {
13764             "name": "ioBinding",
13765             "type": "InputOutputBinding",
13766             "isMany": true
13767           }]
13768         }, {
13769           "name": "FlowNode",
13770           "isAbstract": true,
13771           "superClass": [
13772             "FlowElement"
13773           ],
13774           "properties": [{
13775             "name": "incoming",
13776             "type": "SequenceFlow",
13777             "isMany": true,
13778             "isReference": true
13779           }, {
13780             "name": "outgoing",
13781             "type": "SequenceFlow",
13782             "isMany": true,
13783             "isReference": true
13784           }, {
13785             "name": "lanes",
13786             "type": "Lane",
13787             "isVirtual": true,
13788             "isMany": true,
13789             "isReference": true
13790           }]
13791         }, {
13792           "name": "CorrelationPropertyRetrievalExpression",
13793           "superClass": [
13794             "BaseElement"
13795           ],
13796           "properties": [{
13797             "name": "messagePath",
13798             "type": "FormalExpression"
13799           }, {
13800             "name": "messageRef",
13801             "type": "Message",
13802             "isAttr": true,
13803             "isReference": true
13804           }]
13805         }, {
13806           "name": "CorrelationPropertyBinding",
13807           "superClass": [
13808             "BaseElement"
13809           ],
13810           "properties": [{
13811             "name": "dataPath",
13812             "type": "FormalExpression"
13813           }, {
13814             "name": "correlationPropertyRef",
13815             "type": "CorrelationProperty",
13816             "isAttr": true,
13817             "isReference": true
13818           }]
13819         }, {
13820           "name": "Resource",
13821           "superClass": [
13822             "RootElement"
13823           ],
13824           "properties": [{
13825             "name": "name",
13826             "isAttr": true,
13827             "type": "String"
13828           }, {
13829             "name": "resourceParameters",
13830             "type": "ResourceParameter",
13831             "isMany": true
13832           }]
13833         }, {
13834           "name": "ResourceParameter",
13835           "superClass": [
13836             "BaseElement"
13837           ],
13838           "properties": [{
13839             "name": "name",
13840             "isAttr": true,
13841             "type": "String"
13842           }, {
13843             "name": "isRequired",
13844             "isAttr": true,
13845             "type": "Boolean"
13846           }, {
13847             "name": "type",
13848             "type": "ItemDefinition",
13849             "isAttr": true,
13850             "isReference": true
13851           }]
13852         }, {
13853           "name": "CorrelationSubscription",
13854           "superClass": [
13855             "BaseElement"
13856           ],
13857           "properties": [{
13858             "name": "correlationKeyRef",
13859             "type": "CorrelationKey",
13860             "isAttr": true,
13861             "isReference": true
13862           }, {
13863             "name": "correlationPropertyBinding",
13864             "type": "CorrelationPropertyBinding",
13865             "isMany": true
13866           }]
13867         }, {
13868           "name": "MessageFlow",
13869           "superClass": [
13870             "BaseElement"
13871           ],
13872           "properties": [{
13873             "name": "name",
13874             "isAttr": true,
13875             "type": "String"
13876           }, {
13877             "name": "sourceRef",
13878             "type": "InteractionNode",
13879             "isAttr": true,
13880             "isReference": true
13881           }, {
13882             "name": "targetRef",
13883             "type": "InteractionNode",
13884             "isAttr": true,
13885             "isReference": true
13886           }, {
13887             "name": "messageRef",
13888             "type": "Message",
13889             "isAttr": true,
13890             "isReference": true
13891           }]
13892         }, {
13893           "name": "MessageFlowAssociation",
13894           "superClass": [
13895             "BaseElement"
13896           ],
13897           "properties": [{
13898             "name": "innerMessageFlowRef",
13899             "type": "MessageFlow",
13900             "isAttr": true,
13901             "isReference": true
13902           }, {
13903             "name": "outerMessageFlowRef",
13904             "type": "MessageFlow",
13905             "isAttr": true,
13906             "isReference": true
13907           }]
13908         }, {
13909           "name": "InteractionNode",
13910           "isAbstract": true,
13911           "properties": [{
13912             "name": "incomingConversationLinks",
13913             "type": "ConversationLink",
13914             "isVirtual": true,
13915             "isMany": true,
13916             "isReference": true
13917           }, {
13918             "name": "outgoingConversationLinks",
13919             "type": "ConversationLink",
13920             "isVirtual": true,
13921             "isMany": true,
13922             "isReference": true
13923           }]
13924         }, {
13925           "name": "Participant",
13926           "superClass": [
13927             "InteractionNode",
13928             "BaseElement"
13929           ],
13930           "properties": [{
13931             "name": "name",
13932             "isAttr": true,
13933             "type": "String"
13934           }, {
13935             "name": "interfaceRefs",
13936             "type": "Interface",
13937             "isMany": true,
13938             "isReference": true
13939           }, {
13940             "name": "participantMultiplicity",
13941             "type": "ParticipantMultiplicity"
13942           }, {
13943             "name": "endPointRefs",
13944             "type": "EndPoint",
13945             "isMany": true,
13946             "isReference": true
13947           }, {
13948             "name": "processRef",
13949             "type": "Process",
13950             "isAttr": true,
13951             "isReference": true
13952           }]
13953         }, {
13954           "name": "ParticipantAssociation",
13955           "superClass": [
13956             "BaseElement"
13957           ],
13958           "properties": [{
13959             "name": "innerParticipantRef",
13960             "type": "Participant",
13961             "isAttr": true,
13962             "isReference": true
13963           }, {
13964             "name": "outerParticipantRef",
13965             "type": "Participant",
13966             "isAttr": true,
13967             "isReference": true
13968           }]
13969         }, {
13970           "name": "ParticipantMultiplicity",
13971           "properties": [{
13972             "name": "minimum",
13973             "default": 0,
13974             "isAttr": true,
13975             "type": "Integer"
13976           }, {
13977             "name": "maximum",
13978             "default": 1,
13979             "isAttr": true,
13980             "type": "Integer"
13981           }]
13982         }, {
13983           "name": "Collaboration",
13984           "superClass": [
13985             "RootElement"
13986           ],
13987           "properties": [{
13988             "name": "name",
13989             "isAttr": true,
13990             "type": "String"
13991           }, {
13992             "name": "isClosed",
13993             "isAttr": true,
13994             "type": "Boolean"
13995           }, {
13996             "name": "choreographyRef",
13997             "type": "Choreography",
13998             "isMany": true,
13999             "isReference": true
14000           }, {
14001             "name": "artifacts",
14002             "type": "Artifact",
14003             "isMany": true
14004           }, {
14005             "name": "participantAssociations",
14006             "type": "ParticipantAssociation",
14007             "isMany": true
14008           }, {
14009             "name": "messageFlowAssociations",
14010             "type": "MessageFlowAssociation",
14011             "isMany": true
14012           }, {
14013             "name": "conversationAssociations",
14014             "type": "ConversationAssociation"
14015           }, {
14016             "name": "participants",
14017             "type": "Participant",
14018             "isMany": true
14019           }, {
14020             "name": "messageFlows",
14021             "type": "MessageFlow",
14022             "isMany": true
14023           }, {
14024             "name": "correlationKeys",
14025             "type": "CorrelationKey",
14026             "isMany": true
14027           }, {
14028             "name": "conversations",
14029             "type": "ConversationNode",
14030             "isMany": true
14031           }, {
14032             "name": "conversationLinks",
14033             "type": "ConversationLink",
14034             "isMany": true
14035           }]
14036         }, {
14037           "name": "ChoreographyActivity",
14038           "isAbstract": true,
14039           "superClass": [
14040             "FlowNode"
14041           ],
14042           "properties": [{
14043             "name": "participantRefs",
14044             "type": "Participant",
14045             "isMany": true,
14046             "isReference": true
14047           }, {
14048             "name": "initiatingParticipantRef",
14049             "type": "Participant",
14050             "isAttr": true,
14051             "isReference": true
14052           }, {
14053             "name": "correlationKeys",
14054             "type": "CorrelationKey",
14055             "isMany": true
14056           }, {
14057             "name": "loopType",
14058             "type": "ChoreographyLoopType",
14059             "default": "None",
14060             "isAttr": true
14061           }]
14062         }, {
14063           "name": "CallChoreography",
14064           "superClass": [
14065             "ChoreographyActivity"
14066           ],
14067           "properties": [{
14068             "name": "calledChoreographyRef",
14069             "type": "Choreography",
14070             "isAttr": true,
14071             "isReference": true
14072           }, {
14073             "name": "participantAssociations",
14074             "type": "ParticipantAssociation",
14075             "isMany": true
14076           }]
14077         }, {
14078           "name": "SubChoreography",
14079           "superClass": [
14080             "ChoreographyActivity",
14081             "FlowElementsContainer"
14082           ],
14083           "properties": [{
14084             "name": "artifacts",
14085             "type": "Artifact",
14086             "isMany": true
14087           }]
14088         }, {
14089           "name": "ChoreographyTask",
14090           "superClass": [
14091             "ChoreographyActivity"
14092           ],
14093           "properties": [{
14094             "name": "messageFlowRef",
14095             "type": "MessageFlow",
14096             "isMany": true,
14097             "isReference": true
14098           }]
14099         }, {
14100           "name": "Choreography",
14101           "superClass": [
14102             "FlowElementsContainer",
14103             "Collaboration"
14104           ]
14105         }, {
14106           "name": "GlobalChoreographyTask",
14107           "superClass": [
14108             "Choreography"
14109           ],
14110           "properties": [{
14111             "name": "initiatingParticipantRef",
14112             "type": "Participant",
14113             "isAttr": true,
14114             "isReference": true
14115           }]
14116         }, {
14117           "name": "TextAnnotation",
14118           "superClass": [
14119             "Artifact"
14120           ],
14121           "properties": [{
14122             "name": "text",
14123             "type": "String"
14124           }, {
14125             "name": "textFormat",
14126             "default": "text/plain",
14127             "isAttr": true,
14128             "type": "String"
14129           }]
14130         }, {
14131           "name": "Group",
14132           "superClass": [
14133             "Artifact"
14134           ],
14135           "properties": [{
14136             "name": "categoryValueRef",
14137             "type": "CategoryValue",
14138             "isAttr": true,
14139             "isReference": true
14140           }]
14141         }, {
14142           "name": "Association",
14143           "superClass": [
14144             "Artifact"
14145           ],
14146           "properties": [{
14147             "name": "associationDirection",
14148             "type": "AssociationDirection",
14149             "isAttr": true
14150           }, {
14151             "name": "sourceRef",
14152             "type": "BaseElement",
14153             "isAttr": true,
14154             "isReference": true
14155           }, {
14156             "name": "targetRef",
14157             "type": "BaseElement",
14158             "isAttr": true,
14159             "isReference": true
14160           }]
14161         }, {
14162           "name": "Category",
14163           "superClass": [
14164             "RootElement"
14165           ],
14166           "properties": [{
14167             "name": "categoryValue",
14168             "type": "CategoryValue",
14169             "isMany": true
14170           }, {
14171             "name": "name",
14172             "isAttr": true,
14173             "type": "String"
14174           }]
14175         }, {
14176           "name": "Artifact",
14177           "isAbstract": true,
14178           "superClass": [
14179             "BaseElement"
14180           ]
14181         }, {
14182           "name": "CategoryValue",
14183           "superClass": [
14184             "BaseElement"
14185           ],
14186           "properties": [{
14187             "name": "categorizedFlowElements",
14188             "type": "FlowElement",
14189             "isVirtual": true,
14190             "isMany": true,
14191             "isReference": true
14192           }, {
14193             "name": "value",
14194             "isAttr": true,
14195             "type": "String"
14196           }]
14197         }, {
14198           "name": "Activity",
14199           "isAbstract": true,
14200           "superClass": [
14201             "FlowNode"
14202           ],
14203           "properties": [{
14204             "name": "isForCompensation",
14205             "default": false,
14206             "isAttr": true,
14207             "type": "Boolean"
14208           }, {
14209             "name": "loopCharacteristics",
14210             "type": "LoopCharacteristics"
14211           }, {
14212             "name": "resources",
14213             "type": "ResourceRole",
14214             "isMany": true
14215           }, {
14216             "name": "default",
14217             "type": "SequenceFlow",
14218             "isAttr": true,
14219             "isReference": true
14220           }, {
14221             "name": "properties",
14222             "type": "Property",
14223             "isMany": true
14224           }, {
14225             "name": "ioSpecification",
14226             "type": "InputOutputSpecification"
14227           }, {
14228             "name": "boundaryEventRefs",
14229             "type": "BoundaryEvent",
14230             "isMany": true,
14231             "isReference": true
14232           }, {
14233             "name": "dataInputAssociations",
14234             "type": "DataInputAssociation",
14235             "isMany": true
14236           }, {
14237             "name": "dataOutputAssociations",
14238             "type": "DataOutputAssociation",
14239             "isMany": true
14240           }, {
14241             "name": "startQuantity",
14242             "default": 1,
14243             "isAttr": true,
14244             "type": "Integer"
14245           }, {
14246             "name": "completionQuantity",
14247             "default": 1,
14248             "isAttr": true,
14249             "type": "Integer"
14250           }]
14251         }, {
14252           "name": "ServiceTask",
14253           "superClass": [
14254             "Task"
14255           ],
14256           "properties": [{
14257             "name": "implementation",
14258             "isAttr": true,
14259             "type": "String"
14260           }, {
14261             "name": "operationRef",
14262             "type": "Operation",
14263             "isAttr": true,
14264             "isReference": true
14265           }]
14266         }, {
14267           "name": "SubProcess",
14268           "superClass": [
14269             "Activity",
14270             "FlowElementsContainer",
14271             "InteractionNode"
14272           ],
14273           "properties": [{
14274             "name": "triggeredByEvent",
14275             "default": false,
14276             "isAttr": true,
14277             "type": "Boolean"
14278           }, {
14279             "name": "artifacts",
14280             "type": "Artifact",
14281             "isMany": true
14282           }]
14283         }, {
14284           "name": "LoopCharacteristics",
14285           "isAbstract": true,
14286           "superClass": [
14287             "BaseElement"
14288           ]
14289         }, {
14290           "name": "MultiInstanceLoopCharacteristics",
14291           "superClass": [
14292             "LoopCharacteristics"
14293           ],
14294           "properties": [{
14295             "name": "isSequential",
14296             "default": false,
14297             "isAttr": true,
14298             "type": "Boolean"
14299           }, {
14300             "name": "behavior",
14301             "type": "MultiInstanceBehavior",
14302             "default": "All",
14303             "isAttr": true
14304           }, {
14305             "name": "loopCardinality",
14306             "type": "Expression",
14307             "serialize": "xsi:type"
14308           }, {
14309             "name": "loopDataInputRef",
14310             "type": "ItemAwareElement",
14311             "isAttr": true,
14312             "isReference": true
14313           }, {
14314             "name": "loopDataOutputRef",
14315             "type": "ItemAwareElement",
14316             "isAttr": true,
14317             "isReference": true
14318           }, {
14319             "name": "inputDataItem",
14320             "type": "DataInput"
14321           }, {
14322             "name": "outputDataItem",
14323             "type": "DataOutput"
14324           }, {
14325             "name": "completionCondition",
14326             "type": "Expression",
14327             "serialize": "xsi:type"
14328           }, {
14329             "name": "complexBehaviorDefinition",
14330             "type": "ComplexBehaviorDefinition",
14331             "isMany": true
14332           }, {
14333             "name": "oneBehaviorEventRef",
14334             "type": "EventDefinition",
14335             "isAttr": true,
14336             "isReference": true
14337           }, {
14338             "name": "noneBehaviorEventRef",
14339             "type": "EventDefinition",
14340             "isAttr": true,
14341             "isReference": true
14342           }]
14343         }, {
14344           "name": "StandardLoopCharacteristics",
14345           "superClass": [
14346             "LoopCharacteristics"
14347           ],
14348           "properties": [{
14349             "name": "testBefore",
14350             "default": false,
14351             "isAttr": true,
14352             "type": "Boolean"
14353           }, {
14354             "name": "loopCondition",
14355             "type": "Expression",
14356             "serialize": "xsi:type"
14357           }, {
14358             "name": "loopMaximum",
14359             "type": "Expression",
14360             "serialize": "xsi:type"
14361           }]
14362         }, {
14363           "name": "CallActivity",
14364           "superClass": [
14365             "Activity"
14366           ],
14367           "properties": [{
14368             "name": "calledElement",
14369             "type": "String",
14370             "isAttr": true
14371           }]
14372         }, {
14373           "name": "Task",
14374           "superClass": [
14375             "Activity",
14376             "InteractionNode"
14377           ]
14378         }, {
14379           "name": "InitiateProcess",
14380           "superClass": [
14381             "Activity",
14382             "InteractionNode"
14383           ]
14384         }, {
14385           "name": "Collector",
14386           "superClass": [
14387             "Activity",
14388             "InteractionNode"
14389           ]
14390         }, {
14391           "name": "StringMatch",
14392           "superClass": [
14393             "Activity",
14394             "InteractionNode"
14395           ]
14396         }, {
14397           "name": "VesCollector",
14398           "superClass": [
14399             "Activity",
14400             "InteractionNode"
14401           ]
14402         }, {
14403           "name": "Holmes",
14404           "superClass": [
14405             "Activity",
14406             "InteractionNode"
14407           ]
14408         },
14409
14410         {
14411           "name": "TCA",
14412           "superClass": [
14413             "Activity",
14414             "InteractionNode"
14415           ]
14416         }, {
14417           "name": "GOC",
14418           "superClass": [
14419             "Activity",
14420             "InteractionNode"
14421           ]
14422         }, {
14423           "name": "Policy",
14424           "superClass": [
14425             "Activity",
14426             "InteractionNode"
14427           ]
14428         }, {
14429           "name": "SendTask",
14430           "superClass": [
14431             "Task"
14432           ],
14433           "properties": [{
14434             "name": "implementation",
14435             "isAttr": true,
14436             "type": "String"
14437           }, {
14438             "name": "operationRef",
14439             "type": "Operation",
14440             "isAttr": true,
14441             "isReference": true
14442           }, {
14443             "name": "messageRef",
14444             "type": "Message",
14445             "isAttr": true,
14446             "isReference": true
14447           }]
14448         }, {
14449           "name": "ReceiveTask",
14450           "superClass": [
14451             "Task"
14452           ],
14453           "properties": [{
14454             "name": "implementation",
14455             "isAttr": true,
14456             "type": "String"
14457           }, {
14458             "name": "instantiate",
14459             "default": false,
14460             "isAttr": true,
14461             "type": "Boolean"
14462           }, {
14463             "name": "operationRef",
14464             "type": "Operation",
14465             "isAttr": true,
14466             "isReference": true
14467           }, {
14468             "name": "messageRef",
14469             "type": "Message",
14470             "isAttr": true,
14471             "isReference": true
14472           }]
14473         }, {
14474           "name": "ScriptTask",
14475           "superClass": [
14476             "Task"
14477           ],
14478           "properties": [{
14479             "name": "scriptFormat",
14480             "isAttr": true,
14481             "type": "String"
14482           }, {
14483             "name": "script",
14484             "type": "String"
14485           }]
14486         }, {
14487           "name": "BusinessRuleTask",
14488           "superClass": [
14489             "Task"
14490           ],
14491           "properties": [{
14492             "name": "implementation",
14493             "isAttr": true,
14494             "type": "String"
14495           }]
14496         }, {
14497           "name": "AdHocSubProcess",
14498           "superClass": [
14499             "SubProcess"
14500           ],
14501           "properties": [{
14502             "name": "completionCondition",
14503             "type": "Expression",
14504             "serialize": "xsi:type"
14505           }, {
14506             "name": "ordering",
14507             "type": "AdHocOrdering",
14508             "isAttr": true
14509           }, {
14510             "name": "cancelRemainingInstances",
14511             "default": true,
14512             "isAttr": true,
14513             "type": "Boolean"
14514           }]
14515         }, {
14516           "name": "Transaction",
14517           "superClass": [
14518             "SubProcess"
14519           ],
14520           "properties": [{
14521             "name": "protocol",
14522             "isAttr": true,
14523             "type": "String"
14524           }, {
14525             "name": "method",
14526             "isAttr": true,
14527             "type": "String"
14528           }]
14529         }, {
14530           "name": "GlobalScriptTask",
14531           "superClass": [
14532             "GlobalTask"
14533           ],
14534           "properties": [{
14535             "name": "scriptLanguage",
14536             "isAttr": true,
14537             "type": "String"
14538           }, {
14539             "name": "script",
14540             "isAttr": true,
14541             "type": "String"
14542           }]
14543         }, {
14544           "name": "GlobalBusinessRuleTask",
14545           "superClass": [
14546             "GlobalTask"
14547           ],
14548           "properties": [{
14549             "name": "implementation",
14550             "isAttr": true,
14551             "type": "String"
14552           }]
14553         }, {
14554           "name": "ComplexBehaviorDefinition",
14555           "superClass": [
14556             "BaseElement"
14557           ],
14558           "properties": [{
14559             "name": "condition",
14560             "type": "FormalExpression"
14561           }, {
14562             "name": "event",
14563             "type": "ImplicitThrowEvent"
14564           }]
14565         }, {
14566           "name": "ResourceRole",
14567           "superClass": [
14568             "BaseElement"
14569           ],
14570           "properties": [{
14571             "name": "resourceRef",
14572             "type": "Resource",
14573             "isReference": true
14574           }, {
14575             "name": "resourceParameterBindings",
14576             "type": "ResourceParameterBinding",
14577             "isMany": true
14578           }, {
14579             "name": "resourceAssignmentExpression",
14580             "type": "ResourceAssignmentExpression"
14581           }, {
14582             "name": "name",
14583             "isAttr": true,
14584             "type": "String"
14585           }]
14586         }, {
14587           "name": "ResourceParameterBinding",
14588           "properties": [{
14589             "name": "expression",
14590             "type": "Expression",
14591             "serialize": "xsi:type"
14592           }, {
14593             "name": "parameterRef",
14594             "type": "ResourceParameter",
14595             "isAttr": true,
14596             "isReference": true
14597           }]
14598         }, {
14599           "name": "ResourceAssignmentExpression",
14600           "properties": [{
14601             "name": "expression",
14602             "type": "Expression",
14603             "serialize": "xsi:type"
14604           }]
14605         }, {
14606           "name": "Import",
14607           "properties": [{
14608             "name": "importType",
14609             "isAttr": true,
14610             "type": "String"
14611           }, {
14612             "name": "location",
14613             "isAttr": true,
14614             "type": "String"
14615           }, {
14616             "name": "namespace",
14617             "isAttr": true,
14618             "type": "String"
14619           }]
14620         }, {
14621           "name": "Definitions",
14622           "superClass": [
14623             "BaseElement"
14624           ],
14625           "properties": [{
14626             "name": "name",
14627             "isAttr": true,
14628             "type": "String"
14629           }, {
14630             "name": "targetNamespace",
14631             "isAttr": true,
14632             "type": "String"
14633           }, {
14634             "name": "expressionLanguage",
14635             "default": "http://www.w3.org/1999/XPath",
14636             "isAttr": true,
14637             "type": "String"
14638           }, {
14639             "name": "typeLanguage",
14640             "default": "http://www.w3.org/2001/XMLSchema",
14641             "isAttr": true,
14642             "type": "String"
14643           }, {
14644             "name": "imports",
14645             "type": "Import",
14646             "isMany": true
14647           }, {
14648             "name": "extensions",
14649             "type": "Extension",
14650             "isMany": true
14651           }, {
14652             "name": "rootElements",
14653             "type": "RootElement",
14654             "isMany": true
14655           }, {
14656             "name": "diagrams",
14657             "isMany": true,
14658             "type": "bpmndi:BPMNDiagram"
14659           }, {
14660             "name": "exporter",
14661             "isAttr": true,
14662             "type": "String"
14663           }, {
14664             "name": "relationships",
14665             "type": "Relationship",
14666             "isMany": true
14667           }, {
14668             "name": "exporterVersion",
14669             "isAttr": true,
14670             "type": "String"
14671           }]
14672         }
14673       ],
14674       "emumerations": [{
14675         "name": "ProcessType",
14676         "literalValues": [{
14677           "name": "None"
14678         }, {
14679           "name": "Public"
14680         }, {
14681           "name": "Private"
14682         }]
14683       }, {
14684         "name": "GatewayDirection",
14685         "literalValues": [{
14686           "name": "Unspecified"
14687         }, {
14688           "name": "Converging"
14689         }, {
14690           "name": "Diverging"
14691         }, {
14692           "name": "Mixed"
14693         }]
14694       }, {
14695         "name": "EventBasedGatewayType",
14696         "literalValues": [{
14697           "name": "Parallel"
14698         }, {
14699           "name": "Exclusive"
14700         }]
14701       }, {
14702         "name": "RelationshipDirection",
14703         "literalValues": [{
14704           "name": "None"
14705         }, {
14706           "name": "Forward"
14707         }, {
14708           "name": "Backward"
14709         }, {
14710           "name": "Both"
14711         }]
14712       }, {
14713         "name": "ItemKind",
14714         "literalValues": [{
14715           "name": "Physical"
14716         }, {
14717           "name": "Information"
14718         }]
14719       }, {
14720         "name": "ChoreographyLoopType",
14721         "literalValues": [{
14722           "name": "None"
14723         }, {
14724           "name": "Standard"
14725         }, {
14726           "name": "MultiInstanceSequential"
14727         }, {
14728           "name": "MultiInstanceParallel"
14729         }]
14730       }, {
14731         "name": "AssociationDirection",
14732         "literalValues": [{
14733           "name": "None"
14734         }, {
14735           "name": "One"
14736         }, {
14737           "name": "Both"
14738         }]
14739       }, {
14740         "name": "MultiInstanceBehavior",
14741         "literalValues": [{
14742           "name": "None"
14743         }, {
14744           "name": "One"
14745         }, {
14746           "name": "All"
14747         }, {
14748           "name": "Complex"
14749         }]
14750       }, {
14751         "name": "AdHocOrdering",
14752         "literalValues": [{
14753           "name": "Parallel"
14754         }, {
14755           "name": "Sequential"
14756         }]
14757       }],
14758       "prefix": "bpmn",
14759       "xml": {
14760         "tagAlias": "lowerCase",
14761         "typePrefix": "t"
14762       }
14763     }
14764   }, {}],
14765   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json": [function(require, module, exports) {
14766     module.exports = {
14767       "name": "BPMNDI",
14768       "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
14769       "types": [{
14770         "name": "BPMNDiagram",
14771         "properties": [{
14772           "name": "plane",
14773           "type": "BPMNPlane",
14774           "redefines": "di:Diagram#rootElement"
14775         }, {
14776           "name": "labelStyle",
14777           "type": "BPMNLabelStyle",
14778           "isMany": true
14779         }],
14780         "superClass": [
14781           "di:Diagram"
14782         ]
14783       }, {
14784         "name": "BPMNPlane",
14785         "properties": [{
14786           "name": "bpmnElement",
14787           "isAttr": true,
14788           "isReference": true,
14789           "type": "bpmn:BaseElement",
14790           "redefines": "di:DiagramElement#modelElement"
14791         }],
14792         "superClass": [
14793           "di:Plane"
14794         ]
14795       }, {
14796         "name": "BPMNShape",
14797         "properties": [{
14798           "name": "bpmnElement",
14799           "isAttr": true,
14800           "isReference": true,
14801           "type": "bpmn:BaseElement",
14802           "redefines": "di:DiagramElement#modelElement"
14803         }, {
14804           "name": "isHorizontal",
14805           "isAttr": true,
14806           "type": "Boolean"
14807         }, {
14808           "name": "isExpanded",
14809           "isAttr": true,
14810           "type": "Boolean"
14811         }, {
14812           "name": "isMarkerVisible",
14813           "isAttr": true,
14814           "type": "Boolean"
14815         }, {
14816           "name": "label",
14817           "type": "BPMNLabel"
14818         }, {
14819           "name": "isMessageVisible",
14820           "isAttr": true,
14821           "type": "Boolean"
14822         }, {
14823           "name": "participantBandKind",
14824           "type": "ParticipantBandKind",
14825           "isAttr": true
14826         }, {
14827           "name": "choreographyActivityShape",
14828           "type": "BPMNShape",
14829           "isAttr": true,
14830           "isReference": true
14831         }],
14832         "superClass": [
14833           "di:LabeledShape"
14834         ]
14835       }, {
14836         "name": "BPMNEdge",
14837         "properties": [{
14838           "name": "label",
14839           "type": "BPMNLabel"
14840         }, {
14841           "name": "bpmnElement",
14842           "isAttr": true,
14843           "isReference": true,
14844           "type": "bpmn:BaseElement",
14845           "redefines": "di:DiagramElement#modelElement"
14846         }, {
14847           "name": "sourceElement",
14848           "isAttr": true,
14849           "isReference": true,
14850           "type": "di:DiagramElement",
14851           "redefines": "di:Edge#source"
14852         }, {
14853           "name": "targetElement",
14854           "isAttr": true,
14855           "isReference": true,
14856           "type": "di:DiagramElement",
14857           "redefines": "di:Edge#target"
14858         }, {
14859           "name": "messageVisibleKind",
14860           "type": "MessageVisibleKind",
14861           "isAttr": true,
14862           "default": "initiating"
14863         }],
14864         "superClass": [
14865           "di:LabeledEdge"
14866         ]
14867       }, {
14868         "name": "BPMNLabel",
14869         "properties": [{
14870           "name": "labelStyle",
14871           "type": "BPMNLabelStyle",
14872           "isAttr": true,
14873           "isReference": true,
14874           "redefines": "di:DiagramElement#style"
14875         }],
14876         "superClass": [
14877           "di:Label"
14878         ]
14879       }, {
14880         "name": "BPMNLabelStyle",
14881         "properties": [{
14882           "name": "font",
14883           "type": "dc:Font"
14884         }],
14885         "superClass": [
14886           "di:Style"
14887         ]
14888       }],
14889       "emumerations": [{
14890         "name": "ParticipantBandKind",
14891         "literalValues": [{
14892           "name": "top_initiating"
14893         }, {
14894           "name": "middle_initiating"
14895         }, {
14896           "name": "bottom_initiating"
14897         }, {
14898           "name": "top_non_initiating"
14899         }, {
14900           "name": "middle_non_initiating"
14901         }, {
14902           "name": "bottom_non_initiating"
14903         }]
14904       }, {
14905         "name": "MessageVisibleKind",
14906         "literalValues": [{
14907           "name": "initiating"
14908         }, {
14909           "name": "non_initiating"
14910         }]
14911       }],
14912       "associations": [],
14913       "prefix": "bpmndi"
14914     }
14915   }, {}],
14916   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json": [function(require, module, exports) {
14917     module.exports = {
14918       "name": "DC",
14919       "uri": "http://www.omg.org/spec/DD/20100524/DC",
14920       "types": [{
14921         "name": "Boolean"
14922       }, {
14923         "name": "Integer"
14924       }, {
14925         "name": "Real"
14926       }, {
14927         "name": "String"
14928       }, {
14929         "name": "Font",
14930         "properties": [{
14931           "name": "name",
14932           "type": "String",
14933           "isAttr": true
14934         }, {
14935           "name": "size",
14936           "type": "Real",
14937           "isAttr": true
14938         }, {
14939           "name": "isBold",
14940           "type": "Boolean",
14941           "isAttr": true
14942         }, {
14943           "name": "isItalic",
14944           "type": "Boolean",
14945           "isAttr": true
14946         }, {
14947           "name": "isUnderline",
14948           "type": "Boolean",
14949           "isAttr": true
14950         }, {
14951           "name": "isStrikeThrough",
14952           "type": "Boolean",
14953           "isAttr": true
14954         }]
14955       }, {
14956         "name": "Point",
14957         "properties": [{
14958           "name": "x",
14959           "type": "Real",
14960           "default": "0",
14961           "isAttr": true
14962         }, {
14963           "name": "y",
14964           "type": "Real",
14965           "default": "0",
14966           "isAttr": true
14967         }]
14968       }, {
14969         "name": "Bounds",
14970         "properties": [{
14971           "name": "x",
14972           "type": "Real",
14973           "default": "0",
14974           "isAttr": true
14975         }, {
14976           "name": "y",
14977           "type": "Real",
14978           "default": "0",
14979           "isAttr": true
14980         }, {
14981           "name": "width",
14982           "type": "Real",
14983           "isAttr": true
14984         }, {
14985           "name": "height",
14986           "type": "Real",
14987           "isAttr": true
14988         }]
14989       }],
14990       "prefix": "dc",
14991       "associations": []
14992     }
14993   }, {}],
14994   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json": [function(require, module, exports) {
14995     module.exports = {
14996       "name": "DI",
14997       "uri": "http://www.omg.org/spec/DD/20100524/DI",
14998       "types": [{
14999         "name": "DiagramElement",
15000         "isAbstract": true,
15001         "properties": [{
15002           "name": "extension",
15003           "type": "Extension"
15004         }, {
15005           "name": "owningDiagram",
15006           "type": "Diagram",
15007           "isReadOnly": true,
15008           "isVirtual": true,
15009           "isReference": true
15010         }, {
15011           "name": "owningElement",
15012           "type": "DiagramElement",
15013           "isReadOnly": true,
15014           "isVirtual": true,
15015           "isReference": true
15016         }, {
15017           "name": "modelElement",
15018           "isReadOnly": true,
15019           "isVirtual": true,
15020           "isReference": true,
15021           "type": "Element"
15022         }, {
15023           "name": "style",
15024           "type": "Style",
15025           "isReadOnly": true,
15026           "isVirtual": true,
15027           "isReference": true
15028         }, {
15029           "name": "ownedElement",
15030           "type": "DiagramElement",
15031           "isReadOnly": true,
15032           "isVirtual": true,
15033           "isMany": true
15034         }]
15035       }, {
15036         "name": "Node",
15037         "isAbstract": true,
15038         "superClass": [
15039           "DiagramElement"
15040         ]
15041       }, {
15042         "name": "Edge",
15043         "isAbstract": true,
15044         "superClass": [
15045           "DiagramElement"
15046         ],
15047         "properties": [{
15048           "name": "source",
15049           "type": "DiagramElement",
15050           "isReadOnly": true,
15051           "isVirtual": true,
15052           "isReference": true
15053         }, {
15054           "name": "target",
15055           "type": "DiagramElement",
15056           "isReadOnly": true,
15057           "isVirtual": true,
15058           "isReference": true
15059         }, {
15060           "name": "waypoint",
15061           "isUnique": false,
15062           "isMany": true,
15063           "type": "dc:Point",
15064           "serialize": "xsi:type"
15065         }]
15066       }, {
15067         "name": "Diagram",
15068         "isAbstract": true,
15069         "properties": [{
15070           "name": "rootElement",
15071           "type": "DiagramElement",
15072           "isReadOnly": true,
15073           "isVirtual": true
15074         }, {
15075           "name": "name",
15076           "isAttr": true,
15077           "type": "String"
15078         }, {
15079           "name": "documentation",
15080           "isAttr": true,
15081           "type": "String"
15082         }, {
15083           "name": "resolution",
15084           "isAttr": true,
15085           "type": "Real"
15086         }, {
15087           "name": "ownedStyle",
15088           "type": "Style",
15089           "isReadOnly": true,
15090           "isVirtual": true,
15091           "isMany": true
15092         }]
15093       }, {
15094         "name": "Shape",
15095         "isAbstract": true,
15096         "superClass": [
15097           "Node"
15098         ],
15099         "properties": [{
15100           "name": "bounds",
15101           "type": "dc:Bounds"
15102         }]
15103       }, {
15104         "name": "Plane",
15105         "isAbstract": true,
15106         "superClass": [
15107           "Node"
15108         ],
15109         "properties": [{
15110           "name": "planeElement",
15111           "type": "DiagramElement",
15112           "subsettedProperty": "DiagramElement-ownedElement",
15113           "isMany": true
15114         }]
15115       }, {
15116         "name": "LabeledEdge",
15117         "isAbstract": true,
15118         "superClass": [
15119           "Edge"
15120         ],
15121         "properties": [{
15122           "name": "ownedLabel",
15123           "type": "Label",
15124           "isReadOnly": true,
15125           "subsettedProperty": "DiagramElement-ownedElement",
15126           "isVirtual": true,
15127           "isMany": true
15128         }]
15129       }, {
15130         "name": "LabeledShape",
15131         "isAbstract": true,
15132         "superClass": [
15133           "Shape"
15134         ],
15135         "properties": [{
15136           "name": "ownedLabel",
15137           "type": "Label",
15138           "isReadOnly": true,
15139           "subsettedProperty": "DiagramElement-ownedElement",
15140           "isVirtual": true,
15141           "isMany": true
15142         }]
15143       }, {
15144         "name": "Label",
15145         "isAbstract": true,
15146         "superClass": [
15147           "Node"
15148         ],
15149         "properties": [{
15150           "name": "bounds",
15151           "type": "dc:Bounds"
15152         }]
15153       }, {
15154         "name": "Style",
15155         "isAbstract": true
15156       }, {
15157         "name": "Extension",
15158         "properties": [{
15159           "name": "values",
15160           "type": "Element",
15161           "isMany": true
15162         }]
15163       }],
15164       "associations": [],
15165       "prefix": "di",
15166       "xml": {
15167         "tagAlias": "lowerCase"
15168       }
15169     }
15170   }, {}],
15171   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js": [function(require, module, exports) {
15172     module.exports = {
15173       __depends__: [require('diagram-js/lib/features/interaction-events')],
15174       __init__: ['directEditing'],
15175       directEditing: ['type', require('./lib/DirectEditing')]
15176     };
15177   }, {
15178     "./lib/DirectEditing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js",
15179     "diagram-js/lib/features/interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js"
15180   }],
15181   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js": [function(require, module, exports) {
15182     'use strict';
15183
15184     var bind = require('lodash/function/bind'),
15185       find = require('lodash/collection/find');
15186
15187     var TextBox = require('./TextBox');
15188
15189
15190     /**
15191      * A direct editing component that allows users to edit an elements text
15192      * directly in the diagram
15193      *
15194      * @param {EventBus}
15195      *            eventBus the event bus
15196      */
15197     function DirectEditing(eventBus, canvas) {
15198
15199       this._eventBus = eventBus;
15200
15201       this._providers = [];
15202       this._textbox = new TextBox({
15203         container: canvas.getContainer(),
15204         keyHandler: bind(this._handleKey, this)
15205       });
15206     }
15207
15208     DirectEditing.$inject = ['eventBus', 'canvas'];
15209
15210
15211     /**
15212      * Register a direct editing provider
15213      *
15214      * @param {Object}
15215      *            provider the provider, must expose an #activate(element) method
15216      *            that returns an activation context ({ bounds: {x, y, width, height },
15217      *            text }) if direct editing is available for the given element.
15218      *            Additionally the provider must expose a #update(element, value)
15219      *            method to receive direct editing updates.
15220      */
15221     DirectEditing.prototype.registerProvider = function(provider) {
15222       this._providers.push(provider);
15223     };
15224
15225
15226     /**
15227      * Returns true if direct editing is currently active
15228      *
15229      * @return {Boolean}
15230      */
15231     DirectEditing.prototype.isActive = function() {
15232       return !!this._active;
15233     };
15234
15235
15236     /**
15237      * Cancel direct editing, if it is currently active
15238      */
15239     DirectEditing.prototype.cancel = function() {
15240       if (!this._active) {
15241         return;
15242       }
15243
15244       this._fire('cancel');
15245       this.close();
15246     };
15247
15248
15249     DirectEditing.prototype._fire = function(event) {
15250       this._eventBus.fire('directEditing.' + event, {
15251         active: this._active
15252       });
15253     };
15254
15255     DirectEditing.prototype.close = function() {
15256       this._textbox.destroy();
15257
15258       this._fire('deactivate');
15259
15260       this._active = null;
15261     };
15262
15263
15264     DirectEditing.prototype.complete = function() {
15265
15266       var active = this._active;
15267
15268       if (!active) {
15269         return;
15270       }
15271
15272       var text = this.getValue();
15273
15274       if (text !== active.context.text) {
15275         active.provider.update(active.element, text, active.context.text);
15276       }
15277
15278       this._fire('complete');
15279
15280       this.close();
15281     };
15282
15283
15284     DirectEditing.prototype.getValue = function() {
15285       return this._textbox.getValue();
15286     };
15287
15288
15289     DirectEditing.prototype._handleKey = function(e) {
15290
15291       // stop bubble
15292       e.stopPropagation();
15293
15294       var key = e.keyCode || e.charCode;
15295
15296       // ESC
15297       if (key === 27) {
15298         e.preventDefault();
15299         return this.cancel();
15300       }
15301
15302       // Enter
15303       if (key === 13 && !e.shiftKey) {
15304         e.preventDefault();
15305         return this.complete();
15306       }
15307     };
15308
15309
15310     /**
15311      * Activate direct editing on the given element
15312      *
15313      * @param {Object}
15314      *            ElementDescriptor the descriptor for a shape or connection
15315      * @return {Boolean} true if the activation was possible
15316      */
15317     DirectEditing.prototype.activate = function(element) {
15318
15319       if (this.isActive()) {
15320         this.cancel();
15321       }
15322
15323       // the direct editing context
15324       var context;
15325
15326       var provider = find(this._providers, function(p) {
15327         return !!(context = p.activate(element)) ? p : null;
15328       });
15329
15330       // check if activation took place
15331       if (context) {
15332         this._textbox.create(context.bounds, context.style, context.text);
15333
15334         this._active = {
15335           element: element,
15336           context: context,
15337           provider: provider
15338         };
15339
15340         this._fire('activate');
15341       }
15342
15343       return !!context;
15344     };
15345
15346
15347     module.exports = DirectEditing;
15348   }, {
15349     "./TextBox": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js",
15350     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
15351     "lodash/function/bind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js"
15352   }],
15353   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js": [function(require, module, exports) {
15354     'use strict';
15355
15356     var assign = require('lodash/object/assign'),
15357       domEvent = require('min-dom/lib/event'),
15358       domRemove = require('min-dom/lib/remove');
15359
15360     function stopPropagation(event) {
15361       event.stopPropagation();
15362     }
15363
15364     function TextBox(options) {
15365
15366       this.container = options.container;
15367       this.textarea = document.createElement('textarea');
15368
15369       this.keyHandler = options.keyHandler || function() {};
15370     }
15371
15372     module.exports = TextBox;
15373
15374
15375     TextBox.prototype.create = function(bounds, style, value) {
15376
15377       var textarea = this.textarea,
15378         container = this.container;
15379
15380       assign(textarea.style, {
15381         width: bounds.width + 'px',
15382         height: bounds.height + 'px',
15383         left: bounds.x + 'px',
15384         top: bounds.y + 'px',
15385         position: 'absolute',
15386         textAlign: 'center',
15387         boxSizing: 'border-box'
15388       }, style || {});
15389
15390       textarea.value = value;
15391       textarea.title = 'Press SHIFT+Enter for line feed';
15392
15393       domEvent.bind(textarea, 'keydown', this.keyHandler);
15394       domEvent.bind(textarea, 'mousedown', stopPropagation);
15395
15396       container.appendChild(textarea);
15397
15398       setTimeout(function() {
15399         if (textarea.parent) {
15400           textarea.select();
15401         }
15402         textarea.focus();
15403       }, 100);
15404     };
15405
15406     TextBox.prototype.destroy = function() {
15407       var textarea = this.textarea;
15408
15409       textarea.value = '';
15410
15411       domEvent.unbind(textarea, 'keydown', this.keyHandler);
15412       domEvent.unbind(textarea, 'mousedown', stopPropagation);
15413
15414       domRemove(textarea);
15415     };
15416
15417     TextBox.prototype.getValue = function() {
15418       return this.textarea.value;
15419     };
15420
15421   }, {
15422     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
15423     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js",
15424     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
15425   }],
15426   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js": [function(require, module, exports) {
15427     'use strict';
15428
15429     var hat = require('hat');
15430
15431
15432     /**
15433      * Create a new id generator / cache instance.
15434      *
15435      * You may optionally provide a seed that is used internally.
15436      *
15437      * @param {Seed}
15438      *            seed
15439      */
15440     function Ids(seed) {
15441       seed = seed || [128, 36, 1];
15442       this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;
15443     }
15444
15445     module.exports = Ids;
15446
15447     /**
15448      * Generate a next id.
15449      *
15450      * @param {Object}
15451      *            [element] element to bind the id to
15452      *
15453      * @return {String} id
15454      */
15455     Ids.prototype.next = function(element) {
15456       return this._seed(element || true);
15457     };
15458
15459     /**
15460      * Generate a next id with a given prefix.
15461      *
15462      * @param {Object}
15463      *            [element] element to bind the id to
15464      *
15465      * @return {String} id
15466      */
15467     Ids.prototype.nextPrefixed = function(prefix, element) {
15468       var id;
15469
15470       do {
15471         id = prefix + this.next(true);
15472       } while (this.assigned(id));
15473
15474       // claim {prefix}{random}
15475       this.claim(id, element);
15476
15477       // return
15478       return id;
15479     };
15480
15481     /**
15482      * Manually claim an existing id.
15483      *
15484      * @param {String}
15485      *            id
15486      * @param {String}
15487      *            [element] element the id is claimed by
15488      */
15489     Ids.prototype.claim = function(id, element) {
15490       this._seed.set(id, element || true);
15491     };
15492
15493     /**
15494      * Returns true if the given id has already been assigned.
15495      *
15496      * @param {String}
15497      *            id
15498      * @return {Boolean}
15499      */
15500     Ids.prototype.assigned = function(id) {
15501       return this._seed.get(id) || false;
15502     };
15503   }, {
15504     "hat": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js"
15505   }],
15506   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js": [function(require, module, exports) {
15507     var hat = module.exports = function(bits, base) {
15508       if (!base) base = 16;
15509       if (bits === undefined) bits = 128;
15510       if (bits <= 0) return '0';
15511
15512       var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
15513       for (var i = 2; digits === Infinity; i *= 2) {
15514         digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
15515       }
15516
15517       var rem = digits - Math.floor(digits);
15518
15519       var res = '';
15520
15521       for (var i = 0; i < Math.floor(digits); i++) {
15522         var x = Math.floor(Math.random() * base).toString(base);
15523         res = x + res;
15524       }
15525
15526       if (rem) {
15527         var b = Math.pow(base, rem);
15528         var x = Math.floor(Math.random() * b).toString(base);
15529         res = x + res;
15530       }
15531
15532       var parsed = parseInt(res, base);
15533       if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
15534         return hat(bits, base)
15535       } else return res;
15536     };
15537
15538     hat.rack = function(bits, base, expandBy) {
15539       var fn = function(data) {
15540         var iters = 0;
15541         do {
15542           if (iters++ > 10) {
15543             if (expandBy) bits += expandBy;
15544             else throw new Error('too many ID collisions, use more bits')
15545           }
15546
15547           var id = hat(bits, base);
15548         } while (Object.hasOwnProperty.call(hats, id));
15549
15550         hats[id] = data;
15551         return id;
15552       };
15553       var hats = fn.hats = {};
15554
15555       fn.get = function(id) {
15556         return fn.hats[id];
15557       };
15558
15559       fn.set = function(id, value) {
15560         fn.hats[id] = value;
15561         return fn;
15562       };
15563
15564       fn.bits = bits || 128;
15565       fn.base = base || 16;
15566       return fn;
15567     };
15568
15569   }, {}],
15570   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
15571     if (typeof Object.create === 'function') {
15572       // implementation from standard node.js 'util' module
15573       module.exports = function inherits(ctor, superCtor) {
15574         ctor.super_ = superCtor
15575         ctor.prototype = Object.create(superCtor.prototype, {
15576           constructor: {
15577             value: ctor,
15578             enumerable: false,
15579             writable: true,
15580             configurable: true
15581           }
15582         });
15583       };
15584     } else {
15585       // old school shim for old browsers
15586       module.exports = function inherits(ctor, superCtor) {
15587         ctor.super_ = superCtor
15588         var TempCtor = function() {}
15589         TempCtor.prototype = superCtor.prototype
15590         ctor.prototype = new TempCtor()
15591         ctor.prototype.constructor = ctor
15592       }
15593     }
15594
15595   }, {}],
15596   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
15597     module.exports = require('domify');
15598   }, {
15599     "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
15600   }],
15601   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
15602     module.exports = require('component-event');
15603   }, {
15604     "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
15605   }],
15606   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
15607     module.exports = require('component-query');
15608   }, {
15609     "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
15610   }],
15611   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
15612     module.exports = function(el) {
15613       el.parentNode && el.parentNode.removeChild(el);
15614     };
15615   }, {}],
15616   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
15617     var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
15618       unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
15619       prefix = bind !== 'addEventListener' ? 'on' : '';
15620
15621     /**
15622      * Bind `el` event `type` to `fn`.
15623      *
15624      * @param {Element}
15625      *            el
15626      * @param {String}
15627      *            type
15628      * @param {Function}
15629      *            fn
15630      * @param {Boolean}
15631      *            capture
15632      * @return {Function}
15633      * @api public
15634      */
15635
15636     exports.bind = function(el, type, fn, capture) {
15637       el[bind](prefix + type, fn, capture || false);
15638       return fn;
15639     };
15640
15641     /**
15642      * Unbind `el` event `type`'s callback `fn`.
15643      *
15644      * @param {Element}
15645      *            el
15646      * @param {String}
15647      *            type
15648      * @param {Function}
15649      *            fn
15650      * @param {Boolean}
15651      *            capture
15652      * @return {Function}
15653      * @api public
15654      */
15655
15656     exports.unbind = function(el, type, fn, capture) {
15657       el[unbind](prefix + type, fn, capture || false);
15658       return fn;
15659     };
15660   }, {}],
15661   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
15662     function one(selector, el) {
15663       return el.querySelector(selector);
15664     }
15665
15666     exports = module.exports = function(selector, el) {
15667       el = el || document;
15668       return one(selector, el);
15669     };
15670
15671     exports.all = function(selector, el) {
15672       el = el || document;
15673       return el.querySelectorAll(selector);
15674     };
15675
15676     exports.engine = function(obj) {
15677       if (!obj.one) throw new Error('.one callback required');
15678       if (!obj.all) throw new Error('.all callback required');
15679       one = obj.one;
15680       exports.all = obj.all;
15681       return exports;
15682     };
15683
15684   }, {}],
15685   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
15686
15687     /**
15688      * Expose `parse`.
15689      */
15690
15691     module.exports = parse;
15692
15693     /**
15694      * Tests for browser support.
15695      */
15696
15697     var div = document.createElement('div');
15698     // Setup
15699     div.innerHTML = '  <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
15700     // Make sure that link elements get serialized correctly by innerHTML
15701     // This requires a wrapper element in IE
15702     var innerHTMLBug = !div.getElementsByTagName('link').length;
15703     div = undefined;
15704
15705     /**
15706      * Wrap map from jquery.
15707      */
15708
15709     var map = {
15710       legend: [1, '<fieldset>', '</fieldset>'],
15711       tr: [2, '<table><tbody>', '</tbody></table>'],
15712       col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
15713       // for script/link/style tags to work in IE6-8, you have to wrap
15714       // in a div with a non-whitespace character in front, ha!
15715       _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
15716     };
15717
15718     map.td =
15719       map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
15720
15721     map.option =
15722       map.optgroup = [1, '<select multiple="multiple">', '</select>'];
15723
15724     map.thead =
15725       map.tbody =
15726       map.colgroup =
15727       map.caption =
15728       map.tfoot = [1, '<table>', '</table>'];
15729
15730     map.polyline =
15731       map.ellipse =
15732       map.polygon =
15733       map.circle =
15734       map.text =
15735       map.line =
15736       map.path =
15737       map.rect =
15738       map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">', '</svg>'];
15739
15740     /**
15741      * Parse `html` and return a DOM Node instance, which could be a TextNode, HTML
15742      * DOM Node of some kind (<div> for example), or a DocumentFragment instance,
15743      * depending on the contents of the `html` string.
15744      *
15745      * @param {String}
15746      *            html - HTML string to "domify"
15747      * @param {Document}
15748      *            doc - The `document` instance to create the Node for
15749      * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
15750      * @api private
15751      */
15752
15753     function parse(html, doc) {
15754       if ('string' != typeof html) throw new TypeError('String expected');
15755
15756       // default to the global `document` object
15757       if (!doc) doc = document;
15758
15759       // tag name
15760       var m = /<([\w:]+)/.exec(html);
15761       if (!m) return doc.createTextNode(html);
15762
15763       html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing
15764       // whitespace
15765
15766       var tag = m[1];
15767
15768       // body support
15769       if (tag == 'body') {
15770         var el = doc.createElement('html');
15771         el.innerHTML = html;
15772         return el.removeChild(el.lastChild);
15773       }
15774
15775       // wrap map
15776       var wrap = map[tag] || map._default;
15777       var depth = wrap[0];
15778       var prefix = wrap[1];
15779       var suffix = wrap[2];
15780       var el = doc.createElement('div');
15781       el.innerHTML = prefix + html + suffix;
15782       while (depth--) el = el.lastChild;
15783
15784       // one element
15785       if (el.firstChild == el.lastChild) {
15786         return el.removeChild(el.firstChild);
15787       }
15788
15789       // several elements
15790       var fragment = doc.createDocumentFragment();
15791       while (el.firstChild) {
15792         fragment.appendChild(el.removeChild(el.firstChild));
15793       }
15794
15795       return fragment;
15796     }
15797
15798   }, {}],
15799   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
15800     module.exports = require('./lib/refs');
15801
15802     module.exports.Collection = require('./lib/collection');
15803   }, {
15804     "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js",
15805     "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"
15806   }],
15807   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
15808     'use strict';
15809
15810     /**
15811      * An empty collection stub. Use {@link RefsCollection.extend} to extend a
15812      * collection with ref semantics.
15813      *
15814      * @classdesc A change and inverse-reference aware collection with set
15815      *            semantics.
15816      *
15817      * @class RefsCollection
15818      */
15819     function RefsCollection() {}
15820
15821     /**
15822      * Extends a collection with {@link Refs} aware methods
15823      *
15824      * @memberof RefsCollection
15825      * @static
15826      *
15827      * @param {Array
15828      *            <Object>} collection
15829      * @param {Refs}
15830      *            refs instance
15831      * @param {Object}
15832      *            property represented by the collection
15833      * @param {Object}
15834      *            target object the collection is attached to
15835      *
15836      * @return {RefsCollection<Object>} the extended array
15837      */
15838     function extend(collection, refs, property, target) {
15839
15840       var inverseProperty = property.inverse;
15841
15842       /**
15843        * Removes the given element from the array and returns it.
15844        *
15845        * @method RefsCollection#remove
15846        *
15847        * @param {Object}
15848        *            element the element to remove
15849        */
15850       collection.remove = function(element) {
15851         var idx = this.indexOf(element);
15852         if (idx !== -1) {
15853           this.splice(idx, 1);
15854
15855           // unset inverse
15856           refs.unset(element, inverseProperty, target);
15857         }
15858
15859         return element;
15860       };
15861
15862       /**
15863        * Returns true if the collection contains the given element
15864        *
15865        * @method RefsCollection#contains
15866        *
15867        * @param {Object}
15868        *            element the element to check for
15869        */
15870       collection.contains = function(element) {
15871         return this.indexOf(element) !== -1;
15872       };
15873
15874       /**
15875        * Adds an element to the array, unless it exists already (set semantics).
15876        *
15877        * @method RefsCollection#add
15878        *
15879        * @param {Object}
15880        *            element the element to add
15881        */
15882       collection.add = function(element) {
15883
15884         if (!this.contains(element)) {
15885           this.push(element);
15886
15887           // set inverse
15888           refs.set(element, inverseProperty, target);
15889         }
15890       };
15891
15892       return collection;
15893     }
15894
15895
15896     module.exports.extend = extend;
15897   }, {}],
15898   "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
15899     'use strict';
15900
15901     var Collection = require('./collection');
15902
15903     function hasOwnProperty(e, property) {
15904       return Object.prototype.hasOwnProperty.call(e, property.name || property);
15905     }
15906
15907
15908     function defineCollectionProperty(ref, property, target) {
15909       Object.defineProperty(target, property.name, {
15910         enumerable: property.enumerable,
15911         value: Collection.extend(target[property.name] || [], ref, property, target)
15912       });
15913     }
15914
15915
15916     function defineProperty(ref, property, target) {
15917
15918       var inverseProperty = property.inverse;
15919
15920       var _value = target[property.name];
15921
15922       Object.defineProperty(target, property.name, {
15923         enumerable: property.enumerable,
15924
15925         get: function() {
15926           return _value;
15927         },
15928
15929         set: function(value) {
15930
15931           // return if we already performed all changes
15932           if (value === _value) {
15933             return;
15934           }
15935
15936           var old = _value;
15937
15938           // temporary set null
15939           _value = null;
15940
15941           if (old) {
15942             ref.unset(old, inverseProperty, target);
15943           }
15944
15945           // set new value
15946           _value = value;
15947
15948           // set inverse value
15949           ref.set(_value, inverseProperty, target);
15950         }
15951       });
15952
15953     }
15954
15955     /**
15956      * Creates a new references object defining two inversly related attribute
15957      * descriptors a and b.
15958      *
15959      * <p>
15960      * When bound to an object using {@link Refs#bind} the references get activated
15961      * and ensure that add and remove operations are applied reversely, too.
15962      * </p>
15963      *
15964      * <p>
15965      * For attributes represented as collections {@link Refs} provides the
15966      * {@link RefsCollection#add}, {@link RefsCollection#remove} and
15967      * {@link RefsCollection#contains} extensions that must be used to properly hook
15968      * into the inverse change mechanism.
15969      * </p>
15970      *
15971      * @class Refs
15972      *
15973      * @classdesc A bi-directional reference between two attributes.
15974      *
15975      * @param {Refs.AttributeDescriptor}
15976      *            a property descriptor
15977      * @param {Refs.AttributeDescriptor}
15978      *            b property descriptor
15979      *
15980      * @example
15981      *
15982      * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, {
15983      * name: 'car' });
15984      *
15985      * var car = { name: 'toyota' }; var wheels = [{ pos: 'front-left' }, { pos:
15986      * 'front-right' }];
15987      *
15988      * refs.bind(car, 'wheels');
15989      *
15990      * car.wheels // [] car.wheels.add(wheels[0]); car.wheels.add(wheels[1]);
15991      *
15992      * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
15993      *
15994      * wheels[0].car // { name: 'toyota' }; car.wheels.remove(wheels[0]);
15995      *
15996      * wheels[0].car // undefined
15997      */
15998     function Refs(a, b) {
15999
16000       if (!(this instanceof Refs)) {
16001         return new Refs(a, b);
16002       }
16003
16004       // link
16005       a.inverse = b;
16006       b.inverse = a;
16007
16008       this.props = {};
16009       this.props[a.name] = a;
16010       this.props[b.name] = b;
16011     }
16012
16013     /**
16014      * Binds one side of a bi-directional reference to a target object.
16015      *
16016      * @memberOf Refs
16017      *
16018      * @param {Object}
16019      *            target
16020      * @param {String}
16021      *            property
16022      */
16023     Refs.prototype.bind = function(target, property) {
16024       if (typeof property === 'string') {
16025         if (!this.props[property]) {
16026           throw new Error('no property <' + property + '> in ref');
16027         }
16028         property = this.props[property];
16029       }
16030
16031       if (property.collection) {
16032         defineCollectionProperty(this, property, target);
16033       } else {
16034         defineProperty(this, property, target);
16035       }
16036     };
16037
16038     Refs.prototype.ensureBound = function(target, property) {
16039       if (!hasOwnProperty(target, property)) {
16040         this.bind(target, property);
16041       }
16042     };
16043
16044     Refs.prototype.unset = function(target, property, value) {
16045
16046       if (target) {
16047         this.ensureBound(target, property);
16048
16049         if (property.collection) {
16050           target[property.name].remove(value);
16051         } else {
16052           target[property.name] = undefined;
16053         }
16054       }
16055     };
16056
16057     Refs.prototype.set = function(target, property, value) {
16058
16059       if (target) {
16060         this.ensureBound(target, property);
16061
16062         if (property.collection) {
16063           target[property.name].add(value);
16064         } else {
16065           target[property.name] = value;
16066         }
16067       }
16068     };
16069
16070     module.exports = Refs;
16071
16072
16073     /**
16074      * An attribute descriptor to be used specify an attribute in a {@link Refs}
16075      * instance
16076      *
16077      * @typedef {Object} Refs.AttributeDescriptor
16078      * @property {String} name
16079      * @property {boolean} [collection=false]
16080      * @property {boolean} [enumerable=false]
16081      */
16082   }, {
16083     "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"
16084   }],
16085   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js": [function(require, module, exports) {
16086     module.exports = require('./lib/Diagram');
16087   }, {
16088     "./lib/Diagram": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js"
16089   }],
16090   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js": [function(require, module, exports) {
16091     'use strict';
16092
16093     var di = require('didi');
16094
16095
16096     /**
16097      * Bootstrap an injector from a list of modules, instantiating a number of
16098      * default components
16099      *
16100      * @ignore
16101      * @param {Array
16102      *            <didi.Module>} bootstrapModules
16103      *
16104      * @return {didi.Injector} a injector to use to access the components
16105      */
16106     function bootstrap(bootstrapModules) {
16107
16108       var modules = [],
16109         components = [];
16110
16111       function hasModule(m) {
16112         return modules.indexOf(m) >= 0;
16113       }
16114
16115       function addModule(m) {
16116         modules.push(m);
16117       }
16118
16119       function visit(m) {
16120         if (hasModule(m)) {
16121           return;
16122         }
16123
16124         (m.__depends__ || []).forEach(visit);
16125
16126         if (hasModule(m)) {
16127           return;
16128         }
16129
16130         addModule(m);
16131
16132         (m.__init__ || []).forEach(function(c) {
16133           components.push(c);
16134         });
16135       }
16136
16137       bootstrapModules.forEach(visit);
16138
16139       var injector = new di.Injector(modules);
16140
16141       components.forEach(function(c) {
16142
16143         try {
16144           // eagerly resolve component (fn or string)
16145           injector[typeof c === 'string' ? 'get' : 'invoke'](c);
16146         } catch (e) {
16147           console.error('Failed to instantiate component');
16148           console.error(e.stack);
16149
16150           throw e;
16151         }
16152       });
16153
16154       return injector;
16155     }
16156
16157     /**
16158      * Creates an injector from passed options.
16159      *
16160      * @ignore
16161      * @param {Object}
16162      *            options
16163      * @return {didi.Injector}
16164      */
16165     function createInjector(options) {
16166
16167       options = options || {};
16168
16169       var configModule = {
16170         'config': ['value', options]
16171       };
16172
16173       var coreModule = require('./core');
16174
16175       var modules = [configModule, coreModule].concat(options.modules || []);
16176
16177       return bootstrap(modules);
16178     }
16179
16180
16181     /**
16182      * The main diagram-js entry point that bootstraps the diagram with the given
16183      * configuration.
16184      *
16185      * To register extensions with the diagram, pass them as Array<didi.Module> to
16186      * the constructor.
16187      *
16188      * @class djs.Diagram
16189      * @memberOf djs
16190      * @constructor
16191      *
16192      * @example
16193      *
16194      * <caption>Creating a plug-in that logs whenever a shape is added to the
16195      * canvas.</caption>
16196      *  // plug-in implemenentation function MyLoggingPlugin(eventBus) {
16197      * eventBus.on('shape.added', function(event) { console.log('shape ',
16198      * event.shape, ' was added to the diagram'); }); }
16199      *  // export as module module.exports = { __init__: [ 'myLoggingPlugin' ],
16200      * myLoggingPlugin: [ 'type', MyLoggingPlugin ] };
16201      *
16202      *  // instantiate the diagram with the new plug-in
16203      *
16204      * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ]
16205      * });
16206      *
16207      * diagram.invoke([ 'canvas', function(canvas) { // add shape to drawing canvas
16208      * canvas.addShape({ x: 10, y: 10 }); });
16209      *  // 'shape ... was added to the diagram' logged to console
16210      *
16211      * @param {Object}
16212      *            options
16213      * @param {Array
16214      *            <didi.Module>} [options.modules] external modules to instantiate
16215      *            with the diagram
16216      * @param {didi.Injector}
16217      *            [injector] an (optional) injector to bootstrap the diagram with
16218      */
16219     function Diagram(options, injector) {
16220
16221       // create injector unless explicitly specified
16222       this.injector = injector = injector || createInjector(options);
16223
16224       // API
16225
16226       /**
16227        * Resolves a diagram service
16228        *
16229        * @method Diagram#get
16230        *
16231        * @param {String}
16232        *            name the name of the diagram service to be retrieved
16233        * @param {Object}
16234        *            [locals] a number of locals to use to resolve certain
16235        *            dependencies
16236        */
16237       this.get = injector.get;
16238
16239       /**
16240        * Executes a function into which diagram services are injected
16241        *
16242        * @method Diagram#invoke
16243        *
16244        * @param {Function|Object[]}
16245        *            fn the function to resolve
16246        * @param {Object}
16247        *            locals a number of locals to use to resolve certain
16248        *            dependencies
16249        */
16250       this.invoke = injector.invoke;
16251
16252       // init
16253
16254       // indicate via event
16255
16256
16257       /**
16258        * An event indicating that all plug-ins are loaded.
16259        *
16260        * Use this event to fire other events to interested plug-ins
16261        *
16262        * @memberOf Diagram
16263        *
16264        * @event diagram.init
16265        *
16266        * @example
16267        *
16268        * eventBus.on('diagram.init', function() { eventBus.fire('my-custom-event', {
16269        * foo: 'BAR' }); });
16270        *
16271        * @type {Object}
16272        */
16273       this.get('eventBus').fire('diagram.init');
16274     }
16275
16276     module.exports = Diagram;
16277
16278
16279     /**
16280      * Destroys the diagram
16281      *
16282      * @method Diagram#destroy
16283      */
16284     Diagram.prototype.destroy = function() {
16285       this.get('eventBus').fire('diagram.destroy');
16286     };
16287   }, {
16288     "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16289     "didi": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js"
16290   }],
16291   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js": [function(require, module, exports) {
16292     'use strict';
16293
16294     var forEach = require('lodash/collection/forEach'),
16295       isFunction = require('lodash/lang/isFunction'),
16296       isArray = require('lodash/lang/isArray');
16297
16298
16299     /**
16300      * A utility that can be used to plug-in into the command execution for
16301      * extension and/or validation.
16302      *
16303      * @param {EventBus}
16304      *            eventBus
16305      *
16306      * @example
16307      *
16308      * var inherits = require('inherits');
16309      *
16310      * var CommandInterceptor =
16311      * require('diagram-js/lib/command/CommandInterceptor');
16312      *
16313      * function CommandLogger(eventBus) { CommandInterceptor.call(this, eventBus);
16314      *
16315      * this.preExecute(function(event) { console.log('command pre-execute', event);
16316      * }); }
16317      *
16318      * inherits(CommandLogger, CommandInterceptor);
16319      *
16320      */
16321     function CommandInterceptor(eventBus) {
16322       this._eventBus = eventBus;
16323     }
16324
16325     CommandInterceptor.$inject = ['eventBus'];
16326
16327     module.exports = CommandInterceptor;
16328
16329     function unwrapEvent(fn) {
16330       return function(event) {
16331         return fn(event.context, event.command, event);
16332       };
16333     }
16334
16335     /**
16336      * Register an interceptor for a command execution
16337      *
16338      * @param {String|Array
16339      *            <String>} [events] list of commands to register on
16340      * @param {String}
16341      *            [hook] command hook, i.e. preExecute, executed to listen on
16342      * @param {Function}
16343      *            handlerFn interceptor to be invoked with (event)
16344      * @param {Boolean}
16345      *            unwrap if true, unwrap the event and pass (context, command,
16346      *            event) to the listener instead
16347      */
16348     CommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {
16349
16350       if (isFunction(hook)) {
16351         unwrap = handlerFn;
16352         handlerFn = hook;
16353         hook = null;
16354       }
16355
16356       if (!isFunction(handlerFn)) {
16357         throw new Error('handlerFn must be a function');
16358       }
16359
16360       if (!isArray(events)) {
16361         events = [events];
16362       }
16363
16364       var eventBus = this._eventBus;
16365
16366       forEach(events, function(event) {
16367         // concat commandStack(.event)?(.hook)?
16368         var fullEvent = ['commandStack', event, hook].filter(function(e) {
16369           return e;
16370         }).join('.');
16371
16372         eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);
16373       });
16374     };
16375
16376
16377     var hooks = [
16378       'canExecute',
16379       'preExecute',
16380       'execute',
16381       'executed',
16382       'postExecute',
16383       'revert',
16384       'reverted'
16385     ];
16386
16387     /*
16388      * Install hook shortcuts
16389      *
16390      * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
16391      * which will in term forward to CommandInterceptor#on.
16392      */
16393     forEach(hooks, function(hook) {
16394       CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {
16395         if (isFunction(events)) {
16396           unwrap = fn;
16397           fn = events;
16398           events = null;
16399         }
16400
16401         this.on(events, hook, fn, unwrap);
16402       };
16403     });
16404   }, {
16405     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
16406     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16407     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
16408   }],
16409   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js": [function(require, module, exports) {
16410     'use strict';
16411
16412     var unique = require('lodash/array/unique'),
16413       isArray = require('lodash/lang/isArray'),
16414       assign = require('lodash/object/assign');
16415
16416     var InternalEvent = require('../core/EventBus').Event;
16417
16418
16419     /**
16420      * A service that offers un- and redoable execution of commands.
16421      *
16422      * The command stack is responsible for executing modeling actions in a un- and
16423      * redoable manner. To do this it delegates the actual command execution to
16424      * {@link CommandHandler}s.
16425      *
16426      * Command handlers provide {@link CommandHandler#execute(ctx)} and
16427      * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
16428      * identified by a command context.
16429      *
16430      *  ## Life-Cycle events
16431      *
16432      * In the process the command stack fires a number of life-cycle events that
16433      * other components to participate in the command execution.
16434      *  * preExecute * execute * executed * postExecute * revert * reverted
16435      *
16436      * A special event is used for validating, whether a command can be performed
16437      * prior to its execution.
16438      *  * canExecute
16439      *
16440      * Each of the events is fired as `commandStack.{eventName}` and
16441      * `commandStack.{commandName}.{eventName}`, respectively. This gives components
16442      * fine grained control on where to hook into.
16443      *
16444      * The event object fired transports `command`, the name of the command and
16445      * `context`, the command context.
16446      *
16447      *  ## Creating Command Handlers
16448      *
16449      * Command handlers should provide the {@link CommandHandler#execute(ctx)} and
16450      * {@link CommandHandler#revert(ctx)} methods to implement redoing and undoing
16451      * of a command. They must ensure undo is performed properly in order not to
16452      * break the undo chain.
16453      *
16454      * Command handlers may execute other modeling operations (and thus commands) in
16455      * their `preExecute` and `postExecute` phases. The command stack will properly
16456      * group all commands together into a logical unit that may be re- and undone
16457      * atomically.
16458      *
16459      * Command handlers must not execute other commands from within their core
16460      * implementation (`execute`, `revert`).
16461      *
16462      *  ## Change Tracking
16463      *
16464      * During the execution of the CommandStack it will keep track of all elements
16465      * that have been touched during the command's execution.
16466      *
16467      * At the end of the CommandStack execution it will notify interested components
16468      * via an 'elements.changed' event with all the dirty elements.
16469      *
16470      * The event can be picked up by components that are interested in the fact that
16471      * elements have been changed. One use case for this is updating their graphical
16472      * representation after moving / resizing or deletion.
16473      *
16474      *
16475      * @param {EventBus}
16476      *            eventBus
16477      * @param {Injector}
16478      *            injector
16479      */
16480     function CommandStack(eventBus, injector) {
16481       /**
16482        * A map of all registered command handlers.
16483        *
16484        * @type {Object}
16485        */
16486       this._handlerMap = {};
16487
16488       /**
16489        * A stack containing all re/undoable actions on the diagram
16490        *
16491        * @type {Array<Object>}
16492        */
16493       this._stack = [];
16494
16495       /**
16496        * The current index on the stack
16497        *
16498        * @type {Number}
16499        */
16500       this._stackIdx = -1;
16501
16502       /**
16503        * Current active commandStack execution
16504        *
16505        * @type {Object}
16506        */
16507       this._currentExecution = {
16508         actions: [],
16509         dirty: []
16510       };
16511
16512
16513       this._injector = injector;
16514       this._eventBus = eventBus;
16515
16516       this._uid = 1;
16517       this._selectedModel = selected_model;
16518
16519       commandStackList.push(this);
16520     }
16521
16522     CommandStack.$inject = ['eventBus', 'injector'];
16523
16524     module.exports = CommandStack;
16525
16526
16527     /**
16528      * Execute a command
16529      *
16530      * @param {String}
16531      *            command the command to execute
16532      * @param {Object}
16533      *            context the environment to execute the command in
16534      */
16535     CommandStack.prototype.execute = function(command, context) {
16536       if (!command) {
16537         throw new Error('command required');
16538       }
16539
16540       var action = {
16541         command: command,
16542         context: context
16543       };
16544
16545       this._pushAction(action);
16546       this._internalExecute(action);
16547       this._popAction(action);
16548     };
16549
16550
16551     /**
16552      * Ask whether a given command can be executed.
16553      *
16554      * Implementors may hook into the mechanism on two ways:
16555      *  * in event listeners:
16556      *
16557      * Users may prevent the execution via an event listener. It must prevent the
16558      * default action for `commandStack.(<command>.)canExecute` events.
16559      *  * in command handlers:
16560      *
16561      * If the method {@link CommandHandler#canExecute} is implemented in a handler
16562      * it will be called to figure out whether the execution is allowed.
16563      *
16564      * @param {String}
16565      *            command the command to execute
16566      * @param {Object}
16567      *            context the environment to execute the command in
16568      *
16569      * @return {Boolean} true if the command can be executed
16570      */
16571     CommandStack.prototype.canExecute = function(command, context) {
16572
16573       var action = {
16574         command: command,
16575         context: context
16576       };
16577
16578       var handler = this._getHandler(command);
16579
16580       if (!handler) {
16581         return false;
16582       }
16583
16584       var result = this._fire(command, 'canExecute', action);
16585
16586       // handler#canExecute will only be called if no listener
16587       // decided on a result already
16588       if (result === undefined && handler.canExecute) {
16589         result = handler.canExecute(context);
16590       }
16591
16592       return result;
16593     };
16594
16595
16596     /**
16597      * Clear the command stack, erasing all undo / redo history
16598      */
16599     CommandStack.prototype.clear = function() {
16600       this._stack.length = 0;
16601       this._stackIdx = -1;
16602
16603       this._fire('changed');
16604     };
16605
16606
16607     /**
16608      * Undo last command(s)
16609      */
16610     CommandStack.prototype.undo = function() {
16611       var action = this._getUndoAction(),
16612         next;
16613       if (action) {
16614         this._pushAction(action);
16615
16616         while (action) {
16617           this._internalUndo(action);
16618           next = this._getUndoAction();
16619
16620           if (!next || next.id !== action.id) {
16621             break;
16622           }
16623
16624           action = next;
16625         }
16626
16627         this._popAction();
16628       }
16629     };
16630
16631
16632     /**
16633      * Redo last command(s)
16634      */
16635     CommandStack.prototype.redo = function() {
16636       var action = this._getRedoAction(),
16637         next;
16638
16639       if (action) {
16640         this._pushAction(action);
16641
16642         while (action) {
16643           this._internalExecute(action, true);
16644           next = this._getRedoAction();
16645
16646           if (!next || next.id !== action.id) {
16647             break;
16648           }
16649
16650           action = next;
16651         }
16652
16653         this._popAction();
16654       }
16655     };
16656
16657
16658     /**
16659      * Register a handler instance with the command stack
16660      *
16661      * @param {String}
16662      *            command
16663      * @param {CommandHandler}
16664      *            handler
16665      */
16666     CommandStack.prototype.register = function(command, handler) {
16667       this._setHandler(command, handler);
16668     };
16669
16670
16671     /**
16672      * Register a handler type with the command stack by instantiating it and
16673      * injecting its dependencies.
16674      *
16675      * @param {String}
16676      *            command
16677      * @param {Function}
16678      *            a constructor for a {@link CommandHandler}
16679      */
16680     CommandStack.prototype.registerHandler = function(command, handlerCls) {
16681
16682       if (!command || !handlerCls) {
16683         throw new Error('command and handlerCls must be defined');
16684       }
16685
16686       var handler = this._injector.instantiate(handlerCls);
16687       this.register(command, handler);
16688     };
16689
16690     CommandStack.prototype.canUndo = function() {
16691       return !!this._getUndoAction();
16692     };
16693
16694     CommandStack.prototype.canRedo = function() {
16695       return !!this._getRedoAction();
16696     };
16697
16698     // //// stack access //////////////////////////////////////
16699
16700     CommandStack.prototype._getRedoAction = function() {
16701       return this._stack[this._stackIdx + 1];
16702     };
16703
16704
16705     CommandStack.prototype._getUndoAction = function() {
16706       return this._stack[this._stackIdx];
16707     };
16708
16709
16710     // //// internal functionality /////////////////////////////
16711
16712     CommandStack.prototype._internalUndo = function(action) {
16713       var command = action.command,
16714         context = action.context;
16715
16716       var handler = this._getHandler(command);
16717
16718       this._fire(command, 'revert', action);
16719
16720       this._markDirty(handler.revert(context));
16721
16722       this._revertedAction(action);
16723
16724       this._fire(command, 'reverted', action);
16725     };
16726
16727
16728     CommandStack.prototype._fire = function(command, qualifier, event) {
16729       if (arguments.length < 3) {
16730         event = qualifier;
16731         qualifier = null;
16732       }
16733
16734       var names = qualifier ? [command + '.' + qualifier, qualifier] : [command],
16735         i, name, result;
16736
16737       event = assign(new InternalEvent(), event);
16738
16739       for (i = 0; !!(name = names[i]); i++) {
16740         result = this._eventBus.fire('commandStack.' + name, event);
16741
16742         if (event.cancelBubble) {
16743           break;
16744         }
16745       }
16746
16747       return result;
16748     };
16749
16750     CommandStack.prototype._createId = function() {
16751       return this._uid++;
16752     };
16753
16754
16755     CommandStack.prototype._internalExecute = function(action, redo) {
16756       var command = action.command,
16757         context = action.context;
16758
16759       var handler = this._getHandler(command);
16760
16761       if (!handler) {
16762         throw new Error('no command handler registered for <' + command + '>');
16763       }
16764
16765       this._pushAction(action);
16766
16767       if (!redo) {
16768         this._fire(command, 'preExecute', action);
16769
16770         if (handler.preExecute) {
16771           handler.preExecute(context);
16772         }
16773       }
16774
16775       this._fire(command, 'execute', action);
16776
16777       // execute
16778       this._markDirty(handler.execute(context));
16779
16780       // log to stack
16781       this._executedAction(action, redo);
16782
16783       this._fire(command, 'executed', action);
16784
16785       if (!redo) {
16786         if (handler.postExecute) {
16787           handler.postExecute(context);
16788         }
16789
16790         this._fire(command, 'postExecute', action);
16791       }
16792
16793       this._popAction(action);
16794     };
16795
16796
16797     CommandStack.prototype._pushAction = function(action) {
16798
16799       var execution = this._currentExecution,
16800         actions = execution.actions;
16801
16802       var baseAction = actions[0];
16803
16804       if (!action.id) {
16805         action.id = (baseAction && baseAction.id) || this._createId();
16806       }
16807
16808       actions.push(action);
16809     };
16810
16811
16812     CommandStack.prototype._popAction = function() {
16813       var execution = this._currentExecution,
16814         actions = execution.actions,
16815         dirty = execution.dirty;
16816
16817       actions.pop();
16818
16819       if (!actions.length) {
16820         this._eventBus.fire('elements.changed', {
16821           elements: unique(dirty)
16822         });
16823
16824         dirty.length = 0;
16825
16826         this._fire('changed');
16827       }
16828     };
16829
16830
16831     CommandStack.prototype._markDirty = function(elements) {
16832       var execution = this._currentExecution;
16833
16834       if (!elements) {
16835         return;
16836       }
16837
16838       elements = isArray(elements) ? elements : [elements];
16839
16840       execution.dirty = execution.dirty.concat(elements);
16841     };
16842
16843
16844     CommandStack.prototype._executedAction = function(action, redo) {
16845       var stackIdx = ++this._stackIdx;
16846
16847       if (!redo) {
16848         this._stack.splice(stackIdx, this._stack.length, action);
16849       }
16850     };
16851
16852
16853     CommandStack.prototype._revertedAction = function(action) {
16854       this._stackIdx--;
16855     };
16856
16857
16858     CommandStack.prototype._getHandler = function(command) {
16859       return this._handlerMap[command];
16860     };
16861
16862     CommandStack.prototype._setHandler = function(command, handler) {
16863       if (!command || !handler) {
16864         throw new Error('command and handler required');
16865       }
16866
16867       if (this._handlerMap[command]) {
16868         throw new Error('overriding handler for command <' + command + '>');
16869       }
16870
16871       this._handlerMap[command] = handler;
16872     };
16873
16874   }, {
16875     "../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
16876     "lodash/array/unique": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js",
16877     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16878     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
16879   }],
16880   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js": [function(require, module, exports) {
16881     module.exports = {
16882       __depends__: [require('../core')],
16883       commandStack: ['type', require('./CommandStack')]
16884     };
16885   }, {
16886     "../core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16887     "./CommandStack": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js"
16888   }],
16889   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js": [function(require, module, exports) {
16890     'use strict';
16891
16892     var isNumber = require('lodash/lang/isNumber'),
16893       assign = require('lodash/object/assign'),
16894       forEach = require('lodash/collection/forEach');
16895
16896     var Collections = require('../util/Collections');
16897
16898     var Snap = require('../../vendor/snapsvg');
16899
16900     function round(number, resolution) {
16901       return Math.round(number * resolution) / resolution;
16902     }
16903
16904     function ensurePx(number) {
16905       return isNumber(number) ? number + 'px' : number;
16906     }
16907
16908     /**
16909      * Creates a HTML container element for a SVG element with the given
16910      * configuration
16911      *
16912      * @param {Object}
16913      *            options
16914      * @return {HTMLElement} the container element
16915      */
16916     function createContainer(options) {
16917
16918       options = assign({}, {
16919         width: '100%',
16920         height: '100%'
16921       }, options);
16922
16923       var container = options.container || document.body;
16924
16925       // create a <div> around the svg element with the respective size
16926       // this way we can always get the correct container size
16927       // (this is impossible for <svg> elements at the moment)
16928       var parent = document.createElement('div');
16929       parent.setAttribute('class', 'djs-container');
16930
16931       assign(parent.style, {
16932         position: 'relative',
16933         overflow: 'hidden',
16934         width: ensurePx(options.width),
16935         height: ensurePx(options.height)
16936       });
16937
16938       container.appendChild(parent);
16939
16940       return parent;
16941     }
16942
16943     function createGroup(parent, cls) {
16944       return parent.group().attr({
16945         'class': cls
16946       });
16947     }
16948
16949     var BASE_LAYER = 'base';
16950
16951
16952     /**
16953      * The main drawing canvas.
16954      *
16955      * @class
16956      * @constructor
16957      *
16958      * @emits Canvas#canvas.init
16959      *
16960      * @param {Object}
16961      *            config
16962      * @param {EventBus}
16963      *            eventBus
16964      * @param {GraphicsFactory}
16965      *            graphicsFactory
16966      * @param {ElementRegistry}
16967      *            elementRegistry
16968      */
16969     function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
16970       this._eventBus = eventBus;
16971       this._elementRegistry = elementRegistry;
16972       this._graphicsFactory = graphicsFactory;
16973
16974       this._init(config || {});
16975     }
16976
16977     Canvas.$inject = ['config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry'];
16978
16979     module.exports = Canvas;
16980
16981
16982     Canvas.prototype._init = function(config) {
16983
16984       // Creates a <svg> element that is wrapped into a <div>.
16985       // This way we are always able to correctly figure out the size of the svg
16986       // element
16987       // by querying the parent node.
16988       //
16989       // (It is not possible to get the size of a svg element cross browser @
16990       // 2014-04-01)
16991       //
16992       // <div class="djs-container" style="width: {desired-width}, height:
16993       // {desired-height}">
16994       // <svg width="100%" height="100%">
16995       // ...
16996       // </svg>
16997       // </div>
16998
16999       // html container
17000       var eventBus = this._eventBus,
17001
17002         container = createContainer(config),
17003         svg = Snap.createSnapAt('100%', '100%', container),
17004         viewport = createGroup(svg, 'viewport'),
17005
17006         self = this;
17007
17008       this._container = container;
17009       this._svg = svg;
17010       this._viewport = viewport;
17011       this._layers = {};
17012
17013       eventBus.on('diagram.init', function(event) {
17014
17015         /**
17016          * An event indicating that the canvas is ready to be drawn on.
17017          *
17018          * @memberOf Canvas
17019          *
17020          * @event canvas.init
17021          *
17022          * @type {Object}
17023          * @property {Snap<SVGSVGElement>} svg the created svg element
17024          * @property {Snap<SVGGroup>} viewport the direct parent of diagram
17025          *           elements and shapes
17026          */
17027         eventBus.fire('canvas.init', {
17028           svg: svg,
17029           viewport: viewport
17030         });
17031       });
17032
17033       eventBus.on('diagram.destroy', function() {
17034
17035         var parent = self._container.parentNode;
17036
17037         if (parent) {
17038           parent.removeChild(container);
17039         }
17040
17041         eventBus.fire('canvas.destroy', {
17042           svg: self._svg,
17043           viewport: self._viewport
17044         });
17045
17046         self._svg.remove();
17047
17048         self._svg = self._container = self._layers = self._viewport = null;
17049       });
17050
17051     };
17052
17053     /**
17054      * Returns the default layer on which all elements are drawn.
17055      *
17056      * @returns {Snap<SVGGroup>}
17057      */
17058     Canvas.prototype.getDefaultLayer = function() {
17059       return this.getLayer(BASE_LAYER);
17060     };
17061
17062     /**
17063      * Returns a layer that is used to draw elements or annotations on it.
17064      *
17065      * @param {String}
17066      *            name
17067      *
17068      * @returns {Snap<SVGGroup>}
17069      */
17070     Canvas.prototype.getLayer = function(name) {
17071
17072       if (!name) {
17073         throw new Error('must specify a name');
17074       }
17075
17076       var layer = this._layers[name];
17077       if (!layer) {
17078         layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
17079       }
17080
17081       return layer;
17082     };
17083
17084
17085     /**
17086      * Returns the html element that encloses the drawing canvas.
17087      *
17088      * @return {DOMNode}
17089      */
17090     Canvas.prototype.getContainer = function() {
17091       return this._container;
17092     };
17093
17094
17095     // ///////////// markers ///////////////////////////////////
17096
17097     Canvas.prototype._updateMarker = function(element, marker, add) {
17098       var container;
17099
17100       if (!element.id) {
17101         element = this._elementRegistry.get(element);
17102       }
17103
17104       // we need to access all
17105       container = this._elementRegistry._elements[element.id];
17106
17107       if (!container) {
17108         return;
17109       }
17110
17111       forEach([container.gfx, container.secondaryGfx], function(gfx) {
17112         if (gfx) {
17113           // invoke either addClass or removeClass based on mode
17114           gfx[add ? 'addClass' : 'removeClass'](marker);
17115         }
17116       });
17117
17118       /**
17119        * An event indicating that a marker has been updated for an element
17120        *
17121        * @event element.marker.update
17122        * @type {Object}
17123        * @property {djs.model.Element} element the shape
17124        * @property {Object} gfx the graphical representation of the shape
17125        * @property {String} marker
17126        * @property {Boolean} add true if the marker was added, false if it got
17127        *           removed
17128        */
17129       this._eventBus.fire('element.marker.update', {
17130         element: element,
17131         gfx: container.gfx,
17132         marker: marker,
17133         add: !!add
17134       });
17135     };
17136
17137
17138     /**
17139      * Adds a marker to an element (basically a css class).
17140      *
17141      * Fires the element.marker.update event, making it possible to integrate
17142      * extension into the marker life-cycle, too.
17143      *
17144      * @example canvas.addMarker('foo', 'some-marker');
17145      *
17146      * var fooGfx = canvas.getGraphics('foo');
17147      *
17148      * fooGfx; // <g class="... some-marker"> ... </g>
17149      *
17150      * @param {String|djs.model.Base}
17151      *            element
17152      * @param {String}
17153      *            marker
17154      */
17155     Canvas.prototype.addMarker = function(element, marker) {
17156       this._updateMarker(element, marker, true);
17157     };
17158
17159
17160     /**
17161      * Remove a marker from an element.
17162      *
17163      * Fires the element.marker.update event, making it possible to integrate
17164      * extension into the marker life-cycle, too.
17165      *
17166      * @param {String|djs.model.Base}
17167      *            element
17168      * @param {String}
17169      *            marker
17170      */
17171     Canvas.prototype.removeMarker = function(element, marker) {
17172       this._updateMarker(element, marker, false);
17173     };
17174
17175     /**
17176      * Check the existence of a marker on element.
17177      *
17178      * @param {String|djs.model.Base}
17179      *            element
17180      * @param {String}
17181      *            marker
17182      */
17183     Canvas.prototype.hasMarker = function(element, marker) {
17184       if (!element.id) {
17185         element = this._elementRegistry.get(element);
17186       }
17187
17188       var gfx = this.getGraphics(element);
17189
17190       return gfx && gfx.hasClass(marker);
17191     };
17192
17193     /**
17194      * Toggles a marker on an element.
17195      *
17196      * Fires the element.marker.update event, making it possible to integrate
17197      * extension into the marker life-cycle, too.
17198      *
17199      * @param {String|djs.model.Base}
17200      *            element
17201      * @param {String}
17202      *            marker
17203      */
17204     Canvas.prototype.toggleMarker = function(element, marker) {
17205       if (this.hasMarker(element, marker)) {
17206         this.removeMarker(element, marker);
17207       } else {
17208         this.addMarker(element, marker);
17209       }
17210     };
17211
17212     Canvas.prototype.getRootElement = function() {
17213       if (!this._rootElement) {
17214         this.setRootElement({
17215           id: '__implicitroot'
17216         });
17217       }
17218
17219       return this._rootElement;
17220     };
17221
17222
17223
17224     // ////////////// root element handling ///////////////////////////
17225
17226     /**
17227      * Sets a given element as the new root element for the canvas and returns the
17228      * new root element.
17229      *
17230      * @param {Object|djs.model.Root}
17231      *            element
17232      * @param {Boolean}
17233      *            [override] whether to override the current root element, if any
17234      *
17235      * @return {Object|djs.model.Root} new root element
17236      */
17237     Canvas.prototype.setRootElement = function(element, override) {
17238
17239       this._ensureValidId(element);
17240
17241       var oldRoot = this._rootElement,
17242         elementRegistry = this._elementRegistry,
17243         eventBus = this._eventBus;
17244
17245       if (oldRoot) {
17246         if (!override) {
17247           throw new Error('rootElement already set, need to specify override');
17248         }
17249
17250         // simulate element remove event sequence
17251         eventBus.fire('root.remove', {
17252           element: oldRoot
17253         });
17254         eventBus.fire('root.removed', {
17255           element: oldRoot
17256         });
17257
17258         elementRegistry.remove(oldRoot);
17259       }
17260
17261       var gfx = this.getDefaultLayer();
17262
17263       // resemble element add event sequence
17264       eventBus.fire('root.add', {
17265         element: element
17266       });
17267
17268       elementRegistry.add(element, gfx, this._svg);
17269
17270       eventBus.fire('root.added', {
17271         element: element,
17272         gfx: gfx
17273       });
17274
17275       this._rootElement = element;
17276
17277       return element;
17278     };
17279
17280
17281
17282     // /////////// add functionality ///////////////////////////////
17283
17284     Canvas.prototype._ensureValidId = function(element) {
17285       if (!element.id) {
17286         throw new Error('element must have an id');
17287       }
17288
17289       if (this._elementRegistry.get(element.id)) {
17290         throw new Error('element with id ' + element.id + ' already exists');
17291       }
17292     };
17293
17294     Canvas.prototype._setParent = function(element, parent) {
17295       Collections.add(parent.children, element);
17296       element.parent = parent;
17297     };
17298
17299     /**
17300      * Adds an element to the canvas.
17301      *
17302      * This wires the parent <-> child relationship between the element and a
17303      * explicitly specified parent or an implicit root element.
17304      *
17305      * During add it emits the events
17306      *  * <{type}.add> (element, parent) * <{type}.added> (element, gfx)
17307      *
17308      * Extensions may hook into these events to perform their magic.
17309      *
17310      * @param {String}
17311      *            type
17312      * @param {Object|djs.model.Base}
17313      *            element
17314      * @param {Object|djs.model.Base}
17315      *            [parent]
17316      *
17317      * @return {Object|djs.model.Base} the added element
17318      */
17319     Canvas.prototype._addElement = function(type, element, parent) {
17320
17321       parent = parent || this.getRootElement();
17322
17323       var eventBus = this._eventBus,
17324         graphicsFactory = this._graphicsFactory;
17325
17326       this._ensureValidId(element);
17327
17328       eventBus.fire(type + '.add', {
17329         element: element,
17330         parent: parent
17331       });
17332
17333       this._setParent(element, parent);
17334
17335       // create graphics
17336       var gfx = graphicsFactory.create(type, element);
17337
17338       this._elementRegistry.add(element, gfx);
17339
17340       // update its visual
17341       graphicsFactory.update(type, element, gfx);
17342
17343       eventBus.fire(type + '.added', {
17344         element: element,
17345         gfx: gfx
17346       });
17347
17348       return element;
17349     };
17350
17351     /**
17352      * Adds a shape to the canvas
17353      *
17354      * @param {Object|djs.model.Shape}
17355      *            shape to add to the diagram
17356      * @param {djs.model.Base}
17357      *            [parent]
17358      *
17359      * @return {djs.model.Shape} the added shape
17360      */
17361     Canvas.prototype.addShape = function(shape, parent) {
17362       return this._addElement('shape', shape, parent);
17363     };
17364
17365     /**
17366      * Adds a connection to the canvas
17367      *
17368      * @param {Object|djs.model.Connection}
17369      *            connection to add to the diagram
17370      * @param {djs.model.Base}
17371      *            [parent]
17372      *
17373      * @return {djs.model.Connection} the added connection
17374      */
17375     Canvas.prototype.addConnection = function(connection, parent) {
17376       return this._addElement('connection', connection, parent);
17377     };
17378
17379
17380     /**
17381      * Internal remove element
17382      */
17383     Canvas.prototype._removeElement = function(element, type) {
17384       console.log(element);
17385       var elementRegistry = this._elementRegistry,
17386         graphicsFactory = this._graphicsFactory,
17387         eventBus = this._eventBus;
17388
17389       element = elementRegistry.get(element.id || element);
17390
17391       if (!element) {
17392         // element was removed already
17393         return;
17394       }
17395
17396       eventBus.fire(type + '.remove', {
17397         element: element
17398       });
17399
17400       graphicsFactory.remove(element);
17401
17402       // unset parent <-> child relationship
17403       Collections.remove(element.parent && element.parent.children, element);
17404       element.parent = null;
17405
17406       eventBus.fire(type + '.removed', {
17407         element: element
17408       });
17409
17410       elementRegistry.remove(element);
17411
17412       return element;
17413     };
17414
17415
17416     /**
17417      * Removes a shape from the canvas
17418      *
17419      * @param {String|djs.model.Shape}
17420      *            shape or shape id to be removed
17421      *
17422      * @return {djs.model.Shape} the removed shape
17423      */
17424     Canvas.prototype.removeShape = function(shape) {
17425
17426       /**
17427        * An event indicating that a shape is about to be removed from the canvas.
17428        *
17429        * @memberOf Canvas
17430        *
17431        * @event shape.remove
17432        * @type {Object}
17433        * @property {djs.model.Shape} element the shape descriptor
17434        * @property {Object} gfx the graphical representation of the shape
17435        */
17436
17437       /**
17438        * An event indicating that a shape has been removed from the canvas.
17439        *
17440        * @memberOf Canvas
17441        *
17442        * @event shape.removed
17443        * @type {Object}
17444        * @property {djs.model.Shape} element the shape descriptor
17445        * @property {Object} gfx the graphical representation of the shape
17446        */
17447       return this._removeElement(shape, 'shape');
17448     };
17449
17450
17451     /**
17452      * Removes a connection from the canvas
17453      *
17454      * @param {String|djs.model.Connection}
17455      *            connection or connection id to be removed
17456      *
17457      * @return {djs.model.Connection} the removed connection
17458      */
17459     Canvas.prototype.removeConnection = function(connection) {
17460
17461       /**
17462        * An event indicating that a connection is about to be removed from the
17463        * canvas.
17464        *
17465        * @memberOf Canvas
17466        *
17467        * @event connection.remove
17468        * @type {Object}
17469        * @property {djs.model.Connection} element the connection descriptor
17470        * @property {Object} gfx the graphical representation of the connection
17471        */
17472
17473       /**
17474        * An event indicating that a connection has been removed from the canvas.
17475        *
17476        * @memberOf Canvas
17477        *
17478        * @event connection.removed
17479        * @type {Object}
17480        * @property {djs.model.Connection} element the connection descriptor
17481        * @property {Object} gfx the graphical representation of the connection
17482        */
17483       return this._removeElement(connection, 'connection');
17484     };
17485
17486
17487     /**
17488      * Sends a shape to the front.
17489      *
17490      * This method takes parent / child relationships between shapes into account
17491      * and makes sure that children are properly handled, too.
17492      *
17493      * @param {djs.model.Shape}
17494      *            shape descriptor of the shape to be sent to front
17495      * @param {boolean}
17496      *            [bubble=true] whether to send parent shapes to front, too
17497      */
17498     Canvas.prototype.sendToFront = function(shape, bubble) {
17499
17500       if (bubble !== false) {
17501         bubble = true;
17502       }
17503
17504       if (bubble && shape.parent) {
17505         this.sendToFront(shape.parent);
17506       }
17507
17508       forEach(shape.children, function(child) {
17509         this.sendToFront(child, false);
17510       }, this);
17511
17512       var gfx = this.getGraphics(shape),
17513         gfxParent = gfx.parent();
17514
17515       gfx.remove().appendTo(gfxParent);
17516     };
17517
17518
17519     /**
17520      * Return the graphical object underlaying a certain diagram element
17521      *
17522      * @param {String|djs.model.Base}
17523      *            element descriptor of the element
17524      * @param {Boolean}
17525      *            [secondary=false] whether to return the secondary connected
17526      *            element
17527      *
17528      * @return {SVGElement}
17529      */
17530     Canvas.prototype.getGraphics = function(element, secondary) {
17531       return this._elementRegistry.getGraphics(element, secondary);
17532     };
17533
17534
17535     Canvas.prototype._fireViewboxChange = function() {
17536       this._eventBus.fire('canvas.viewbox.changed', {
17537         viewbox: this.viewbox(false)
17538       });
17539     };
17540
17541
17542     /**
17543      * Gets or sets the view box of the canvas, i.e. the area that is currently
17544      * displayed
17545      *
17546      * @param {Object}
17547      *            [box] the new view box to set
17548      * @param {Number}
17549      *            box.x the top left X coordinate of the canvas visible in view box
17550      * @param {Number}
17551      *            box.y the top left Y coordinate of the canvas visible in view box
17552      * @param {Number}
17553      *            box.width the visible width
17554      * @param {Number}
17555      *            box.height
17556      *
17557      * @example
17558      *
17559      * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
17560      *  // sets the visible area of the diagram to (100|100) -> (600|100) // and and
17561      * scales it according to the diagram width
17562      *
17563      * @return {Object} the current view box
17564      */
17565     Canvas.prototype.viewbox = function(box) {
17566
17567       if (box === undefined && this._cachedViewbox) {
17568         return this._cachedViewbox;
17569       }
17570
17571       var viewport = this._viewport,
17572         innerBox,
17573         outerBox = this.getSize(),
17574         matrix,
17575         scale,
17576         x, y;
17577
17578       if (!box) {
17579         // compute the inner box based on the
17580         // diagrams default layer. This allows us to exclude
17581         // external components, such as overlays
17582         innerBox = this.getDefaultLayer().getBBox(true);
17583
17584         matrix = viewport.transform().localMatrix;
17585         scale = round(matrix.a, 1000);
17586
17587         x = round(-matrix.e || 0, 1000);
17588         y = round(-matrix.f || 0, 1000);
17589
17590         box = this._cachedViewbox = {
17591           x: x ? x / scale : 0,
17592           y: y ? y / scale : 0,
17593           width: outerBox.width / scale,
17594           height: outerBox.height / scale,
17595           scale: scale,
17596           inner: {
17597             width: innerBox.width,
17598             height: innerBox.height,
17599             x: innerBox.x,
17600             y: innerBox.y
17601           },
17602           outer: outerBox
17603         };
17604
17605         return box;
17606       } else {
17607         scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
17608
17609         matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
17610         viewport.transform(matrix);
17611
17612         this._fireViewboxChange();
17613       }
17614
17615       return box;
17616     };
17617
17618
17619     /**
17620      * Gets or sets the scroll of the canvas.
17621      *
17622      * @param {Object}
17623      *            [delta] the new scroll to apply.
17624      *
17625      * @param {Number}
17626      *            [delta.dx]
17627      * @param {Number}
17628      *            [delta.dy]
17629      */
17630     Canvas.prototype.scroll = function(delta) {
17631       var node = this._viewport.node;
17632       var matrix = node.getCTM();
17633
17634       if (delta) {
17635         delta = assign({
17636           dx: 0,
17637           dy: 0
17638         }, delta || {});
17639
17640         matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
17641
17642         setCTM(node, matrix);
17643
17644         this._fireViewboxChange();
17645       }
17646
17647       return {
17648         x: matrix.e,
17649         y: matrix.f
17650       };
17651     };
17652
17653
17654     /**
17655      * Gets or sets the current zoom of the canvas, optionally zooming to the
17656      * specified position.
17657      *
17658      * @param {String|Number}
17659      *            [newScale] the new zoom level, either a number, i.e. 0.9, or
17660      *            `fit-viewport` to adjust the size to fit the current viewport
17661      * @param {String|Point}
17662      *            [center] the reference point { x: .., y: ..} to zoom to, 'auto' to
17663      *            zoom into mid or null
17664      *
17665      * @return {Number} the current scale
17666      */
17667     Canvas.prototype.zoom = function(newScale, center) {
17668
17669       if (newScale === 'fit-viewport') {
17670         return this._fitViewport(center);
17671       }
17672
17673       var vbox = this.viewbox();
17674
17675       if (newScale === undefined) {
17676         return vbox.scale;
17677       }
17678
17679       var outer = vbox.outer;
17680
17681       if (center === 'auto') {
17682         center = {
17683           x: outer.width / 2,
17684           y: outer.height / 2
17685         };
17686       }
17687
17688       var matrix = this._setZoom(newScale, center);
17689
17690       this._fireViewboxChange();
17691
17692       return round(matrix.a, 1000);
17693     };
17694
17695     function setCTM(node, m) {
17696       var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
17697       node.setAttribute('transform', mstr);
17698     }
17699
17700     Canvas.prototype._fitViewport = function(center) {
17701
17702       var vbox = this.viewbox(),
17703         outer = vbox.outer,
17704         inner = vbox.inner,
17705         newScale,
17706         newViewbox;
17707
17708       // display the complete diagram without zooming in.
17709       // instead of relying on internal zoom, we perform a
17710       // hard reset on the canvas viewbox to realize this
17711       //
17712       // if diagram does not need to be zoomed in, we focus it around
17713       // the diagram origin instead
17714
17715       if (inner.x >= 0 &&
17716         inner.y >= 0 &&
17717         inner.x + inner.width <= outer.width &&
17718         inner.y + inner.height <= outer.height &&
17719         !center) {
17720
17721         newViewbox = {
17722           x: 0,
17723           y: 0,
17724           width: Math.max(inner.width + inner.x, outer.width),
17725           height: Math.max(inner.height + inner.y, outer.height)
17726         };
17727       } else {
17728
17729         newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
17730         newViewbox = {
17731           x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
17732           y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
17733           width: outer.width / newScale,
17734           height: outer.height / newScale
17735         };
17736       }
17737
17738       this.viewbox(newViewbox);
17739
17740       return this.viewbox().scale;
17741     };
17742
17743
17744     Canvas.prototype._setZoom = function(scale, center) {
17745
17746       var svg = this._svg.node,
17747         viewport = this._viewport.node;
17748
17749       var matrix = svg.createSVGMatrix();
17750       var point = svg.createSVGPoint();
17751
17752       var centerPoint,
17753         originalPoint,
17754         currentMatrix,
17755         scaleMatrix,
17756         newMatrix;
17757
17758       currentMatrix = viewport.getCTM();
17759
17760
17761       var currentScale = currentMatrix.a;
17762
17763       if (center) {
17764         centerPoint = assign(point, center);
17765
17766         // revert applied viewport transformations
17767         originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
17768
17769         // create scale matrix
17770         scaleMatrix = matrix
17771           .translate(originalPoint.x, originalPoint.y)
17772           .scale(1 / currentScale * scale)
17773           .translate(-originalPoint.x, -originalPoint.y);
17774
17775         newMatrix = currentMatrix.multiply(scaleMatrix);
17776       } else {
17777         newMatrix = matrix.scale(scale);
17778       }
17779
17780       setCTM(this._viewport.node, newMatrix);
17781
17782       return newMatrix;
17783     };
17784
17785
17786     /**
17787      * Returns the size of the canvas
17788      *
17789      * @return {Dimensions}
17790      */
17791     Canvas.prototype.getSize = function() {
17792       return {
17793         width: this._container.clientWidth,
17794         height: this._container.clientHeight
17795       };
17796     };
17797
17798
17799     /**
17800      * Return the absolute bounding box for the given element
17801      *
17802      * The absolute bounding box may be used to display overlays in the callers
17803      * (browser) coordinate system rather than the zoomed in/out canvas coordinates.
17804      *
17805      * @param {ElementDescriptor}
17806      *            element
17807      * @return {Bounds} the absolute bounding box
17808      */
17809     Canvas.prototype.getAbsoluteBBox = function(element) {
17810       var vbox = this.viewbox();
17811       var bbox;
17812
17813       // connection
17814       // use svg bbox
17815       if (element.waypoints) {
17816         var gfx = this.getGraphics(element);
17817
17818         var transformBBox = gfx.getBBox(true);
17819         bbox = gfx.getBBox();
17820
17821         bbox.x -= transformBBox.x;
17822         bbox.y -= transformBBox.y;
17823
17824         bbox.width += 2 * transformBBox.x;
17825         bbox.height += 2 * transformBBox.y;
17826       }
17827       // shapes
17828       // use data
17829       else {
17830         bbox = element;
17831       }
17832
17833       var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
17834       var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
17835
17836       var width = bbox.width * vbox.scale;
17837       var height = bbox.height * vbox.scale;
17838
17839       return {
17840         x: x,
17841         y: y,
17842         width: width,
17843         height: height
17844       };
17845     };
17846
17847   }, {
17848     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
17849     "../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
17850     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
17851     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
17852     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
17853   }],
17854   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js": [function(require, module, exports) {
17855     'use strict';
17856
17857     var Model = require('../model');
17858
17859
17860     /**
17861      * A factory for diagram-js shapes
17862      */
17863     function ElementFactory() {
17864       this._uid = 12;
17865     }
17866
17867     module.exports = ElementFactory;
17868
17869
17870     ElementFactory.prototype.createRoot = function(attrs) {
17871       return this.create('root', attrs);
17872     };
17873
17874     ElementFactory.prototype.createLabel = function(attrs) {
17875       return this.create('label', attrs);
17876     };
17877
17878     ElementFactory.prototype.createShape = function(attrs) {
17879       // alert("In createShape");
17880       return this.create('shape', attrs);
17881     };
17882
17883     ElementFactory.prototype.createConnection = function(attrs) {
17884       return this.create('connection', attrs);
17885     };
17886
17887     /**
17888      * Create a model element with the given type and a number of pre-set
17889      * attributes.
17890      *
17891      * @param {String}
17892      *            type
17893      * @param {Object}
17894      *            attrs
17895      * @return {djs.model.Base} the newly created model instance
17896      */
17897     ElementFactory.prototype.create = function(type, attrs) {
17898       // alert("In create");
17899
17900       attrs = attrs || {};
17901
17902       if (!attrs.id) {
17903         attrs.id = type + '_' + (this._uid++);
17904       }
17905
17906       return Model.create(type, attrs);
17907     };
17908   }, {
17909     "../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js"
17910   }],
17911   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js": [function(require, module, exports) {
17912     'use strict';
17913
17914     var ELEMENT_ID = 'data-element-id';
17915
17916
17917     /**
17918      * @class
17919      *
17920      * A registry that keeps track of all shapes in the diagram.
17921      */
17922     function ElementRegistry() {
17923       this._elements = {};
17924     }
17925
17926     module.exports = ElementRegistry;
17927
17928     /**
17929      * Register a pair of (element, gfx, (secondaryGfx)).
17930      *
17931      * @param {djs.model.Base}
17932      *            element
17933      * @param {Snap
17934      *            <SVGElement>} gfx
17935      * @param {Snap
17936      *            <SVGElement>} [secondaryGfx] optional other element to register,
17937      *            too
17938      */
17939     ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
17940
17941       var id = element.id;
17942
17943       this._validateId(id);
17944
17945       // associate dom node with element
17946       gfx.attr(ELEMENT_ID, id);
17947
17948       if (secondaryGfx) {
17949         secondaryGfx.attr(ELEMENT_ID, id);
17950       }
17951
17952       this._elements[id] = {
17953         element: element,
17954         gfx: gfx,
17955         secondaryGfx: secondaryGfx
17956       };
17957     };
17958
17959     /**
17960      * Removes an element from the registry.
17961      *
17962      * @param {djs.model.Base}
17963      *            element
17964      */
17965     ElementRegistry.prototype.remove = function(element) {
17966       var elements = this._elements,
17967         id = element.id || element,
17968         container = id && elements[id];
17969
17970       if (container) {
17971
17972         // unset element id on gfx
17973         container.gfx.attr(ELEMENT_ID, null);
17974
17975         if (container.secondaryGfx) {
17976           container.secondaryGfx.attr(ELEMENT_ID, null);
17977         }
17978
17979         delete elements[id];
17980       }
17981     };
17982
17983     /**
17984      * Update the id of an element
17985      *
17986      * @param {djs.model.Base}
17987      *            element
17988      * @param {String}
17989      *            newId
17990      */
17991     ElementRegistry.prototype.updateId = function(element, newId) {
17992
17993       this._validateId(newId);
17994
17995       if (typeof element === 'string') {
17996         element = this.get(element);
17997       }
17998
17999       var gfx = this.getGraphics(element),
18000         secondaryGfx = this.getGraphics(element, true);
18001
18002       this.remove(element);
18003
18004       element.id = newId;
18005
18006       this.add(element, gfx, secondaryGfx);
18007     };
18008
18009     /**
18010      * Return the model element for a given id or graphics.
18011      *
18012      * @example
18013      *
18014      * elementRegistry.get('SomeElementId_1'); elementRegistry.get(gfx);
18015      *
18016      *
18017      * @param {String|SVGElement}
18018      *            filter for selecting the element
18019      *
18020      * @return {djs.model.Base}
18021      */
18022     ElementRegistry.prototype.get = function(filter) {
18023       var id;
18024
18025       if (typeof filter === 'string') {
18026         id = filter;
18027       } else {
18028         id = filter && filter.attr(ELEMENT_ID);
18029       }
18030
18031       var container = this._elements[id];
18032       return container && container.element;
18033     };
18034
18035     /**
18036      * Return all elements that match a given filter function.
18037      *
18038      * @param {Function}
18039      *            fn
18040      *
18041      * @return {Array<djs.model.Base>}
18042      */
18043     ElementRegistry.prototype.filter = function(fn) {
18044
18045       var filtered = [];
18046
18047       this.forEach(function(element, gfx) {
18048         if (fn(element, gfx)) {
18049           filtered.push(element);
18050         }
18051       });
18052
18053       return filtered;
18054     };
18055
18056     /**
18057      * Iterate over all diagram elements.
18058      *
18059      * @param {Function}
18060      *            fn
18061      */
18062     ElementRegistry.prototype.forEach = function(fn) {
18063
18064       var map = this._elements;
18065
18066       Object.keys(map).forEach(function(id) {
18067         var container = map[id],
18068           element = container.element,
18069           gfx = container.gfx;
18070
18071         return fn(element, gfx);
18072       });
18073     };
18074
18075     /**
18076      * Return the graphical representation of an element or its id.
18077      *
18078      * @example elementRegistry.getGraphics('SomeElementId_1');
18079      *          elementRegistry.getGraphics(rootElement); // <g ...>
18080      *
18081      * elementRegistry.getGraphics(rootElement, true); // <svg ...>
18082      *
18083      *
18084      * @param {String|djs.model.Base}
18085      *            filter
18086      * @param {Boolean}
18087      *            [secondary=false] whether to return the secondary connected
18088      *            element
18089      *
18090      * @return {SVGElement}
18091      */
18092     ElementRegistry.prototype.getGraphics = function(filter, secondary) {
18093       var id = filter.id || filter;
18094
18095       var container = this._elements[id];
18096       return container && (secondary ? container.secondaryGfx : container.gfx);
18097     };
18098
18099     /**
18100      * Validate the suitability of the given id and signals a problem with an
18101      * exception.
18102      *
18103      * @param {String}
18104      *            id
18105      *
18106      * @throws {Error}
18107      *             if id is empty or already assigned
18108      */
18109     ElementRegistry.prototype._validateId = function(id) {
18110       if (!id) {
18111         throw new Error('element must have an id');
18112       }
18113
18114       if (this._elements[id]) {
18115         throw new Error('element with id ' + id + ' already added');
18116       }
18117     };
18118   }, {}],
18119   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js": [function(require, module, exports) {
18120     'use strict';
18121
18122     var isFunction = require('lodash/lang/isFunction'),
18123       isArray = require('lodash/lang/isArray'),
18124       isNumber = require('lodash/lang/isNumber'),
18125       assign = require('lodash/object/assign');
18126
18127     var DEFAULT_PRIORITY = 1000;
18128
18129
18130     /**
18131      * A general purpose event bus.
18132      *
18133      * This component is used to communicate across a diagram instance. Other parts
18134      * of a diagram can use it to listen to and broadcast events.
18135      *
18136      *  ## Registering for Events
18137      *
18138      * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
18139      * methods to register for events. {@link EventBus#off} can be used to remove
18140      * event registrations. Listeners receive an instance of {@link Event} as the
18141      * first argument. It allows them to hook into the event execution.
18142      *
18143      * ```javascript
18144      *  // listen for event eventBus.on('foo', function(event) {
18145      *  // access event type event.type; // 'foo'
18146      *  // stop propagation to other listeners event.stopPropagation();
18147      *  // prevent event default event.preventDefault(); });
18148      *  // listen for event with custom payload eventBus.on('bar', function(event,
18149      * payload) { console.log(payload); });
18150      *  // listen for event returning value eventBus.on('foobar', function(event) {
18151      *  // stop event propagation + prevent default return false;
18152      *  // stop event propagation + return custom result return { complex:
18153      * 'listening result' }; });
18154      *
18155      *  // listen with custom priority (default=1000, higher is better)
18156      * eventBus.on('priorityfoo', 1500, function(event) { console.log('invoked
18157      * first!'); }); ```
18158      *
18159      *  ## Emitting Events
18160      *
18161      * Events can be emitted via the event bus using {@link EventBus#fire}.
18162      *
18163      * ```javascript
18164      *  // false indicates that the default action // was prevented by listeners if
18165      * (eventBus.fire('foo') === false) { console.log('default has been
18166      * prevented!'); };
18167      *
18168      *  // custom args + return value listener eventBus.on('sum', function(event, a,
18169      * b) { return a + b; });
18170      *  // you can pass custom arguments + retrieve result values. var sum =
18171      * eventBus.fire('sum', 1, 2); console.log(sum); // 3 ```
18172      */
18173     function EventBus() {
18174       this._listeners = {};
18175
18176       // cleanup on destroy
18177
18178       var self = this;
18179
18180       // destroy on lowest priority to allow
18181       // message passing until the bitter end
18182       this.on('diagram.destroy', 1, function() {
18183         self._listeners = null;
18184       });
18185     }
18186
18187     module.exports = EventBus;
18188
18189
18190     /**
18191      * Register an event listener for events with the given name.
18192      *
18193      * The callback will be invoked with `event, ...additionalArguments` that have
18194      * been passed to {@link EventBus#fire}.
18195      *
18196      * Returning false from a listener will prevent the events default action (if
18197      * any is specified). To stop an event from being processed further in other
18198      * listeners execute {@link Event#stopPropagation}.
18199      *
18200      * Returning anything but `undefined` from a listener will stop the listener
18201      * propagation.
18202      *
18203      * @param {String|Array
18204      *            <String>} events
18205      * @param {Number}
18206      *            [priority=1000] the priority in which this listener is called,
18207      *            larger is higher
18208      * @param {Function}
18209      *            callback
18210      */
18211     EventBus.prototype.on = function(events, priority, callback) {
18212
18213       events = isArray(events) ? events : [events];
18214
18215       if (isFunction(priority)) {
18216         callback = priority;
18217         priority = DEFAULT_PRIORITY;
18218       }
18219
18220       if (!isNumber(priority)) {
18221         throw new Error('priority must be a number');
18222       }
18223
18224       var self = this,
18225         listener = {
18226           priority: priority,
18227           callback: callback
18228         };
18229
18230       events.forEach(function(e) {
18231         self._addListener(e, listener);
18232       });
18233     };
18234
18235
18236     /**
18237      * Register an event listener that is executed only once.
18238      *
18239      * @param {String}
18240      *            event the event name to register for
18241      * @param {Function}
18242      *            callback the callback to execute
18243      */
18244     EventBus.prototype.once = function(event, callback) {
18245
18246       var self = this;
18247
18248       function wrappedCallback() {
18249         callback.apply(self, arguments);
18250         self.off(event, wrappedCallback);
18251       }
18252
18253       this.on(event, wrappedCallback);
18254     };
18255
18256
18257     /**
18258      * Removes event listeners by event and callback.
18259      *
18260      * If no callback is given, all listeners for a given event name are being
18261      * removed.
18262      *
18263      * @param {String}
18264      *            event
18265      * @param {Function}
18266      *            [callback]
18267      */
18268     EventBus.prototype.off = function(event, callback) {
18269       var listeners = this._getListeners(event),
18270         listener, idx;
18271
18272       if (callback) {
18273
18274         // move through listeners from back to front
18275         // and remove matching listeners
18276         for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
18277           if (listener.callback === callback) {
18278             listeners.splice(idx, 1);
18279           }
18280         }
18281       } else {
18282         // clear listeners
18283         listeners.length = 0;
18284       }
18285     };
18286
18287
18288     /**
18289      * Fires a named event.
18290      *
18291      * @example
18292      *  // fire event by name events.fire('foo');
18293      *  // fire event object with nested type var event = { type: 'foo' };
18294      * events.fire(event);
18295      *  // fire event with explicit type var event = { x: 10, y: 20 };
18296      * events.fire('element.moved', event);
18297      *  // pass additional arguments to the event events.on('foo', function(event,
18298      * bar) { alert(bar); });
18299      *
18300      * events.fire({ type: 'foo' }, 'I am bar!');
18301      *
18302      * @param {String}
18303      *            [name] the optional event name
18304      * @param {Object}
18305      *            [event] the event object
18306      * @param {...Object}
18307      *            additional arguments to be passed to the callback functions
18308      *
18309      * @return {Boolean} the events return value, if specified or false if the
18310      *         default action was prevented by listeners
18311      */
18312     EventBus.prototype.fire = function(type, data) {
18313
18314       var event,
18315         originalType,
18316         listeners, idx, listener,
18317         returnValue,
18318         args;
18319
18320       args = Array.prototype.slice.call(arguments);
18321
18322       if (typeof type === 'object') {
18323         event = type;
18324         type = event.type;
18325       }
18326
18327       if (!type) {
18328         throw new Error('no event type specified');
18329       }
18330
18331       listeners = this._listeners[type];
18332
18333       if (!listeners) {
18334         return;
18335       }
18336
18337       // we make sure we fire instances of our home made
18338       // events here. We wrap them only once, though
18339       if (data instanceof Event) {
18340         // we are fine, we alread have an event
18341         event = data;
18342       } else {
18343         event = new Event();
18344         event.init(data);
18345       }
18346
18347       // ensure we pass the event as the first parameter
18348       args[0] = event;
18349
18350       // original event type (in case we delegate)
18351       originalType = event.type;
18352
18353       try {
18354
18355         // update event type before delegation
18356         if (type !== originalType) {
18357           event.type = type;
18358         }
18359
18360         for (idx = 0; !!(listener = listeners[idx]); idx++) {
18361
18362           // handle stopped propagation
18363           if (event.cancelBubble) {
18364             break;
18365           }
18366
18367           try {
18368             // returning false prevents the default action
18369             returnValue = event.returnValue = listener.callback.apply(null, args);
18370
18371             // stop propagation on return value
18372             if (returnValue !== undefined) {
18373               event.stopPropagation();
18374             }
18375
18376             // prevent default on return false
18377             if (returnValue === false) {
18378               event.preventDefault();
18379             }
18380           } catch (e) {
18381             if (!this.handleError(e)) {
18382               console.error('unhandled error in event listener');
18383               console.error(e.stack);
18384
18385               throw e;
18386             }
18387           }
18388         }
18389       } finally {
18390         // reset event type after delegation
18391         if (type !== originalType) {
18392           event.type = originalType;
18393         }
18394       }
18395
18396       // set the return value to false if the event default
18397       // got prevented and no other return value exists
18398       if (returnValue === undefined && event.defaultPrevented) {
18399         returnValue = false;
18400       }
18401
18402       return returnValue;
18403     };
18404
18405
18406     EventBus.prototype.handleError = function(error) {
18407       return this.fire('error', {
18408         error: error
18409       }) === false;
18410     };
18411
18412
18413     /*
18414      * Add new listener with a certain priority to the list of listeners (for the
18415      * given event).
18416      *
18417      * The semantics of listener registration / listener execution are first
18418      * register, first serve: New listeners will always be inserted after existing
18419      * listeners with the same priority.
18420      *
18421      * Example: Inserting two listeners with priority 1000 and 1300
18422      *  * before: [ 1500, 1500, 1000, 1000 ] * after: [ 1500, 1500, (new=1300),
18423      * 1000, 1000, (new=1000) ]
18424      *
18425      * @param {String} event @param {Object} listener { priority, callback }
18426      */
18427     EventBus.prototype._addListener = function(event, newListener) {
18428
18429       var listeners = this._getListeners(event),
18430         existingListener,
18431         idx;
18432
18433       // ensure we order listeners by priority from
18434       // 0 (high) to n > 0 (low)
18435       for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
18436         if (existingListener.priority < newListener.priority) {
18437
18438           // prepend newListener at before existingListener
18439           listeners.splice(idx, 0, newListener);
18440           return;
18441         }
18442       }
18443
18444       listeners.push(newListener);
18445     };
18446
18447
18448     EventBus.prototype._getListeners = function(name) {
18449       var listeners = this._listeners[name];
18450
18451       if (!listeners) {
18452         this._listeners[name] = listeners = [];
18453       }
18454
18455       return listeners;
18456     };
18457
18458
18459     /**
18460      * A event that is emitted via the event bus.
18461      */
18462     function Event() {}
18463
18464     module.exports.Event = Event;
18465
18466     Event.prototype.stopPropagation = function() {
18467       this.cancelBubble = true;
18468     };
18469
18470     Event.prototype.preventDefault = function() {
18471       this.defaultPrevented = true;
18472     };
18473
18474     Event.prototype.init = function(data) {
18475       assign(this, data || {});
18476     };
18477
18478   }, {
18479     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18480     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
18481     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
18482     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18483   }],
18484   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js": [function(require, module, exports) {
18485     'use strict';
18486
18487     var forEach = require('lodash/collection/forEach'),
18488       reduce = require('lodash/collection/reduce');
18489
18490     var GraphicsUtil = require('../util/GraphicsUtil'),
18491       domClear = require('min-dom/lib/clear');
18492
18493     /**
18494      * A factory that creates graphical elements
18495      *
18496      * @param {Renderer}
18497      *            renderer
18498      */
18499     function GraphicsFactory(renderer, elementRegistry) {
18500       this._renderer = renderer;
18501       this._elementRegistry = elementRegistry;
18502     }
18503
18504     GraphicsFactory.$inject = ['renderer', 'elementRegistry'];
18505
18506     module.exports = GraphicsFactory;
18507
18508
18509     GraphicsFactory.prototype._getChildren = function(element) {
18510
18511       var gfx = this._elementRegistry.getGraphics(element);
18512
18513       var childrenGfx;
18514
18515       // root element
18516       if (!element.parent) {
18517         childrenGfx = gfx;
18518       } else {
18519         childrenGfx = GraphicsUtil.getChildren(gfx);
18520         if (!childrenGfx) {
18521           childrenGfx = gfx.parent().group().attr('class', 'djs-children');
18522         }
18523       }
18524
18525       return childrenGfx;
18526     };
18527
18528     /**
18529      * Clears the graphical representation of the element and returns the cleared
18530      * visual (the <g class="djs-visual" /> element).
18531      */
18532     GraphicsFactory.prototype._clear = function(gfx) {
18533       var visual = GraphicsUtil.getVisual(gfx);
18534
18535       domClear(visual.node);
18536
18537       return visual;
18538     };
18539
18540     /**
18541      * Creates a gfx container for shapes and connections
18542      *
18543      * The layout is as follows:
18544      *
18545      * <g class="djs-group">
18546      *
18547      * <!-- the gfx --> <g class="djs-element djs-(shape|connection)"> <g
18548      * class="djs-visual"> <!-- the renderer draws in here --> </g>
18549      *
18550      * <!-- extensions (overlays, click box, ...) goes here </g>
18551      *
18552      * <!-- the gfx child nodes --> <g class="djs-children"></g> </g>
18553      *
18554      * @param {Object}
18555      *            parent
18556      * @param {String}
18557      *            type the type of the element, i.e. shape | connection
18558      */
18559     GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
18560       var outerGfx = parentGfx.group().attr('class', 'djs-group'),
18561         gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
18562
18563       // create visual
18564       gfx.group().attr('class', 'djs-visual');
18565
18566       return gfx;
18567     };
18568
18569     GraphicsFactory.prototype.create = function(type, element) {
18570       var childrenGfx = this._getChildren(element.parent);
18571       return this._createContainer(type, childrenGfx);
18572     };
18573
18574
18575     GraphicsFactory.prototype.updateContainments = function(elements) {
18576
18577       var self = this,
18578         elementRegistry = this._elementRegistry,
18579         parents;
18580
18581
18582       parents = reduce(elements, function(map, e) {
18583
18584         if (e.parent) {
18585           map[e.parent.id] = e.parent;
18586         }
18587
18588         return map;
18589       }, {});
18590
18591       // update all parents of changed and reorganized their children
18592       // in the correct order (as indicated in our model)
18593       forEach(parents, function(parent) {
18594
18595         var childGfx = self._getChildren(parent),
18596           children = parent.children;
18597
18598         if (!children) {
18599           return;
18600         }
18601
18602         forEach(children.slice().reverse(), function(c) {
18603           var gfx = elementRegistry.getGraphics(c);
18604           gfx.parent().prependTo(childGfx);
18605         });
18606       });
18607
18608     };
18609
18610     GraphicsFactory.prototype.update = function(type, element, gfx) {
18611
18612       // Do not update root element
18613       if (!element.parent) {
18614         return;
18615       }
18616
18617       var visual = this._clear(gfx);
18618
18619       // redraw
18620       if (type === 'shape') {
18621         this._renderer.drawShape(visual, element);
18622
18623         // update positioning
18624         gfx.translate(element.x, element.y);
18625       } else
18626       if (type === 'connection') {
18627         this._renderer.drawConnection(visual, element);
18628       } else {
18629         throw new Error('unknown type: ' + type);
18630       }
18631
18632       gfx.attr('display', element.hidden ? 'none' : 'block');
18633     };
18634
18635
18636     GraphicsFactory.prototype.remove = function(element) {
18637       var gfx = this._elementRegistry.getGraphics(element);
18638
18639       // remove
18640       gfx.parent().remove();
18641     };
18642
18643   }, {
18644     "../util/GraphicsUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js",
18645     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
18646     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18647     "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js"
18648   }],
18649   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js": [function(require, module, exports) {
18650     module.exports = {
18651       __depends__: [require('../draw')],
18652       __init__: ['canvas'],
18653       canvas: ['type', require('./Canvas')],
18654       elementRegistry: ['type', require('./ElementRegistry')],
18655       elementFactory: ['type', require('./ElementFactory')],
18656       eventBus: ['type', require('./EventBus')],
18657       graphicsFactory: ['type', require('./GraphicsFactory')]
18658     };
18659   }, {
18660     "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js",
18661     "./Canvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js",
18662     "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
18663     "./ElementRegistry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js",
18664     "./EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
18665     "./GraphicsFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js"
18666   }],
18667   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js": [function(require, module, exports) {
18668     'use strict';
18669
18670     var Snap = require('../../vendor/snapsvg');
18671
18672
18673     /**
18674      * The default renderer used for shapes and connections.
18675      *
18676      * @param {Styles}
18677      *            styles
18678      */
18679     function Renderer(styles) {
18680       this.CONNECTION_STYLE = styles.style(['no-fill'], {
18681         strokeWidth: 5,
18682         stroke: 'fuchsia'
18683       });
18684       this.SHAPE_STYLE = styles.style({
18685         fill: 'white',
18686         stroke: 'fuchsia',
18687         strokeWidth: 2
18688       });
18689     }
18690
18691     module.exports = Renderer;
18692
18693     Renderer.$inject = ['styles'];
18694
18695
18696     Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
18697       return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
18698     };
18699
18700     Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
18701       return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
18702     };
18703
18704     function componentsToPath(components) {
18705       return components.join(',').replace(/,?([A-z]),?/g, '$1');
18706     }
18707
18708     /**
18709      * Gets the default SVG path of a shape that represents it's visual bounds.
18710      *
18711      * @param {djs.model.Shape}
18712      *            shape
18713      * @return {string} svg path
18714      */
18715     Renderer.prototype.getShapePath = function getShapePath(shape) {
18716
18717       var x = shape.x,
18718         y = shape.y,
18719         width = shape.width,
18720         height = shape.height;
18721
18722       var shapePath = [
18723         ['M', x, y],
18724         ['l', width, 0],
18725         ['l', 0, height],
18726         ['l', -width, 0],
18727         ['z']
18728       ];
18729
18730       return componentsToPath(shapePath);
18731     };
18732
18733     /**
18734      * Gets the default SVG path of a connection that represents it's visual bounds.
18735      *
18736      * @param {djs.model.Connection}
18737      *            connection
18738      * @return {string} svg path
18739      */
18740     Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
18741       var waypoints = connection.waypoints;
18742
18743       var idx, point, connectionPath = [];
18744
18745       for (idx = 0; !!(point = waypoints[idx]); idx++) {
18746
18747         // take invisible docking into account
18748         // when creating the path
18749         point = point.original || point;
18750
18751         connectionPath.push([idx === 0 ? 'M' : 'L', point.x, point.y]);
18752       }
18753
18754       return componentsToPath(connectionPath);
18755     };
18756
18757
18758     function toSVGPoints(points) {
18759       var result = '';
18760
18761       for (var i = 0, p; !!(p = points[i]); i++) {
18762         result += p.x + ',' + p.y + ' ';
18763       }
18764
18765       return result;
18766     }
18767
18768     function createLine(points, attrs) {
18769       return Snap.create('polyline', {
18770         points: toSVGPoints(points)
18771       }).attr(attrs || {});
18772     }
18773
18774     function updateLine(gfx, points) {
18775       return gfx.attr({
18776         points: toSVGPoints(points)
18777       });
18778     }
18779
18780     module.exports.createLine = createLine;
18781     module.exports.updateLine = updateLine;
18782   }, {
18783     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
18784   }],
18785   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js": [function(require, module, exports) {
18786     'use strict';
18787
18788     var isArray = require('lodash/lang/isArray'),
18789       assign = require('lodash/object/assign'),
18790       reduce = require('lodash/collection/reduce');
18791
18792
18793     /**
18794      * A component that manages shape styles
18795      */
18796     function Styles() {
18797
18798       var defaultTraits = {
18799
18800         'no-fill': {
18801           fill: 'none'
18802         },
18803         'no-border': {
18804           strokeOpacity: 0.0
18805         },
18806         'no-events': {
18807           pointerEvents: 'none'
18808         }
18809       };
18810
18811       /**
18812        * Builds a style definition from a className, a list of traits and an
18813        * object of additional attributes.
18814        *
18815        * @param {String}
18816        *            className
18817        * @param {Array
18818        *            <String>} traits
18819        * @param {Object}
18820        *            additionalAttrs
18821        *
18822        * @return {Object} the style defintion
18823        */
18824       this.cls = function(className, traits, additionalAttrs) {
18825         var attrs = this.style(traits, additionalAttrs);
18826
18827         return assign(attrs, {
18828           'class': className
18829         });
18830       };
18831
18832       /**
18833        * Builds a style definition from a list of traits and an object of
18834        * additional attributes.
18835        *
18836        * @param {Array
18837        *            <String>} traits
18838        * @param {Object}
18839        *            additionalAttrs
18840        *
18841        * @return {Object} the style defintion
18842        */
18843       this.style = function(traits, additionalAttrs) {
18844
18845         if (!isArray(traits) && !additionalAttrs) {
18846           additionalAttrs = traits;
18847           traits = [];
18848         }
18849
18850         var attrs = reduce(traits, function(attrs, t) {
18851           return assign(attrs, defaultTraits[t] || {});
18852         }, {});
18853
18854         return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
18855       };
18856     }
18857
18858     module.exports = Styles;
18859   }, {
18860     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18861     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18862     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18863   }],
18864   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js": [function(require, module, exports) {
18865     module.exports = {
18866       renderer: ['type', require('./Renderer')],
18867       styles: ['type', require('./Styles')]
18868     };
18869   }, {
18870     "./Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
18871     "./Styles": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js"
18872   }],
18873   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js": [function(require, module, exports) {
18874     'use strict';
18875
18876     var Geometry = require('../../util/Geometry'),
18877       Util = require('./Util');
18878
18879     var MARKER_OK = 'connect-ok',
18880       MARKER_NOT_OK = 'connect-not-ok',
18881       MARKER_CONNECT_HOVER = 'connect-hover',
18882       MARKER_CONNECT_UPDATING = 'djs-updating';
18883
18884     var COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',
18885       COMMAND_RECONNECT_START = 'connection.reconnectStart',
18886       COMMAND_RECONNECT_END = 'connection.reconnectEnd';
18887
18888     var round = Math.round;
18889
18890
18891     /**
18892      * A component that implements moving of bendpoints
18893      */
18894     function BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {
18895
18896       var connectionDocking;
18897
18898       // optional connection docking integration
18899       try {
18900         connectionDocking = injector.get('connectionDocking');
18901       } catch (e) {}
18902
18903
18904       // API
18905
18906       this.start = function(event, connection, bendpointIndex, insert) {
18907
18908         var type,
18909           context,
18910           waypoints = connection.waypoints,
18911           gfx = canvas.getGraphics(connection);
18912
18913         if (!insert && bendpointIndex === 0) {
18914           type = COMMAND_RECONNECT_START;
18915         } else
18916         if (!insert && bendpointIndex === waypoints.length - 1) {
18917           type = COMMAND_RECONNECT_END;
18918         } else {
18919           type = COMMAND_BENDPOINT_UPDATE;
18920         }
18921
18922         context = {
18923           connection: connection,
18924           bendpointIndex: bendpointIndex,
18925           insert: insert,
18926           type: type
18927         };
18928
18929         dragging.activate(event, 'bendpoint.move', {
18930           data: {
18931             connection: connection,
18932             connectionGfx: gfx,
18933             context: context
18934           }
18935         });
18936       };
18937
18938
18939       // DRAGGING IMPLEMENTATION
18940
18941
18942       function redrawConnection(data) {
18943         graphicsFactory.update('connection', data.connection, data.connectionGfx);
18944       }
18945
18946       function filterRedundantWaypoints(waypoints) {
18947         return waypoints.filter(function(r, idx) {
18948           return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);
18949         });
18950       }
18951
18952       eventBus.on('bendpoint.move.start', function(e) {
18953
18954         var context = e.context,
18955           connection = context.connection,
18956           originalWaypoints = connection.waypoints,
18957           waypoints = originalWaypoints.slice(),
18958           insert = context.insert,
18959           idx = context.bendpointIndex;
18960
18961         context.originalWaypoints = originalWaypoints;
18962
18963         if (insert) {
18964           // insert placeholder for bendpoint to-be-added
18965           waypoints.splice(idx, 0, null);
18966         }
18967
18968         connection.waypoints = waypoints;
18969
18970         // add dragger gfx
18971         context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));
18972         context.draggerGfx.addClass('djs-dragging');
18973
18974         canvas.addMarker(connection, MARKER_CONNECT_UPDATING);
18975       });
18976
18977       eventBus.on('bendpoint.move.hover', function(e) {
18978         e.context.hover = e.hover;
18979
18980         canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);
18981       });
18982
18983       eventBus.on([
18984         'bendpoint.move.out',
18985         'bendpoint.move.cleanup'
18986       ], function(e) {
18987
18988         // remove connect marker
18989         // if it was added
18990         var hover = e.context.hover;
18991
18992         if (hover) {
18993           canvas.removeMarker(hover, MARKER_CONNECT_HOVER);
18994           canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);
18995         }
18996       });
18997
18998       eventBus.on('bendpoint.move.move', function(e) {
18999
19000         var context = e.context,
19001           moveType = context.type,
19002           connection = e.connection,
19003           source, target;
19004
19005         connection.waypoints[context.bendpointIndex] = {
19006           x: e.x,
19007           y: e.y
19008         };
19009
19010         if (connectionDocking) {
19011
19012           if (context.hover) {
19013             if (moveType === COMMAND_RECONNECT_START) {
19014               source = context.hover;
19015             }
19016
19017             if (moveType === COMMAND_RECONNECT_END) {
19018               target = context.hover;
19019             }
19020           }
19021
19022           connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);
19023         }
19024
19025         // asks whether reconnect / bendpoint move / bendpoint add
19026         // is allowed at the given position
19027         var allowed = context.allowed = rules.allowed(context.type, context);
19028
19029         if (allowed) {
19030
19031           if (context.hover) {
19032             canvas.removeMarker(context.hover, MARKER_NOT_OK);
19033             canvas.addMarker(context.hover, MARKER_OK);
19034
19035             context.target = context.hover;
19036           }
19037         } else
19038         if (allowed === false) {
19039           if (context.hover) {
19040             canvas.removeMarker(context.hover, MARKER_OK);
19041             canvas.addMarker(context.hover, MARKER_NOT_OK);
19042
19043             context.target = null;
19044           }
19045         }
19046
19047         // add dragger gfx
19048         context.draggerGfx.translate(e.x, e.y);
19049
19050         redrawConnection(e);
19051       });
19052
19053       eventBus.on([
19054         'bendpoint.move.end',
19055         'bendpoint.move.cancel'
19056       ], function(e) {
19057
19058         var context = e.context,
19059           connection = context.connection;
19060
19061         // remove dragger gfx
19062         context.draggerGfx.remove();
19063
19064         context.newWaypoints = connection.waypoints.slice();
19065
19066         connection.waypoints = context.originalWaypoints;
19067
19068         canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);
19069       });
19070
19071       eventBus.on('bendpoint.move.end', function(e) {
19072
19073         var context = e.context,
19074           waypoints = context.newWaypoints,
19075           bendpointIndex = context.bendpointIndex,
19076           bendpoint = waypoints[bendpointIndex],
19077           allowed = context.allowed;
19078
19079         // ensure we have actual pixel values bendpoint
19080         // coordinates (important when zoom level was > 1 during move)
19081         bendpoint.x = round(bendpoint.x);
19082         bendpoint.y = round(bendpoint.y);
19083
19084         if (allowed === true && context.type === COMMAND_RECONNECT_START) {
19085           modeling.reconnectStart(context.connection, context.target, bendpoint);
19086         } else
19087         if (allowed === true && context.type === COMMAND_RECONNECT_END) {
19088           modeling.reconnectEnd(context.connection, context.target, bendpoint);
19089         } else
19090         if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {
19091           modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));
19092         } else {
19093           redrawConnection(e);
19094
19095           return false;
19096         }
19097       });
19098
19099       eventBus.on('bendpoint.move.cancel', function(e) {
19100         redrawConnection(e);
19101       });
19102     }
19103
19104     BendpointMove.$inject = ['injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling'];
19105
19106     module.exports = BendpointMove;
19107   }, {
19108     "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
19109     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js"
19110   }],
19111   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js": [function(require, module, exports) {
19112     'use strict';
19113
19114     var assign = require('lodash/object/assign'),
19115       pick = require('lodash/object/pick'),
19116       forEach = require('lodash/collection/forEach');
19117
19118     var Snap = require('../../../vendor/snapsvg');
19119
19120     var round = Math.round;
19121
19122
19123     function BendpointSnapping(eventBus) {
19124
19125       function snapTo(candidates, point) {
19126         return Snap.snapTo(candidates, point);
19127       }
19128
19129       function toPoint(e) {
19130         return pick(e, ['x', 'y']);
19131       }
19132
19133       function mid(element) {
19134         if (element.width) {
19135           return {
19136             x: round(element.width / 2 + element.x),
19137             y: round(element.height / 2 + element.y)
19138           };
19139         }
19140       }
19141
19142       function getSnapPoints(context) {
19143
19144         var snapPoints = context.snapPoints,
19145           waypoints = context.connection.waypoints,
19146           bendpointIndex = context.bendpointIndex,
19147           referenceWaypoints = [waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1]];
19148
19149         if (!snapPoints) {
19150           context.snapPoints = snapPoints = {
19151             horizontal: [],
19152             vertical: []
19153           };
19154
19155           forEach(referenceWaypoints, function(p) {
19156             // we snap on existing bendpoints only,
19157             // not placeholders that are inserted during add
19158             if (p) {
19159               p = p.original || p;
19160
19161               snapPoints.horizontal.push(p.y);
19162               snapPoints.vertical.push(p.x);
19163             }
19164           });
19165         }
19166
19167         return snapPoints;
19168       }
19169
19170       eventBus.on('bendpoint.move.start', function(event) {
19171         event.context.snapStart = toPoint(event);
19172       });
19173
19174       eventBus.on('bendpoint.move.move', 1500, function(event) {
19175
19176         var context = event.context,
19177           snapPoints = getSnapPoints(context),
19178           start = context.snapStart,
19179           target = context.target,
19180           targetMid = target && mid(target),
19181           x = start.x + event.dx,
19182           y = start.y + event.dy,
19183           sx, sy;
19184
19185         if (!snapPoints) {
19186           return;
19187         }
19188
19189         // snap
19190         sx = snapTo(targetMid ? snapPoints.vertical.concat([targetMid.x]) : snapPoints.vertical, x);
19191         sy = snapTo(targetMid ? snapPoints.horizontal.concat([targetMid.y]) : snapPoints.horizontal, y);
19192
19193
19194         // correction x/y
19195         var cx = (x - sx),
19196           cy = (y - sy);
19197
19198         // update delta
19199         assign(event, {
19200           dx: event.dx - cx,
19201           dy: event.dy - cy,
19202           x: event.x - cx,
19203           y: event.y - cy
19204         });
19205       });
19206     }
19207
19208
19209     BendpointSnapping.$inject = ['eventBus'];
19210
19211     module.exports = BendpointSnapping;
19212   }, {
19213     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19214     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19215     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
19216     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
19217   }],
19218   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js": [function(require, module, exports) {
19219     'use strict';
19220
19221     var domEvent = require('min-dom/lib/event'),
19222       Util = require('./Util');
19223
19224     var BENDPOINT_CLS = Util.BENDPOINT_CLS;
19225
19226
19227     /**
19228      * A service that adds editable bendpoints to connections.
19229      */
19230     function Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {
19231
19232       function getConnectionIntersection(waypoints, event) {
19233         var localPosition = Util.toCanvasCoordinates(canvas, event);
19234         return Util.getApproxIntersection(waypoints, localPosition);
19235       }
19236
19237       function activateBendpointMove(event, connection) {
19238         var waypoints = connection.waypoints,
19239           intersection = getConnectionIntersection(waypoints, event);
19240
19241         if (!intersection) {
19242           return;
19243         }
19244
19245         bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);
19246       }
19247
19248       function getBendpointsContainer(element, create) {
19249
19250         var layer = canvas.getLayer('overlays'),
19251           gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');
19252
19253         if (!gfx && create) {
19254           gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);
19255
19256           domEvent.bind(gfx.node, 'mousedown', function(event) {
19257             activateBendpointMove(event, element);
19258           });
19259         }
19260
19261         return gfx;
19262       }
19263
19264       function createBendpoints(gfx, connection) {
19265         connection.waypoints.forEach(function(p, idx) {
19266           Util.addBendpoint(gfx).translate(p.x, p.y);
19267         });
19268
19269         // add floating bendpoint
19270         Util.addBendpoint(gfx).addClass('floating');
19271       }
19272
19273       function clearBendpoints(gfx) {
19274         gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {
19275           s.remove();
19276         });
19277       }
19278
19279       function addBendpoints(connection) {
19280         var gfx = getBendpointsContainer(connection);
19281
19282         if (!gfx) {
19283           gfx = getBendpointsContainer(connection, true);
19284           createBendpoints(gfx, connection);
19285         }
19286
19287         return gfx;
19288       }
19289
19290       function updateBendpoints(connection) {
19291
19292         var gfx = getBendpointsContainer(connection);
19293
19294         if (gfx) {
19295           clearBendpoints(gfx);
19296           createBendpoints(gfx, connection);
19297         }
19298       }
19299
19300       eventBus.on('connection.changed', function(event) {
19301         updateBendpoints(event.element);
19302       });
19303
19304       eventBus.on('connection.remove', function(event) {
19305         var gfx = getBendpointsContainer(event.element);
19306         if (gfx) {
19307           gfx.remove();
19308         }
19309       });
19310
19311       eventBus.on('element.marker.update', function(event) {
19312
19313         var element = event.element,
19314           bendpointsGfx;
19315
19316         if (!element.waypoints) {
19317           return;
19318         }
19319
19320         bendpointsGfx = addBendpoints(element);
19321         bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);
19322       });
19323
19324       eventBus.on('element.mousemove', function(event) {
19325
19326         var element = event.element,
19327           waypoints = element.waypoints,
19328           bendpointsGfx,
19329           floating,
19330           intersection;
19331
19332         if (waypoints) {
19333
19334           bendpointsGfx = getBendpointsContainer(element, true);
19335           floating = bendpointsGfx.select('.floating');
19336
19337           if (!floating) {
19338             return;
19339           }
19340
19341           intersection = getConnectionIntersection(waypoints, event.originalEvent);
19342
19343           if (intersection) {
19344             floating.translate(intersection.point.x, intersection.point.y);
19345           }
19346         }
19347       });
19348
19349       eventBus.on('element.mousedown', function(event) {
19350
19351         var originalEvent = event.originalEvent,
19352           element = event.element,
19353           waypoints = element.waypoints;
19354
19355         if (!waypoints) {
19356           return;
19357         }
19358
19359         activateBendpointMove(originalEvent, element, waypoints);
19360       });
19361
19362       eventBus.on('selection.changed', function(event) {
19363         var newSelection = event.newSelection,
19364           primary = newSelection[0];
19365
19366         if (primary && primary.waypoints) {
19367           addBendpoints(primary);
19368         }
19369       });
19370
19371       eventBus.on('element.hover', function(event) {
19372         var element = event.element;
19373
19374         if (element.waypoints) {
19375           addBendpoints(element);
19376
19377           interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19378         }
19379       });
19380
19381       eventBus.on('element.out', function(event) {
19382         interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19383       });
19384     }
19385
19386     Bendpoints.$inject = ['injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove'];
19387
19388     module.exports = Bendpoints;
19389   }, {
19390     "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js",
19391     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
19392   }],
19393   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js": [function(require, module, exports) {
19394     'use strict';
19395
19396     var Snap = require('../../../vendor/snapsvg');
19397
19398     var Events = require('../../util/Event'),
19399       Geometry = require('../../util/Geometry');
19400
19401     var BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';
19402
19403     module.exports.toCanvasCoordinates = function(canvas, event) {
19404
19405       var position = Events.toPoint(event),
19406         clientRect = canvas._container.getBoundingClientRect(),
19407         offset;
19408
19409       // canvas relative position
19410
19411       offset = {
19412         x: clientRect.left,
19413         y: clientRect.top
19414       };
19415
19416       // update actual event payload with canvas relative measures
19417
19418       var viewbox = canvas.viewbox();
19419
19420       return {
19421         x: viewbox.x + (position.x - offset.x) / viewbox.scale,
19422         y: viewbox.y + (position.y - offset.y) / viewbox.scale
19423       };
19424     };
19425
19426     module.exports.addBendpoint = function(parentGfx) {
19427       var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);
19428
19429       groupGfx.circle(0, 0, 4).addClass('djs-visual');
19430       groupGfx.circle(0, 0, 10).addClass('djs-hit');
19431
19432       return groupGfx;
19433     };
19434
19435
19436     function circlePath(center, r) {
19437       var x = center.x,
19438         y = center.y;
19439
19440       return [
19441         ['M', x, y],
19442         ['m', 0, -r],
19443         ['a', r, r, 0, 1, 1, 0, 2 * r],
19444         ['a', r, r, 0, 1, 1, 0, -2 * r],
19445         ['z']
19446       ];
19447     }
19448
19449     function linePath(points) {
19450       var segments = [];
19451
19452       points.forEach(function(p, idx) {
19453         segments.push([idx === 0 ? 'M' : 'L', p.x, p.y]);
19454       });
19455
19456       return segments;
19457     }
19458
19459
19460     var INTERSECTION_THRESHOLD = 10;
19461
19462     function getBendpointIntersection(waypoints, reference) {
19463
19464       var i, w;
19465
19466       for (i = 0; !!(w = waypoints[i]); i++) {
19467
19468         if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {
19469           return {
19470             point: waypoints[i],
19471             bendpoint: true,
19472             index: i
19473           };
19474         }
19475       }
19476
19477       return null;
19478     }
19479
19480     function getPathIntersection(waypoints, reference) {
19481
19482       var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
19483
19484       var a = intersections[0],
19485         b = intersections[intersections.length - 1],
19486         idx;
19487
19488       if (!a) {
19489         // no intersection
19490         return null;
19491       }
19492
19493       if (a !== b) {
19494
19495         if (a.segment2 !== b.segment2) {
19496           // we use the bendpoint in between both segments
19497           // as the intersection point
19498
19499           idx = Math.max(a.segment2, b.segment2) - 1;
19500
19501           return {
19502             point: waypoints[idx],
19503             bendpoint: true,
19504             index: idx
19505           };
19506         }
19507
19508         return {
19509           point: {
19510             x: (Math.round(a.x + b.x) / 2),
19511             y: (Math.round(a.y + b.y) / 2)
19512           },
19513           index: a.segment2
19514         };
19515       }
19516
19517       return {
19518         point: {
19519           x: Math.round(a.x),
19520           y: Math.round(a.y)
19521         },
19522         index: a.segment2
19523       };
19524     }
19525
19526     /**
19527      * Returns the closest point on the connection towards a given reference point.
19528      *
19529      * @param {Array
19530      *            <Point>} waypoints
19531      * @param {Point}
19532      *            reference
19533      *
19534      * @return {Object} intersection data (segment, point)
19535      */
19536     module.exports.getApproxIntersection = function(waypoints, reference) {
19537       return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
19538     };
19539   }, {
19540     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19541     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
19542     "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js"
19543   }],
19544   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js": [function(require, module, exports) {
19545     module.exports = {
19546       __depends__: [require('../dragging'), require('../rules')],
19547       __init__: ['bendpoints', 'bendpointSnapping'],
19548       bendpoints: ['type', require('./Bendpoints')],
19549       bendpointMove: ['type', require('./BendpointMove')],
19550       bendpointSnapping: ['type', require('./BendpointSnapping')]
19551     };
19552   }, {
19553     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19554     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19555     "./BendpointMove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js",
19556     "./BendpointSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js",
19557     "./Bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js"
19558   }],
19559   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js": [function(require, module, exports) {
19560     'use strict';
19561
19562     /**
19563      * Adds change support to the diagram, including
19564      *
19565      * <ul>
19566      * <li>redrawing shapes and connections on change</li>
19567      * </ul>
19568      *
19569      * @param {EventBus}
19570      *            eventBus
19571      * @param {ElementRegistry}
19572      *            elementRegistry
19573      * @param {GraphicsFactory}
19574      *            graphicsFactory
19575      */
19576     function ChangeSupport(eventBus, elementRegistry, graphicsFactory) {
19577
19578       // redraw shapes / connections on change
19579
19580       eventBus.on('element.changed', function(event) {
19581
19582         var element = event.element;
19583
19584         if (!event.gfx) {
19585           event.gfx = elementRegistry.getGraphics(element);
19586         }
19587
19588         // shape + gfx may have been deleted
19589         if (!event.gfx) {
19590           return;
19591         }
19592
19593         if (element.waypoints) {
19594           eventBus.fire('connection.changed', event);
19595         } else {
19596           eventBus.fire('shape.changed', event);
19597         }
19598       });
19599
19600       eventBus.on('elements.changed', function(event) {
19601
19602         var elements = event.elements;
19603
19604         elements.forEach(function(e) {
19605           eventBus.fire('element.changed', {
19606             element: e
19607           });
19608         });
19609
19610         graphicsFactory.updateContainments(elements);
19611       });
19612
19613       eventBus.on('shape.changed', function(event) {
19614         graphicsFactory.update('shape', event.element, event.gfx);
19615       });
19616
19617       eventBus.on('connection.changed', function(event) {
19618         graphicsFactory.update('connection', event.element, event.gfx);
19619       });
19620     }
19621
19622     ChangeSupport.$inject = ['eventBus', 'elementRegistry', 'graphicsFactory'];
19623
19624     module.exports = ChangeSupport;
19625
19626   }, {}],
19627   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js": [function(require, module, exports) {
19628     module.exports = {
19629       __init__: ['changeSupport'],
19630       changeSupport: ['type', require('./ChangeSupport')]
19631     };
19632   }, {
19633     "./ChangeSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js"
19634   }],
19635   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js": [function(require, module, exports) {
19636     'use strict';
19637
19638     var LayoutUtil = require('../../layout/LayoutUtil');
19639
19640     var MARKER_OK = 'connect-ok',
19641       MARKER_NOT_OK = 'connect-not-ok';
19642
19643
19644     function Connect(eventBus, dragging, modeling, rules, canvas, renderer) {
19645
19646       // TODO(nre): separate UI and events
19647
19648       // rules
19649
19650       function canConnect(source, target) {
19651         return rules.allowed('connection.create', {
19652           source: source,
19653           target: target
19654         });
19655       }
19656
19657
19658       // layouting
19659
19660       function crop(start, end, source, target) {
19661
19662         var sourcePath = renderer.getShapePath(source),
19663           targetPath = target && renderer.getShapePath(target),
19664           connectionPath = renderer.getConnectionPath({
19665             waypoints: [start, end]
19666           });
19667
19668         start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;
19669         end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;
19670
19671         return [start, end];
19672       }
19673
19674
19675       // event handlers
19676
19677       eventBus.on('connect.move', function(event) {
19678
19679         var context = event.context,
19680           source = context.source,
19681           target = context.target,
19682           visual = context.visual,
19683           start, end, waypoints;
19684
19685         // update connection visuals during drag
19686
19687         start = LayoutUtil.getMidPoint(source);
19688
19689         end = {
19690           x: event.x,
19691           y: event.y
19692         };
19693
19694         waypoints = crop(start, end, source, target);
19695
19696         visual.attr('points', [waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y]);
19697       });
19698
19699       eventBus.on('connect.hover', function(event) {
19700         var context = event.context,
19701           source = context.source,
19702           hover = event.hover,
19703           canExecute;
19704
19705         canExecute = context.canExecute = canConnect(source, hover);
19706
19707         // simply ignore hover
19708         if (canExecute === null) {
19709           return;
19710         }
19711
19712         context.target = hover;
19713
19714         canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
19715       });
19716
19717       eventBus.on(['connect.out', 'connect.cleanup'], function(event) {
19718         var context = event.context;
19719
19720         if (context.target) {
19721           canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
19722         }
19723
19724         context.target = null;
19725       });
19726
19727       eventBus.on('connect.cleanup', function(event) {
19728         var context = event.context;
19729
19730         if (context.visual) {
19731           context.visual.remove();
19732         }
19733       });
19734
19735       eventBus.on('connect.start', function(event) {
19736         var context = event.context,
19737           visual;
19738
19739         visual = canvas.getDefaultLayer().polyline().attr({
19740           'stroke': '#333',
19741           'strokeDasharray': [1],
19742           'strokeWidth': 2,
19743           'pointer-events': 'none'
19744         });
19745
19746         context.visual = visual;
19747       });
19748
19749       eventBus.on('connect.end', function(event) {
19750
19751         var context = event.context,
19752           source = context.source,
19753           target = context.target,
19754           canExecute = context.canExecute || canConnect(source, target);
19755
19756         if (!canExecute) {
19757           return false;
19758         }
19759
19760         modeling.connect(source, target);
19761       });
19762
19763
19764       // API
19765
19766       this.start = function(event, source, autoActivate) {
19767
19768         dragging.activate(event, 'connect', {
19769           autoActivate: autoActivate,
19770           data: {
19771             shape: source,
19772             context: {
19773               source: source
19774             }
19775           }
19776         });
19777       };
19778     }
19779
19780     Connect.$inject = ['eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer'];
19781
19782     module.exports = Connect;
19783   }, {
19784     "../../layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
19785   }],
19786   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js": [function(require, module, exports) {
19787     module.exports = {
19788       __depends__: [
19789         require('../selection'),
19790         require('../rules'),
19791         require('../dragging')
19792       ],
19793       connect: ['type', require('./Connect')]
19794     };
19795
19796   }, {
19797     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19798     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19799     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
19800     "./Connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js"
19801   }],
19802   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js": [function(require, module, exports) {
19803     'use strict';
19804
19805     var isFunction = require('lodash/lang/isFunction'),
19806       forEach = require('lodash/collection/forEach'),
19807
19808       domDelegate = require('min-dom/lib/delegate'),
19809       domClear = require('min-dom/lib/clear'),
19810       domEvent = require('min-dom/lib/event'),
19811       domAttr = require('min-dom/lib/attr'),
19812       domQuery = require('min-dom/lib/query'),
19813       domClasses = require('min-dom/lib/classes'),
19814       domify = require('min-dom/lib/domify');
19815
19816
19817     var entrySelector = '.entry';
19818
19819
19820     /**
19821      * A context pad that displays element specific, contextual actions next to a
19822      * diagram element.
19823      *
19824      * @param {EventBus}
19825      *            eventBus
19826      * @param {Overlays}
19827      *            overlays
19828      */
19829     function ContextPad(eventBus, overlays) {
19830
19831       this._providers = [];
19832
19833       this._eventBus = eventBus;
19834       this._overlays = overlays;
19835
19836       this._current = null;
19837
19838       this._init();
19839     }
19840
19841     ContextPad.$inject = ['eventBus', 'overlays'];
19842
19843     /**
19844      * Registers events needed for interaction with other components
19845      */
19846     ContextPad.prototype._init = function() {
19847
19848       var eventBus = this._eventBus;
19849
19850       var self = this;
19851
19852       eventBus.on('selection.changed', function(e) {
19853
19854         var selection = e.newSelection;
19855
19856         if (selection.length === 1) {
19857           self.open(selection[0]);
19858         } else {
19859           self.close();
19860         }
19861       });
19862     };
19863
19864
19865     /**
19866      * Register a provider with the context pad
19867      *
19868      * @param {ContextPadProvider}
19869      *            provider
19870      */
19871     ContextPad.prototype.registerProvider = function(provider) {
19872       this._providers.push(provider);
19873     };
19874
19875
19876     /**
19877      * Returns the context pad entries for a given element
19878      *
19879      * @param {djs.element.Base}
19880      *            element
19881      *
19882      * @return {Array<ContextPadEntryDescriptor>} list of entries
19883      */
19884     ContextPad.prototype.getEntries = function(element) {
19885       var entries = {};
19886
19887       // loop through all providers and their entries.
19888       // group entries by id so that overriding an entry is possible
19889       forEach(this._providers, function(provider) {
19890         var e = provider.getContextPadEntries(element);
19891
19892         forEach(e, function(entry, id) {
19893           entries[id] = entry;
19894         });
19895       });
19896
19897       return entries;
19898     };
19899
19900
19901     /**
19902      * Trigger an action available on the opened context pad
19903      *
19904      * @param {String}
19905      *            action
19906      * @param {Event}
19907      *            event
19908      */
19909     ContextPad.prototype.trigger = function(action, event, autoActivate) {
19910
19911       var current = this._current,
19912         element = current.element,
19913         entries = current.entries,
19914         entry,
19915         handler,
19916         originalEvent,
19917         button = event.delegateTarget || event.target;
19918
19919       if (!button) {
19920         return event.preventDefault();
19921       }
19922
19923       entry = entries[domAttr(button, 'data-action')];
19924       handler = entry.action;
19925
19926       originalEvent = event.originalEvent || event;
19927
19928       // simple action (via callback function)
19929       if (isFunction(handler)) {
19930         if (action === 'click') {
19931           return handler(originalEvent, element, autoActivate);
19932         }
19933       } else {
19934         if (handler[action]) {
19935           return handler[action](originalEvent, element, autoActivate);
19936         }
19937       }
19938
19939       // silence other actions
19940       event.preventDefault();
19941     };
19942
19943
19944     /**
19945      * Open the context pad for the given element
19946      *
19947      * @param {djs.model.Base}
19948      *            element
19949      */
19950     ContextPad.prototype.open = function(element) {
19951
19952       if (this._current && this._current.open) {
19953
19954         if (this._current.element === element) {
19955           // no change needed
19956           return;
19957         }
19958
19959         this.close();
19960       }
19961
19962       this._updateAndOpen(element);
19963     };
19964
19965
19966     ContextPad.prototype._updateAndOpen = function(element) {
19967
19968       var entries = this.getEntries(element),
19969         pad = this.getPad(element),
19970         html = pad.html;
19971
19972       domClear(html);
19973
19974       forEach(entries, function(entry, id) {
19975         var grouping = entry.group || 'default',
19976           control = domify(entry.html || '<div class="entry" draggable="true"></div>'),
19977           container;
19978
19979         domAttr(control, 'data-action', id);
19980
19981         container = domQuery('[data-group=' + grouping + ']', html);
19982         if (!container) {
19983           container = domify('<div class="group" data-group="' + grouping + '"></div>');
19984           html.appendChild(container);
19985         }
19986
19987         container.appendChild(control);
19988
19989         if (entry.className) {
19990           domClasses(control).add(entry.className);
19991         }
19992
19993         if (entry.title) {
19994           domAttr(control, 'title', entry.title);
19995         }
19996
19997         if (entry.imageUrl) {
19998           control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
19999         }
20000       });
20001
20002       domClasses(html).add('open');
20003
20004       this._current = {
20005         element: element,
20006         pad: pad,
20007         entries: entries,
20008         open: true
20009       };
20010
20011       this._eventBus.fire('contextPad.open', {
20012         current: this._current
20013       });
20014     };
20015
20016     ContextPad.prototype.getPad = function(element) {
20017
20018       var self = this;
20019
20020       var overlays = this._overlays,
20021         pads = overlays.get({
20022           element: element,
20023           type: 'context-pad'
20024         });
20025
20026       // create context pad on demand if needed
20027       if (!pads.length) {
20028
20029         var html = domify('<div class="djs-context-pad"></div>');
20030
20031         domDelegate.bind(html, entrySelector, 'click', function(event) {
20032           self.trigger('click', event);
20033         });
20034
20035         domDelegate.bind(html, entrySelector, 'dragstart', function(event) {
20036           self.trigger('dragstart', event);
20037         });
20038
20039         // stop propagation of mouse events
20040         domEvent.bind(html, 'mousedown', function(event) {
20041           event.stopPropagation();
20042         });
20043
20044
20045         overlays.add(element, 'context-pad', {
20046           position: {
20047             right: -9,
20048             top: -6
20049           },
20050           html: html
20051         });
20052
20053         pads = overlays.get({
20054           element: element,
20055           type: 'context-pad'
20056         });
20057
20058         this._eventBus.fire('contextPad.create', {
20059           element: element,
20060           pad: pads[0]
20061         });
20062       }
20063
20064       return pads[0];
20065     };
20066
20067
20068     /**
20069      * Close the context pad
20070      */
20071     ContextPad.prototype.close = function() {
20072
20073       var html;
20074
20075       if (this._current) {
20076         if (this._current.open) {
20077           html = this._current.pad.html;
20078           domClasses(html).remove('open');
20079         }
20080
20081         this._current.open = false;
20082
20083         this._eventBus.fire('contextPad.close', {
20084           current: this._current
20085         });
20086       }
20087     };
20088
20089
20090     /**
20091      * Return the element the context pad is currently opened for, if it is opened.
20092      *
20093      * @example
20094      *
20095      * contextPad.open(shape1);
20096      *
20097      * if (contextPad.isOpen()) { // yes, we are open }
20098      *
20099      * @return {djs.model.Base} element
20100      */
20101     ContextPad.prototype.isOpen = function() {
20102       return this._current && this._current.open;
20103     };
20104
20105     module.exports = ContextPad;
20106
20107   }, {
20108     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20109     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
20110     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
20111     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
20112     "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
20113     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
20114     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
20115     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
20116     "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
20117   }],
20118   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
20119     module.exports = {
20120       __depends__: [
20121         require('../interaction-events'),
20122         require('../overlays')
20123       ],
20124       contextPad: ['type', require('./ContextPad')]
20125     };
20126   }, {
20127     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
20128     "../overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
20129     "./ContextPad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js"
20130   }],
20131   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js": [function(require, module, exports) {
20132     'use strict';
20133
20134     var MARKER_OK = 'drop-ok',
20135       MARKER_NOT_OK = 'drop-not-ok';
20136
20137
20138     function Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {
20139
20140       // rules
20141
20142       function canCreate(shape, target, source) {
20143
20144         if (source) {
20145           return rules.allowed('shape.append', {
20146             source: source,
20147             shape: shape,
20148             parent: target
20149           });
20150         } else {
20151           return rules.allowed('shape.create', {
20152             shape: shape,
20153             parent: target
20154           });
20155         }
20156       }
20157
20158
20159       // visual helpers
20160
20161       function createVisual(shape) {
20162         var group, preview, visual;
20163
20164         group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
20165
20166         preview = group.group().addClass('djs-dragger');
20167
20168         preview.translate(shape.width / -2, shape.height / -2);
20169
20170         visual = preview.group().addClass('djs-visual');
20171
20172         // hijack renderer to draw preview
20173         renderer.drawShape(visual, shape);
20174
20175         return group;
20176       }
20177
20178
20179       // event handlers
20180
20181       eventBus.on('create.move', function(event) {
20182
20183         var context = event.context,
20184           shape = context.shape,
20185           visual = context.visual;
20186
20187         // lazy init drag visual once we received the first real
20188         // drag move event (this allows us to get the proper canvas local
20189         // coordinates)
20190         if (!visual) {
20191           visual = context.visual = createVisual(shape);
20192         }
20193
20194         visual.translate(event.x, event.y);
20195
20196         var hover = event.hover,
20197           canExecute;
20198
20199         canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);
20200
20201         // ignore hover visually if canExecute is null
20202         if (hover && canExecute !== null) {
20203           context.target = hover;
20204           canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
20205         }
20206       });
20207
20208       eventBus.on(['create.end', 'create.out', 'create.cleanup'], function(event) {
20209         var context = event.context;
20210
20211         if (context.target) {
20212           canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
20213         }
20214       });
20215
20216       eventBus.on('create.end', function(event) {
20217         var context = event.context,
20218           source = context.source,
20219           shape = context.shape,
20220           target = context.target,
20221           canExecute = context.canExecute,
20222           position = {
20223             x: event.x,
20224             y: event.y
20225           };
20226
20227         if (!canExecute) {
20228           return false;
20229         }
20230
20231         if (source) {
20232           modeling.appendShape(source, shape, position, target);
20233         } else {
20234           modeling.createShape(shape, position, target);
20235         }
20236       });
20237
20238
20239       eventBus.on('create.cleanup', function(event) {
20240         var context = event.context;
20241
20242         if (context.visual) {
20243           context.visual.remove();
20244         }
20245       });
20246
20247       // API
20248
20249       this.start = function(event, shape, source) {
20250
20251         dragging.activate(event, 'create', {
20252           cursor: 'grabbing',
20253           autoActivate: true,
20254           data: {
20255             shape: shape,
20256             context: {
20257               shape: shape,
20258               source: source
20259             }
20260           }
20261         });
20262       };
20263     }
20264
20265     Create.$inject = ['eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles'];
20266
20267     module.exports = Create;
20268   }, {}],
20269   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js": [function(require, module, exports) {
20270     module.exports = {
20271       __depends__: [
20272         require('../dragging'),
20273         require('../selection')
20274       ],
20275       create: ['type', require('./Create')]
20276     };
20277   }, {
20278     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
20279     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20280     "./Create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js"
20281   }],
20282   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js": [function(require, module, exports) {
20283     'use strict';
20284
20285     /* global TouchEvent */
20286
20287     var assign = require('lodash/object/assign');
20288
20289     var domEvent = require('min-dom/lib/event'),
20290       Event = require('../../util/Event'),
20291       ClickTrap = require('../../util/ClickTrap'),
20292       Cursor = require('../../util/Cursor');
20293
20294     function suppressEvent(event) {
20295       if (event instanceof MouseEvent) {
20296         Event.stopEvent(event, true);
20297       } else {
20298         Event.preventDefault(event);
20299       }
20300     }
20301
20302     function getLength(point) {
20303       return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
20304     }
20305
20306     function substract(p1, p2) {
20307       return {
20308         x: p1.x - p2.x,
20309         y: p1.y - p2.y
20310       };
20311     }
20312
20313     /**
20314      * A helper that fires canvas localized drag events and realizes the general
20315      * "drag-and-drop" look and feel.
20316      *
20317      * Calling {@link Dragging#activate} activates dragging on a canvas.
20318      *
20319      * It provides the following:
20320      *  * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the
20321      * {@link EventBus}. Each of the events is prefixed with a prefix that is
20322      * assigned during activate. * sets and restores the cursor * sets and restores
20323      * the selection * ensures there can be only one drag operation active at a time
20324      *
20325      * Dragging may be canceled manually by calling {@link Dragging#cancel} or by
20326      * pressing ESC.
20327      *
20328      * @example
20329      *
20330      * function MyDragComponent(eventBus, dragging) {
20331      *
20332      * eventBus.on('mydrag.start', function(event) { console.log('yes, we start
20333      * dragging'); });
20334      *
20335      * eventBus.on('mydrag.move', function(event) { console.log('canvas local
20336      * coordinates', event.x, event.y, event.dx, event.dy);
20337      *  // local drag data is passed with the event event.context.foo; // "BAR"
20338      *  // the original mouse event, too event.originalEvent; // MouseEvent(...) });
20339      *
20340      * eventBus.on('element.click', function(event) { dragging.activate(event,
20341      * 'mydrag', { cursor: 'grabbing', data: { context: { foo: "BAR" } } }); }); }
20342      */
20343     function Dragging(eventBus, canvas, selection) {
20344
20345       var defaultOptions = {
20346         threshold: 5
20347       };
20348
20349       // the currently active drag operation
20350       // dragging is active as soon as this context exists.
20351       //
20352       // it is visually _active_ only when a context.active flag is set to true.
20353       var context;
20354
20355
20356       // helpers
20357
20358       function fire(type) {
20359
20360         var ActualEvent = require('../../core/EventBus').Event;
20361
20362         var event = assign(new ActualEvent(), context.payload, context.data);
20363
20364         // default integration
20365         if (eventBus.fire('drag.' + type, event) === false) {
20366           return false;
20367         }
20368
20369         return eventBus.fire(context.prefix + '.' + type, event);
20370       }
20371
20372       // event listeners
20373
20374       function move(event, activate) {
20375
20376         var payload = context.payload,
20377           start = context.start,
20378           position = Event.toPoint(event),
20379           delta = substract(position, start),
20380           clientRect = canvas._container.getBoundingClientRect(),
20381           offset;
20382
20383         // canvas relative position
20384
20385         offset = {
20386           x: clientRect.left,
20387           y: clientRect.top
20388         };
20389
20390         // update actual event payload with canvas relative measures
20391
20392         var viewbox = canvas.viewbox();
20393
20394         var movement = {
20395           x: viewbox.x + (position.x - offset.x) / viewbox.scale,
20396           y: viewbox.y + (position.y - offset.y) / viewbox.scale,
20397           dx: delta.x / viewbox.scale,
20398           dy: delta.y / viewbox.scale
20399         };
20400
20401         // activate context explicitly or once threshold is reached
20402
20403         if (!context.active && (activate || getLength(delta) > context.threshold)) {
20404
20405           // fire start event with original
20406           // starting coordinates
20407
20408           assign(payload, {
20409             x: movement.x - movement.dx,
20410             y: movement.y - movement.dy,
20411             dx: 0,
20412             dy: 0
20413           }, {
20414             originalEvent: event
20415           });
20416
20417           if (false === fire('start')) {
20418             return cancel();
20419           }
20420
20421           context.active = true;
20422
20423           // unset selection
20424           if (!context.keepSelection) {
20425             context.previousSelection = selection.get();
20426             selection.select(null);
20427           }
20428
20429           // allow custom cursor
20430           if (context.cursor) {
20431             Cursor.set(context.cursor);
20432           }
20433         }
20434
20435         suppressEvent(event);
20436
20437         if (context.active) {
20438
20439           // fire move event with actual coordinates
20440           assign(payload, movement, {
20441             originalEvent: event
20442           });
20443
20444           fire('move');
20445         }
20446       }
20447
20448       function end(event) {
20449
20450         var returnValue = true;
20451
20452         if (context.active) {
20453
20454           if (event) {
20455             context.payload.originalEvent = event;
20456
20457             // suppress original event (click, ...)
20458             // because we just ended a drag operation
20459             suppressEvent(event);
20460           }
20461
20462           // implementations may stop restoring the
20463           // original state (selections, ...) by preventing the
20464           // end events default action
20465           returnValue = fire('end');
20466         }
20467
20468         if (returnValue === false) {
20469           fire('rejected');
20470         }
20471
20472         cleanup(returnValue !== true);
20473       }
20474
20475
20476       // cancel active drag operation if the user presses
20477       // the ESC key on the keyboard
20478
20479       function checkCancel(event) {
20480
20481         if (event.which === 27) {
20482           event.preventDefault();
20483
20484           cancel();
20485         }
20486       }
20487
20488
20489       // prevent ghost click that might occur after a finished
20490       // drag and drop session
20491
20492       function trapClickAndEnd(event) {
20493
20494         var untrap;
20495
20496         // trap the click in case we are part of an active
20497         // drag operation. This will effectively prevent
20498         // the ghost click that cannot be canceled otherwise.
20499         if (context.active) {
20500           untrap = ClickTrap.install();
20501           setTimeout(untrap, 400);
20502         }
20503
20504         end(event);
20505       }
20506
20507       function trapTouch(event) {
20508         move(event);
20509       }
20510
20511       // update the drag events hover (djs.model.Base) and hoverGfx
20512       // (Snap<SVGElement>)
20513       // properties during hover and out and fire {prefix}.hover and {prefix}.out
20514       // properties
20515       // respectively
20516
20517       function hover(event) {
20518         var payload = context.payload;
20519
20520         payload.hoverGfx = event.gfx;
20521         payload.hover = event.element;
20522
20523         fire('hover');
20524       }
20525
20526       function out(event) {
20527         fire('out');
20528
20529         var payload = context.payload;
20530
20531         payload.hoverGfx = null;
20532         payload.hover = null;
20533       }
20534
20535
20536       // life-cycle methods
20537
20538       function cancel(restore) {
20539
20540         if (!context) {
20541           return;
20542         }
20543
20544         if (context.active) {
20545           fire('cancel');
20546         }
20547
20548         cleanup(restore);
20549       }
20550
20551       function cleanup(restore) {
20552
20553         fire('cleanup');
20554
20555         // reset cursor
20556         Cursor.unset();
20557
20558         // reset dom listeners
20559         domEvent.unbind(document, 'mousemove', move);
20560
20561         domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);
20562         domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);
20563
20564         domEvent.unbind(document, 'keyup', checkCancel);
20565
20566         domEvent.unbind(document, 'touchstart', trapTouch, true);
20567         domEvent.unbind(document, 'touchcancel', cancel, true);
20568         domEvent.unbind(document, 'touchmove', move, true);
20569         domEvent.unbind(document, 'touchend', end, true);
20570
20571         eventBus.off('element.hover', hover);
20572         eventBus.off('element.out', out);
20573
20574         // restore selection, unless it has changed
20575         if (restore !== false && context.previousSelection && !selection.get().length) {
20576           selection.select(context.previousSelection);
20577         }
20578
20579         context = null;
20580       }
20581
20582       /**
20583        * Activate a drag operation
20584        *
20585        * @param {MouseEvent|TouchEvent}
20586        *            [event]
20587        * @param {String}
20588        *            prefix
20589        * @param {Object}
20590        *            [options]
20591        */
20592       function activate(event, prefix, options) {
20593
20594         // only one drag operation may be active, at a time
20595         if (context) {
20596           cancel(false);
20597         }
20598
20599         options = assign({}, defaultOptions, options || {});
20600
20601         var data = options.data || {},
20602           originalEvent,
20603           start;
20604
20605         if (event) {
20606           originalEvent = Event.getOriginal(event) || event;
20607           start = Event.toPoint(event);
20608
20609           suppressEvent(event);
20610         } else {
20611           originalEvent = null;
20612           start = {
20613             x: 0,
20614             y: 0
20615           };
20616         }
20617
20618         context = assign({
20619           prefix: prefix,
20620           data: data,
20621           payload: {},
20622           start: start
20623         }, options);
20624
20625         // skip dom registration if trigger
20626         // is set to manual (during testing)
20627         if (!options.manual) {
20628
20629           // add dom listeners
20630
20631           // fixes TouchEvent not being available on desktop Firefox
20632           if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
20633             domEvent.bind(document, 'touchstart', trapTouch, true);
20634             domEvent.bind(document, 'touchcancel', cancel, true);
20635             domEvent.bind(document, 'touchmove', move, true);
20636             domEvent.bind(document, 'touchend', end, true);
20637           } else {
20638             // assume we use the mouse to interact per default
20639             domEvent.bind(document, 'mousemove', move);
20640
20641             domEvent.bind(document, 'mousedown', trapClickAndEnd, true);
20642             domEvent.bind(document, 'mouseup', trapClickAndEnd, true);
20643           }
20644
20645           domEvent.bind(document, 'keyup', checkCancel);
20646
20647           eventBus.on('element.hover', hover);
20648           eventBus.on('element.out', out);
20649         }
20650
20651         fire('activate');
20652
20653         if (options.autoActivate) {
20654           move(event, true);
20655         }
20656       }
20657
20658       // cancel on diagram destruction
20659       eventBus.on('diagram.destroy', cancel);
20660
20661
20662       // API
20663
20664       this.activate = activate;
20665       this.move = move;
20666       this.hover = hover;
20667       this.out = out;
20668       this.end = end;
20669
20670       this.cancel = cancel;
20671
20672       // for introspection
20673
20674       this.active = function() {
20675         return context;
20676       };
20677
20678       this.setOptions = function(options) {
20679         assign(defaultOptions, options);
20680       };
20681     }
20682
20683     Dragging.$inject = ['eventBus', 'canvas', 'selection'];
20684
20685     module.exports = Dragging;
20686   }, {
20687     "../../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
20688     "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
20689     "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
20690     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
20691     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
20692     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
20693   }],
20694   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js": [function(require, module, exports) {
20695     module.exports = {
20696       __depends__: [
20697         require('../selection')
20698       ],
20699       dragging: ['type', require('./Dragging')]
20700     };
20701   }, {
20702     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20703     "./Dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js"
20704   }],
20705   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js": [function(require, module, exports) {
20706     'use strict';
20707
20708     var forEach = require('lodash/collection/forEach'),
20709       domDelegate = require('min-dom/lib/delegate'),
20710       Renderer = require('../../draw/Renderer'),
20711       createLine = Renderer.createLine,
20712       updateLine = Renderer.updateLine;
20713
20714
20715     var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
20716
20717     var Snap = require('../../../vendor/snapsvg');
20718
20719     /**
20720      * A plugin that provides interaction events for diagram elements.
20721      *
20722      * It emits the following events:
20723      *  * element.hover * element.out * element.click * element.dblclick *
20724      * element.mousedown
20725      *
20726      * Each event is a tuple { element, gfx, originalEvent }.
20727      *
20728      * Canceling the event via Event#preventDefault() prevents the original DOM
20729      * operation.
20730      *
20731      * @param {EventBus}
20732      *            eventBus
20733      */
20734     function InteractionEvents(eventBus, elementRegistry, styles) {
20735
20736       var HIT_STYLE = styles.cls('djs-hit', ['no-fill', 'no-border'], {
20737         stroke: 'white',
20738         strokeWidth: 15
20739       });
20740
20741       function fire(type, event) {
20742         var target = event.delegateTarget || event.target,
20743           gfx = target && new Snap(target),
20744           element = elementRegistry.get(gfx),
20745           returnValue;
20746
20747         if (!gfx || !element) {
20748           return;
20749         }
20750
20751         returnValue = eventBus.fire(type, {
20752           element: element,
20753           gfx: gfx,
20754           originalEvent: event
20755         });
20756
20757         if (returnValue === false) {
20758           event.stopPropagation();
20759           event.preventDefault();
20760         }
20761       }
20762
20763       var handlers = {};
20764
20765       function mouseHandler(type) {
20766
20767         var fn = handlers[type];
20768
20769         if (!fn) {
20770           fn = handlers[type] = function(event) {
20771             // only indicate left mouse button interactions
20772             if (isPrimaryButton(event)) {
20773               fire(type, event);
20774             }
20775           };
20776         }
20777
20778         return fn;
20779       }
20780
20781       var bindings = {
20782         mouseover: 'element.hover',
20783         mouseout: 'element.out',
20784         click: 'element.click',
20785         dblclick: 'element.dblclick',
20786         mousedown: 'element.mousedown',
20787         mouseup: 'element.mouseup',
20788         keydown: 'element.keyup'
20789
20790       };
20791
20792       var elementSelector = 'svg, .djs-element';
20793
20794       // /// event registration
20795
20796       function registerEvent(node, event, localEvent) {
20797         var handler = mouseHandler(localEvent);
20798         handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
20799       }
20800
20801       function unregisterEvent(node, event, localEvent) {
20802         domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
20803       }
20804
20805       function registerEvents(svg) {
20806         forEach(bindings, function(val, key) {
20807           registerEvent(svg.node, key, val);
20808         });
20809       }
20810
20811       function unregisterEvents(svg) {
20812         forEach(bindings, function(val, key) {
20813           unregisterEvent(svg.node, key, val);
20814         });
20815       }
20816
20817       eventBus.on('canvas.destroy', function(event) {
20818         unregisterEvents(event.svg);
20819       });
20820
20821       eventBus.on('canvas.init', function(event) {
20822         registerEvents(event.svg);
20823       });
20824
20825
20826       eventBus.on(['shape.added', 'connection.added'], function(event) {
20827         var element = event.element,
20828           gfx = event.gfx,
20829           hit,
20830           type;
20831
20832         if (element.waypoints) {
20833           hit = createLine(element.waypoints);
20834           type = 'connection';
20835         } else {
20836           hit = Snap.create('rect', {
20837             x: 0,
20838             y: 0,
20839             width: element.width,
20840             height: element.height
20841           });
20842           type = 'shape';
20843         }
20844
20845         hit.attr(HIT_STYLE).appendTo(gfx.node);
20846       });
20847
20848       // update djs-hit on change
20849
20850       eventBus.on('shape.changed', function(event) {
20851
20852         var element = event.element,
20853           gfx = event.gfx,
20854           hit = gfx.select('.djs-hit');
20855
20856         hit.attr({
20857           width: element.width,
20858           height: element.height
20859         });
20860       });
20861
20862       eventBus.on('connection.changed', function(event) {
20863
20864         var element = event.element,
20865           gfx = event.gfx,
20866           hit = gfx.select('.djs-hit');
20867
20868         updateLine(hit, element.waypoints);
20869       });
20870
20871
20872       // API
20873
20874       this.fire = fire;
20875
20876       this.mouseHandler = mouseHandler;
20877
20878       this.registerEvent = registerEvent;
20879       this.unregisterEvent = unregisterEvent;
20880     }
20881
20882
20883     InteractionEvents.$inject = ['eventBus', 'elementRegistry', 'styles'];
20884
20885     module.exports = InteractionEvents;
20886
20887
20888     /**
20889      * An event indicating that the mouse hovered over an element
20890      *
20891      * @event element.hover
20892      *
20893      * @type {Object}
20894      * @property {djs.model.Base} element
20895      * @property {Snap<Element>} gfx
20896      * @property {Event} originalEvent
20897      */
20898
20899     /**
20900      * An event indicating that the mouse has left an element
20901      *
20902      * @event element.out
20903      *
20904      * @type {Object}
20905      * @property {djs.model.Base} element
20906      * @property {Snap<Element>} gfx
20907      * @property {Event} originalEvent
20908      */
20909
20910     /**
20911      * An event indicating that the mouse has clicked an element
20912      *
20913      * @event element.click
20914      *
20915      * @type {Object}
20916      * @property {djs.model.Base} element
20917      * @property {Snap<Element>} gfx
20918      * @property {Event} originalEvent
20919      */
20920
20921     /**
20922      * An event indicating that the mouse has double clicked an element
20923      *
20924      * @event element.dblclick
20925      *
20926      * @type {Object}
20927      * @property {djs.model.Base} element
20928      * @property {Snap<Element>} gfx
20929      * @property {Event} originalEvent
20930      */
20931
20932     /**
20933      * An event indicating that the mouse has gone down on an element.
20934      *
20935      * @event element.mousedown
20936      *
20937      * @type {Object}
20938      * @property {djs.model.Base} element
20939      * @property {Snap<Element>} gfx
20940      * @property {Event} originalEvent
20941      */
20942
20943     /**
20944      * An event indicating that the mouse has gone up on an element.
20945      *
20946      * @event element.mouseup
20947      *
20948      * @type {Object}
20949      * @property {djs.model.Base} element
20950      * @property {Snap<Element>} gfx
20951      * @property {Event} originalEvent
20952      */
20953   }, {
20954     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
20955     "../../draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
20956     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
20957     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20958     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js"
20959   }],
20960   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js": [function(require, module, exports) {
20961     module.exports = {
20962       __init__: ['interactionEvents'],
20963       interactionEvents: ['type', require('./InteractionEvents')]
20964     };
20965   }, {
20966     "./InteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js"
20967   }],
20968   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js": [function(require, module, exports) {
20969     'use strict';
20970
20971     var domEvent = require('min-dom/lib/event'),
20972       domMatches = require('min-dom/lib/matches');
20973     //keyboard.bindTo=DOMElement;
20974     // var $ = require('jquery'),
20975
20976
20977
20978
20979     /**
20980      * A keyboard abstraction that may be activated and
20981      * deactivated by users at will, consuming key events
20982      * and triggering diagram actions.
20983      *
20984      * The implementation fires the following key events that allow
20985      * other components to hook into key handling:
20986      *
20987      *  - keyboard.bind
20988      *  - keyboard.unbind
20989      *  - keyboard.init
20990      *  - keyboard.destroy
20991      *
20992      * All events contain the fields (node, listeners).
20993      *
20994      * A default binding for the keyboard may be specified via the
20995      * `keyboard.bindTo` configuration option.
20996      *
20997      * @param {EventBus} eventBus
20998      * @param {CommandStack} commandStack
20999      * @param {Modeling} modeling
21000      * @param {Selection} selection
21001      *
21002      */
21003
21004     function Keyboard(config, eventBus, commandStack, modeling, selection, zoomScroll, canvas) {
21005
21006       $(document).keydown(function(e) {
21007         if (commandStack._selectedModel == selected_model) {
21008           if (commandStack._eventBus._listeners != null) {
21009
21010             var model_commandStack = [];
21011             for (var i = 0; i < commandStackList.length; i++) {
21012               if (commandStackList[i]._selectedModel == selected_model) {
21013                 if (commandStackList[i]._stack.length > 0) {
21014                   model_commandStack.push(commandStackList[i]);
21015                 }
21016               }
21017             }
21018
21019             var selected_commandStack;
21020             for (var i = model_commandStack.length - 1; i >= 0; i--) {
21021               if (model_commandStack[i]._stackIdx > -1) {
21022                 selected_commandStack = model_commandStack[i];
21023                 break;
21024               }
21025             }
21026
21027             if (e.which == 90 && e.ctrlKey) {
21028               if (commandStack == selected_commandStack) {
21029                 commandStack.undo();
21030                 return true;
21031               }
21032             } else if (e.which == 89 && e.ctrlKey) {
21033               commandStack.redo();
21034               return true;
21035             }
21036           }
21037
21038
21039         }
21040
21041
21042       });
21043
21044       var self = this;
21045
21046       this._commandStack = commandStack;
21047       this._modeling = modeling;
21048       this._selection = selection;
21049       this._eventBus = eventBus;
21050       this._zoomScroll = zoomScroll;
21051       this._canvas = canvas;
21052
21053       this._listeners = [];
21054
21055       // our key handler is a singleton that passes
21056       // (keycode, modifiers) to each listener.
21057       //
21058       // listeners must indicate that they handled a key event
21059       // by returning true. This stops the event propagation.
21060       //
21061       this._keyHandler = function(event) {
21062
21063         var i, l,
21064           target = event.target,
21065           listeners = self._listeners,
21066           code = event.keyCode || event.charCode || -1;
21067
21068         if (domMatches(target, 'input, textarea')) {
21069           return;
21070         }
21071
21072         for (i = 0; !!(l = listeners[i]); i++) {
21073           if (l(code, event)) {
21074             event.preventDefault();
21075             event.stopPropagation();
21076           }
21077         }
21078       };
21079
21080       // properly clean dom registrations
21081       eventBus.on('diagram.destroy', function() {
21082         self._fire('destroy');
21083
21084         self.unbind();
21085         self._listeners = null;
21086       });
21087
21088       eventBus.on('diagram.init', function() {
21089         self._fire('init');
21090
21091         if (config && config.bindTo) {
21092           self.bind(config.bindTo);
21093         }
21094       });
21095
21096       this._init();
21097     }
21098
21099     Keyboard.$inject = [
21100       'config.keyboard',
21101       'eventBus',
21102       'commandStack',
21103       'modeling',
21104       'selection',
21105       'zoomScroll',
21106       'canvas'
21107     ];
21108
21109     module.exports = Keyboard;
21110
21111
21112     Keyboard.prototype.bind = function(node) {
21113       this._node = node;
21114
21115       // bind key events
21116       domEvent.bind(node, 'keydown', this._keyHandler, true);
21117
21118       this._fire('bind');
21119     };
21120
21121     Keyboard.prototype.getBinding = function() {
21122       return this._node;
21123     };
21124
21125     Keyboard.prototype.unbind = function() {
21126       var node = this._node;
21127
21128       if (node) {
21129         this._fire('unbind');
21130
21131         // unbind key events
21132         domEvent.unbind(node, 'keydown', this._keyHandler, true);
21133       }
21134
21135       this._node = null;
21136     };
21137
21138
21139     Keyboard.prototype._fire = function(event) {
21140       this._eventBus.fire('keyboard.' + event, {
21141         node: this._node,
21142         listeners: this._listeners
21143       });
21144
21145
21146     };
21147
21148
21149
21150     Keyboard.prototype._init = function() {
21151
21152       var listeners = this._listeners,
21153         commandStack = this._commandStack,
21154         modeling = this._modeling,
21155         selection = this._selection,
21156         zoomScroll = this._zoomScroll,
21157         canvas = this._canvas;
21158
21159       // init default listeners
21160
21161       // undo
21162       // (CTRL|CMD) + Z
21163       function undo(key, modifiers) {
21164
21165         if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {
21166           commandStack.undo();
21167
21168           return true;
21169         }
21170       }
21171
21172       // redo
21173       // CTRL + Y
21174       // CMD + SHIFT + Z
21175       function redo(key, modifiers) {
21176
21177         if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {
21178           commandStack.redo();
21179
21180           return true;
21181         }
21182       }
21183
21184       /**
21185        * zoom in one step
21186        * CTRL + +
21187        *
21188        * 107 = numpad plus
21189        * 187 = regular plus
21190        * 171 = regular plus in Firefox (german keyboard layout)
21191        *  61 = regular plus in Firefox (US keyboard layout)
21192        */
21193       function zoomIn(key, modifiers) {
21194
21195         if ((key === 107 || key === 187 || key === 171 || key === 61) && isCmd(modifiers)) {
21196
21197           zoomScroll.stepZoom(1);
21198
21199           return true;
21200         }
21201       }
21202
21203       /**
21204        * zoom out one step
21205        * CTRL + -
21206        *
21207        * 109 = numpad minus
21208        * 189 = regular minus
21209        * 173 = regular minus in Firefox (US and german keyboard layout)
21210        */
21211       function zoomOut(key, modifiers) {
21212
21213         if ((key === 109 || key === 189 || key === 173) && isCmd(modifiers)) {
21214
21215           zoomScroll.stepZoom(-1);
21216
21217           return true;
21218         }
21219       }
21220
21221       /**
21222        * zoom to the default level
21223        * CTRL + 0
21224        *
21225        * 96 = numpad zero
21226        * 48 = regular zero
21227        */
21228       function zoomDefault(key, modifiers) {
21229
21230         if ((key === 96 || key === 48) && isCmd(modifiers)) {
21231
21232           canvas.zoom(1);
21233
21234           return true;
21235         }
21236       }
21237
21238       // delete selected element
21239       // DEL
21240       function remove(key, modifiers) {
21241
21242         if (key === 46) {
21243
21244           var selectedElements = selection.get();
21245           console.log(selectedElements);
21246           if (selectedElements.length) {
21247             modeling.removeElements(selectedElements.slice());
21248           }
21249
21250           return true;
21251         }
21252       }
21253
21254       listeners.push(undo);
21255       listeners.push(redo);
21256       listeners.push(remove);
21257       listeners.push(zoomIn);
21258       listeners.push(zoomOut);
21259       listeners.push(zoomDefault);
21260     };
21261
21262
21263     /**
21264      * Add a listener function that is notified with (key, modifiers) whenever
21265      * the keyboard is bound and the user presses a key.
21266      *
21267      * @param {Function} listenerFn
21268      */
21269     Keyboard.prototype.addListener = function(listenerFn) {
21270
21271       this._listeners.push(listenerFn);
21272     };
21273
21274     Keyboard.prototype.hasModifier = hasModifier;
21275     Keyboard.prototype.isCmd = isCmd;
21276     Keyboard.prototype.isShift = isShift;
21277
21278
21279     function hasModifier(modifiers) {
21280       return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);
21281     }
21282
21283     function isCmd(modifiers) {
21284       return modifiers.ctrlKey || modifiers.metaKey;
21285     }
21286
21287     function isShift(modifiers) {
21288       return modifiers.shiftKey;
21289     }
21290
21291   }, {
21292     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
21293     "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js"
21294   }],
21295   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
21296     module.exports = {
21297       __init__: ['keyboard'],
21298       keyboard: ['type', require('./Keyboard')]
21299     };
21300
21301   }, {
21302     "./Keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js"
21303   }],
21304   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js": [function(require, module, exports) {
21305     'use strict';
21306
21307     var values = require('lodash/object/values');
21308
21309     var getEnclosedElements = require('../../util/Elements').getEnclosedElements;
21310
21311     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
21312
21313     var Snap = require('../../../vendor/snapsvg');
21314
21315
21316     function LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {
21317
21318       this._selection = selection;
21319       this._dragging = dragging;
21320
21321       var self = this;
21322
21323       // lasso visuals implementation
21324
21325       /**
21326        * A helper that realizes the selection box visual
21327        */
21328       var visuals = {
21329
21330         create: function(context) {
21331           var container = canvas.getDefaultLayer(),
21332             frame;
21333
21334           frame = context.frame = Snap.create('rect', {
21335             class: 'djs-lasso-overlay',
21336             width: 1,
21337             height: 1,
21338             x: 0,
21339             y: 0
21340           });
21341
21342           frame.appendTo(container);
21343         },
21344
21345         update: function(context) {
21346           var frame = context.frame,
21347             bbox = context.bbox;
21348
21349           frame.attr({
21350             x: bbox.x,
21351             y: bbox.y,
21352             width: bbox.width,
21353             height: bbox.height
21354           });
21355         },
21356
21357         remove: function(context) {
21358
21359           if (context.frame) {
21360             context.frame.remove();
21361           }
21362         }
21363       };
21364
21365
21366       eventBus.on('lasso.selection.end', function(event) {
21367
21368         setTimeout(function() {
21369           self.activateLasso(event.originalEvent, true);
21370         });
21371       });
21372
21373       // lasso interaction implementation
21374
21375       eventBus.on('lasso.end', function(event) {
21376
21377         var bbox = toBBox(event);
21378
21379         var elements = elementRegistry.filter(function(element) {
21380           return element;
21381         });
21382
21383         self.select(elements, bbox);
21384       });
21385
21386       eventBus.on('lasso.start', function(event) {
21387
21388         var context = event.context;
21389
21390         context.bbox = toBBox(event);
21391         visuals.create(context);
21392       });
21393
21394       eventBus.on('lasso.move', function(event) {
21395
21396         var context = event.context;
21397
21398         context.bbox = toBBox(event);
21399         visuals.update(context);
21400       });
21401
21402       eventBus.on('lasso.end', function(event) {
21403
21404         var context = event.context;
21405
21406         visuals.remove(context);
21407       });
21408
21409       eventBus.on('lasso.cleanup', function(event) {
21410
21411         var context = event.context;
21412
21413         visuals.remove(context);
21414       });
21415
21416
21417       // event integration
21418
21419       eventBus.on('element.mousedown', 1500, function(event) {
21420
21421         if (hasPrimaryModifier(event)) {
21422           self.activateLasso(event.originalEvent);
21423
21424           event.stopPropagation();
21425         }
21426       });
21427     }
21428
21429     LassoTool.$inject = [
21430       'eventBus',
21431       'canvas',
21432       'dragging',
21433       'elementRegistry',
21434       'selection'
21435     ];
21436
21437     module.exports = LassoTool;
21438
21439
21440     LassoTool.prototype.activateLasso = function(event, autoActivate) {
21441
21442       this._dragging.activate(event, 'lasso', {
21443         autoActivate: autoActivate,
21444         cursor: 'crosshair',
21445         data: {
21446           context: {}
21447         }
21448       });
21449     };
21450
21451     LassoTool.prototype.activateSelection = function(event) {
21452
21453       this._dragging.activate(event, 'lasso.selection', {
21454         cursor: 'crosshair'
21455       });
21456     };
21457
21458     LassoTool.prototype.select = function(elements, bbox) {
21459       var selectedElements = getEnclosedElements(elements, bbox);
21460
21461       this._selection.select(values(selectedElements));
21462     };
21463
21464
21465     function toBBox(event) {
21466
21467       var start = {
21468
21469         x: event.x - event.dx,
21470         y: event.y - event.dy
21471       };
21472
21473       var end = {
21474         x: event.x,
21475         y: event.y
21476       };
21477
21478       var bbox;
21479
21480       if ((start.x <= end.x && start.y < end.y) ||
21481         (start.x < end.x && start.y <= end.y)) {
21482
21483         bbox = {
21484           x: start.x,
21485           y: start.y,
21486           width: end.x - start.x,
21487           height: end.y - start.y
21488         };
21489       } else if ((start.x >= end.x && start.y < end.y) ||
21490         (start.x > end.x && start.y <= end.y)) {
21491
21492         bbox = {
21493           x: end.x,
21494           y: start.y,
21495           width: start.x - end.x,
21496           height: end.y - start.y
21497         };
21498       } else if ((start.x <= end.x && start.y > end.y) ||
21499         (start.x < end.x && start.y >= end.y)) {
21500
21501         bbox = {
21502           x: start.x,
21503           y: end.y,
21504           width: end.x - start.x,
21505           height: start.y - end.y
21506         };
21507       } else if ((start.x >= end.x && start.y > end.y) ||
21508         (start.x > end.x && start.y >= end.y)) {
21509
21510         bbox = {
21511           x: end.x,
21512           y: end.y,
21513           width: start.x - end.x,
21514           height: start.y - end.y
21515         };
21516       } else {
21517
21518         bbox = {
21519           x: end.x,
21520           y: end.y,
21521           width: 0,
21522           height: 0
21523         };
21524       }
21525       return bbox;
21526     }
21527   }, {
21528     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
21529     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
21530     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
21531     "lodash/object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
21532   }],
21533   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js": [function(require, module, exports) {
21534     'use strict';
21535
21536     module.exports = {
21537       __init__: ['lassoTool'],
21538       lassoTool: ['type', require('./LassoTool')]
21539     };
21540
21541   }, {
21542     "./LassoTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js"
21543   }],
21544   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
21545     'use strict';
21546
21547     var forEach = require('lodash/collection/forEach');
21548
21549     var model = require('../../model');
21550
21551
21552     /**
21553      * The basic modeling entry point.
21554      *
21555      * @param {EventBus}
21556      *            eventBus
21557      * @param {ElementFactory}
21558      *            elementFactory
21559      * @param {CommandStack}
21560      *            commandStack
21561      */
21562     function Modeling(eventBus, elementFactory, commandStack) {
21563       this._eventBus = eventBus;
21564       this._elementFactory = elementFactory;
21565       this._commandStack = commandStack;
21566       var self = this;
21567
21568       eventBus.on('diagram.init', function() {
21569         // register modeling handlers
21570         self.registerHandlers(commandStack);
21571       });
21572     }
21573
21574     Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack'];
21575
21576     module.exports = Modeling;
21577
21578
21579     Modeling.prototype.getHandlers = function() {
21580       return {
21581         'shape.append': require('./cmd/AppendShapeHandler'),
21582         'shape.create': require('./cmd/CreateShapeHandler'),
21583         'shape.delete': require('./cmd/DeleteShapeHandler'),
21584         'shape.move': require('./cmd/MoveShapeHandler'),
21585         'shapes.move': require('./cmd/MoveShapesHandler'),
21586         'shape.resize': require('./cmd/ResizeShapeHandler'),
21587         'shape.replace': require('./cmd/ReplaceShapeHandler'),
21588
21589         'spaceTool': require('./cmd/SpaceToolHandler'),
21590
21591         'label.create': require('./cmd/CreateLabelHandler'),
21592
21593         'connection.create': require('./cmd/CreateConnectionHandler'),
21594         'connection.delete': require('./cmd/DeleteConnectionHandler'),
21595         'connection.move': require('./cmd/MoveConnectionHandler'),
21596         'connection.layout': require('./cmd/LayoutConnectionHandler'),
21597
21598         'connection.updateWaypoints': require('./cmd/UpdateWaypointsHandler'),
21599
21600         'connection.reconnectStart': require('./cmd/ReconnectConnectionHandler'),
21601         'connection.reconnectEnd': require('./cmd/ReconnectConnectionHandler'),
21602
21603         'elements.delete': require('./cmd/DeleteElementsHandler'),
21604         'element.updateAnchors': require('./cmd/UpdateAnchorsHandler')
21605       };
21606     };
21607
21608     /**
21609      * Register handlers with the command stack
21610      *
21611      * @param {CommandStack}
21612      *            commandStack
21613      */
21614     Modeling.prototype.registerHandlers = function(commandStack) {
21615       forEach(this.getHandlers(), function(handler, id) {
21616         commandStack.registerHandler(id, handler);
21617       });
21618     };
21619
21620
21621     // /// modeling helpers /////////////////////////////////////////
21622
21623
21624     Modeling.prototype.moveShape = function(shape, delta, newParent, hints) {
21625
21626       var context = {
21627         shape: shape,
21628         delta: delta,
21629         newParent: newParent,
21630         hints: hints || {}
21631       };
21632
21633       this._commandStack.execute('shape.move', context);
21634     };
21635
21636
21637     Modeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {
21638
21639       var context = {
21640         shapes: shapes,
21641         delta: delta,
21642         newParent: newParent,
21643         hints: hints || {}
21644       };
21645
21646       this._commandStack.execute('shapes.move', context);
21647     };
21648
21649     /**
21650      * Update the anchors on the element with the given delta movement
21651      *
21652      * @param {djs.model.Element}
21653      *            element
21654      * @param {Point}
21655      *            delta
21656      */
21657     Modeling.prototype.updateAnchors = function(element, delta) {
21658       var context = {
21659         element: element,
21660         delta: delta
21661       };
21662
21663       this._commandStack.execute('element.updateAnchors', context);
21664     };
21665
21666     Modeling.prototype.moveConnection = function(connection, delta, newParent, hints) {
21667
21668       var context = {
21669         connection: connection,
21670         delta: delta,
21671         newParent: newParent,
21672         hints: hints || {}
21673       };
21674
21675       this._commandStack.execute('connection.move', context);
21676     };
21677
21678
21679     Modeling.prototype.layoutConnection = function(connection, hints) {
21680
21681       var context = {
21682         connection: connection,
21683         hints: hints || {}
21684       };
21685
21686       this._commandStack.execute('connection.layout', context);
21687     };
21688
21689
21690     Modeling.prototype.createConnection = function(source, target, connection, parent) {
21691
21692       connection = this._create('connection', connection);
21693
21694       var context = {
21695         source: source,
21696         target: target,
21697         parent: parent,
21698         connection: connection
21699       };
21700
21701       this._commandStack.execute('connection.create', context);
21702
21703       return context.connection;
21704     };
21705
21706     Modeling.prototype.createShape = function(shape, position, parent) {
21707
21708       shape = this._create('shape', shape);
21709
21710       var context = {
21711         position: position,
21712         parent: parent,
21713         shape: shape
21714       };
21715
21716       this._commandStack.execute('shape.create', context);
21717
21718       return context.shape;
21719     };
21720
21721
21722     Modeling.prototype.createLabel = function(labelTarget, position, label, parent) {
21723
21724       label = this._create('label', label);
21725
21726       var context = {
21727         labelTarget: labelTarget,
21728         position: position,
21729         parent: parent,
21730         shape: label
21731       };
21732
21733       this._commandStack.execute('label.create', context);
21734
21735       return context.shape;
21736     };
21737
21738
21739     Modeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {
21740
21741       shape = this._create('shape', shape);
21742
21743       var context = {
21744         source: source,
21745         position: position,
21746         parent: parent,
21747         shape: shape,
21748         connection: connection,
21749         connectionParent: connectionParent
21750       };
21751
21752       this._commandStack.execute('shape.append', context);
21753
21754       return context.shape;
21755     };
21756
21757
21758     Modeling.prototype.removeElements = function(elements) {
21759       console.log(elements);
21760       var context = {
21761         elements: elements
21762       };
21763
21764       this._commandStack.execute('elements.delete', context);
21765     };
21766
21767
21768     Modeling.prototype.removeShape = function(shape) {
21769       var context = {
21770         shape: shape
21771       };
21772
21773       this._commandStack.execute('shape.delete', context);
21774     };
21775
21776
21777     Modeling.prototype.removeConnection = function(connection) {
21778       var context = {
21779         connection: connection
21780       };
21781
21782       this._commandStack.execute('connection.delete', context);
21783     };
21784
21785     Modeling.prototype.replaceShape = function(oldShape, newShape, options) {
21786       var context = {
21787         oldShape: oldShape,
21788         newData: newShape,
21789         options: options
21790       };
21791
21792       this._commandStack.execute('shape.replace', context);
21793
21794       return context.newShape;
21795     };
21796
21797     Modeling.prototype.resizeShape = function(shape, newBounds) {
21798       var context = {
21799         shape: shape,
21800         newBounds: newBounds
21801       };
21802
21803       this._commandStack.execute('shape.resize', context);
21804     };
21805
21806     Modeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {
21807       var context = {
21808         movingShapes: movingShapes,
21809         resizingShapes: resizingShapes,
21810         delta: delta,
21811         direction: direction
21812       };
21813
21814       this._commandStack.execute('spaceTool', context);
21815     };
21816
21817     Modeling.prototype.updateWaypoints = function(connection, newWaypoints) {
21818       var context = {
21819         connection: connection,
21820         newWaypoints: newWaypoints
21821       };
21822
21823       this._commandStack.execute('connection.updateWaypoints', context);
21824     };
21825
21826     Modeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {
21827       var context = {
21828         connection: connection,
21829         newSource: newSource,
21830         dockingPoint: dockingPoint
21831       };
21832
21833       this._commandStack.execute('connection.reconnectStart', context);
21834     };
21835
21836     Modeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {
21837       var context = {
21838         connection: connection,
21839         newTarget: newTarget,
21840         dockingPoint: dockingPoint
21841       };
21842
21843       this._commandStack.execute('connection.reconnectEnd', context);
21844     };
21845
21846     Modeling.prototype.connect = function(source, target, attrs) {
21847       return this.createConnection(source, target, attrs || {}, source.parent);
21848     };
21849
21850
21851     Modeling.prototype._create = function(type, attrs) {
21852       if (attrs instanceof model.Base) {
21853         return attrs;
21854       } else {
21855         return this._elementFactory.create(type, attrs);
21856       }
21857     };
21858
21859   }, {
21860     "../../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
21861     "./cmd/AppendShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js",
21862     "./cmd/CreateConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js",
21863     "./cmd/CreateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js",
21864     "./cmd/CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21865     "./cmd/DeleteConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js",
21866     "./cmd/DeleteElementsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js",
21867     "./cmd/DeleteShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js",
21868     "./cmd/LayoutConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js",
21869     "./cmd/MoveConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js",
21870     "./cmd/MoveShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js",
21871     "./cmd/MoveShapesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js",
21872     "./cmd/ReconnectConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js",
21873     "./cmd/ReplaceShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js",
21874     "./cmd/ResizeShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js",
21875     "./cmd/SpaceToolHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js",
21876     "./cmd/UpdateAnchorsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js",
21877     "./cmd/UpdateWaypointsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js",
21878     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
21879   }],
21880   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js": [function(require, module, exports) {
21881     'use strict';
21882
21883     var inherits = require('inherits');
21884
21885
21886     /**
21887      * A handler that implements reversible appending of shapes to a source shape.
21888      *
21889      * @param {canvas}
21890      *            Canvas
21891      * @param {elementFactory}
21892      *            ElementFactory
21893      * @param {modeling}
21894      *            Modeling
21895      */
21896     function AppendShapeHandler(modeling) {
21897       this._modeling = modeling;
21898     }
21899
21900     inherits(AppendShapeHandler, require('./NoopHandler'));
21901
21902
21903     AppendShapeHandler.$inject = ['modeling'];
21904
21905     module.exports = AppendShapeHandler;
21906
21907
21908     // //// api /////////////////////////////////////////////
21909
21910     /**
21911      * Creates a new shape
21912      *
21913      * @param {Object}
21914      *            context
21915      * @param {ElementDescriptor}
21916      *            context.shape the new shape
21917      * @param {ElementDescriptor}
21918      *            context.source the source object
21919      * @param {ElementDescriptor}
21920      *            context.parent the parent object
21921      * @param {Point}
21922      *            context.position position of the new element
21923      */
21924     AppendShapeHandler.prototype.preExecute = function(context) {
21925
21926       if (!context.source) {
21927         throw new Error('source required');
21928       }
21929
21930       var parent = context.parent || context.source.parent,
21931         shape = this._modeling.createShape(context.shape, context.position, parent);
21932
21933       context.shape = shape;
21934     };
21935
21936     AppendShapeHandler.prototype.postExecute = function(context) {
21937       var parent = context.connectionParent || context.shape.parent;
21938
21939       // create connection
21940       this._modeling.connect(context.source, context.shape, context.connection, parent);
21941     };
21942   }, {
21943     "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
21944     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21945   }],
21946   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js": [function(require, module, exports) {
21947     'use strict';
21948
21949
21950     function CreateConnectionHandler(canvas, layouter) {
21951       this._canvas = canvas;
21952       this._layouter = layouter;
21953     }
21954
21955     CreateConnectionHandler.$inject = ['canvas', 'layouter'];
21956
21957     module.exports = CreateConnectionHandler;
21958
21959
21960
21961     // //// api /////////////////////////////////////////
21962
21963     /**
21964      * Appends a shape to a target shape
21965      *
21966      * @param {Object}
21967      *            context
21968      * @param {djs.element.Base}
21969      *            context.source the source object
21970      * @param {djs.element.Base}
21971      *            context.target the parent object
21972      * @param {Point}
21973      *            context.position position of the new element
21974      */
21975     CreateConnectionHandler.prototype.execute = function(context) {
21976
21977       var source = context.source,
21978         target = context.target,
21979         parent = context.parent;
21980
21981       if (!source || !target) {
21982         throw new Error('source and target required');
21983       }
21984
21985       if (!parent) {
21986         throw new Error('parent required');
21987       }
21988
21989       var connection = context.connection;
21990
21991       connection.source = source;
21992       connection.target = target;
21993
21994       if (!connection.waypoints) {
21995         connection.waypoints = this._layouter.layoutConnection(connection);
21996       }
21997
21998       // add connection
21999       this._canvas.addConnection(connection, parent);
22000
22001       return connection;
22002     };
22003
22004     CreateConnectionHandler.prototype.revert = function(context) {
22005       var connection = context.connection;
22006
22007       this._canvas.removeConnection(connection);
22008
22009       connection.source = null;
22010       connection.target = null;
22011     };
22012   }, {}],
22013   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js": [function(require, module, exports) {
22014     'use strict';
22015
22016     var inherits = require('inherits');
22017
22018     var CreateShapeHandler = require('./CreateShapeHandler');
22019
22020
22021     /**
22022      * A handler that attaches a label to a given target shape.
22023      *
22024      * @param {canvas}
22025      *            Canvas
22026      */
22027     function CreateLabelHandler(canvas) {
22028       CreateShapeHandler.call(this, canvas);
22029     }
22030
22031     inherits(CreateLabelHandler, CreateShapeHandler);
22032
22033     CreateLabelHandler.$inject = ['canvas'];
22034
22035     module.exports = CreateLabelHandler;
22036
22037
22038
22039     // //// api /////////////////////////////////////////
22040
22041
22042     /**
22043      * Appends a label to a target shape.
22044      *
22045      * @method CreateLabelHandler#execute
22046      *
22047      * @param {Object}
22048      *            context
22049      * @param {ElementDescriptor}
22050      *            context.target the element the label is attached to
22051      * @param {ElementDescriptor}
22052      *            context.parent the parent object
22053      * @param {Point}
22054      *            context.position position of the new element
22055      */
22056
22057     /**
22058      * Undo append by removing the shape
22059      */
22060     CreateLabelHandler.prototype.revert = function(context) {
22061       context.shape.labelTarget = null;
22062       this._canvas.removeShape(context.shape);
22063     };
22064
22065
22066     // //// helpers /////////////////////////////////////////
22067
22068     CreateLabelHandler.prototype.getParent = function(context) {
22069       return context.parent || context.labelTarget && context.labelTarget.parent;
22070     };
22071
22072     CreateLabelHandler.prototype.addElement = function(shape, parent, context) {
22073       shape.labelTarget = context.labelTarget;
22074       this._canvas.addShape(shape, parent, true);
22075     };
22076   }, {
22077     "./CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
22078     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
22079   }],
22080   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js": [function(require, module, exports) {
22081     'use strict';
22082
22083     var assign = require('lodash/object/assign');
22084
22085
22086     /**
22087      * A handler that implements reversible addition of shapes.
22088      *
22089      * @param {canvas}
22090      *            Canvas
22091      */
22092     function CreateShapeHandler(canvas) {
22093       this._canvas = canvas;
22094     }
22095
22096     CreateShapeHandler.$inject = ['canvas'];
22097
22098     module.exports = CreateShapeHandler;
22099
22100
22101
22102     // //// api /////////////////////////////////////////
22103
22104
22105     /**
22106      * Appends a shape to a target shape
22107      *
22108      * @param {Object}
22109      *            context
22110      * @param {djs.model.Base}
22111      *            context.parent the parent object
22112      * @param {Point}
22113      *            context.position position of the new element
22114      */
22115     CreateShapeHandler.prototype.execute = function(context) {
22116
22117       var parent = this.getParent(context);
22118
22119       var shape = context.shape;
22120
22121       this.setPosition(shape, context);
22122
22123       this.addElement(shape, parent, context);
22124
22125       return shape;
22126     };
22127
22128
22129     /**
22130      * Undo append by removing the shape
22131      */
22132     CreateShapeHandler.prototype.revert = function(context) {
22133       this._canvas.removeShape(context.shape);
22134     };
22135
22136
22137     // //// helpers /////////////////////////////////////////
22138
22139     CreateShapeHandler.prototype.getParent = function(context) {
22140       var parent = context.parent;
22141
22142       if (!parent) {
22143         throw new Error('parent required');
22144       }
22145
22146       return parent;
22147     };
22148
22149     CreateShapeHandler.prototype.getPosition = function(context) {
22150       if (!context.position) {
22151         throw new Error('no position given');
22152       }
22153
22154       return context.position;
22155     };
22156
22157     CreateShapeHandler.prototype.addElement = function(shape, parent) {
22158       this._canvas.addShape(shape, parent);
22159     };
22160
22161     CreateShapeHandler.prototype.setPosition = function(shape, context) {
22162       var position = this.getPosition(context);
22163
22164       // update to center position
22165       // specified in create context
22166       assign(shape, {
22167         x: position.x - shape.width / 2,
22168         y: position.y - shape.height / 2
22169       });
22170     };
22171   }, {
22172     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22173   }],
22174   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js": [function(require, module, exports) {
22175     'use strict';
22176
22177     var Collections = require('../../../util/Collections');
22178
22179
22180     /**
22181      * A handler that implements reversible deletion of Connections.
22182      *
22183      */
22184     function DeleteConnectionHandler(canvas, modeling) {
22185       this._canvas = canvas;
22186       this._modeling = modeling;
22187     }
22188
22189     DeleteConnectionHandler.$inject = ['canvas', 'modeling'];
22190
22191     module.exports = DeleteConnectionHandler;
22192
22193
22194     /**
22195      * - Remove attached label
22196      */
22197     DeleteConnectionHandler.prototype.preExecute = function(context) {
22198
22199       var connection = context.connection;
22200
22201       // Remove label
22202       if (connection.label) {
22203         this._modeling.removeShape(connection.label);
22204       }
22205     };
22206
22207     DeleteConnectionHandler.prototype.execute = function(context) {
22208
22209       var connection = context.connection,
22210         parent = connection.parent;
22211
22212       context.parent = parent;
22213       context.parentIndex = Collections.indexOf(parent.children, connection);
22214
22215       context.source = connection.source;
22216       context.target = connection.target;
22217
22218       this._canvas.removeConnection(connection);
22219
22220       connection.source = null;
22221       connection.target = null;
22222       connection.label = null;
22223     };
22224
22225     /**
22226      * Command revert implementation.
22227      */
22228     DeleteConnectionHandler.prototype.revert = function(context) {
22229
22230       var connection = context.connection,
22231         parent = context.parent,
22232         parentIndex = context.parentIndex;
22233
22234       connection.source = context.source;
22235       connection.target = context.target;
22236
22237       // restore previous location in old parent
22238       Collections.add(parent.children, connection, parentIndex);
22239
22240       this._canvas.addConnection(connection, parent);
22241     };
22242
22243   }, {
22244     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22245   }],
22246   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js": [function(require, module, exports) {
22247     'use strict';
22248
22249     var forEach = require('lodash/collection/forEach'),
22250       inherits = require('inherits');
22251
22252
22253     function DeleteElementsHandler(modeling, elementRegistry) {
22254       this._modeling = modeling;
22255       this._elementRegistry = elementRegistry;
22256     }
22257
22258     inherits(DeleteElementsHandler, require('./NoopHandler'));
22259
22260     DeleteElementsHandler.$inject = ['modeling', 'elementRegistry'];
22261
22262     module.exports = DeleteElementsHandler;
22263
22264
22265     DeleteElementsHandler.prototype.postExecute = function(context) {
22266
22267       var modeling = this._modeling,
22268         elementRegistry = this._elementRegistry,
22269         elements = context.elements;
22270
22271       forEach(elements, function(element) {
22272
22273         // element may have been removed with previous
22274         // remove operations already (e.g. in case of nesting)
22275         if (!elementRegistry.get(element.id)) {
22276           return;
22277         }
22278
22279         if (element.waypoints) {
22280           modeling.removeConnection(element);
22281         } else {
22282           modeling.removeShape(element);
22283         }
22284       });
22285     };
22286   }, {
22287     "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
22288     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
22289     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22290   }],
22291   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js": [function(require, module, exports) {
22292     'use strict';
22293
22294     var Collections = require('../../../util/Collections');
22295
22296
22297     /**
22298      * A handler that implements reversible deletion of shapes.
22299      *
22300      */
22301     function DeleteShapeHandler(canvas, modeling) {
22302       this._canvas = canvas;
22303       this._modeling = modeling;
22304     }
22305
22306     DeleteShapeHandler.$inject = ['canvas', 'modeling'];
22307
22308     module.exports = DeleteShapeHandler;
22309
22310
22311     /**
22312      * - Remove connections - Remove all direct children
22313      */
22314     DeleteShapeHandler.prototype.preExecute = function(context) {
22315
22316       var shape = context.shape,
22317         label = shape.label,
22318         modeling = this._modeling;
22319
22320       // Clean up on removeShape(label)
22321       if (shape.labelTarget) {
22322         context.labelTarget = shape.labelTarget;
22323         shape.labelTarget = null;
22324       }
22325
22326       // Remove label
22327       if (label) {
22328         this._modeling.removeShape(label);
22329       }
22330
22331       // remove connections
22332       this._saveClear(shape.incoming, function(connection) {
22333         // To make sure that the connection isn't removed twice
22334         // For example if a container is removed
22335         modeling.removeConnection(connection);
22336       });
22337
22338       this._saveClear(shape.outgoing, function(connection) {
22339         modeling.removeConnection(connection);
22340       });
22341
22342
22343       // remove children
22344       this._saveClear(shape.children, function(e) {
22345         modeling.removeShape(e);
22346       });
22347     };
22348
22349
22350     DeleteShapeHandler.prototype._saveClear = function(collection, remove) {
22351
22352       var e;
22353
22354       while (!!(e = collection[0])) {
22355         remove(e);
22356       }
22357     };
22358
22359
22360     /**
22361      * Remove shape and remember the parent
22362      */
22363     DeleteShapeHandler.prototype.execute = function(context) {
22364
22365       var shape = context.shape,
22366         parent = shape.parent;
22367
22368       context.parent = parent;
22369       context.parentIndex = Collections.indexOf(parent.children, shape);
22370
22371       shape.label = null;
22372
22373       this._canvas.removeShape(shape);
22374     };
22375
22376
22377     /**
22378      * Command revert implementation
22379      */
22380     DeleteShapeHandler.prototype.revert = function(context) {
22381
22382       var shape = context.shape,
22383         parent = context.parent,
22384         parentIndex = context.parentIndex,
22385         labelTarget = context.labelTarget;
22386
22387       // restore previous location in old parent
22388       Collections.add(parent.children, shape, parentIndex);
22389
22390       if (labelTarget) {
22391         labelTarget.label = shape;
22392       }
22393
22394       this._canvas.addShape(shape, parent);
22395     };
22396
22397   }, {
22398     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22399   }],
22400   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js": [function(require, module, exports) {
22401     'use strict';
22402
22403     var assign = require('lodash/object/assign');
22404
22405
22406     /**
22407      * A handler that implements reversible moving of shapes.
22408      */
22409     function LayoutConnectionHandler(layouter, canvas) {
22410       this._layouter = layouter;
22411       this._canvas = canvas;
22412     }
22413
22414     LayoutConnectionHandler.$inject = ['layouter', 'canvas'];
22415
22416     module.exports = LayoutConnectionHandler;
22417
22418     LayoutConnectionHandler.prototype.execute = function(context) {
22419
22420       var connection = context.connection,
22421         parent = connection.parent,
22422         connectionSiblings = parent.children;
22423
22424       var oldIndex = connectionSiblings.indexOf(connection);
22425
22426       assign(context, {
22427         oldWaypoints: connection.waypoints,
22428         oldIndex: oldIndex
22429       });
22430
22431       sendToFront(connection);
22432
22433       connection.waypoints = this._layouter.layoutConnection(connection, context.hints);
22434
22435       return connection;
22436     };
22437
22438     LayoutConnectionHandler.prototype.revert = function(context) {
22439
22440       var connection = context.connection,
22441         parent = connection.parent,
22442         connectionSiblings = parent.children,
22443         currentIndex = connectionSiblings.indexOf(connection),
22444         oldIndex = context.oldIndex;
22445
22446       connection.waypoints = context.oldWaypoints;
22447
22448       if (oldIndex !== currentIndex) {
22449
22450         // change position of connection in shape
22451         connectionSiblings.splice(currentIndex, 1);
22452         connectionSiblings.splice(oldIndex, 0, connection);
22453       }
22454
22455       return connection;
22456     };
22457
22458     // connections should have a higher z-order as there source and targets
22459     function sendToFront(connection) {
22460
22461       var connectionSiblings = connection.parent.children;
22462
22463       var connectionIdx = connectionSiblings.indexOf(connection),
22464         sourceIdx = findIndex(connectionSiblings, connection.source),
22465         targetIdx = findIndex(connectionSiblings, connection.target),
22466
22467         // ensure we do not send the connection back
22468         // if it is already in front
22469         insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);
22470
22471       if (connectionIdx < insertIndex) {
22472         connectionSiblings.splice(insertIndex, 0, connection); // add to new
22473         // position
22474         connectionSiblings.splice(connectionIdx, 1); // remove from old position
22475       }
22476
22477       function findIndex(array, obj) {
22478
22479         var index = array.indexOf(obj);
22480         if (index < 0 && obj) {
22481           var parent = obj.parent;
22482           index = findIndex(array, parent);
22483         }
22484         return index;
22485       }
22486
22487       return insertIndex;
22488     }
22489
22490   }, {
22491     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22492   }],
22493   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js": [function(require, module, exports) {
22494     'use strict';
22495
22496     var forEach = require('lodash/collection/forEach');
22497
22498     var Collections = require('../../../util/Collections');
22499
22500
22501     /**
22502      * A handler that implements reversible moving of connections.
22503      *
22504      * The handler differs from the layout connection handler in a sense that it
22505      * preserves the connection layout.
22506      */
22507     function MoveConnectionHandler() {}
22508
22509     module.exports = MoveConnectionHandler;
22510
22511
22512     MoveConnectionHandler.prototype.execute = function(context) {
22513
22514       var updateAnchors = (context.hints.updateAnchors !== false);
22515
22516       var connection = context.connection,
22517         delta = context.delta;
22518
22519       var newParent = this.getNewParent(connection, context),
22520         oldParent = connection.parent;
22521
22522       // save old position + parent in context
22523       context.oldParent = oldParent;
22524       context.oldParentIndex = Collections.indexOf(oldParent.children, connection);
22525
22526       // update waypoint positions
22527       forEach(connection.waypoints, function(p) {
22528         p.x += delta.x;
22529         p.y += delta.y;
22530
22531         if (updateAnchors && p.original) {
22532           p.original.x += delta.x;
22533           p.original.y += delta.y;
22534         }
22535       });
22536
22537       // update parent
22538       connection.parent = newParent;
22539
22540       return connection;
22541     };
22542
22543     MoveConnectionHandler.prototype.revert = function(context) {
22544
22545       var updateAnchors = (context.hints.updateAnchors !== false);
22546
22547       var connection = context.connection,
22548         oldParent = context.oldParent,
22549         oldParentIndex = context.oldParentIndex,
22550         delta = context.delta;
22551
22552       // restore previous location in old parent
22553       Collections.add(oldParent.children, connection, oldParentIndex);
22554
22555       // restore parent
22556       connection.parent = oldParent;
22557
22558       // revert to old waypoint positions
22559       forEach(connection.waypoints, function(p) {
22560         p.x -= delta.x;
22561         p.y -= delta.y;
22562
22563         if (updateAnchors && p.original) {
22564           p.original.x -= delta.x;
22565           p.original.y -= delta.y;
22566         }
22567       });
22568
22569       return connection;
22570     };
22571
22572
22573     MoveConnectionHandler.prototype.getNewParent = function(connection, context) {
22574       return context.newParent || connection.parent;
22575     };
22576
22577   }, {
22578     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22579     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22580   }],
22581   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js": [function(require, module, exports) {
22582     'use strict';
22583
22584     var assign = require('lodash/object/assign'),
22585       forEach = require('lodash/collection/forEach');
22586
22587     var MoveHelper = require('./helper/MoveHelper'),
22588       Collections = require('../../../util/Collections');
22589
22590
22591     /**
22592      * A handler that implements reversible moving of shapes.
22593      */
22594     function MoveShapeHandler(modeling) {
22595       this._modeling = modeling;
22596
22597       this._helper = new MoveHelper(modeling);
22598     }
22599
22600     MoveShapeHandler.$inject = ['modeling'];
22601
22602     module.exports = MoveShapeHandler;
22603
22604
22605     MoveShapeHandler.prototype.execute = function(context) {
22606
22607       var shape = context.shape,
22608         delta = context.delta,
22609         newParent = this.getNewParent(context),
22610         oldParent = shape.parent;
22611
22612       // save old parent in context
22613       context.oldParent = oldParent;
22614       context.oldParentIndex = Collections.indexOf(oldParent.children, shape);
22615
22616       // update shape parent + position
22617       assign(shape, {
22618         parent: newParent,
22619         x: shape.x + delta.x,
22620         y: shape.y + delta.y
22621       });
22622
22623       return shape;
22624     };
22625
22626     MoveShapeHandler.prototype.postExecute = function(context) {
22627
22628       var shape = context.shape,
22629         delta = context.delta;
22630
22631       var modeling = this._modeling;
22632
22633       if (context.hints.updateAnchors !== false) {
22634         modeling.updateAnchors(shape, delta);
22635       }
22636
22637       if (context.hints.layout !== false) {
22638         forEach(shape.incoming, function(c) {
22639           modeling.layoutConnection(c, {
22640             endChanged: true
22641           });
22642         });
22643
22644         forEach(shape.outgoing, function(c) {
22645           modeling.layoutConnection(c, {
22646             startChanged: true
22647           });
22648         });
22649       }
22650
22651       if (context.hints.recurse !== false) {
22652         this.moveChildren(context);
22653       }
22654     };
22655
22656     MoveShapeHandler.prototype.revert = function(context) {
22657
22658       var shape = context.shape,
22659         oldParent = context.oldParent,
22660         oldParentIndex = context.oldParentIndex,
22661         delta = context.delta;
22662
22663       // restore previous location in old parent
22664       Collections.add(oldParent.children, shape, oldParentIndex);
22665
22666       // revert to old position and parent
22667       assign(shape, {
22668         parent: oldParent,
22669         x: shape.x - delta.x,
22670         y: shape.y - delta.y
22671       });
22672
22673       return shape;
22674     };
22675
22676     MoveShapeHandler.prototype.moveChildren = function(context) {
22677
22678       var delta = context.delta,
22679         shape = context.shape;
22680
22681       this._helper.moveRecursive(shape.children, delta, null);
22682     };
22683
22684     MoveShapeHandler.prototype.getNewParent = function(context) {
22685       return context.newParent || context.shape.parent;
22686     };
22687   }, {
22688     "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22689     "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js",
22690     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22691     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22692   }],
22693   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js": [function(require, module, exports) {
22694     'use strict';
22695
22696     var MoveHelper = require('./helper/MoveHelper');
22697
22698
22699     /**
22700      * A handler that implements reversible moving of shapes.
22701      */
22702     function MoveShapesHandler(modeling) {
22703       this._helper = new MoveHelper(modeling);
22704     }
22705
22706     MoveShapesHandler.$inject = ['modeling'];
22707
22708     module.exports = MoveShapesHandler;
22709
22710     MoveShapesHandler.prototype.preExecute = function(context) {
22711       context.closure = this._helper.getClosure(context.shapes);
22712     };
22713
22714     MoveShapesHandler.prototype.postExecute = function(context) {
22715       this._helper.moveClosure(context.closure, context.delta, context.newParent);
22716     };
22717
22718
22719     MoveShapesHandler.prototype.execute = function(context) {};
22720     MoveShapesHandler.prototype.revert = function(context) {};
22721
22722   }, {
22723     "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js"
22724   }],
22725   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js": [function(require, module, exports) {
22726     'use strict';
22727
22728     function NoopHandler() {}
22729
22730     module.exports = NoopHandler;
22731
22732     NoopHandler.prototype.execute = function() {};
22733     NoopHandler.prototype.revert = function() {};
22734   }, {}],
22735   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js": [function(require, module, exports) {
22736     'use strict';
22737
22738
22739     function ReconnectConnectionHandler(layouter) {}
22740
22741     ReconnectConnectionHandler.$inject = ['layouter'];
22742
22743     module.exports = ReconnectConnectionHandler;
22744
22745     ReconnectConnectionHandler.prototype.execute = function(context) {
22746
22747       var newSource = context.newSource,
22748         newTarget = context.newTarget,
22749         connection = context.connection;
22750
22751       if (!newSource && !newTarget) {
22752         throw new Error('newSource or newTarget are required');
22753       }
22754
22755       if (newSource && newTarget) {
22756         throw new Error('must specify either newSource or newTarget');
22757       }
22758
22759       if (newSource) {
22760         context.oldSource = connection.source;
22761         connection.source = newSource;
22762
22763         context.oldDockingPoint = connection.waypoints[0];
22764         connection.waypoints[0] = context.dockingPoint;
22765       }
22766
22767       if (newTarget) {
22768         context.oldTarget = connection.target;
22769         connection.target = newTarget;
22770
22771         context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];
22772         connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;
22773       }
22774
22775       return connection;
22776     };
22777
22778     ReconnectConnectionHandler.prototype.revert = function(context) {
22779
22780       var newSource = context.newSource,
22781         newTarget = context.newTarget,
22782         connection = context.connection;
22783
22784       if (newSource) {
22785         connection.source = context.oldSource;
22786         connection.waypoints[0] = context.oldDockingPoint;
22787       }
22788
22789       if (newTarget) {
22790         connection.target = context.oldTarget;
22791         connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;
22792       }
22793
22794       return connection;
22795     };
22796   }, {}],
22797   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js": [function(require, module, exports) {
22798     'use strict';
22799
22800     var forEach = require('lodash/collection/forEach');
22801
22802
22803     /**
22804      * A handler that implements reversible replacing of shapes. Internally the old
22805      * shape will be removed and the new shape will be added.
22806      *
22807      *
22808      * @class
22809      * @constructor
22810      *
22811      * @param {canvas}
22812      *            Canvas
22813      */
22814     function ReplaceShapeHandler(modeling, rules) {
22815       this._modeling = modeling;
22816       this._rules = rules;
22817     }
22818
22819     ReplaceShapeHandler.$inject = ['modeling', 'rules'];
22820
22821     module.exports = ReplaceShapeHandler;
22822
22823
22824
22825     // //// api /////////////////////////////////////////
22826
22827
22828     /**
22829      * Replaces a shape with an replacement Element.
22830      *
22831      * The newData object should contain type, x, y.
22832      *
22833      * If possible also the incoming/outgoing connection will be restored.
22834      *
22835      * @param {Object}
22836      *            context
22837      */
22838     ReplaceShapeHandler.prototype.preExecute = function(context) {
22839
22840       var modeling = this._modeling,
22841         rules = this._rules;
22842
22843       var oldShape = context.oldShape,
22844         newData = context.newData,
22845         newShape;
22846
22847
22848       // (1) place a new shape at the given position
22849
22850       var position = {
22851         x: newData.x,
22852         y: newData.y
22853       };
22854
22855       newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);
22856
22857
22858       // (2) reconnect connections to the new shape (where allowed)
22859
22860       var incoming = oldShape.incoming.slice(),
22861         outgoing = oldShape.outgoing.slice();
22862
22863       forEach(incoming, function(connection) {
22864         var waypoints = connection.waypoints,
22865           docking = waypoints[waypoints.length - 1],
22866           allowed = rules.allowed('connection.reconnectEnd', {
22867             source: connection.source,
22868             target: newShape,
22869             connection: connection
22870           });
22871
22872         if (allowed) {
22873           modeling.reconnectEnd(connection, newShape, docking);
22874         }
22875       });
22876
22877       forEach(outgoing, function(connection) {
22878         var waypoints = connection.waypoints,
22879           docking = waypoints[0],
22880           allowed = rules.allowed('connection.reconnectStart', {
22881             source: newShape,
22882             target: connection.target,
22883             connection: connection
22884           });
22885
22886         if (allowed) {
22887           modeling.reconnectStart(connection, newShape, docking);
22888         }
22889       });
22890     };
22891
22892
22893     ReplaceShapeHandler.prototype.postExecute = function(context) {
22894       var modeling = this._modeling;
22895
22896       var oldShape = context.oldShape;
22897
22898       modeling.removeShape(oldShape);
22899     };
22900
22901
22902     ReplaceShapeHandler.prototype.execute = function(context) {};
22903
22904     ReplaceShapeHandler.prototype.revert = function(context) {};
22905
22906   }, {
22907     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22908   }],
22909   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js": [function(require, module, exports) {
22910     'use strict';
22911
22912     var assign = require('lodash/object/assign'),
22913       forEach = require('lodash/collection/forEach');
22914
22915
22916     /**
22917      * A handler that implements reversible resizing of shapes.
22918      *
22919      */
22920     function ResizeShapeHandler(modeling) {
22921       this._modeling = modeling;
22922     }
22923
22924     ResizeShapeHandler.$inject = ['modeling'];
22925
22926     module.exports = ResizeShapeHandler;
22927
22928     /**
22929      * { shape: {....} newBounds: { width: 20, height: 40, x: 5, y: 10 }
22930      *  }
22931      */
22932     ResizeShapeHandler.prototype.execute = function(context) {
22933
22934       var shape = context.shape,
22935         newBounds = context.newBounds;
22936
22937       if (newBounds.x === undefined || newBounds.y === undefined ||
22938         newBounds.width === undefined || newBounds.height === undefined) {
22939         throw new Error('newBounds must have {x, y, width, height} properties');
22940       }
22941
22942       if (newBounds.width < 10 || newBounds.height < 10) {
22943         throw new Error('width and height cannot be less than 10px');
22944       }
22945
22946       // save old bbox in context
22947       context.oldBounds = {
22948         width: shape.width,
22949         height: shape.height,
22950         x: shape.x,
22951         y: shape.y
22952       };
22953
22954       // update shape
22955       assign(shape, {
22956         width: newBounds.width,
22957         height: newBounds.height,
22958         x: newBounds.x,
22959         y: newBounds.y
22960       });
22961
22962       return shape;
22963     };
22964
22965     ResizeShapeHandler.prototype.postExecute = function(context) {
22966
22967       var shape = context.shape;
22968
22969       var modeling = this._modeling;
22970
22971       forEach(shape.incoming, function(c) {
22972         modeling.layoutConnection(c, {
22973           endChanged: true
22974         });
22975       });
22976
22977       forEach(shape.outgoing, function(c) {
22978         modeling.layoutConnection(c, {
22979           startChanged: true
22980         });
22981       });
22982
22983     };
22984
22985     ResizeShapeHandler.prototype.revert = function(context) {
22986
22987       var shape = context.shape,
22988         oldBounds = context.oldBounds;
22989
22990       // restore previous bbox
22991       assign(shape, {
22992         width: oldBounds.width,
22993         height: oldBounds.height,
22994         x: oldBounds.x,
22995         y: oldBounds.y
22996       });
22997
22998       return shape;
22999     };
23000
23001   }, {
23002     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23003     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23004   }],
23005   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js": [function(require, module, exports) {
23006     'use strict';
23007
23008     var forEach = require('lodash/collection/forEach');
23009
23010     var SpaceUtil = require('../../space-tool/SpaceUtil');
23011
23012     /**
23013      * A handler that implements reversible creating and removing of space.
23014      *
23015      * It executes in two phases:
23016      *
23017      * (1) resize all affected resizeShapes (2) move all affected moveShapes
23018      */
23019     function SpaceToolHandler(modeling) {
23020       this._modeling = modeling;
23021     }
23022
23023     SpaceToolHandler.$inject = ['modeling'];
23024
23025     module.exports = SpaceToolHandler;
23026
23027
23028     SpaceToolHandler.prototype.preExecute = function(context) {
23029
23030       // resize
23031       var modeling = this._modeling,
23032         resizingShapes = context.resizingShapes,
23033         delta = context.delta,
23034         direction = context.direction;
23035
23036       forEach(resizingShapes, function(shape) {
23037         var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);
23038
23039         modeling.resizeShape(shape, newBounds);
23040       });
23041     };
23042
23043     SpaceToolHandler.prototype.postExecute = function(context) {
23044       // move
23045       var modeling = this._modeling,
23046         movingShapes = context.movingShapes,
23047         delta = context.delta;
23048
23049       modeling.moveShapes(movingShapes, delta);
23050     };
23051
23052     SpaceToolHandler.prototype.execute = function(context) {};
23053     SpaceToolHandler.prototype.revert = function(context) {};
23054
23055   }, {
23056     "../../space-tool/SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js",
23057     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23058   }],
23059   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js": [function(require, module, exports) {
23060     'use strict';
23061
23062     var forEach = require('lodash/collection/forEach'),
23063       assign = require('lodash/object/assign');
23064
23065
23066     /**
23067      * Update the anchors of
23068      */
23069     function UpdateAnchorsHandler() {}
23070
23071     module.exports = UpdateAnchorsHandler;
23072
23073
23074     UpdateAnchorsHandler.prototype.execute = function(context) {
23075
23076       // update connection anchors
23077       return this.updateAnchors(context.element, context.delta);
23078     };
23079
23080     UpdateAnchorsHandler.prototype.revert = function(context) {
23081
23082       var delta = context.delta,
23083         revertedDelta = {
23084           x: -1 * delta.x,
23085           y: -1 * delta.y
23086         };
23087
23088       // revert update connection anchors
23089       return this.updateAnchors(context.element, revertedDelta);
23090     };
23091
23092     /**
23093      * Update anchors on the element according to the delta movement.
23094      *
23095      * @param {djs.model.Element}
23096      *            element
23097      * @param {Point}
23098      *            delta
23099      *
23100      * @return Array<djs.model.Connection>
23101      */
23102     UpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {
23103
23104       function add(point, delta) {
23105         return {
23106           x: point.x + delta.x,
23107           y: point.y + delta.y
23108         };
23109       }
23110
23111       function updateAnchor(waypoint) {
23112         var original = waypoint.original;
23113
23114         waypoint.original = assign(original || {}, add(original || waypoint, delta));
23115       }
23116
23117       var changed = [];
23118
23119       forEach(element.incoming, function(c) {
23120         var waypoints = c.waypoints;
23121         updateAnchor(waypoints[waypoints.length - 1]);
23122
23123         changed.push(c);
23124       });
23125
23126       forEach(element.outgoing, function(c) {
23127         var waypoints = c.waypoints;
23128         updateAnchor(waypoints[0]);
23129
23130         changed.push(c);
23131       });
23132
23133       return changed;
23134     };
23135   }, {
23136     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23137     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23138   }],
23139   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js": [function(require, module, exports) {
23140     'use strict';
23141
23142     function UpdateWaypointsHandler() {}
23143
23144     module.exports = UpdateWaypointsHandler;
23145
23146     UpdateWaypointsHandler.prototype.execute = function(context) {
23147
23148       var connection = context.connection,
23149         newWaypoints = context.newWaypoints;
23150
23151       context.oldWaypoints = connection.waypoints;
23152
23153       connection.waypoints = newWaypoints;
23154
23155       return connection;
23156     };
23157
23158     UpdateWaypointsHandler.prototype.revert = function(context) {
23159
23160       var connection = context.connection,
23161         oldWaypoints = context.oldWaypoints;
23162
23163       connection.waypoints = oldWaypoints;
23164
23165       return connection;
23166     };
23167   }, {}],
23168   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js": [function(require, module, exports) {
23169     'use strict';
23170
23171     var forEach = require('lodash/collection/forEach');
23172
23173     var Elements = require('../../../../util/Elements');
23174
23175
23176     /**
23177      * A helper that is able to carry out serialized move operations on multiple
23178      * elements.
23179      *
23180      * @param {Modeling}
23181      *            modeling
23182      */
23183     function MoveHelper(modeling) {
23184       this._modeling = modeling;
23185     }
23186
23187     module.exports = MoveHelper;
23188
23189     /**
23190      * Move the specified elements and all children by the given delta.
23191      *
23192      * This moves all enclosed connections, too and layouts all affected external
23193      * connections.
23194      *
23195      * @param {Array
23196      *            <djs.model.Base>} elements
23197      * @param {Point}
23198      *            delta
23199      * @param {djs.model.Base}
23200      *            newParent applied to the first level of shapes
23201      *
23202      * @return {Array<djs.model.Base>} list of touched elements
23203      */
23204     MoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {
23205       return this.moveClosure(this.getClosure(elements), delta, newParent);
23206     };
23207
23208     /**
23209      * Move the given closure of elmements
23210      */
23211     MoveHelper.prototype.moveClosure = function(closure, delta, newParent) {
23212
23213       var modeling = this._modeling;
23214
23215       var allShapes = closure.allShapes,
23216         allConnections = closure.allConnections,
23217         enclosedConnections = closure.enclosedConnections,
23218         topLevel = closure.topLevel;
23219
23220       // move all shapes
23221       forEach(allShapes, function(s) {
23222
23223         modeling.moveShape(s, delta, topLevel[s.id] && newParent, {
23224           recurse: false,
23225           layout: false
23226         });
23227       });
23228
23229       // move all child connections / layout external connections
23230       forEach(allConnections, function(c) {
23231
23232         var startMoved = !!allShapes[c.source.id],
23233           endMoved = !!allShapes[c.target.id];
23234
23235         if (enclosedConnections[c.id] &&
23236           startMoved && endMoved) {
23237           modeling.moveConnection(c, delta, topLevel[c.id] && newParent, {
23238             updateAnchors: false
23239           });
23240         } else {
23241           modeling.layoutConnection(c, {
23242             startChanged: startMoved,
23243             endChanged: endMoved
23244           });
23245         }
23246       });
23247     };
23248
23249     /**
23250      * Returns the closure for the selected elements
23251      *
23252      * @param {Array
23253      *            <djs.model.Base>} elements
23254      * @return {Object} closure
23255      */
23256     MoveHelper.prototype.getClosure = function(elements) {
23257       return Elements.getClosure(elements);
23258     };
23259
23260   }, {
23261     "../../../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23262     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23263   }],
23264   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
23265     module.exports = {
23266       __depends__: [
23267         require('../../command'),
23268         require('../change-support'),
23269         require('../rules')
23270       ],
23271       __init__: ['modeling'],
23272       modeling: ['type', require('./Modeling')],
23273       layouter: ['type', require('../../layout/BaseLayouter')]
23274     };
23275
23276   }, {
23277     "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
23278     "../../layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
23279     "../change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
23280     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23281     "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js"
23282   }],
23283   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js": [function(require, module, exports) {
23284     'use strict';
23285
23286     var assign = require('lodash/object/assign'),
23287       filter = require('lodash/collection/filter'),
23288       groupBy = require('lodash/collection/groupBy');
23289
23290
23291     var LOW_PRIORITY = 500,
23292       HIGH_PRIORITY = 1500;
23293
23294     var getOriginalEvent = require('../../util/Event').getOriginal;
23295
23296     var round = Math.round;
23297
23298
23299     /**
23300      * Return a filtered list of elements that do not contain those nested into
23301      * others.
23302      *
23303      * @param {Array
23304      *            <djs.model.Base>} elements
23305      *
23306      * @return {Array<djs.model.Base>} filtered
23307      */
23308     function removeNested(elements) {
23309
23310       var ids = groupBy(elements, 'id');
23311
23312       return filter(elements, function(element) {
23313         while (!!(element = element.parent)) {
23314           if (ids[element.id]) {
23315             return false;
23316           }
23317         }
23318
23319         return true;
23320       });
23321     }
23322
23323
23324
23325     /**
23326      * A plugin that makes shapes draggable / droppable.
23327      *
23328      * @param {EventBus}
23329      *            eventBus
23330      * @param {Dragging}
23331      *            dragging
23332      * @param {Modeling}
23333      *            modeling
23334      * @param {Selection}
23335      *            selection
23336      * @param {Rules}
23337      *            rules
23338      */
23339     function MoveEvents(eventBus, dragging, modeling, selection, rules) {
23340
23341       // rules
23342
23343       function canMove(shapes, delta, target) {
23344
23345         return rules.allowed('shapes.move', {
23346           shapes: shapes,
23347           delta: delta,
23348           newParent: target
23349         });
23350       }
23351
23352
23353       // move events
23354
23355       // assign a high priority to this handler to setup the environment
23356       // others may hook up later, e.g. at default priority and modify
23357       // the move environment
23358       //
23359       eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {
23360
23361         var context = event.context,
23362           shape = event.shape,
23363           shapes = selection.get().slice();
23364
23365         // move only single shape shape if the dragged element
23366         // is not part of the current selection
23367         if (shapes.indexOf(shape) === -1) {
23368           shapes = [shape];
23369         }
23370
23371         // ensure we remove nested elements in the collection
23372         shapes = removeNested(shapes);
23373
23374         // attach shapes to drag context
23375         assign(context, {
23376           shapes: shapes,
23377           shape: shape
23378         });
23379
23380         // check if we can move the elements
23381         if (!canMove(shapes)) {
23382           // suppress move operation
23383           event.stopPropagation();
23384
23385           return false;
23386         }
23387       });
23388
23389       // assign a low priority to this handler
23390       // to let others modify the move event before we update
23391       // the context
23392       //
23393       eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23394
23395         var context = event.context,
23396           shapes = context.shapes,
23397           hover = event.hover,
23398           delta = {
23399             x: event.dx,
23400             y: event.dy
23401           },
23402           canExecute;
23403
23404         // check if we can move the elements
23405         canExecute = canMove(shapes, delta, hover);
23406
23407         context.delta = delta;
23408         context.canExecute = canExecute;
23409
23410         // simply ignore move over
23411         if (canExecute === null) {
23412           context.target = null;
23413
23414           return;
23415         }
23416
23417         context.target = hover;
23418       });
23419
23420       eventBus.on('shape.move.end', function(event) {
23421
23422         var context = event.context;
23423
23424         var delta = context.delta,
23425           canExecute = context.canExecute;
23426
23427         if (!canExecute) {
23428           return false;
23429         }
23430
23431         // ensure we have actual pixel values deltas
23432         // (important when zoom level was > 1 during move)
23433         delta.x = round(delta.x);
23434         delta.y = round(delta.y);
23435
23436         modeling.moveShapes(context.shapes, delta, context.target);
23437       });
23438
23439
23440       // move activation
23441
23442       eventBus.on('element.mousedown', function(event) {
23443
23444         var originalEvent = getOriginalEvent(event);
23445
23446         if (!originalEvent) {
23447           throw new Error('must supply DOM mousedown event');
23448         }
23449
23450         start(originalEvent, event.element);
23451       });
23452
23453
23454       function start(event, element, activate) {
23455
23456         // do not move connections or the root element
23457         if (element.waypoints || !element.parent) {
23458           return;
23459         }
23460
23461         dragging.activate(event, 'shape.move', {
23462           cursor: 'grabbing',
23463           autoActivate: activate,
23464           data: {
23465             shape: element,
23466             context: {}
23467           }
23468         });
23469       }
23470
23471       // API
23472
23473       this.start = start;
23474     }
23475
23476     MoveEvents.$inject = ['eventBus', 'dragging', 'modeling', 'selection', 'rules'];
23477
23478     module.exports = MoveEvents;
23479
23480   }, {
23481     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
23482     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23483     "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
23484     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23485   }],
23486   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js": [function(require, module, exports) {
23487     'use strict';
23488
23489     var flatten = require('lodash/array/flatten'),
23490       forEach = require('lodash/collection/forEach'),
23491       filter = require('lodash/collection/filter'),
23492       find = require('lodash/collection/find'),
23493       map = require('lodash/collection/map');
23494
23495     var Elements = require('../../util/Elements');
23496
23497     var LOW_PRIORITY = 500;
23498
23499     var MARKER_DRAGGING = 'djs-dragging',
23500       MARKER_OK = 'drop-ok',
23501       MARKER_NOT_OK = 'drop-not-ok';
23502
23503
23504     /**
23505      * A plugin that makes shapes draggable / droppable.
23506      *
23507      * @param {EventBus}
23508      *            eventBus
23509      * @param {ElementRegistry}
23510      *            elementRegistry
23511      * @param {Canvas}
23512      *            canvas
23513      * @param {Styles}
23514      *            styles
23515      */
23516     function MoveVisuals(eventBus, elementRegistry, canvas, styles) {
23517
23518       function getGfx(e) {
23519         return elementRegistry.getGraphics(e);
23520       }
23521
23522       function getVisualDragShapes(shapes) {
23523
23524         var elements = Elements.selfAndDirectChildren(shapes, true);
23525         var filteredElements = removeEdges(elements);
23526
23527         return filteredElements;
23528       }
23529
23530       function getAllDraggedElements(shapes) {
23531         var allShapes = Elements.selfAndAllChildren(shapes, true);
23532
23533         var allConnections = map(allShapes, function(shape) {
23534           return (shape.incoming || []).concat(shape.outgoing || []);
23535         });
23536
23537         return flatten(allShapes.concat(allConnections), true);
23538       }
23539
23540       function addDragger(shape, dragGroup) {
23541         var gfx = getGfx(shape);
23542         var dragger = gfx.clone();
23543         var bbox = gfx.getBBox();
23544
23545         dragger.attr(styles.cls('djs-dragger', [], {
23546           x: bbox.x,
23547           y: bbox.y
23548         }));
23549
23550         dragGroup.add(dragger);
23551       }
23552
23553       // assign a low priority to this handler
23554       // to let others modify the move context before
23555       // we draw things
23556       //
23557       eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {
23558
23559         var context = event.context,
23560           dragShapes = context.shapes;
23561
23562         var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
23563
23564         var visuallyDraggedShapes = getVisualDragShapes(dragShapes);
23565
23566         visuallyDraggedShapes.forEach(function(shape) {
23567           addDragger(shape, dragGroup);
23568         });
23569
23570
23571         // cache all dragged elements / gfx
23572         // so that we can quickly undo their state changes later
23573         var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);
23574
23575         // add dragging marker
23576         forEach(allDraggedElements, function(e) {
23577           canvas.addMarker(e, MARKER_DRAGGING);
23578         });
23579
23580         context.dragGroup = dragGroup;
23581       });
23582
23583       // assign a low priority to this handler
23584       // to let others modify the move context before
23585       // we draw things
23586       //
23587       eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23588
23589         var context = event.context,
23590           dragGroup = context.dragGroup,
23591           target = context.target;
23592
23593         if (target) {
23594           canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23595         }
23596
23597         dragGroup.translate(event.dx, event.dy);
23598       });
23599
23600       eventBus.on(['shape.move.out', 'shape.move.cleanup'], function(event) {
23601         var context = event.context;
23602
23603         if (context.target) {
23604           canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23605         }
23606       });
23607
23608       eventBus.on('shape.move.cleanup', function(event) {
23609
23610         var context = event.context,
23611           allDraggedElements = context.allDraggedElements,
23612           dragGroup = context.dragGroup;
23613
23614
23615         // remove dragging marker
23616         forEach(allDraggedElements, function(e) {
23617           canvas.removeMarker(e, MARKER_DRAGGING);
23618         });
23619
23620         if (dragGroup) {
23621           dragGroup.remove();
23622         }
23623       });
23624     }
23625
23626     // returns elements minus all connections
23627     // where source or target is not elements
23628     function removeEdges(elements) {
23629
23630       var filteredElements = filter(elements, function(element) {
23631
23632         if (!element.waypoints) { // shapes
23633           return true;
23634         } else { // connections
23635           var srcFound = find(elements, element.source);
23636           var targetFound = find(elements, element.target);
23637
23638           return srcFound && targetFound;
23639         }
23640       });
23641
23642       return filteredElements;
23643     }
23644
23645     MoveVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
23646
23647     module.exports = MoveVisuals;
23648
23649   }, {
23650     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23651     "lodash/array/flatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js",
23652     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23653     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
23654     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23655     "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js"
23656   }],
23657   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js": [function(require, module, exports) {
23658     module.exports = {
23659       __depends__: [
23660         require('../interaction-events'),
23661         require('../selection'),
23662         require('../outline'),
23663         require('../rules'),
23664         require('../dragging')
23665       ],
23666       __init__: ['move', 'moveVisuals'],
23667       move: ['type', require('./Move')],
23668       moveVisuals: ['type', require('./MoveVisuals')]
23669     };
23670
23671   }, {
23672     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
23673     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
23674     "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
23675     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23676     "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
23677     "./Move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js",
23678     "./MoveVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js"
23679   }],
23680   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js": [function(require, module, exports) {
23681     'use strict';
23682
23683     var Snap = require('../../../vendor/snapsvg');
23684     var getBBox = require('../../util/Elements').getBBox;
23685
23686
23687     /**
23688      * @class
23689      *
23690      * A plugin that adds an outline to shapes and connections that may be activated
23691      * and styled via CSS classes.
23692      *
23693      * @param {EventBus}
23694      *            events the event bus
23695      */
23696     function Outline(eventBus, styles, elementRegistry) {
23697
23698       var OUTLINE_OFFSET = 6;
23699
23700       var OUTLINE_STYLE = styles.cls('djs-outline', ['no-fill']);
23701
23702       function createOutline(gfx, bounds) {
23703         return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
23704       }
23705
23706       function updateShapeOutline(outline, bounds) {
23707
23708         outline.attr({
23709           x: -OUTLINE_OFFSET,
23710           y: -OUTLINE_OFFSET,
23711           width: bounds.width + OUTLINE_OFFSET * 2,
23712           height: bounds.height + OUTLINE_OFFSET * 2
23713         });
23714       }
23715
23716       function updateConnectionOutline(outline, connection) {
23717
23718         var bbox = getBBox(connection);
23719
23720         outline.attr({
23721           x: bbox.x - OUTLINE_OFFSET,
23722           y: bbox.y - OUTLINE_OFFSET,
23723           width: bbox.width + OUTLINE_OFFSET * 2,
23724           height: bbox.height + OUTLINE_OFFSET * 2
23725         });
23726       }
23727
23728       eventBus.on(['shape.added', 'shape.changed'], function(event) {
23729         var element = event.element,
23730           gfx = event.gfx;
23731
23732         var outline = gfx.select('.djs-outline');
23733
23734         if (!outline) {
23735           outline = createOutline(gfx, element);
23736         }
23737
23738         updateShapeOutline(outline, element);
23739       });
23740
23741       eventBus.on(['connection.added', 'connection.changed'], function(event) {
23742         var element = event.element,
23743           gfx = event.gfx;
23744
23745         var outline = gfx.select('.djs-outline');
23746
23747         if (!outline) {
23748           outline = createOutline(gfx, element);
23749         }
23750
23751         updateConnectionOutline(outline, element);
23752       });
23753
23754
23755     }
23756
23757
23758     Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
23759
23760     module.exports = Outline;
23761
23762   }, {
23763     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
23764     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js"
23765   }],
23766   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js": [function(require, module, exports) {
23767     'use strict';
23768
23769     module.exports = {
23770       __init__: ['outline'],
23771       outline: ['type', require('./Outline')]
23772     };
23773   }, {
23774     "./Outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js"
23775   }],
23776   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js": [function(require, module, exports) {
23777     'use strict';
23778
23779     var isArray = require('lodash/lang/isArray'),
23780       isString = require('lodash/lang/isString'),
23781       isObject = require('lodash/lang/isObject'),
23782       assign = require('lodash/object/assign'),
23783       forEach = require('lodash/collection/forEach'),
23784       filter = require('lodash/collection/filter'),
23785       debounce = require('lodash/function/debounce');
23786
23787     var domify = require('min-dom/lib/domify'),
23788       domClasses = require('min-dom/lib/classes'),
23789       domRemove = require('min-dom/lib/remove');
23790
23791     var getBBox = require('../../util/Elements').getBBox;
23792
23793     // document wide unique overlay ids
23794     var ids = new(require('../../util/IdGenerator'))('ov');
23795
23796
23797     function createRoot(parent) {
23798       var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
23799       parent.insertBefore(root, parent.firstChild);
23800
23801       return root;
23802     }
23803
23804
23805     function setPosition(el, x, y) {
23806       assign(el.style, {
23807         left: x + 'px',
23808         top: y + 'px'
23809       });
23810     }
23811
23812     function setVisible(el, visible) {
23813       el.style.display = visible === false ? 'none' : '';
23814     }
23815
23816     /**
23817      * A service that allows users to attach overlays to diagram elements.
23818      *
23819      * The overlay service will take care of overlay positioning during updates.
23820      *
23821      * @example
23822      *  // add a pink badge on the top left of the shape overlays.add(someShape, {
23823      * position: { top: -5, left: -5 }, html: '<div style="width: 10px; background:
23824      * fuchsia; color: white;">0</div>' });
23825      *  // or add via shape id
23826      *
23827      * overlays.add('some-element-id', { position: { top: -5, left: -5 } html: '<div
23828      * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23829      *  // or add with optional type
23830      *
23831      * overlays.add(someShape, 'badge', { position: { top: -5, left: -5 } html: '<div
23832      * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23833      *
23834      *  // remove an overlay
23835      *
23836      * var id = overlays.add(...); overlays.remove(id);
23837      *
23838      * @param {EventBus}
23839      *            eventBus
23840      * @param {Canvas}
23841      *            canvas
23842      * @param {ElementRegistry}
23843      *            elementRegistry
23844      */
23845     function Overlays(config, eventBus, canvas, elementRegistry) {
23846
23847       this._eventBus = eventBus;
23848       this._canvas = canvas;
23849       this._elementRegistry = elementRegistry;
23850
23851       this._ids = ids;
23852
23853       this._overlayDefaults = {
23854         show: {
23855           minZoom: 0.7,
23856           maxZoom: 5.0
23857         }
23858       };
23859
23860       /**
23861        * Mapping overlayId -> overlay
23862        */
23863       this._overlays = {};
23864
23865       /**
23866        * Mapping elementId -> overlay container
23867        */
23868       this._overlayContainers = {};
23869
23870       // root html element for all overlays
23871       this._overlayRoot = createRoot(canvas.getContainer());
23872
23873       this._init(config);
23874     }
23875
23876
23877     Overlays.$inject = ['config.overlays', 'eventBus', 'canvas', 'elementRegistry'];
23878
23879     module.exports = Overlays;
23880
23881
23882     /**
23883      * Returns the overlay with the specified id or a list of overlays for an
23884      * element with a given type.
23885      *
23886      * @example
23887      *  // return the single overlay with the given id overlays.get('some-id');
23888      *  // return all overlays for the shape overlays.get({ element: someShape });
23889      *  // return all overlays on shape with type 'badge' overlays.get({ element:
23890      * someShape, type: 'badge' });
23891      *  // shape can also be specified as id overlays.get({ element: 'element-id',
23892      * type: 'badge' });
23893      *
23894      *
23895      * @param {Object}
23896      *            search
23897      * @param {String}
23898      *            [search.id]
23899      * @param {String|djs.model.Base}
23900      *            [search.element]
23901      * @param {String}
23902      *            [search.type]
23903      *
23904      * @return {Object|Array<Object>} the overlay(s)
23905      */
23906     Overlays.prototype.get = function(search) {
23907
23908       if (isString(search)) {
23909         search = {
23910           id: search
23911         };
23912       }
23913
23914       if (search.element) {
23915         var container = this._getOverlayContainer(search.element, true);
23916
23917         // return a list of overlays when searching by element (+type)
23918         if (container) {
23919           return search.type ? filter(container.overlays, {
23920             type: search.type
23921           }) : container.overlays.slice();
23922         } else {
23923           return [];
23924         }
23925       } else
23926       if (search.type) {
23927         return filter(this._overlays, {
23928           type: search.type
23929         });
23930       } else {
23931         // return single element when searching by id
23932         return search.id ? this._overlays[search.id] : null;
23933       }
23934     };
23935
23936     /**
23937      * Adds a HTML overlay to an element.
23938      *
23939      * @param {String|djs.model.Base}
23940      *            element attach overlay to this shape
23941      * @param {String}
23942      *            [type] optional type to assign to the overlay
23943      * @param {Object}
23944      *            overlay the overlay configuration
23945      *
23946      * @param {String|DOMElement}
23947      *            overlay.html html element to use as an overlay
23948      * @param {Object}
23949      *            [overlay.show] show configuration
23950      * @param {Number}
23951      *            [overlay.show.minZoom] minimal zoom level to show the overlay
23952      * @param {Number}
23953      *            [overlay.show.maxZoom] maximum zoom level to show the overlay
23954      * @param {Object}
23955      *            overlay.position where to attach the overlay
23956      * @param {Number}
23957      *            [overlay.position.left] relative to element bbox left attachment
23958      * @param {Number}
23959      *            [overlay.position.top] relative to element bbox top attachment
23960      * @param {Number}
23961      *            [overlay.position.bottom] relative to element bbox bottom
23962      *            attachment
23963      * @param {Number}
23964      *            [overlay.position.right] relative to element bbox right attachment
23965      *
23966      * @return {String} id that may be used to reference the overlay for update or
23967      *         removal
23968      */
23969     Overlays.prototype.add = function(element, type, overlay) {
23970
23971       if (isObject(type)) {
23972         overlay = type;
23973         type = null;
23974       }
23975
23976       if (!element.id) {
23977         element = this._elementRegistry.get(element);
23978       }
23979
23980       if (!overlay.position) {
23981         throw new Error('must specifiy overlay position');
23982       }
23983
23984       if (!overlay.html) {
23985         throw new Error('must specifiy overlay html');
23986       }
23987
23988       if (!element) {
23989         throw new Error('invalid element specified');
23990       }
23991
23992       var id = this._ids.next();
23993
23994       overlay = assign({}, this._overlayDefaults, overlay, {
23995         id: id,
23996         type: type,
23997         element: element,
23998         html: overlay.html
23999       });
24000
24001       this._addOverlay(overlay);
24002
24003       return id;
24004     };
24005
24006
24007     /**
24008      * Remove an overlay with the given id or all overlays matching the given
24009      * filter.
24010      *
24011      * @see Overlays#get for filter options.
24012      *
24013      * @param {String}
24014      *            [id]
24015      * @param {Object}
24016      *            [filter]
24017      */
24018     Overlays.prototype.remove = function(filter) {
24019
24020       var overlays = this.get(filter) || [];
24021
24022       if (!isArray(overlays)) {
24023         overlays = [overlays];
24024       }
24025
24026       var self = this;
24027
24028       forEach(overlays, function(overlay) {
24029
24030         var container = self._getOverlayContainer(overlay.element, true);
24031
24032         if (overlay) {
24033           domRemove(overlay.html);
24034           domRemove(overlay.htmlContainer);
24035
24036           delete overlay.htmlContainer;
24037           delete overlay.element;
24038
24039           delete self._overlays[overlay.id];
24040         }
24041
24042         if (container) {
24043           var idx = container.overlays.indexOf(overlay);
24044           if (idx !== -1) {
24045             container.overlays.splice(idx, 1);
24046           }
24047         }
24048       });
24049
24050     };
24051
24052
24053     Overlays.prototype.show = function() {
24054       setVisible(this._overlayRoot);
24055     };
24056
24057
24058     Overlays.prototype.hide = function() {
24059       setVisible(this._overlayRoot, false);
24060     };
24061
24062
24063     Overlays.prototype._updateOverlayContainer = function(container) {
24064       var element = container.element,
24065         html = container.html;
24066
24067       // update container left,top according to the elements x,y coordinates
24068       // this ensures we can attach child elements relative to this container
24069
24070       var x = element.x,
24071         y = element.y;
24072
24073       if (element.waypoints) {
24074         var bbox = getBBox(element);
24075         x = bbox.x;
24076         y = bbox.y;
24077       }
24078
24079       setPosition(html, x, y);
24080     };
24081
24082
24083     Overlays.prototype._updateOverlay = function(overlay) {
24084
24085       var position = overlay.position,
24086         htmlContainer = overlay.htmlContainer,
24087         element = overlay.element;
24088
24089       // update overlay html relative to shape because
24090       // it is already positioned on the element
24091
24092       // update relative
24093       var left = position.left,
24094         top = position.top;
24095
24096       if (position.right !== undefined) {
24097
24098         var width;
24099
24100         if (element.waypoints) {
24101           width = getBBox(element).width;
24102         } else {
24103           width = element.width;
24104         }
24105
24106         left = position.right * -1 + width;
24107       }
24108
24109       if (position.bottom !== undefined) {
24110
24111         var height;
24112
24113         if (element.waypoints) {
24114           height = getBBox(element).height;
24115         } else {
24116           height = element.height;
24117         }
24118
24119         top = position.bottom * -1 + height;
24120       }
24121
24122       setPosition(htmlContainer, left || 0, top || 0);
24123     };
24124
24125
24126     Overlays.prototype._createOverlayContainer = function(element) {
24127       var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
24128
24129       this._overlayRoot.appendChild(html);
24130
24131       var container = {
24132         html: html,
24133         element: element,
24134         overlays: []
24135       };
24136
24137       this._updateOverlayContainer(container);
24138
24139       return container;
24140     };
24141
24142
24143     Overlays.prototype._updateRoot = function(viewbox) {
24144       var a = viewbox.scale || 1;
24145       var d = viewbox.scale || 1;
24146
24147       var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
24148
24149       this._overlayRoot.style.transform = matrix;
24150       this._overlayRoot.style['-ms-transform'] = matrix;
24151     };
24152
24153
24154     Overlays.prototype._getOverlayContainer = function(element, raw) {
24155       var id = (element && element.id) || element;
24156
24157       var container = this._overlayContainers[id];
24158       if (!container && !raw) {
24159         container = this._overlayContainers[id] = this._createOverlayContainer(element);
24160       }
24161
24162       return container;
24163     };
24164
24165
24166     Overlays.prototype._addOverlay = function(overlay) {
24167
24168       var id = overlay.id,
24169         element = overlay.element,
24170         html = overlay.html,
24171         htmlContainer,
24172         overlayContainer;
24173
24174       // unwrap jquery (for those who need it)
24175       if (html.get) {
24176         html = html.get(0);
24177       }
24178
24179       // create proper html elements from
24180       // overlay HTML strings
24181       if (isString(html)) {
24182         html = domify(html);
24183       }
24184
24185       overlayContainer = this._getOverlayContainer(element);
24186
24187       htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
24188
24189       htmlContainer.appendChild(html);
24190
24191       if (overlay.type) {
24192         domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
24193       }
24194
24195       overlay.htmlContainer = htmlContainer;
24196
24197       overlayContainer.overlays.push(overlay);
24198       overlayContainer.html.appendChild(htmlContainer);
24199
24200       this._overlays[id] = overlay;
24201
24202       this._updateOverlay(overlay);
24203     };
24204
24205     Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
24206
24207       forEach(this._overlays, function(overlay) {
24208         var show = overlay.show,
24209           htmlContainer = overlay.htmlContainer,
24210           visible = true;
24211
24212         if (show) {
24213           if (show.minZoom > viewbox.scale ||
24214             show.maxZoom < viewbox.scale) {
24215             visible = false;
24216           }
24217
24218           setVisible(htmlContainer, visible);
24219         }
24220       });
24221     };
24222
24223     Overlays.prototype._init = function(config) {
24224
24225       var eventBus = this._eventBus;
24226
24227       var self = this;
24228
24229
24230       // scroll/zoom integration
24231
24232       var updateViewbox = function(viewbox) {
24233         self._updateRoot(viewbox);
24234         self._updateOverlayVisibilty(viewbox);
24235
24236         self.show();
24237       };
24238
24239       if (!config || config.deferUpdate !== false) {
24240         updateViewbox = debounce(updateViewbox, 300);
24241       }
24242
24243       eventBus.on('canvas.viewbox.changed', function(event) {
24244         self.hide();
24245         updateViewbox(event.viewbox);
24246       });
24247
24248
24249       // remove integration
24250
24251       eventBus.on(['shape.remove', 'connection.remove'], function(e) {
24252         var overlays = self.get({
24253           element: e.element
24254         });
24255
24256         forEach(overlays, function(o) {
24257           self.remove(o.id);
24258         });
24259       });
24260
24261
24262       // move integration
24263
24264       eventBus.on([
24265         'element.changed'
24266       ], function(e) {
24267         var element = e.element;
24268
24269         var container = self._getOverlayContainer(element, true);
24270
24271         if (container) {
24272           forEach(container.overlays, function(overlay) {
24273             self._updateOverlay(overlay);
24274           });
24275
24276           self._updateOverlayContainer(container);
24277         }
24278       });
24279
24280
24281       // marker integration, simply add them on the overlays as classes, too.
24282
24283       eventBus.on('element.marker.update', function(e) {
24284         var container = self._getOverlayContainer(e.element, true);
24285         if (container) {
24286           domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
24287         }
24288       });
24289     };
24290
24291   }, {
24292     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
24293     "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
24294     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
24295     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24296     "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
24297     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
24298     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
24299     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
24300     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24301     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24302     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24303     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24304   }],
24305   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js": [function(require, module, exports) {
24306     module.exports = {
24307       __init__: ['overlays'],
24308       overlays: ['type', require('./Overlays')]
24309     };
24310   }, {
24311     "./Overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js"
24312   }],
24313   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js": [function(require, module, exports) {
24314     'use strict';
24315
24316     var isFunction = require('lodash/lang/isFunction'),
24317       forEach = require('lodash/collection/forEach');
24318
24319     var domify = require('min-dom/lib/domify'),
24320       domQuery = require('min-dom/lib/query'),
24321       domAttr = require('min-dom/lib/attr'),
24322       domClear = require('min-dom/lib/clear'),
24323       domClasses = require('min-dom/lib/classes'),
24324       domMatches = require('min-dom/lib/matches'),
24325       domDelegate = require('min-dom/lib/delegate'),
24326       domEvent = require('min-dom/lib/event');
24327
24328
24329     var toggleSelector = '.djs-palette-toggle',
24330       entrySelector = '.entry',
24331       elementSelector = toggleSelector + ', ' + entrySelector;
24332
24333
24334     /**
24335      * A palette containing modeling elements.
24336      */
24337     function Palette(eventBus, canvas) {
24338
24339       this._eventBus = eventBus;
24340       this._canvas = canvas;
24341
24342       this._providers = [];
24343     }
24344
24345     Palette.$inject = ['eventBus', 'canvas'];
24346
24347     module.exports = Palette;
24348
24349
24350     /**
24351      * Register a provider with the palette
24352      *
24353      * @param {PaletteProvider}
24354      *            provider
24355      */
24356     Palette.prototype.registerProvider = function(provider) {
24357       this._providers.push(provider);
24358
24359       if (!this._container) {
24360         this._init();
24361       }
24362
24363       this._update();
24364     };
24365
24366
24367     /**
24368      * Returns the palette entries for a given element
24369      *
24370      * @return {Array<PaletteEntryDescriptor>} list of entries
24371      */
24372     Palette.prototype.getEntries = function() {
24373
24374       var entries = {};
24375
24376       // loop through all providers and their entries.
24377       // group entries by id so that overriding an entry is possible
24378       forEach(this._providers, function(provider) {
24379         var e = provider.getPaletteEntries();
24380
24381         forEach(e, function(entry, id) {
24382           entries[id] = entry;
24383         });
24384       });
24385
24386       return entries;
24387     };
24388
24389
24390     /**
24391      * Initialize
24392      */
24393     Palette.prototype._init = function() {
24394       var parent = this._canvas.getContainer(),
24395         container = this._container = domify(Palette.HTML_MARKUP),
24396         self = this;
24397
24398       parent.appendChild(container);
24399
24400       domDelegate.bind(container, elementSelector, 'click', function(event) {
24401
24402         var target = event.delegateTarget;
24403
24404         if (domMatches(target, toggleSelector)) {
24405           return self.toggle();
24406         }
24407
24408         self.trigger('click', event);
24409       });
24410
24411       // prevent drag propagation
24412       domEvent.bind(container, 'mousedown', function(event) {
24413         event.stopPropagation();
24414       });
24415
24416       // prevent drag propagation
24417       domDelegate.bind(container, entrySelector, 'dragstart', function(event) {
24418         self.trigger('dragstart', event);
24419       });
24420
24421       this._eventBus.fire('palette.create', {
24422         html: container
24423       });
24424     };
24425
24426
24427     Palette.prototype._update = function() {
24428
24429       var entriesContainer = domQuery('.djs-palette-entries', this._container),
24430         entries = this._entries = this.getEntries();
24431
24432       domClear(entriesContainer);
24433
24434       forEach(entries, function(entry, id) {
24435
24436         var grouping = entry.group || 'default';
24437
24438         var container = domQuery('[data-group=' + grouping + ']', entriesContainer);
24439         if (!container) {
24440           container = domify('<div class="group" data-group="' + grouping + '"></div>');
24441           entriesContainer.appendChild(container);
24442         }
24443
24444         var html = entry.html || (
24445           entry.separator ?
24446           '<hr class="separator" />' :
24447           '<div class="entry" draggable="true"></div>');
24448
24449
24450         var control = domify(html);
24451         // alert("Control ::" + control + " HTML :: " + html);
24452
24453         container.appendChild(control);
24454
24455         if (!entry.separator) {
24456           domAttr(control, 'data-action', id);
24457
24458           if (entry.title) {
24459             domAttr(control, 'title', entry.title);
24460           }
24461
24462
24463
24464           if (entry.className) {
24465             domClasses(control).add(entry.className);
24466           }
24467
24468           if (entry.imageUrl) {
24469             control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
24470           }
24471         }
24472
24473         // alert("Entry Title :: " + entry.title + " Entry HTML :: " + html);
24474       });
24475
24476       // open after update
24477       this.open(true);
24478     };
24479
24480
24481     /**
24482      * Trigger an action available on the palette
24483      *
24484      * @param {String}
24485      *            action
24486      * @param {Event}
24487      *            event
24488      */
24489     Palette.prototype.trigger = function(action, event, autoActivate) {
24490
24491       var entries = this._entries,
24492         entry,
24493         handler,
24494         originalEvent,
24495         button = event.delegateTarget || event.target;
24496
24497       if (!button) {
24498         return event.preventDefault();
24499       }
24500
24501
24502       entry = entries[domAttr(button, 'data-action')];
24503       handler = entry.action;
24504
24505       originalEvent = event.originalEvent || event;
24506
24507       // simple action (via callback function)
24508       if (isFunction(handler)) {
24509         if (action === 'click') {
24510           return handler(originalEvent, autoActivate);
24511         }
24512       } else {
24513         if (handler[action]) {
24514           return handler[action](originalEvent, autoActivate);
24515         }
24516       }
24517
24518       // silence other actions
24519       event.preventDefault();
24520     };
24521
24522
24523     /**
24524      * Close the palette
24525      */
24526     Palette.prototype.close = function() {
24527       domClasses(this._container).remove('open');
24528     };
24529
24530
24531     /**
24532      * Open the palette
24533      */
24534     Palette.prototype.open = function() {
24535       domClasses(this._container).add('open');
24536     };
24537
24538
24539     Palette.prototype.toggle = function(open) {
24540       if (this.isOpen()) {
24541         this.close();
24542       } else {
24543         this.open();
24544       }
24545     };
24546
24547
24548     /**
24549      * Return true if the palette is opened.
24550      *
24551      * @example
24552      *
24553      * palette.open();
24554      *
24555      * if (palette.isOpen()) { // yes, we are open }
24556      *
24557      * @return {boolean} true if palette is opened
24558      */
24559     Palette.prototype.isOpen = function() {
24560       return this._container && domClasses(this._container).has('open');
24561     };
24562
24563
24564     /* markup definition */
24565
24566     Palette.HTML_MARKUP =
24567       '<div class="djs-palette">' +
24568       '<div class="djs-palette-entries"></div>' +
24569       '<div class="djs-palette-toggle"></div>' +
24570       '</div>';
24571   }, {
24572     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24573     "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
24574     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24575     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24576     "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
24577     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
24578     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24579     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24580     "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js",
24581     "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
24582   }],
24583   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
24584     module.exports = {
24585       __init__: ['palette'],
24586       palette: ['type', require('./Palette')]
24587     };
24588
24589   }, {
24590     "./Palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js"
24591   }],
24592   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js": [function(require, module, exports) {
24593     'use strict';
24594
24595     var forEach = require('lodash/collection/forEach'),
24596       assign = require('lodash/object/assign'),
24597       domEvent = require('min-dom/lib/event'),
24598       domify = require('min-dom/lib/domify'),
24599       domClasses = require('min-dom/lib/classes'),
24600       domAttr = require('min-dom/lib/attr'),
24601       domRemove = require('min-dom/lib/remove');
24602
24603
24604     function PopupMenu(eventBus, canvas) {
24605
24606       this._eventBus = eventBus;
24607       this._canvas = canvas;
24608       this._instances = {};
24609     }
24610
24611     PopupMenu.$inject = ['eventBus', 'canvas'];
24612
24613     module.exports = PopupMenu;
24614
24615     PopupMenu.prototype.open = function(name, position, entries, options) {
24616
24617       var outer = this,
24618         canvas = this._canvas,
24619         instances = outer._instances;
24620
24621       // return existing instance
24622       if (instances[name]) {
24623         return instances[name];
24624       }
24625
24626       var parent = canvas.getContainer();
24627
24628       // ------------------------
24629       function PopupMenuInstance() {
24630
24631         var self = this;
24632
24633         self._actions = {};
24634         self.name = name || 'popup-menu';
24635
24636         var _options = {
24637           entryClassName: 'entry'
24638         };
24639         assign(_options, options);
24640
24641         // Container setup
24642         var container = this._container = domify('<div class="djs-popup">');
24643
24644         assign(container.style, {
24645           position: 'absolute',
24646           left: position.x + 'px',
24647           top: position.y + 'px'
24648         });
24649         domClasses(container).add(name);
24650
24651         // Add entries
24652         forEach(entries, function(entry) {
24653
24654           var entryContainer = domify('<div>');
24655           domClasses(entryContainer).add(entry.className || _options.entryClassName);
24656           domClasses(entryContainer).add('djs-popup-entry');
24657
24658           if (entry.style) {
24659             domAttr(entryContainer, 'style', entry.style);
24660           }
24661
24662           if (entry.action) {
24663             domAttr(entryContainer, 'data-action', entry.action.name);
24664             self._actions[entry.action.name] = entry.action.handler;
24665           }
24666
24667           var title = domify('<span>');
24668           title.textContent = entry.label;
24669           entryContainer.appendChild(title);
24670
24671           container.appendChild(entryContainer);
24672         });
24673
24674         // Event handler
24675         domEvent.bind(container, 'click', function(event) {
24676           self.trigger(event);
24677         });
24678
24679
24680
24681         // apply canvas zoom level
24682         var zoom = canvas.zoom();
24683
24684         container.style.transformOrigin = 'top left';
24685         container.style.transform = 'scale(' + zoom + ')';
24686
24687         // Attach to DOM
24688         parent.appendChild(container);
24689
24690         // Add Handler
24691         this.bindHandlers();
24692       }
24693
24694       PopupMenuInstance.prototype.close = function() {
24695         this.unbindHandlers();
24696         domRemove(this._container);
24697         delete outer._instances[this.name];
24698       };
24699
24700       PopupMenuInstance.prototype.bindHandlers = function() {
24701
24702         var self = this,
24703           eventBus = outer._eventBus;
24704
24705         this._closeHandler = function() {
24706           self.close();
24707         };
24708
24709         eventBus.once('contextPad.close', this._closeHandler);
24710         eventBus.once('canvas.viewbox.changed', this._closeHandler);
24711       };
24712
24713       PopupMenuInstance.prototype.unbindHandlers = function() {
24714
24715         var eventBus = outer._eventBus;
24716
24717         eventBus.off('contextPad.close', this._closeHandler);
24718         eventBus.off('canvas.viewbox.changed', this._closeHandler);
24719       };
24720
24721       PopupMenuInstance.prototype.trigger = function(event) {
24722
24723         var element = event.target,
24724           actionName = element.getAttribute('data-action') ||
24725           element.parentNode.getAttribute('data-action');
24726
24727         var action = this._actions[actionName];
24728
24729
24730         if (action) {
24731           action();
24732         }
24733
24734         // silence other actions
24735         event.preventDefault();
24736       };
24737
24738       var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);
24739
24740       return instance;
24741     };
24742
24743   }, {
24744     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24745     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24746     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24747     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24748     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24749     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24750     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24751   }],
24752   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js": [function(require, module, exports) {
24753     'use strict';
24754
24755     module.exports = {
24756       __init__: ['popupMenu'],
24757       popupMenu: ['type', require('./PopupMenu')]
24758     };
24759
24760   }, {
24761     "./PopupMenu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js"
24762   }],
24763   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js": [function(require, module, exports) {
24764     'use strict';
24765
24766
24767     /**
24768      * Service that allow replacing of elements.
24769      *
24770      *
24771      * @class
24772      * @constructor
24773      */
24774     function Replace(modeling) {
24775
24776       this._modeling = modeling;
24777     }
24778
24779     module.exports = Replace;
24780
24781     Replace.$inject = ['modeling'];
24782
24783     /**
24784      * @param {Element}
24785      *            oldElement - Element to be replaced
24786      * @param {Object}
24787      *            newElementData - Containing information about the new Element, for
24788      *            example height, width, type.
24789      * @param {Object}
24790      *            options - Custom options that will be attached to the context. It
24791      *            can be used to inject data that is needed in the command chain.
24792      *            For example it could be used in
24793      *            eventbus.on('commandStack.shape.replace.postExecute') to change
24794      *            shape attributes after shape creation.
24795      */
24796     Replace.prototype.replaceElement = function(oldElement, newElementData, options) {
24797
24798       var modeling = this._modeling;
24799
24800       var newElement = null;
24801
24802       if (oldElement.waypoints) {
24803         // TODO
24804         // modeling.replaceConnection
24805       } else {
24806         // set center of element for modeling API
24807         // if no new width / height is given use old elements size
24808         newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;
24809         newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;
24810
24811         newElement = modeling.replaceShape(oldElement, newElementData, options);
24812       }
24813
24814       return newElement;
24815     };
24816
24817   }, {}],
24818   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
24819     'use strict';
24820
24821     module.exports = {
24822       __init__: ['replace'],
24823       replace: ['type', require('./Replace')]
24824     };
24825
24826   }, {
24827     "./Replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js"
24828   }],
24829   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js": [function(require, module, exports) {
24830     'use strict';
24831
24832     var forEach = require('lodash/collection/forEach'),
24833       filter = require('lodash/collection/filter'),
24834       pick = require('lodash/object/pick');
24835
24836     var ResizeUtil = require('./ResizeUtil'),
24837       domEvent = require('min-dom/lib/event'),
24838       Elements = require('../../util/Elements');
24839
24840     var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
24841
24842     var round = Math.round;
24843
24844     var Snap = require('../../../vendor/snapsvg');
24845
24846     var HANDLE_OFFSET = -2,
24847       HANDLE_SIZE = 5,
24848       HANDLE_HIT_SIZE = 20;
24849
24850     var MARKER_RESIZING = 'djs-resizing',
24851       MARKER_RESIZE_NOT_OK = 'resize-not-ok',
24852       CLS_RESIZER = 'djs-resizer';
24853
24854
24855     /**
24856      * Implements resize on shapes by
24857      *  * adding resize handles, * creating a visual during resize * checking resize
24858      * rules * committing a change once finished
24859      *
24860      *  ## Customizing
24861      *
24862      * It's possible to customize the resizing behaviour by intercepting
24863      * 'resize.start' and providing the following parameters through the 'context':
24864      *  * minDimensions ({ width, height }) - Minimum shape dimensions *
24865      * childrenBoxPadding (number) - Gap between the minimum bounding box and the
24866      * container
24867      *
24868      * f.ex:
24869      *
24870      * eventBus.on('resize.start', 1500, function(event) { var context =
24871      * event.context,
24872      *
24873      * context.minDimensions = { width: 140, height: 120 };
24874      * context.childrenBoxPadding = 30; });
24875      */
24876
24877     function Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {
24878
24879       function canResize(context) {
24880         var ctx = pick(context, ['newBounds', 'shape', 'delta', 'direction']);
24881         return rules.allowed('shape.resize', ctx);
24882       }
24883
24884
24885       // resizing implementation //////////////////////////////////
24886
24887       /**
24888        * A helper that realizes the resize visuals
24889        */
24890       var visuals = {
24891         create: function(context) {
24892           var container = canvas.getDefaultLayer(),
24893             shape = context.shape,
24894             frame;
24895
24896           frame = context.frame = Snap.create('rect', {
24897             class: 'djs-resize-overlay',
24898             width: shape.width + 10,
24899             height: shape.height + 10,
24900             x: shape.x - 5,
24901             y: shape.y - 5
24902           });
24903
24904           frame.appendTo(container);
24905         },
24906
24907         update: function(context) {
24908           var frame = context.frame,
24909             bounds = context.newBounds;
24910
24911           if (bounds.width > 5) {
24912             frame.attr({
24913               x: bounds.x,
24914               width: bounds.width
24915             });
24916           }
24917
24918           if (bounds.height > 5) {
24919             frame.attr({
24920               y: bounds.y,
24921               height: bounds.height
24922             });
24923           }
24924
24925           frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);
24926         },
24927
24928         remove: function(context) {
24929           if (context.frame) {
24930             context.frame.remove();
24931           }
24932         }
24933       };
24934
24935       function computeMinBoundaryBox(context) {
24936
24937         var shape = context.shape,
24938           direction = context.direction,
24939           minDimensions = context.minDimensions || {},
24940           childrenBoxPadding = context.childrenBoxPadding || 20,
24941           children,
24942           minBoundaryBox;
24943
24944         // grab all the shapes that are NOT labels or connections
24945         children = filter(shape.children, function(child) {
24946           // connections
24947           if (child.waypoints) {
24948             return false;
24949           }
24950
24951           // labels
24952           if (child.type === 'label') {
24953             return false;
24954           }
24955
24956           return true;
24957         });
24958
24959         // compute a minimum bounding box
24960         // around the existing children
24961         if (children.length) {
24962           minBoundaryBox = Elements.getBBox(children);
24963
24964           // add a gap between the minBoundaryBox and the resizable container
24965           minBoundaryBox.width += childrenBoxPadding * 2;
24966           minBoundaryBox.height += childrenBoxPadding * 2;
24967           minBoundaryBox.x -= childrenBoxPadding;
24968           minBoundaryBox.y -= childrenBoxPadding;
24969         } else {
24970           minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {
24971             width: minDimensions.width || 10,
24972             height: minDimensions.height || 10
24973           });
24974         }
24975
24976         return minBoundaryBox;
24977       }
24978
24979       eventBus.on('resize.start', function(event) {
24980
24981         var context = event.context,
24982           shape = context.shape,
24983           minBoundaryBox = context.minBoundaryBox;
24984
24985         if (minBoundaryBox === undefined) {
24986           context.minBoundaryBox = computeMinBoundaryBox(context);
24987         }
24988
24989         // add resizable indicator
24990         canvas.addMarker(shape, MARKER_RESIZING);
24991
24992         visuals.create(context);
24993       });
24994
24995       eventBus.on('resize.move', function(event) {
24996
24997         var context = event.context,
24998           shape = context.shape,
24999           direction = context.direction,
25000           minBoundaryBox = context.minBoundaryBox,
25001           delta;
25002
25003         delta = {
25004           x: event.dx,
25005           y: event.dy
25006         };
25007
25008         context.delta = delta;
25009
25010         context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);
25011
25012         if (minBoundaryBox) {
25013           context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);
25014         }
25015
25016         // update + cache executable state
25017         context.canExecute = canResize(context);
25018
25019         // update resize frame visuals
25020         visuals.update(context);
25021       });
25022
25023       eventBus.on('resize.end', function(event) {
25024         var context = event.context,
25025           shape = context.shape;
25026
25027         var newBounds = context.newBounds;
25028
25029
25030         // ensure we have actual pixel values for new bounds
25031         // (important when zoom level was > 1 during move)
25032         newBounds.x = round(newBounds.x);
25033         newBounds.y = round(newBounds.y);
25034         newBounds.width = round(newBounds.width);
25035         newBounds.height = round(newBounds.height);
25036
25037         // perform the actual resize
25038         if (context.canExecute) {
25039           modeling.resizeShape(shape, context.newBounds);
25040         }
25041       });
25042
25043       eventBus.on('resize.cleanup', function(event) {
25044
25045         var context = event.context,
25046           shape = context.shape;
25047
25048         // remove resizable indicator
25049         canvas.removeMarker(shape, MARKER_RESIZING);
25050
25051         // remove frame + destroy context
25052         visuals.remove(context);
25053       });
25054
25055
25056       function activate(event, shape, direction) {
25057
25058         dragging.activate(event, 'resize', {
25059           autoActivate: true,
25060           cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),
25061           data: {
25062             shape: shape,
25063             context: {
25064               direction: direction,
25065               shape: shape
25066             }
25067           }
25068         });
25069       }
25070
25071       function makeDraggable(element, gfx, direction) {
25072
25073         function listener(event) {
25074           // only trigger on left mouse button
25075           if (isPrimaryButton(event)) {
25076             activate(event, element, direction);
25077           }
25078         }
25079
25080         domEvent.bind(gfx.node, 'mousedown', listener);
25081         domEvent.bind(gfx.node, 'touchstart', listener);
25082       }
25083
25084       function __createResizer(gfx, x, y, rotation, direction) {
25085
25086         var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);
25087
25088         var origin = -HANDLE_SIZE + HANDLE_OFFSET;
25089
25090         // Create four drag indicators on the outline
25091         group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');
25092         group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');
25093
25094         var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);
25095         group.transform(matrix);
25096
25097         return group;
25098       }
25099
25100       function createResizer(element, gfx, direction) {
25101
25102         var resizer;
25103
25104         if (direction === 'nw') {
25105           resizer = __createResizer(gfx, 0, 0, 0, direction);
25106         } else if (direction === 'ne') {
25107           resizer = __createResizer(gfx, element.width, 0, 90, direction);
25108         } else if (direction === 'se') {
25109           resizer = __createResizer(gfx, element.width, element.height, 180, direction);
25110         } else {
25111           resizer = __createResizer(gfx, 0, element.height, 270, direction);
25112         }
25113
25114         makeDraggable(element, resizer, direction);
25115       }
25116
25117       // resize handles implementation ///////////////////////////////
25118
25119       function addResize(shape) {
25120
25121         if (!canResize({
25122             shape: shape
25123           })) {
25124           return;
25125         }
25126
25127         var gfx = elementRegistry.getGraphics(shape);
25128
25129         createResizer(shape, gfx, 'nw');
25130         createResizer(shape, gfx, 'ne');
25131         createResizer(shape, gfx, 'se');
25132         createResizer(shape, gfx, 'sw');
25133       }
25134
25135       function removeResize(shape) {
25136
25137         var gfx = elementRegistry.getGraphics(shape);
25138         var resizers = gfx.selectAll('.' + CLS_RESIZER);
25139
25140         forEach(resizers, function(resizer) {
25141           resizer.remove();
25142         });
25143       }
25144
25145       eventBus.on('selection.changed', function(e) {
25146
25147         var oldSelection = e.oldSelection,
25148           newSelection = e.newSelection;
25149
25150         // remove old selection markers
25151         forEach(oldSelection, removeResize);
25152
25153         // add new selection markers ONLY if single selection
25154         if (newSelection.length === 1) {
25155           forEach(newSelection, addResize);
25156         }
25157       });
25158
25159       eventBus.on('shape.changed', function(e) {
25160         var shape = e.element;
25161
25162         removeResize(shape);
25163
25164         if (selection.isSelected(shape)) {
25165           addResize(shape);
25166         }
25167       });
25168
25169
25170       // API
25171
25172       this.activate = activate;
25173     }
25174
25175     Resize.$inject = ['eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging'];
25176
25177     module.exports = Resize;
25178
25179   }, {
25180     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
25181     "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
25182     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
25183     "./ResizeUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js",
25184     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
25185     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25186     "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js",
25187     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
25188   }],
25189   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js": [function(require, module, exports) {
25190     'use strict';
25191
25192     /**
25193      * Resize the given bounds by the specified delta from a given anchor point.
25194      *
25195      * @param {Bounds}
25196      *            bounds the bounding box that should be resized
25197      * @param {String}
25198      *            direction in which the element is resized (nw, ne, se, sw)
25199      * @param {Point}
25200      *            delta of the resize operation
25201      *
25202      * @return {Bounds} resized bounding box
25203      */
25204     module.exports.resizeBounds = function(bounds, direction, delta) {
25205
25206       var dx = delta.x,
25207         dy = delta.y;
25208
25209       switch (direction) {
25210
25211         case 'nw':
25212           return {
25213             x: bounds.x + dx,
25214             y: bounds.y + dy,
25215             width: bounds.width - dx,
25216             height: bounds.height - dy
25217           };
25218
25219         case 'sw':
25220           return {
25221             x: bounds.x + dx,
25222             y: bounds.y,
25223             width: bounds.width - dx,
25224             height: bounds.height + dy
25225           };
25226
25227         case 'ne':
25228           return {
25229             x: bounds.x,
25230             y: bounds.y + dy,
25231             width: bounds.width + dx,
25232             height: bounds.height - dy
25233           };
25234
25235         case 'se':
25236           return {
25237             x: bounds.x,
25238             y: bounds.y,
25239             width: bounds.width + dx,
25240             height: bounds.height + dy
25241           };
25242
25243         default:
25244           throw new Error('unrecognized direction: ' + direction);
25245       }
25246     };
25247
25248     module.exports.reattachPoint = function(bounds, newBounds, point) {
25249
25250       var sx = bounds.width / newBounds.width,
25251         sy = bounds.height / newBounds.height;
25252
25253       return {
25254         x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),
25255         y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)
25256       };
25257     };
25258
25259
25260     module.exports.ensureMinBounds = function(currentBounds, minBounds) {
25261       var topLeft = {
25262         x: Math.min(currentBounds.x, minBounds.x),
25263         y: Math.min(currentBounds.y, minBounds.y)
25264       };
25265
25266       var bottomRight = {
25267         x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),
25268         y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)
25269       };
25270
25271       return {
25272         x: topLeft.x,
25273         y: topLeft.y,
25274         width: bottomRight.x - topLeft.x,
25275         height: bottomRight.y - topLeft.y
25276       };
25277     };
25278
25279
25280     module.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {
25281
25282       switch (direction) {
25283         case 'nw':
25284           return {
25285             x: currentBounds.x + currentBounds.width - minDimensions.width,
25286             y: currentBounds.y + currentBounds.height - minDimensions.height,
25287             width: minDimensions.width,
25288             height: minDimensions.height
25289           };
25290         case 'sw':
25291           return {
25292             x: currentBounds.x + currentBounds.width - minDimensions.width,
25293             y: currentBounds.y,
25294             width: minDimensions.width,
25295             height: minDimensions.height
25296           };
25297         case 'ne':
25298           return {
25299             x: currentBounds.x,
25300             y: currentBounds.y + currentBounds.height - minDimensions.height,
25301             width: minDimensions.width,
25302             height: minDimensions.height
25303           };
25304         case 'se':
25305           return {
25306             x: currentBounds.x,
25307             y: currentBounds.y,
25308             width: minDimensions.width,
25309             height: minDimensions.height
25310           };
25311         default:
25312           throw new Error('unrecognized direction: ' + direction);
25313       }
25314     };
25315
25316
25317
25318   }, {}],
25319   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js": [function(require, module, exports) {
25320     module.exports = {
25321       __depends__: [
25322         require('../modeling'),
25323         require('../rules'),
25324         require('../dragging')
25325       ],
25326       __init__: ['resize'],
25327       resize: ['type', require('./Resize')]
25328     };
25329
25330   }, {
25331     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
25332     "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
25333     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
25334     "./Resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js"
25335   }],
25336   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js": [function(require, module, exports) {
25337     'use strict';
25338
25339     var inherits = require('inherits');
25340
25341     var CommandInterceptor = require('../../command/CommandInterceptor');
25342
25343     /**
25344      * A basic provider that may be extended to implement modeling rules.
25345      *
25346      * Extensions should implement the init method to actually add their custom
25347      * modeling checks. Checks may be added via the #addRule(action, fn) method.
25348      *
25349      * @param {EventBus}
25350      *            eventBus
25351      */
25352     function RuleProvider(eventBus) {
25353       CommandInterceptor.call(this, eventBus);
25354
25355       this.init();
25356     }
25357
25358     RuleProvider.$inject = ['eventBus'];
25359
25360     inherits(RuleProvider, CommandInterceptor);
25361
25362     module.exports = RuleProvider;
25363
25364
25365     /**
25366      * Adds a modeling rule for the given action, implemented through a callback
25367      * function.
25368      *
25369      * The function will receive the modeling specific action context to perform its
25370      * check. It must return false or null to disallow the action from happening.
25371      *
25372      * Returning <code>null</code> may encode simply ignoring the action.
25373      *
25374      * @example
25375      *
25376      * ResizableRules.prototype.init = function() {
25377      *
25378      * this.addRule('shape.resize', function(context) {
25379      *
25380      * var shape = context.shape;
25381      *
25382      * if (!context.newBounds) { // check general resizability if (!shape.resizable) {
25383      * return false; } } else { // element must have minimum size of 10*10 points
25384      * return context.newBounds.width > 10 && context.newBounds.height > 10; } }); };
25385      *
25386      * @param {String|Array
25387      *            <String>} actions the identifier for the modeling action to check
25388      * @param {Function}
25389      *            fn the callback function that performs the actual check
25390      */
25391     RuleProvider.prototype.addRule = function(actions, fn) {
25392
25393       var self = this;
25394
25395       if (typeof actions === 'string') {
25396         actions = [actions];
25397       }
25398
25399       actions.forEach(function(action) {
25400
25401         self.canExecute(action, function(context, action, event) {
25402           return fn(context);
25403         }, true);
25404       });
25405     };
25406   }, {
25407     "../../command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
25408     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
25409   }],
25410   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js": [function(require, module, exports) {
25411     'use strict';
25412
25413     /**
25414      * A service that provides rules for certain diagram actions.
25415      *
25416      * @param {CommandStack}
25417      *            commandStack
25418      */
25419     function Rules(commandStack) {
25420       this._commandStack = commandStack;
25421     }
25422
25423     Rules.$inject = ['commandStack'];
25424
25425     module.exports = Rules;
25426
25427
25428     /**
25429      * This method can be queried to ask whether certain modeling actions are
25430      * allowed or not.
25431      *
25432      * @param {String}
25433      *            action the action to be checked
25434      * @param {Object}
25435      *            [context] the context to check the action in
25436      *
25437      * @return {Boolean} returns true, false or null depending on whether the
25438      *         operation is allowed, not allowed or should be ignored.
25439      */
25440     Rules.prototype.allowed = function(action, context) {
25441       var allowed = this._commandStack.canExecute(action, context);
25442
25443       // map undefined to true, i.e. no rules
25444       return allowed === undefined ? true : allowed;
25445     };
25446   }, {}],
25447   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js": [function(require, module, exports) {
25448     module.exports = {
25449       __depends__: [require('../../command')],
25450       __init__: ['rules'],
25451       rules: ['type', require('./Rules')]
25452     };
25453
25454   }, {
25455     "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
25456     "./Rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js"
25457   }],
25458   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js": [function(require, module, exports) {
25459     'use strict';
25460
25461     var isArray = require('lodash/lang/isArray'),
25462       forEach = require('lodash/collection/forEach');
25463
25464
25465     /**
25466      * A service that offers the current selection in a diagram. Offers the api to
25467      * control the selection, too.
25468      *
25469      * @class
25470      *
25471      * @param {EventBus}
25472      *            eventBus the event bus
25473      */
25474     function Selection(eventBus) {
25475
25476       this._eventBus = eventBus;
25477
25478       this._selectedElements = [];
25479
25480       var self = this;
25481
25482       eventBus.on(['shape.remove', 'connection.remove'], function(e) {
25483         var element = e.element;
25484         self.deselect(element);
25485       });
25486     }
25487
25488     Selection.$inject = ['eventBus'];
25489
25490     module.exports = Selection;
25491
25492
25493     Selection.prototype.deselect = function(element) {
25494       var selectedElements = this._selectedElements;
25495
25496       var idx = selectedElements.indexOf(element);
25497
25498       if (idx !== -1) {
25499         var oldSelection = selectedElements.slice();
25500
25501         selectedElements.splice(idx, 1);
25502
25503         this._eventBus.fire('selection.changed', {
25504           oldSelection: oldSelection,
25505           newSelection: selectedElements
25506         });
25507       }
25508     };
25509
25510
25511     Selection.prototype.get = function() {
25512       return this._selectedElements;
25513     };
25514
25515     Selection.prototype.isSelected = function(element) {
25516       return this._selectedElements.indexOf(element) !== -1;
25517     };
25518
25519
25520     /**
25521      * This method selects one or more elements on the diagram.
25522      *
25523      * By passing an additional add parameter you can decide whether or not the
25524      * element(s) should be added to the already existing selection or not.
25525      *
25526      * @method Selection#select
25527      *
25528      * @param {Object|Object[]}
25529      *            elements element or array of elements to be selected
25530      * @param {boolean}
25531      *            [add] whether the element(s) should be appended to the current
25532      *            selection, defaults to false
25533      */
25534     Selection.prototype.select = function(elements, add) {
25535       var selectedElements = this._selectedElements,
25536         oldSelection = selectedElements.slice();
25537
25538       if (!isArray(elements)) {
25539         elements = elements ? [elements] : [];
25540       }
25541
25542       // selection may be cleared by passing an empty array or null
25543       // to the method
25544       if (add) {
25545         forEach(elements, function(element) {
25546           if (selectedElements.indexOf(element) !== -1) {
25547             // already selected
25548             return;
25549           } else {
25550             selectedElements.push(element);
25551           }
25552         });
25553       } else {
25554         this._selectedElements = selectedElements = elements.slice();
25555       }
25556       this._eventBus.fire('selection.changed', {
25557         oldSelection: oldSelection,
25558         newSelection: selectedElements
25559       });
25560     };
25561
25562   }, {
25563     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25564     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
25565   }],
25566   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js": [function(require, module, exports) {
25567     'use strict';
25568
25569     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
25570
25571
25572     function SelectionBehavior(eventBus, selection, canvas) {
25573
25574       eventBus.on('create.end', 500, function(e) {
25575         if (e.context.canExecute) {
25576           selection.select(e.shape);
25577         }
25578       });
25579
25580       eventBus.on('connect.end', 500, function(e) {
25581         if (e.context.canExecute && e.context.target) {
25582           selection.select(e.context.target);
25583         }
25584       });
25585
25586       eventBus.on('shape.move.end', 500, function(e) {
25587         selection.select(e.context.shapes);
25588       });
25589
25590       eventBus.on('element.keydown', function(event) {
25591         alert("Key Down Elements ");
25592       });
25593       // Shift + click selection
25594       eventBus.on('element.click', function(event) {
25595
25596         var element = event.element;
25597
25598         // do not select the root element
25599         // or connections
25600         if (element === canvas.getRootElement()) {
25601           element = null;
25602         }
25603
25604         var isSelected = selection.isSelected(element),
25605           isMultiSelect = selection.get().length > 1;
25606
25607         // mouse-event: SELECTION_KEY
25608         var add = hasPrimaryModifier(event);
25609
25610         // select OR deselect element in multi selection
25611         if (isSelected && isMultiSelect) {
25612           if (add) {
25613             return selection.deselect(element);
25614           } else {
25615             return selection.select(element);
25616           }
25617         } else
25618         if (!isSelected) {
25619           selection.select(element, add);
25620         } else {
25621           selection.deselect(element);
25622         }
25623       });
25624
25625     }
25626
25627     SelectionBehavior.$inject = ['eventBus', 'selection', 'canvas'];
25628
25629     module.exports = SelectionBehavior;
25630
25631   }, {
25632     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js"
25633   }],
25634   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js": [function(require, module, exports) {
25635     'use strict';
25636
25637     var forEach = require('lodash/collection/forEach');
25638
25639     var MARKER_HOVER = 'hover',
25640       MARKER_SELECTED = 'selected';
25641
25642
25643     /**
25644      * A plugin that adds a visible selection UI to shapes and connections by
25645      * appending the <code>hover</code> and <code>selected</code> classes to
25646      * them.
25647      *
25648      * @class
25649      *
25650      * Makes elements selectable, too.
25651      *
25652      * @param {EventBus}
25653      *            events
25654      * @param {SelectionService}
25655      *            selection
25656      * @param {Canvas}
25657      *            canvas
25658      */
25659     function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
25660
25661       this._multiSelectionBox = null;
25662
25663       function addMarker(e, cls) {
25664         canvas.addMarker(e, cls);
25665       }
25666
25667       function removeMarker(e, cls) {
25668         canvas.removeMarker(e, cls);
25669       }
25670
25671       events.on('element.hover', function(event) {
25672         addMarker(event.element, MARKER_HOVER);
25673       });
25674
25675       events.on('element.out', function(event) {
25676         removeMarker(event.element, MARKER_HOVER);
25677       });
25678
25679       events.on('selection.changed', function(event) {
25680
25681         function deselect(s) {
25682           removeMarker(s, MARKER_SELECTED);
25683         }
25684
25685         function select(s) {
25686           addMarker(s, MARKER_SELECTED);
25687         }
25688
25689         var oldSelection = event.oldSelection,
25690           newSelection = event.newSelection;
25691
25692         forEach(oldSelection, function(e) {
25693           if (newSelection.indexOf(e) === -1) {
25694             deselect(e);
25695           }
25696         });
25697
25698         forEach(newSelection, function(e) {
25699           if (oldSelection.indexOf(e) === -1) {
25700             select(e);
25701           }
25702         });
25703       });
25704     }
25705
25706     SelectionVisuals.$inject = [
25707       'eventBus',
25708       'canvas',
25709       'selection',
25710       'graphicsFactory',
25711       'styles'
25712     ];
25713
25714     module.exports = SelectionVisuals;
25715
25716   }, {
25717     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25718   }],
25719   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js": [function(require, module, exports) {
25720     module.exports = {
25721       __init__: ['selectionVisuals', 'selectionBehavior'],
25722       __depends__: [
25723         require('../interaction-events'),
25724         require('../outline')
25725       ],
25726       selection: ['type', require('./Selection')],
25727       selectionVisuals: ['type', require('./SelectionVisuals')],
25728       selectionBehavior: ['type', require('./SelectionBehavior')]
25729     };
25730
25731   }, {
25732     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
25733     "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
25734     "./Selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js",
25735     "./SelectionBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js",
25736     "./SelectionVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js"
25737   }],
25738   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js": [function(require, module, exports) {
25739     'use strict';
25740
25741     var forEach = require('lodash/collection/forEach');
25742
25743     var snapTo = require('./SnapUtil').snapTo;
25744
25745
25746     /**
25747      * A snap context, containing the (possibly incomplete) mappings of drop targets
25748      * (to identify the snapping) to computed snap points.
25749      */
25750     function SnapContext() {
25751
25752       /**
25753        * Map<String, SnapPoints> mapping drop targets to a list of possible
25754        * snappings.
25755        *
25756        * @type {Object}
25757        */
25758       this._targets = {};
25759
25760       /**
25761        * Map<String, Point> initial positioning of element regarding various snap
25762        * directions.
25763        *
25764        * @type {Object}
25765        */
25766       this._snapOrigins = {};
25767
25768       /**
25769        * List of snap locations
25770        *
25771        * @type {Array<String>}
25772        */
25773       this._snapLocations = [];
25774
25775       /**
25776        * Map<String, Array<Point>> of default snapping locations
25777        *
25778        * @type {Object}
25779        */
25780       this._defaultSnaps = {};
25781     }
25782
25783
25784     SnapContext.prototype.getSnapOrigin = function(snapLocation) {
25785       return this._snapOrigins[snapLocation];
25786     };
25787
25788
25789     SnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {
25790       this._snapOrigins[snapLocation] = initialValue;
25791
25792       if (this._snapLocations.indexOf(snapLocation) === -1) {
25793         this._snapLocations.push(snapLocation);
25794       }
25795     };
25796
25797
25798     SnapContext.prototype.addDefaultSnap = function(type, point) {
25799
25800       var snapValues = this._defaultSnaps[type];
25801
25802       if (!snapValues) {
25803         snapValues = this._defaultSnaps[type] = [];
25804       }
25805
25806       snapValues.push(point);
25807     };
25808
25809     /**
25810      * Return a number of initialized snaps, i.e. snap locations such as top-left,
25811      * mid, bottom-right and so forth.
25812      *
25813      * @return {Array<String>} snapLocations
25814      */
25815     SnapContext.prototype.getSnapLocations = function() {
25816       return this._snapLocations;
25817     };
25818
25819     /**
25820      * Set the snap locations for this context.
25821      *
25822      * The order of locations determines precedence.
25823      *
25824      * @param {Array
25825      *            <String>} snapLocations
25826      */
25827     SnapContext.prototype.setSnapLocations = function(snapLocations) {
25828       this._snapLocations = snapLocations;
25829     };
25830
25831     /**
25832      * Get snap points for a given target
25833      *
25834      * @param {Element|String}
25835      *            target
25836      */
25837     SnapContext.prototype.pointsForTarget = function(target) {
25838
25839       var targetId = target.id || target;
25840
25841       var snapPoints = this._targets[targetId];
25842
25843       if (!snapPoints) {
25844         snapPoints = this._targets[targetId] = new SnapPoints();
25845         snapPoints.initDefaults(this._defaultSnaps);
25846       }
25847
25848       return snapPoints;
25849     };
25850
25851     module.exports = SnapContext;
25852
25853
25854     /**
25855      * Creates the snap points and initializes them with the given default values.
25856      *
25857      * @param {Object
25858      *            <String, Array<Point>>} [defaultPoints]
25859      */
25860     function SnapPoints(defaultSnaps) {
25861
25862       /**
25863        * Map<String, Map<(x|y), Array<Number>>> mapping snap locations, i.e.
25864        * top-left, bottom-right, center to actual snap values.
25865        *
25866        * @type {Object}
25867        */
25868       this._snapValues = {};
25869     }
25870
25871     SnapPoints.prototype.add = function(snapLocation, point) {
25872
25873       var snapValues = this._snapValues[snapLocation];
25874
25875       if (!snapValues) {
25876         snapValues = this._snapValues[snapLocation] = {
25877           x: [],
25878           y: []
25879         };
25880       }
25881
25882       if (snapValues.x.indexOf(point.x) === -1) {
25883         snapValues.x.push(point.x);
25884       }
25885
25886       if (snapValues.y.indexOf(point.y) === -1) {
25887         snapValues.y.push(point.y);
25888       }
25889     };
25890
25891
25892     SnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {
25893       var snappingValues = this._snapValues[snapLocation];
25894
25895       return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);
25896     };
25897
25898     /**
25899      * Initialize a number of default snapping points.
25900      *
25901      * @param {Object}
25902      *            defaultSnaps
25903      */
25904     SnapPoints.prototype.initDefaults = function(defaultSnaps) {
25905
25906       var self = this;
25907
25908       forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {
25909         forEach(snapPoints, function(point) {
25910           self.add(snapLocation, point);
25911         });
25912       });
25913     };
25914   }, {
25915     "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
25916     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25917   }],
25918   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js": [function(require, module, exports) {
25919     'use strict';
25920
25921     var abs = Math.abs,
25922       round = Math.round;
25923
25924
25925     /**
25926      * Snap value to a collection of reference values.
25927      *
25928      * @param {Number}
25929      *            value
25930      * @param {Array
25931      *            <Number>} values
25932      * @param {Number}
25933      *            [tolerance=10]
25934      *
25935      * @return {Number} the value we snapped to or null, if none snapped
25936      */
25937     function snapTo(value, values, tolerance) {
25938       tolerance = tolerance === undefined ? 10 : tolerance;
25939
25940       var idx, snapValue;
25941
25942       for (idx = 0; idx < values.length; idx++) {
25943         snapValue = values[idx];
25944
25945         if (abs(snapValue - value) <= tolerance) {
25946           return snapValue;
25947         }
25948       }
25949     }
25950
25951
25952     module.exports.snapTo = snapTo;
25953
25954
25955     function topLeft(bounds) {
25956       return {
25957         x: bounds.x,
25958         y: bounds.y
25959       };
25960     }
25961
25962     module.exports.topLeft = topLeft;
25963
25964
25965     function mid(bounds, defaultValue) {
25966
25967       if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
25968         return defaultValue;
25969       }
25970
25971       return {
25972         x: round(bounds.x + bounds.width / 2),
25973         y: round(bounds.y + bounds.height / 2)
25974       };
25975     }
25976
25977     module.exports.mid = mid;
25978
25979
25980     function bottomRight(bounds) {
25981       return {
25982         x: bounds.x + bounds.width,
25983         y: bounds.y + bounds.height
25984       };
25985     }
25986
25987     module.exports.bottomRight = bottomRight;
25988   }, {}],
25989   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js": [function(require, module, exports) {
25990     'use strict';
25991
25992     var filter = require('lodash/collection/filter'),
25993       forEach = require('lodash/collection/forEach'),
25994       debounce = require('lodash/function/debounce');
25995
25996
25997     var mid = require('./SnapUtil').mid;
25998
25999     var SnapContext = require('./SnapContext');
26000
26001     /**
26002      * A general purpose snapping component for diagram elements.
26003      *
26004      * @param {EventBus}
26005      *            eventBus
26006      * @param {Canvas}
26007      *            canvas
26008      */
26009     function Snapping(eventBus, canvas) {
26010
26011       this._canvas = canvas;
26012
26013       var self = this;
26014
26015       eventBus.on(['shape.move.start', 'create.start'], function(event) {
26016         self.initSnap(event);
26017       });
26018
26019       eventBus.on(['shape.move.move', 'shape.move.end', 'create.move', 'create.end'], function(event) {
26020         if (event.snapped) {
26021           return;
26022         }
26023
26024         self.snap(event);
26025       });
26026
26027       eventBus.on(['shape.move.cleanup', 'create.cleanup'], function(event) {
26028         self.hide();
26029       });
26030
26031       // delay hide by 1000 seconds since last match
26032       this._asyncHide = debounce(this.hide, 1000);
26033     }
26034
26035     Snapping.$inject = ['eventBus', 'canvas'];
26036
26037     module.exports = Snapping;
26038
26039
26040     Snapping.prototype.initSnap = function(event) {
26041
26042       var context = event.context,
26043         shape = context.shape,
26044         snapContext = context.snapContext;
26045
26046       if (!snapContext) {
26047         snapContext = context.snapContext = new SnapContext();
26048       }
26049
26050       var snapMid = mid(shape, event);
26051
26052       snapContext.setSnapOrigin('mid', {
26053         x: snapMid.x - event.x,
26054         y: snapMid.y - event.y
26055       });
26056
26057       return snapContext;
26058     };
26059
26060
26061     Snapping.prototype.snap = function(event) {
26062
26063       var context = event.context,
26064         snapContext = context.snapContext,
26065         shape = context.shape,
26066         target = context.target,
26067         snapLocations = snapContext.getSnapLocations();
26068
26069       if (!target) {
26070         return;
26071       }
26072
26073       var snapPoints = snapContext.pointsForTarget(target);
26074
26075       if (!snapPoints.initialized) {
26076         this.addTargetSnaps(snapPoints, shape, target);
26077
26078         snapPoints.initialized = true;
26079       }
26080
26081
26082       var snapping = {};
26083
26084       forEach(snapLocations, function(location) {
26085
26086         var snapOrigin = snapContext.getSnapOrigin(location);
26087
26088         var snapCurrent = {
26089           x: event.x + snapOrigin.x,
26090           y: event.y + snapOrigin.y
26091         };
26092
26093         // snap on both axis, if not snapped already
26094         forEach(['x', 'y'], function(axis) {
26095           var locationSnapping;
26096
26097           if (!snapping[axis]) {
26098             locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);
26099
26100             if (locationSnapping !== undefined) {
26101               snapping[axis] = {
26102                 value: locationSnapping,
26103                 originValue: locationSnapping - snapOrigin[axis]
26104               };
26105             }
26106           }
26107         });
26108
26109         // no more need to snap, drop out of interation
26110         if (snapping.x && snapping.y) {
26111           return false;
26112         }
26113       });
26114
26115
26116       // show snap visuals
26117
26118       this.showSnapLine('vertical', snapping.x && snapping.x.value);
26119       this.showSnapLine('horizontal', snapping.y && snapping.y.value);
26120
26121
26122       // adjust event { x, y, dx, dy } and mark as snapping
26123       var cx, cy;
26124
26125       if (snapping.x) {
26126
26127         cx = event.x - snapping.x.originValue;
26128
26129         event.x = snapping.x.originValue;
26130         event.dx = event.dx - cx;
26131
26132         event.snapped = true;
26133       }
26134
26135       if (snapping.y) {
26136         cy = event.y - snapping.y.originValue;
26137
26138         event.y = snapping.y.originValue;
26139         event.dy = event.dy - cy;
26140
26141         event.snapped = true;
26142       }
26143     };
26144
26145
26146     Snapping.prototype._createLine = function(orientation) {
26147
26148       var root = this._canvas.getLayer('snap');
26149
26150       var line = root.path('M0,0 L0,0').addClass('djs-snap-line');
26151
26152       return {
26153         update: function(position) {
26154
26155           if (position === undefined) {
26156             line.attr({
26157               display: 'none'
26158             });
26159           } else {
26160             if (orientation === 'horizontal') {
26161               line.attr({
26162                 path: 'M-100000,' + position + ' L+100000,' + position,
26163                 display: ''
26164               });
26165             } else {
26166               line.attr({
26167                 path: 'M ' + position + ',-100000 L ' + position + ', +100000',
26168                 display: ''
26169               });
26170             }
26171           }
26172         }
26173       };
26174     };
26175
26176
26177     Snapping.prototype._createSnapLines = function() {
26178
26179       this._snapLines = {
26180         horizontal: this._createLine('horizontal'),
26181         vertical: this._createLine('vertical')
26182       };
26183     };
26184
26185     Snapping.prototype.showSnapLine = function(orientation, position) {
26186
26187       var line = this.getSnapLine(orientation);
26188
26189       if (line) {
26190         line.update(position);
26191       }
26192
26193       this._asyncHide();
26194     };
26195
26196     Snapping.prototype.getSnapLine = function(orientation) {
26197       if (!this._snapLines) {
26198         this._createSnapLines();
26199       }
26200
26201       return this._snapLines[orientation];
26202     };
26203
26204     Snapping.prototype.hide = function() {
26205       forEach(this._snapLines, function(l) {
26206         l.update();
26207       });
26208     };
26209
26210     Snapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
26211
26212       var siblings = this.getSiblings(shape, target);
26213
26214       forEach(siblings, function(s) {
26215         snapPoints.add('mid', mid(s));
26216       });
26217
26218     };
26219
26220     Snapping.prototype.getSiblings = function(element, target) {
26221
26222       // snap to all non connection siblings
26223       return target && filter(target.children, function(e) {
26224         return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;
26225       });
26226     };
26227   }, {
26228     "./SnapContext": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js",
26229     "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
26230     "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
26231     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26232     "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js"
26233   }],
26234   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js": [function(require, module, exports) {
26235     'use strict';
26236
26237     var SpaceUtil = require('./SpaceUtil');
26238
26239     var Cursor = require('../../util/Cursor');
26240
26241     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
26242
26243     var abs = Math.abs,
26244       round = Math.round;
26245
26246     var HIGH_PRIORITY = 1500;
26247
26248     /**
26249      * A tool that allows users to create and remove space in a diagram.
26250      *
26251      * The tool needs to be activated manually via
26252      * {@link SpaceTool#activate(MouseEvent)}.
26253      */
26254     function SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {
26255
26256       function canResize(shape) {
26257         var ctx = {
26258           shape: shape
26259         };
26260         return rules.allowed('shape.resize', ctx);
26261       }
26262
26263       function activateSelection(event, autoActivate) {
26264         dragging.activate(event, 'spaceTool.selection', {
26265           cursor: 'crosshair',
26266           autoActivate: autoActivate,
26267           data: {
26268             context: {
26269               crosshair: {}
26270             }
26271           }
26272         });
26273       }
26274
26275       function activateMakeSpace(event) {
26276         dragging.activate(event, 'spaceTool', {
26277           autoActivate: true,
26278           cursor: 'crosshair',
26279           data: {
26280             context: {}
26281           }
26282         });
26283       }
26284
26285
26286       eventBus.on('spaceTool.selection.end', function(event) {
26287         setTimeout(function() {
26288           activateMakeSpace(event.originalEvent);
26289         });
26290       });
26291
26292
26293       var AXIS_TO_DIMENSION = {
26294           x: 'width',
26295           y: 'height'
26296         },
26297         AXIS_INVERTED = {
26298           x: 'y',
26299           y: 'x'
26300         };
26301
26302
26303       function initializeMakeSpace(event, context) {
26304
26305         var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',
26306           offset = event['d' + axis],
26307           // start point of create space operation
26308           spacePos = event[axis] - offset,
26309           // list of moving shapes
26310           movingShapes = [],
26311           // list of resizing shapes
26312           resizingShapes = [];
26313
26314         if (abs(offset) < 5) {
26315           return false;
26316         }
26317
26318         // inverts the offset to choose the shapes
26319         // on the opposite side of the resizer if
26320         // a key modifier is pressed
26321         if (hasPrimaryModifier(event)) {
26322           offset *= -1;
26323         }
26324
26325         // collect all elements that need to be moved _AND_
26326         // resized given on the initial create space position
26327         elementRegistry.forEach(function(shape) {
26328           var shapeStart = shape[[axis]],
26329             shapeEnd = shapeStart + shape[AXIS_TO_DIMENSION[axis]];
26330
26331           // checking if it's root
26332           if (!shape.parent) {
26333             return;
26334           }
26335
26336           // checking if it's a shape
26337           if (shape.waypoints) {
26338             return;
26339           }
26340
26341           // shape after spacePos
26342           if (offset > 0 && shapeStart > spacePos) {
26343             return movingShapes.push(shape);
26344           }
26345
26346           // shape before spacePos
26347           if (offset < 0 && shapeEnd < spacePos) {
26348             return movingShapes.push(shape);
26349           }
26350
26351           // shape on top of spacePos, resize only if allowed
26352           if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {
26353             return resizingShapes.push(shape);
26354           }
26355         });
26356
26357         // store data in context
26358         context.axis = axis;
26359         context.direction = SpaceUtil.getDirection(axis, offset);
26360         context.movingShapes = movingShapes;
26361         context.resizingShapes = resizingShapes;
26362
26363         Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
26364
26365         return true;
26366       }
26367
26368
26369       eventBus.on('spaceTool.move', HIGH_PRIORITY, function(event) {
26370
26371         var context = event.context;
26372
26373         if (!context.initialized) {
26374           context.initialized = initializeMakeSpace(event, context);
26375         }
26376       });
26377
26378
26379       eventBus.on('spaceTool.end', function(event) {
26380
26381         var context = event.context,
26382           axis = context.axis,
26383           direction = context.direction,
26384           movingShapes = context.movingShapes,
26385           resizingShapes = context.resizingShapes;
26386
26387         // skip if create space has not been initialized yet
26388         if (!context.initialized) {
26389           return;
26390         }
26391
26392         var delta = {
26393           x: round(event.dx),
26394           y: round(event.dy)
26395         };
26396         delta[AXIS_INVERTED[axis]] = 0;
26397
26398         return modeling.createSpace(movingShapes, resizingShapes, delta, direction);
26399       });
26400
26401       // API
26402       this.activateSelection = activateSelection;
26403       this.activateMakeSpace = activateMakeSpace;
26404     }
26405
26406     SpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];
26407
26408     module.exports = SpaceTool;
26409
26410   }, {
26411     "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
26412     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
26413     "./SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js"
26414   }],
26415   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js": [function(require, module, exports) {
26416     'use strict';
26417
26418     var forEach = require('lodash/collection/forEach');
26419
26420
26421     var MARKER_DRAGGING = 'djs-dragging';
26422
26423
26424     /**
26425      * A plugin that makes shapes draggable / droppable.
26426      *
26427      * @param {EventBus}
26428      *            eventBus
26429      * @param {ElementRegistry}
26430      *            elementRegistry
26431      * @param {Canvas}
26432      *            canvas
26433      * @param {Styles}
26434      *            styles
26435      */
26436
26437     function SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {
26438
26439       function getGfx(e) {
26440         return elementRegistry.getGraphics(e);
26441       }
26442
26443       function addDragger(shape, dragGroup) {
26444         var gfx = getGfx(shape);
26445         var dragger = gfx.clone();
26446         var bbox = gfx.getBBox();
26447
26448         dragger.attr(styles.cls('djs-dragger', [], {
26449           x: bbox.x,
26450           y: bbox.y
26451         }));
26452
26453         dragGroup.add(dragger);
26454       }
26455
26456       eventBus.on('spaceTool.selection.start', function(event) {
26457         var space = canvas.getLayer('space'),
26458           context = event.context;
26459
26460         var orientation = {
26461           x: 'M 0,-10000 L 0,10000',
26462           y: 'M -10000,0 L 10000,0'
26463         };
26464
26465         var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', ['no-events']));
26466
26467         crosshairGroup.path(orientation.x).addClass('djs-crosshair');
26468         crosshairGroup.path(orientation.y).addClass('djs-crosshair');
26469
26470         context.crosshairGroup = crosshairGroup;
26471       });
26472
26473       eventBus.on('spaceTool.selection.move', function(event) {
26474         var crosshairGroup = event.context.crosshairGroup;
26475
26476         crosshairGroup.translate(event.x, event.y);
26477       });
26478
26479       eventBus.on('spaceTool.selection.cleanup', function(event) {
26480         var context = event.context,
26481           crosshairGroup = context.crosshairGroup;
26482
26483         if (crosshairGroup) {
26484           crosshairGroup.remove();
26485         }
26486       });
26487
26488
26489       // assign a low priority to this handler
26490       // to let others modify the move context before
26491       // we draw things
26492       eventBus.on('spaceTool.move', function(event) {
26493         /*
26494          * TODO (Ricardo): extend connections while adding space
26495          */
26496
26497         var context = event.context,
26498           line = context.line,
26499           axis = context.axis,
26500           dragShapes = context.movingShapes;
26501
26502         if (!context.initialized) {
26503           return;
26504         }
26505
26506         if (!context.dragGroup) {
26507           var spaceLayer = canvas.getLayer('space');
26508           line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');
26509
26510           context.line = line;
26511           var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
26512
26513
26514           forEach(dragShapes, function(shape) {
26515             addDragger(shape, dragGroup);
26516             canvas.addMarker(shape, MARKER_DRAGGING);
26517           });
26518
26519           context.dragGroup = dragGroup;
26520         }
26521
26522         var orientation = {
26523           x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',
26524           y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
26525         };
26526
26527         line.attr({
26528           path: orientation[axis],
26529           display: ''
26530         });
26531
26532         var opposite = {
26533           x: 'y',
26534           y: 'x'
26535         };
26536         var delta = {
26537           x: event.dx,
26538           y: event.dy
26539         };
26540         delta[opposite[context.axis]] = 0;
26541
26542         context.dragGroup.translate(delta.x, delta.y);
26543       });
26544
26545       eventBus.on('spaceTool.cleanup', function(event) {
26546
26547         var context = event.context,
26548           shapes = context.movingShapes,
26549           line = context.line,
26550           dragGroup = context.dragGroup;
26551
26552         // remove dragging marker
26553         forEach(shapes, function(e) {
26554           canvas.removeMarker(e, MARKER_DRAGGING);
26555         });
26556
26557         if (dragGroup) {
26558           line.remove();
26559           dragGroup.remove();
26560         }
26561       });
26562     }
26563
26564     SpaceToolVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
26565
26566     module.exports = SpaceToolVisuals;
26567
26568   }, {
26569     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
26570   }],
26571   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js": [function(require, module, exports) {
26572     'use strict';
26573
26574     /**
26575      * Get Resize direction given axis + offset
26576      *
26577      * @param {String}
26578      *            axis (x|y)
26579      * @param {Number}
26580      *            offset
26581      *
26582      * @return {String} (e|w|n|s)
26583      */
26584     function getDirection(axis, offset) {
26585
26586       if (axis === 'x') {
26587         if (offset > 0) {
26588           return 'e';
26589         }
26590
26591         if (offset < 0) {
26592           return 'w';
26593         }
26594       }
26595
26596       if (axis === 'y') {
26597         if (offset > 0) {
26598           return 's';
26599         }
26600
26601         if (offset < 0) {
26602           return 'n';
26603         }
26604       }
26605
26606       return null;
26607     }
26608
26609     module.exports.getDirection = getDirection;
26610
26611     /**
26612      * Resize the given bounds by the specified delta from a given anchor point.
26613      *
26614      * @param {Bounds}
26615      *            bounds the bounding box that should be resized
26616      * @param {String}
26617      *            direction in which the element is resized (n, s, e, w)
26618      * @param {Point}
26619      *            delta of the resize operation
26620      *
26621      * @return {Bounds} resized bounding box
26622      */
26623     module.exports.resizeBounds = function(bounds, direction, delta) {
26624
26625       var dx = delta.x,
26626         dy = delta.y;
26627
26628       switch (direction) {
26629
26630         case 'n':
26631           return {
26632             x: bounds.x,
26633             y: bounds.y + dy,
26634             width: bounds.width,
26635             height: bounds.height - dy
26636           };
26637
26638         case 's':
26639           return {
26640             x: bounds.x,
26641             y: bounds.y,
26642             width: bounds.width,
26643             height: bounds.height + dy
26644           };
26645
26646         case 'w':
26647           return {
26648             x: bounds.x + dx,
26649             y: bounds.y,
26650             width: bounds.width - dx,
26651             height: bounds.height
26652           };
26653
26654         case 'e':
26655           return {
26656             x: bounds.x,
26657             y: bounds.y,
26658             width: bounds.width + dx,
26659             height: bounds.height
26660           };
26661
26662         default:
26663           throw new Error('unrecognized direction: ' + direction);
26664       }
26665     };
26666   }, {}],
26667   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js": [function(require, module, exports) {
26668     module.exports = {
26669       __init__: ['spaceToolVisuals'],
26670       __depends__: [require('../dragging'), require('../modeling'), require('../rules')],
26671       spaceTool: ['type', require('./SpaceTool')],
26672       spaceToolVisuals: ['type', require('./SpaceToolVisuals')]
26673     };
26674
26675   }, {
26676     "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
26677     "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
26678     "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
26679     "./SpaceTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js",
26680     "./SpaceToolVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js"
26681   }],
26682   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js": [function(require, module, exports) {
26683     'use strict';
26684
26685     var isString = require('lodash/lang/isString'),
26686       assign = require('lodash/object/assign'),
26687       forEach = require('lodash/collection/forEach'),
26688       debounce = require('lodash/function/debounce');
26689
26690     var domify = require('min-dom/lib/domify'),
26691       domAttr = require('min-dom/lib/attr'),
26692       domClasses = require('min-dom/lib/classes'),
26693       domRemove = require('min-dom/lib/remove'),
26694       domDelegate = require('min-dom/lib/delegate');
26695
26696
26697     // document wide unique tooltip ids
26698     var ids = new(require('../../util/IdGenerator'))('tt');
26699
26700
26701     function createRoot(parent) {
26702       var root = domify('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');
26703       parent.insertBefore(root, parent.firstChild);
26704
26705       return root;
26706     }
26707
26708
26709     function setPosition(el, x, y) {
26710       assign(el.style, {
26711         left: x + 'px',
26712         top: y + 'px'
26713       });
26714     }
26715
26716     function setVisible(el, visible) {
26717       el.style.display = visible === false ? 'none' : '';
26718     }
26719
26720
26721     var tooltipClass = 'djs-tooltip',
26722       tooltipSelector = '.' + tooltipClass;
26723
26724     /**
26725      * A service that allows users to render tool tips on the diagram.
26726      *
26727      * The tooltip service will take care of updating the tooltip positioning during
26728      * navigation + zooming.
26729      *
26730      * @example
26731      *
26732      * ```javascript
26733      *  // add a pink badge on the top left of the shape tooltips.add({ position: {
26734      * x: 50, y: 100 }, html: '<div style="width: 10px; background: fuchsia; color:
26735      * white;">0</div>' });
26736      *  // or with optional life span tooltips.add({ position: { top: -5, left: -5 },
26737      * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
26738      * ttl: 2000 });
26739      *  // remove a tool tip var id = tooltips.add(...); tooltips.remove(id); ```
26740      *
26741      * @param {Object}
26742      *            config
26743      * @param {EventBus}
26744      *            eventBus
26745      * @param {Canvas}
26746      *            canvas
26747      */
26748     function Tooltips(config, eventBus, canvas) {
26749
26750       this._eventBus = eventBus;
26751       this._canvas = canvas;
26752
26753       this._ids = ids;
26754
26755       this._tooltipDefaults = {
26756         show: {
26757           minZoom: 0.7,
26758           maxZoom: 5.0
26759         }
26760       };
26761
26762       /**
26763        * Mapping tooltipId -> tooltip
26764        */
26765       this._tooltips = {};
26766
26767       // root html element for all tooltips
26768       this._tooltipRoot = createRoot(canvas.getContainer());
26769
26770
26771       var self = this;
26772
26773       domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
26774         event.stopPropagation();
26775       });
26776
26777       domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
26778         self.trigger('mouseover', event);
26779       });
26780
26781       domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
26782         self.trigger('mouseout', event);
26783       });
26784
26785       this._init(config);
26786     }
26787
26788
26789     Tooltips.$inject = ['config.tooltips', 'eventBus', 'canvas'];
26790
26791     module.exports = Tooltips;
26792
26793
26794     /**
26795      * Adds a HTML tooltip to the diagram
26796      *
26797      * @param {Object}
26798      *            tooltip the tooltip configuration
26799      *
26800      * @param {String|DOMElement}
26801      *            tooltip.html html element to use as an tooltip
26802      * @param {Object}
26803      *            [tooltip.show] show configuration
26804      * @param {Number}
26805      *            [tooltip.show.minZoom] minimal zoom level to show the tooltip
26806      * @param {Number}
26807      *            [tooltip.show.maxZoom] maximum zoom level to show the tooltip
26808      * @param {Object}
26809      *            tooltip.position where to attach the tooltip
26810      * @param {Number}
26811      *            [tooltip.position.left] relative to element bbox left attachment
26812      * @param {Number}
26813      *            [tooltip.position.top] relative to element bbox top attachment
26814      * @param {Number}
26815      *            [tooltip.position.bottom] relative to element bbox bottom
26816      *            attachment
26817      * @param {Number}
26818      *            [tooltip.position.right] relative to element bbox right attachment
26819      * @param {Number}
26820      *            [tooltip.timeout=-1]
26821      *
26822      * @return {String} id that may be used to reference the tooltip for update or
26823      *         removal
26824      */
26825     Tooltips.prototype.add = function(tooltip) {
26826
26827       if (!tooltip.position) {
26828         throw new Error('must specifiy tooltip position');
26829       }
26830
26831       if (!tooltip.html) {
26832         throw new Error('must specifiy tooltip html');
26833       }
26834
26835       var id = this._ids.next();
26836
26837       tooltip = assign({}, this._tooltipDefaults, tooltip, {
26838         id: id
26839       });
26840
26841       this._addTooltip(tooltip);
26842
26843       if (tooltip.timeout) {
26844         this.setTimeout(tooltip);
26845       }
26846
26847       return id;
26848     };
26849
26850     Tooltips.prototype.trigger = function(action, event) {
26851
26852       var node = event.delegateTarget || event.target;
26853
26854       var tooltip = this.get(domAttr(node, 'data-tooltip-id'));
26855
26856       if (!tooltip) {
26857         return;
26858       }
26859
26860       if (action === 'mouseover' && tooltip.timeout) {
26861         this.clearTimeout(tooltip);
26862       }
26863
26864       if (action === 'mouseout' && tooltip.timeout) {
26865         // cut timeout after mouse out
26866         tooltip.timeout = 1000;
26867
26868         this.setTimeout(tooltip);
26869       }
26870
26871       console.log('mouse leave', event);
26872     };
26873
26874     /**
26875      * Get a tooltip with the given id
26876      *
26877      * @param {String}
26878      *            id
26879      */
26880     Tooltips.prototype.get = function(id) {
26881
26882       if (typeof id !== 'string') {
26883         id = id.id;
26884       }
26885
26886       return this._tooltips[id];
26887     };
26888
26889     Tooltips.prototype.clearTimeout = function(tooltip) {
26890
26891       tooltip = this.get(tooltip);
26892
26893       if (!tooltip) {
26894         return;
26895       }
26896
26897       var removeTimer = tooltip.removeTimer;
26898
26899       if (removeTimer) {
26900         clearTimeout(removeTimer);
26901         tooltip.removeTimer = null;
26902       }
26903     };
26904
26905     Tooltips.prototype.setTimeout = function(tooltip) {
26906
26907       tooltip = this.get(tooltip);
26908
26909       if (!tooltip) {
26910         return;
26911       }
26912
26913       this.clearTimeout(tooltip);
26914
26915       var self = this;
26916
26917       tooltip.removeTimer = setTimeout(function() {
26918         self.remove(tooltip);
26919       }, tooltip.timeout);
26920     };
26921
26922     /**
26923      * Remove an tooltip with the given id
26924      *
26925      * @param {String}
26926      *            id
26927      */
26928     Tooltips.prototype.remove = function(id) {
26929
26930       var tooltip = this.get(id);
26931
26932       if (tooltip) {
26933         domRemove(tooltip.html);
26934         domRemove(tooltip.htmlContainer);
26935
26936         delete tooltip.htmlContainer;
26937
26938         delete this._tooltips[tooltip.id];
26939       }
26940     };
26941
26942
26943     Tooltips.prototype.show = function() {
26944       setVisible(this._tooltipRoot);
26945     };
26946
26947
26948     Tooltips.prototype.hide = function() {
26949       setVisible(this._tooltipRoot, false);
26950     };
26951
26952
26953     Tooltips.prototype._updateRoot = function(viewbox) {
26954       var a = viewbox.scale || 1;
26955       var d = viewbox.scale || 1;
26956
26957       var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
26958
26959       this._tooltipRoot.style.transform = matrix;
26960       this._tooltipRoot.style['-ms-transform'] = matrix;
26961     };
26962
26963
26964     Tooltips.prototype._addTooltip = function(tooltip) {
26965
26966       var id = tooltip.id,
26967         html = tooltip.html,
26968         htmlContainer,
26969         tooltipRoot = this._tooltipRoot;
26970
26971       // unwrap jquery (for those who need it)
26972       if (html.get) {
26973         html = html.get(0);
26974       }
26975
26976       // create proper html elements from
26977       // tooltip HTML strings
26978       if (isString(html)) {
26979         html = domify(html);
26980       }
26981
26982       htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="position: absolute">');
26983
26984       htmlContainer.appendChild(html);
26985
26986       if (tooltip.type) {
26987         domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
26988       }
26989
26990       if (tooltip.className) {
26991         domClasses(htmlContainer).add(tooltip.className);
26992       }
26993
26994       tooltip.htmlContainer = htmlContainer;
26995
26996       tooltipRoot.appendChild(htmlContainer);
26997
26998       this._tooltips[id] = tooltip;
26999
27000       this._updateTooltip(tooltip);
27001     };
27002
27003
27004     Tooltips.prototype._updateTooltip = function(tooltip) {
27005
27006       var position = tooltip.position,
27007         htmlContainer = tooltip.htmlContainer;
27008
27009       // update overlay html based on tooltip x, y
27010
27011       setPosition(htmlContainer, position.x, position.y);
27012     };
27013
27014
27015     Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
27016
27017       forEach(this._tooltips, function(tooltip) {
27018         var show = tooltip.show,
27019           htmlContainer = tooltip.htmlContainer,
27020           visible = true;
27021
27022         if (show) {
27023           if (show.minZoom > viewbox.scale ||
27024             show.maxZoom < viewbox.scale) {
27025             visible = false;
27026           }
27027
27028           setVisible(htmlContainer, visible);
27029         }
27030       });
27031     };
27032
27033     Tooltips.prototype._init = function(config) {
27034
27035       var self = this;
27036
27037
27038       // scroll/zoom integration
27039
27040       var updateViewbox = function(viewbox) {
27041         self._updateRoot(viewbox);
27042         self._updateTooltipVisibilty(viewbox);
27043
27044         self.show();
27045       };
27046
27047       if (!config || config.deferUpdate !== false) {
27048         updateViewbox = debounce(updateViewbox, 300);
27049       }
27050
27051       this._eventBus.on('canvas.viewbox.changed', function(event) {
27052         self.hide();
27053         updateViewbox(event.viewbox);
27054       });
27055     };
27056
27057   }, {
27058     "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
27059     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27060     "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
27061     "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
27062     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
27063     "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
27064     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
27065     "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
27066     "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
27067     "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
27068   }],
27069   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js": [function(require, module, exports) {
27070     module.exports = {
27071       __init__: ['tooltips'],
27072       tooltips: ['type', require('./Tooltips')]
27073     };
27074   }, {
27075     "./Tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js"
27076   }],
27077   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js": [function(require, module, exports) {
27078     'use strict';
27079
27080     function TouchFix(canvas, eventBus) {
27081
27082       var self = this;
27083
27084       eventBus.on('canvas.init', function(e) {
27085         self.addBBoxMarker(e.svg);
27086       });
27087     }
27088
27089     TouchFix.$inject = ['canvas', 'eventBus'];
27090
27091     module.exports = TouchFix;
27092
27093
27094     /**
27095      * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element if
27096      * there is no shape between 0,0 and viewport elements origin.
27097      *
27098      * So touchstart event is only fired when the <g class="viewport"> element was
27099      * hit. Putting an element over and below the 'viewport' fixes that behavior.
27100      */
27101     TouchFix.prototype.addBBoxMarker = function(paper) {
27102
27103       var markerStyle = {
27104         fill: 'none',
27105         class: 'outer-bound-marker'
27106       };
27107
27108       paper.rect(-10000, -10000, 10, 10).attr(markerStyle);
27109       paper.rect(10000, 10000, 10, 10).attr(markerStyle);
27110     };
27111
27112   }, {}],
27113   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js": [function(require, module, exports) {
27114     'use strict';
27115
27116     var forEach = require('lodash/collection/forEach'),
27117       domEvent = require('min-dom/lib/event'),
27118       domClosest = require('min-dom/lib/closest'),
27119       Hammer = require('hammerjs'),
27120       Snap = require('../../../vendor/snapsvg'),
27121       Event = require('../../util/Event');
27122
27123     var MIN_ZOOM = 0.2,
27124       MAX_ZOOM = 4;
27125
27126     var mouseEvents = [
27127       'mousedown',
27128       'mouseup',
27129       'mouseover',
27130       'mouseout',
27131       'click',
27132       'dblclick'
27133     ];
27134
27135     function log() {
27136       if (false) {
27137         console.log.apply(console, arguments);
27138       }
27139     }
27140
27141     function get(service, injector) {
27142       try {
27143         return injector.get(service);
27144       } catch (e) {
27145         return null;
27146       }
27147     }
27148
27149     function createTouchRecognizer(node) {
27150
27151       function stopEvent(event) {
27152         Event.stopEvent(event, true);
27153       }
27154
27155       function stopMouse(event) {
27156
27157         forEach(mouseEvents, function(e) {
27158           domEvent.bind(node, e, stopEvent, true);
27159         });
27160       }
27161
27162       function allowMouse(event) {
27163         setTimeout(function() {
27164           forEach(mouseEvents, function(e) {
27165             domEvent.unbind(node, e, stopEvent, true);
27166           });
27167         }, 500);
27168       }
27169
27170       domEvent.bind(node, 'touchstart', stopMouse, true);
27171       domEvent.bind(node, 'touchend', allowMouse, true);
27172       domEvent.bind(node, 'touchcancel', allowMouse, true);
27173
27174       // A touch event recognizer that handles
27175       // touch events only (we know, we can already handle
27176       // mouse events out of the box)
27177
27178       var recognizer = new Hammer.Manager(node, {
27179         inputClass: Hammer.TouchInput,
27180         recognizers: []
27181       });
27182
27183
27184       var tap = new Hammer.Tap();
27185       var pan = new Hammer.Pan({
27186         threshold: 10
27187       });
27188       var press = new Hammer.Press();
27189       var pinch = new Hammer.Pinch();
27190
27191       var doubleTap = new Hammer.Tap({
27192         event: 'doubletap',
27193         taps: 2
27194       });
27195
27196       pinch.requireFailure(pan);
27197       pinch.requireFailure(press);
27198
27199       recognizer.add([pan, press, pinch, doubleTap, tap]);
27200
27201       recognizer.reset = function(force) {
27202         var recognizers = this.recognizers,
27203           session = this.session;
27204
27205         if (session.stopped) {
27206           return;
27207         }
27208
27209         log('recognizer', 'stop');
27210
27211         recognizer.stop(force);
27212
27213         setTimeout(function() {
27214           var i, r;
27215
27216           log('recognizer', 'reset');
27217           for (i = 0; !!(r = recognizers[i]); i++) {
27218             r.reset();
27219             r.state = 8; // FAILED STATE
27220           }
27221
27222           session.curRecognizer = null;
27223         }, 0);
27224       };
27225
27226       recognizer.on('hammer.input', function(event) {
27227         if (event.srcEvent.defaultPrevented) {
27228           recognizer.reset(true);
27229         }
27230       });
27231
27232       return recognizer;
27233     }
27234
27235     /**
27236      * A plugin that provides touch events for elements.
27237      *
27238      * @param {EventBus}
27239      *            eventBus
27240      * @param {InteractionEvents}
27241      *            interactionEvents
27242      */
27243     function TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {
27244
27245       // optional integrations
27246       var dragging = get('dragging', injector),
27247         move = get('move', injector),
27248         contextPad = get('contextPad', injector),
27249         palette = get('palette', injector);
27250
27251       // the touch recognizer
27252       var recognizer;
27253
27254       function handler(type) {
27255
27256         return function(event) {
27257           log('element', type, event);
27258
27259           interactionEvents.fire(type, event);
27260         };
27261       }
27262
27263       function getGfx(target) {
27264         var node = domClosest(target, 'svg, .djs-element', true);
27265         return node && new Snap(node);
27266       }
27267
27268       function initEvents(svg) {
27269
27270         // touch recognizer
27271         recognizer = createTouchRecognizer(svg);
27272
27273         recognizer.on('doubletap', handler('element.dblclick'));
27274
27275         recognizer.on('tap', handler('element.click'));
27276
27277         function startGrabCanvas(event) {
27278
27279           log('canvas', 'grab start');
27280
27281           var lx = 0,
27282             ly = 0;
27283
27284           function update(e) {
27285
27286             var dx = e.deltaX - lx,
27287               dy = e.deltaY - ly;
27288
27289             canvas.scroll({
27290               dx: dx,
27291               dy: dy
27292             });
27293
27294             lx = e.deltaX;
27295             ly = e.deltaY;
27296           }
27297
27298           function end(e) {
27299             recognizer.off('panmove', update);
27300             recognizer.off('panend', end);
27301             recognizer.off('pancancel', end);
27302
27303             log('canvas', 'grab end');
27304           }
27305
27306           recognizer.on('panmove', update);
27307           recognizer.on('panend', end);
27308           recognizer.on('pancancel', end);
27309         }
27310
27311         function startGrab(event) {
27312
27313           var gfx = getGfx(event.target),
27314             element = gfx && elementRegistry.get(gfx);
27315
27316           // recognizer
27317           if (move && canvas.getRootElement() !== element) {
27318             log('element', 'move start', element, event, true);
27319             return move.start(event, element, true);
27320           } else {
27321             startGrabCanvas(event);
27322           }
27323         }
27324
27325         function startZoom(e) {
27326
27327           log('canvas', 'zoom start');
27328
27329           var zoom = canvas.zoom(),
27330             mid = e.center;
27331
27332           function update(e) {
27333
27334             var ratio = 1 - (1 - e.scale) / 1.50,
27335               newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));
27336
27337             canvas.zoom(newZoom, mid);
27338
27339             Event.stopEvent(e, true);
27340           }
27341
27342           function end(e) {
27343             recognizer.off('pinchmove', update);
27344             recognizer.off('pinchend', end);
27345             recognizer.off('pinchcancel', end);
27346
27347             recognizer.reset(true);
27348
27349             log('canvas', 'zoom end');
27350           }
27351
27352           recognizer.on('pinchmove', update);
27353           recognizer.on('pinchend', end);
27354           recognizer.on('pinchcancel', end);
27355         }
27356
27357         recognizer.on('panstart', startGrab);
27358         recognizer.on('press', startGrab);
27359
27360         recognizer.on('pinchstart', startZoom);
27361       }
27362
27363       if (dragging) {
27364
27365         // simulate hover during dragging
27366         eventBus.on('drag.move', function(event) {
27367
27368           var position = Event.toPoint(event.originalEvent);
27369
27370           var node = document.elementFromPoint(position.x, position.y),
27371             gfx = getGfx(node),
27372             element = gfx && elementRegistry.get(gfx);
27373
27374           if (element !== event.hover) {
27375             if (event.hover) {
27376               dragging.out(event);
27377             }
27378
27379             if (element) {
27380               dragging.hover({
27381                 element: element,
27382                 gfx: gfx
27383               });
27384
27385               event.hover = element;
27386               event.hoverGfx = gfx;
27387             }
27388           }
27389         });
27390       }
27391
27392       if (contextPad) {
27393
27394         eventBus.on('contextPad.create', function(event) {
27395           var node = event.pad.html;
27396
27397           // touch recognizer
27398           var padRecognizer = createTouchRecognizer(node);
27399
27400           padRecognizer.on('panstart', function(event) {
27401             log('context-pad', 'panstart', event);
27402             contextPad.trigger('dragstart', event, true);
27403           });
27404
27405           padRecognizer.on('press', function(event) {
27406             log('context-pad', 'press', event);
27407             contextPad.trigger('dragstart', event, true);
27408           });
27409
27410           padRecognizer.on('tap', function(event) {
27411             log('context-pad', 'tap', event);
27412             contextPad.trigger('click', event);
27413           });
27414         });
27415       }
27416
27417       if (palette) {
27418         eventBus.on('palette.create', function(event) {
27419           var node = event.html;
27420
27421           // touch recognizer
27422           var padRecognizer = createTouchRecognizer(node);
27423
27424           padRecognizer.on('panstart', function(event) {
27425             log('palette', 'panstart', event);
27426             palette.trigger('dragstart', event, true);
27427           });
27428
27429           padRecognizer.on('press', function(event) {
27430             log('palette', 'press', event);
27431             palette.trigger('dragstart', event, true);
27432           });
27433
27434           padRecognizer.on('tap', function(event) {
27435             log('palette', 'tap', event);
27436             palette.trigger('click', event);
27437           });
27438         });
27439       }
27440
27441       eventBus.on('canvas.init', function(event) {
27442         initEvents(event.svg.node);
27443       });
27444     }
27445
27446
27447     TouchInteractionEvents.$inject = [
27448       'injector',
27449       'canvas',
27450       'eventBus',
27451       'elementRegistry',
27452       'interactionEvents',
27453       'touchFix'
27454     ];
27455
27456     module.exports = TouchInteractionEvents;
27457   }, {
27458     "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27459     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
27460     "hammerjs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js",
27461     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27462     "min-dom/lib/closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js",
27463     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
27464   }],
27465   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js": [function(require, module, exports) {
27466     module.exports = {
27467       __depends__: [require('../interaction-events')],
27468       __init__: ['touchInteractionEvents'],
27469       touchInteractionEvents: ['type', require('./TouchInteractionEvents')],
27470       touchFix: ['type', require('./TouchFix')]
27471     };
27472   }, {
27473     "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
27474     "./TouchFix": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js",
27475     "./TouchInteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js"
27476   }],
27477   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js": [function(require, module, exports) {
27478     'use strict';
27479
27480     var LayoutUtil = require('./LayoutUtil');
27481
27482
27483     /**
27484      * A base connection layouter implementation that layouts the connection by
27485      * directly connecting mid(source) + mid(target).
27486      */
27487     function BaseLayouter() {}
27488
27489     module.exports = BaseLayouter;
27490
27491
27492     /**
27493      * Return the new layouted waypoints for the given connection.
27494      *
27495      * @param {djs.model.Connection}
27496      *            connection
27497      * @param {Object}
27498      *            hints
27499      * @param {Boolean}
27500      *            [hints.movedStart=false]
27501      * @param {Boolean}
27502      *            [hints.movedEnd=false]
27503      *
27504      * @return {Array<Point>} the layouted connection waypoints
27505      */
27506     BaseLayouter.prototype.layoutConnection = function(connection, hints) {
27507       return [
27508         LayoutUtil.getMidPoint(connection.source),
27509         LayoutUtil.getMidPoint(connection.target)
27510       ];
27511     };
27512
27513   }, {
27514     "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
27515   }],
27516   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js": [function(require, module, exports) {
27517     'use strict';
27518
27519     var assign = require('lodash/object/assign');
27520
27521     var LayoutUtil = require('./LayoutUtil');
27522
27523
27524     function dockingToPoint(docking) {
27525       // use the dockings actual point and
27526       // retain the original docking
27527       return assign({
27528         original: docking.point.original || docking.point
27529       }, docking.actual);
27530     }
27531
27532
27533     /**
27534      * A {@link ConnectionDocking} that crops connection waypoints based on the
27535      * path(s) of the connection source and target.
27536      *
27537      * @param {djs.core.ElementRegistry}
27538      *            elementRegistry
27539      */
27540     function CroppingConnectionDocking(elementRegistry, renderer) {
27541       this._elementRegistry = elementRegistry;
27542       this._renderer = renderer;
27543     }
27544
27545     CroppingConnectionDocking.$inject = ['elementRegistry', 'renderer'];
27546
27547     module.exports = CroppingConnectionDocking;
27548
27549
27550     /**
27551      * @inheritDoc ConnectionDocking#getCroppedWaypoints
27552      */
27553     CroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {
27554
27555       source = source || connection.source;
27556       target = target || connection.target;
27557
27558       var sourceDocking = this.getDockingPoint(connection, source, true),
27559         targetDocking = this.getDockingPoint(connection, target);
27560
27561       var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);
27562
27563       croppedWaypoints.unshift(dockingToPoint(sourceDocking));
27564       croppedWaypoints.push(dockingToPoint(targetDocking));
27565
27566       return croppedWaypoints;
27567     };
27568
27569     /**
27570      * Return the connection docking point on the specified shape
27571      *
27572      * @inheritDoc ConnectionDocking#getDockingPoint
27573      */
27574     CroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {
27575
27576       var waypoints = connection.waypoints,
27577         dockingIdx,
27578         dockingPoint,
27579         croppedPoint;
27580
27581       dockingIdx = dockStart ? 0 : waypoints.length - 1;
27582       dockingPoint = waypoints[dockingIdx];
27583
27584       croppedPoint = this._getIntersection(shape, connection, dockStart);
27585
27586       return {
27587         point: dockingPoint,
27588         actual: croppedPoint || dockingPoint,
27589         idx: dockingIdx
27590       };
27591     };
27592
27593
27594     // //// helper methods ///////////////////////////////////////////////////
27595
27596     CroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
27597
27598       var shapePath = this._getShapePath(shape),
27599         connectionPath = this._getConnectionPath(connection);
27600
27601       return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);
27602     };
27603
27604     CroppingConnectionDocking.prototype._getConnectionPath = function(connection) {
27605       return this._renderer.getConnectionPath(connection);
27606     };
27607
27608     CroppingConnectionDocking.prototype._getShapePath = function(shape) {
27609       return this._renderer.getShapePath(shape);
27610     };
27611
27612     CroppingConnectionDocking.prototype._getGfx = function(element) {
27613       return this._elementRegistry.getGraphics(element);
27614     };
27615   }, {
27616     "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
27617     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
27618   }],
27619   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js": [function(require, module, exports) {
27620     'use strict';
27621
27622     var isArray = require('lodash/lang/isArray'),
27623       sortBy = require('lodash/collection/sortBy');
27624
27625     var Snap = require('../../vendor/snapsvg');
27626
27627     /**
27628      * Returns whether two points are in a horizontal or vertical line.
27629      *
27630      * @param {Point}
27631      *            a
27632      * @param {Point}
27633      *            b
27634      *
27635      * @return {String|Boolean} returns false if the points are not aligned or 'h|v'
27636      *         if they are aligned horizontally / vertically.
27637      */
27638     function pointsAligned(a, b) {
27639       switch (true) {
27640         case a.x === b.x:
27641           return 'h';
27642         case a.y === b.y:
27643           return 'v';
27644       }
27645
27646       return false;
27647     }
27648
27649     module.exports.pointsAligned = pointsAligned;
27650
27651
27652     function roundPoint(point) {
27653
27654       return {
27655         x: Math.round(point.x),
27656         y: Math.round(point.y)
27657       };
27658     }
27659
27660     module.exports.roundPoint = roundPoint;
27661
27662
27663     function pointsEqual(a, b) {
27664       return a.x === b.x && a.y === b.y;
27665     }
27666
27667     module.exports.pointsEqual = pointsEqual;
27668
27669
27670     function pointDistance(a, b) {
27671       return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
27672     }
27673
27674     module.exports.pointDistance = pointDistance;
27675
27676
27677     function asTRBL(bounds) {
27678       return {
27679         top: bounds.y,
27680         right: bounds.x + (bounds.width || 0),
27681         bottom: bounds.y + (bounds.height || 0),
27682         left: bounds.x
27683       };
27684     }
27685
27686     module.exports.asTRBL = asTRBL;
27687
27688
27689     function getMidPoint(bounds) {
27690       return roundPoint({
27691         x: bounds.x + bounds.width / 2,
27692         y: bounds.y + bounds.height / 2
27693       });
27694     }
27695
27696     module.exports.getMidPoint = getMidPoint;
27697
27698
27699     // //// orientation utils //////////////////////////////
27700
27701     function getOrientation(rect, reference, pointDistance) {
27702
27703       pointDistance = pointDistance || 0;
27704
27705       var rectOrientation = asTRBL(rect),
27706         referenceOrientation = asTRBL(reference);
27707
27708       var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,
27709         right = rectOrientation.left - pointDistance >= referenceOrientation.right,
27710         bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,
27711         left = rectOrientation.right + pointDistance <= referenceOrientation.left;
27712
27713       var vertical = top ? 'top' : (bottom ? 'bottom' : null),
27714         horizontal = left ? 'left' : (right ? 'right' : null);
27715
27716       if (horizontal && vertical) {
27717         return vertical + '-' + horizontal;
27718       } else
27719       if (horizontal || vertical) {
27720         return horizontal || vertical;
27721       } else {
27722         return 'intersect';
27723       }
27724     }
27725
27726     module.exports.getOrientation = getOrientation;
27727
27728
27729     function hasAnyOrientation(rect, reference, pointDistance, locations) {
27730
27731       if (isArray(pointDistance)) {
27732         locations = pointDistance;
27733         pointDistance = 0;
27734       }
27735
27736       var orientation = getOrientation(rect, reference, pointDistance);
27737
27738       return locations.indexOf(orientation) !== -1;
27739     }
27740
27741     module.exports.hasAnyOrientation = hasAnyOrientation;
27742
27743
27744     // //// intersection utils //////////////////////////////
27745
27746     function getElementLineIntersection(elementPath, linePath, cropStart) {
27747
27748       var intersections = getIntersections(elementPath, linePath);
27749
27750       // recognize intersections
27751       // only one -> choose
27752       // two close together -> choose first
27753       // two or more distinct -> pull out appropriate one
27754       // none -> ok (fallback to point itself)
27755       if (intersections.length === 1) {
27756         return roundPoint(intersections[0]);
27757       } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {
27758         return roundPoint(intersections[0]);
27759       } else if (intersections.length > 1) {
27760
27761         // sort by intersections based on connection segment +
27762         // distance from start
27763         intersections = sortBy(intersections, function(i) {
27764           var distance = Math.floor(i.t2 * 100) || 1;
27765
27766           distance = 100 - distance;
27767
27768           distance = (distance < 10 ? '0' : '') + distance;
27769
27770           // create a sort string that makes sure we sort
27771           // line segment ASC + line segment position DESC (for cropStart)
27772           // line segment ASC + line segment position ASC (for cropEnd)
27773           return i.segment2 + '#' + distance;
27774         });
27775
27776         return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
27777       }
27778
27779       return null;
27780     }
27781
27782     module.exports.getElementLineIntersection = getElementLineIntersection;
27783
27784
27785     function getIntersections(a, b) {
27786       return Snap.path.intersection(a, b);
27787     }
27788
27789     module.exports.getIntersections = getIntersections;
27790   }, {
27791     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27792     "lodash/collection/sortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js",
27793     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
27794   }],
27795   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js": [function(require, module, exports) {
27796     'use strict';
27797
27798     var isArray = require('lodash/lang/isArray'),
27799       find = require('lodash/collection/find');
27800
27801     var LayoutUtil = require('./LayoutUtil'),
27802       Geometry = require('../util/Geometry');
27803
27804     var MIN_DISTANCE = 20;
27805
27806
27807     /**
27808      * Returns the mid points for a manhattan connection between two points.
27809      *
27810      * @example
27811      *
27812      * [a]----[x] | [x]--->[b]
27813      *
27814      * @param {Point}
27815      *            a
27816      * @param {Point}
27817      *            b
27818      * @param {String}
27819      *            directions
27820      *
27821      * @return {Array<Point>}
27822      */
27823     module.exports.getMidPoints = function(a, b, directions) {
27824
27825       directions = directions || 'h:h';
27826
27827       var xmid, ymid;
27828
27829       // one point, next to a
27830       if (directions === 'h:v') {
27831         return [{
27832           x: b.x,
27833           y: a.y
27834         }];
27835       } else
27836         // one point, above a
27837         if (directions === 'v:h') {
27838           return [{
27839             x: a.x,
27840             y: b.y
27841           }];
27842         } else
27843           // vertical edge xmid
27844           if (directions === 'h:h') {
27845             xmid = Math.round((b.x - a.x) / 2 + a.x);
27846
27847             return [{
27848               x: xmid,
27849               y: a.y
27850             }, {
27851               x: xmid,
27852               y: b.y
27853             }];
27854           } else
27855             // horizontal edge ymid
27856             if (directions === 'v:v') {
27857               ymid = Math.round((b.y - a.y) / 2 + a.y);
27858
27859               return [{
27860                 x: a.x,
27861                 y: ymid
27862               }, {
27863                 x: b.x,
27864                 y: ymid
27865               }];
27866             } else {
27867               throw new Error(
27868                 'unknown directions: <' + directions + '>: ' +
27869                 'directions must be specified as {a direction}:{b direction} (direction in h|v)');
27870             }
27871     };
27872
27873
27874     /**
27875      * Create a connection between the two points according to the manhattan layout
27876      * (only horizontal and vertical) edges.
27877      *
27878      * @param {Point}
27879      *            a
27880      * @param {Point}
27881      *            b
27882      *
27883      * @param {String}
27884      *            [directions='h:h'] specifies manhattan directions for each point
27885      *            as {adirection}:{bdirection}. A directionfor a point is either `h`
27886      *            (horizontal) or `v` (vertical)
27887      *
27888      * @return {Array<Point>}
27889      */
27890     module.exports.connectPoints = function(a, b, directions) {
27891
27892       var points = [];
27893
27894       if (!LayoutUtil.pointsAligned(a, b)) {
27895         points = this.getMidPoints(a, b, directions);
27896       }
27897
27898       points.unshift(a);
27899       points.push(b);
27900
27901       return points;
27902     };
27903
27904
27905     /**
27906      * Connect two rectangles using a manhattan layouted connection.
27907      *
27908      * @param {Bounds}
27909      *            source source rectangle
27910      * @param {Bounds}
27911      *            target target rectangle
27912      * @param {Point}
27913      *            [start] source docking
27914      * @param {Point}
27915      *            [end] target docking
27916      *
27917      * @return {Array<Point>} connection points
27918      */
27919     module.exports.connectRectangles = function(source, target, start, end, options) {
27920
27921       options = options || {};
27922
27923       var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
27924
27925       var directions = this.getDirections(source, target, options.preferVertical);
27926
27927       start = start || LayoutUtil.getMidPoint(source);
27928       end = end || LayoutUtil.getMidPoint(target);
27929
27930       // overlapping elements
27931       if (!directions) {
27932         return;
27933       }
27934
27935       if (directions === 'h:h') {
27936
27937         switch (orientation) {
27938           case 'top-right':
27939           case 'right':
27940           case 'bottom-right':
27941             start = {
27942               original: start,
27943               x: source.x,
27944               y: start.y
27945             };
27946             end = {
27947               original: end,
27948               x: target.x + target.width,
27949               y: end.y
27950             };
27951             break;
27952           case 'top-left':
27953           case 'left':
27954           case 'bottom-left':
27955             start = {
27956               original: start,
27957               x: source.x + source.width,
27958               y: start.y
27959             };
27960             end = {
27961               original: end,
27962               x: target.x,
27963               y: end.y
27964             };
27965             break;
27966         }
27967       }
27968
27969       if (directions === 'v:v') {
27970
27971         switch (orientation) {
27972           case 'top-left':
27973           case 'top':
27974           case 'top-right':
27975             start = {
27976               original: start,
27977               x: start.x,
27978               y: source.y + source.height
27979             };
27980             end = {
27981               original: end,
27982               x: end.x,
27983               y: target.y
27984             };
27985             break;
27986           case 'bottom-left':
27987           case 'bottom':
27988           case 'bottom-right':
27989             start = {
27990               original: start,
27991               x: start.x,
27992               y: source.y
27993             };
27994             end = {
27995               original: end,
27996               x: end.x,
27997               y: target.y + target.height
27998             };
27999             break;
28000         }
28001       }
28002
28003       return this.connectPoints(start, end, directions);
28004     };
28005
28006     /**
28007      * Repair the connection between two rectangles, of which one has been updated.
28008      *
28009      * @param {Bounds}
28010      *            source
28011      * @param {Bounds}
28012      *            target
28013      * @param {Point}
28014      *            [start]
28015      * @param {Point}
28016      *            [end]
28017      * @param {Array
28018      *            <Point>} waypoints
28019      * @param {Object}
28020      *            [hints]
28021      * @param {Boolean}
28022      *            hints.preferStraight
28023      * @param {Boolean}
28024      *            hints.preferVertical
28025      * @param {Boolean}
28026      *            hints.startChanged
28027      * @param {Boolean}
28028      *            hints.endChanged
28029      *
28030      * @return {Array<Point>} repaired waypoints
28031      */
28032     module.exports.repairConnection = function(source, target, start, end, waypoints, hints) {
28033
28034       if (isArray(start)) {
28035         waypoints = start;
28036         hints = end;
28037
28038         start = LayoutUtil.getMidPoint(source);
28039         end = LayoutUtil.getMidPoint(target);
28040       }
28041
28042       hints = hints || {};
28043
28044
28045       var repairedWaypoints;
28046
28047       // just layout non-existing or simple connections
28048       // attempt to render straight lines, if required
28049       if (!waypoints || waypoints.length < 3) {
28050
28051         if (hints.preferStraight) {
28052           // attempt to layout a straight line
28053           repairedWaypoints = this.layoutStraight(source, target, start, end, hints);
28054         }
28055       } else {
28056         // check if we layout from start or end
28057         if (hints.endChanged) {
28058           repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());
28059           repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();
28060         } else
28061         if (hints.startChanged) {
28062           repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);
28063         }
28064         // or whether nothing seems to have changed
28065         else {
28066           repairedWaypoints = waypoints;
28067         }
28068       }
28069
28070       // simply reconnect if nothing else worked
28071       if (!repairedWaypoints) {
28072         return this.connectRectangles(source, target, start, end, hints);
28073       }
28074
28075       return repairedWaypoints;
28076     };
28077
28078     function max(a, b) {
28079       return Math.max(a, b);
28080     }
28081
28082     function min(a, b) {
28083       return Math.min(a, b);
28084     }
28085
28086     function inRange(a, start, end) {
28087       return a >= start && a <= end;
28088     }
28089
28090     module.exports.layoutStraight = function(source, target, start, end, hints) {
28091
28092       var startX, endX, x,
28093         startY, endY, y;
28094
28095       startX = max(source.x + 10, target.x + 10);
28096       endX = min(source.x + source.width - 10, target.x + target.width - 10);
28097
28098       if (startX < endX) {
28099
28100         if (source.width === target.width) {
28101
28102           if (hints.endChanged && inRange(end.x, startX, endX)) {
28103             x = end.x;
28104           } else
28105           if (inRange(start.x, startX, endX)) {
28106             x = start.x;
28107           }
28108         }
28109
28110         if (x === undefined) {
28111           if (source.width < target.width && inRange(start.x, startX, endX)) {
28112             x = start.x;
28113           } else
28114           if (source.width > target.width && inRange(end.x, startX, endX)) {
28115             x = end.x;
28116           } else {
28117             x = (startX + endX) / 2;
28118           }
28119         }
28120       }
28121
28122       startY = max(source.y + 10, target.y + 10);
28123       endY = min(source.y + source.height - 10, target.y + target.height - 10);
28124
28125       if (startY < endY) {
28126
28127         if (source.height === target.height) {
28128           if (hints.endChanged && inRange(end.y, startY, endY)) {
28129             y = end.y;
28130           } else
28131           if (inRange(start.y, startY, endY)) {
28132             y = start.y;
28133           }
28134         }
28135
28136         if (y === undefined) {
28137           if (source.height <= target.height && inRange(start.y, startY, endY)) {
28138             y = start.y;
28139           } else
28140           if (target.height <= source.height && inRange(end.y, startY, endY)) {
28141             y = end.y;
28142           } else {
28143             y = (startY + endY) / 2;
28144           }
28145         }
28146       }
28147
28148       // cannot layout straight
28149       if (x === undefined && y === undefined) {
28150         return null;
28151       }
28152
28153       return [{
28154         x: x !== undefined ? x : start.x,
28155         y: y !== undefined ? y : start.y
28156       }, {
28157         x: x !== undefined ? x : end.x,
28158         y: y !== undefined ? y : end.y
28159       }];
28160     };
28161
28162
28163     /**
28164      * Repair a connection from one side that moved.
28165      *
28166      * @param {Bounds}
28167      *            moved
28168      * @param {Bounds}
28169      *            other
28170      * @param {Point}
28171      *            newDocking
28172      * @param {Array
28173      *            <Point>} points originalPoints from moved to other
28174      *
28175      * @return {Array<Point>} the repaired points between the two rectangles
28176      */
28177     module.exports._repairConnectionSide = function(moved, other, newDocking, points) {
28178
28179       function needsRelayout(moved, other, points) {
28180
28181         if (points.length < 3) {
28182           return true;
28183         }
28184
28185         if (points.length > 4) {
28186           return false;
28187         }
28188
28189         // relayout if two points overlap
28190         // this is most likely due to
28191         return !!find(points, function(p, idx) {
28192           var q = points[idx - 1];
28193
28194           return q && Geometry.distance(p, q) < 3;
28195         });
28196       }
28197
28198       function repairBendpoint(candidate, oldPeer, newPeer) {
28199
28200         var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);
28201
28202         switch (alignment) {
28203           case 'v':
28204             // repair vertical alignment
28205             return {
28206               x: candidate.x,
28207               y: newPeer.y
28208             };
28209           case 'h':
28210             // repair horizontal alignment
28211             return {
28212               x: newPeer.x,
28213               y: candidate.y
28214             };
28215         }
28216
28217         return {
28218           x: candidate.x,
28219           y: candidate.y
28220         };
28221       }
28222
28223       function removeOverlapping(points, a, b) {
28224         var i;
28225
28226         for (i = points.length - 2; i !== 0; i--) {
28227
28228           // intersects (?) break, remove all bendpoints up to this one and
28229           // relayout
28230           if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||
28231             Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {
28232
28233             // return sliced old connection
28234             return points.slice(i);
28235           }
28236         }
28237
28238         return points;
28239       }
28240
28241
28242       // (0) only repair what has layoutable bendpoints
28243
28244       // (1) if only one bendpoint and on shape moved onto other shapes axis
28245       // (horizontally / vertically), relayout
28246
28247       if (needsRelayout(moved, other, points)) {
28248         return null;
28249       }
28250
28251       var oldDocking = points[0],
28252         newPoints = points.slice(),
28253         slicedPoints;
28254
28255       // (2) repair only last line segment and only if it was layouted before
28256
28257       newPoints[0] = newDocking;
28258       newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);
28259
28260
28261       // (3) if shape intersects with any bendpoint after repair,
28262       // remove all segments up to this bendpoint and repair from there
28263
28264       slicedPoints = removeOverlapping(newPoints, moved, other);
28265       if (slicedPoints !== newPoints) {
28266         return this._repairConnectionSide(moved, other, newDocking, slicedPoints);
28267       }
28268
28269       return newPoints;
28270     };
28271
28272     /**
28273      * Returns the default manhattan directions connecting two rectangles.
28274      *
28275      * @param {Bounds}
28276      *            source
28277      * @param {Bounds}
28278      *            target
28279      * @param {Boolean}
28280      *            preferVertical
28281      *
28282      * @return {String}
28283      */
28284     module.exports.getDirections = function(source, target, preferVertical) {
28285       var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
28286
28287       switch (orientation) {
28288         case 'intersect':
28289           return null;
28290
28291         case 'top':
28292         case 'bottom':
28293           return 'v:v';
28294
28295         case 'left':
28296         case 'right':
28297           return 'h:h';
28298
28299         default:
28300           return preferVertical ? 'v:v' : 'h:h';
28301       }
28302     };
28303   }, {
28304     "../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
28305     "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
28306     "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
28307     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
28308   }],
28309   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js": [function(require, module, exports) {
28310     'use strict';
28311
28312     var assign = require('lodash/object/assign'),
28313       inherits = require('inherits');
28314
28315     var Refs = require('object-refs');
28316
28317     var parentRefs = new Refs({
28318         name: 'children',
28319         enumerable: true,
28320         collection: true
28321       }, {
28322         name: 'parent'
28323       }),
28324       labelRefs = new Refs({
28325         name: 'label',
28326         enumerable: true
28327       }, {
28328         name: 'labelTarget'
28329       }),
28330       outgoingRefs = new Refs({
28331         name: 'outgoing',
28332         collection: true
28333       }, {
28334         name: 'source'
28335       }),
28336       incomingRefs = new Refs({
28337         name: 'incoming',
28338         collection: true
28339       }, {
28340         name: 'target'
28341       });
28342
28343     /**
28344      * @namespace djs.model
28345      */
28346
28347     /**
28348      * @memberOf djs.model
28349      */
28350
28351     /**
28352      * The basic graphical representation
28353      *
28354      * @class
28355      *
28356      * @abstract
28357      */
28358     function Base() {
28359
28360       /**
28361        * The object that backs up the shape
28362        *
28363        * @name Base#businessObject
28364        * @type Object
28365        */
28366       Object.defineProperty(this, 'businessObject', {
28367         writable: true
28368       });
28369
28370       /**
28371        * The parent shape
28372        *
28373        * @name Base#parent
28374        * @type Shape
28375        */
28376       parentRefs.bind(this, 'parent');
28377
28378       /**
28379        * @name Base#label
28380        * @type Label
28381        */
28382       labelRefs.bind(this, 'label');
28383
28384       /**
28385        * The list of outgoing connections
28386        *
28387        * @name Base#outgoing
28388        * @type Array<Connection>
28389        */
28390       outgoingRefs.bind(this, 'outgoing');
28391
28392       /**
28393        * The list of outgoing connections
28394        *
28395        * @name Base#incoming
28396        * @type Array<Connection>
28397        */
28398       incomingRefs.bind(this, 'incoming');
28399     }
28400
28401
28402     /**
28403      * A graphical object
28404      *
28405      * @class
28406      * @constructor
28407      *
28408      * @extends Base
28409      */
28410     function Shape() {
28411       Base.call(this);
28412
28413       /**
28414        * The list of children
28415        *
28416        * @name Shape#children
28417        * @type Array<Base>
28418        */
28419       parentRefs.bind(this, 'children');
28420     }
28421
28422     inherits(Shape, Base);
28423
28424
28425     /**
28426      * A root graphical object
28427      *
28428      * @class
28429      * @constructor
28430      *
28431      * @extends Shape
28432      */
28433     function Root() {
28434       Shape.call(this);
28435     }
28436
28437     inherits(Root, Shape);
28438
28439
28440     /**
28441      * A label for an element
28442      *
28443      * @class
28444      * @constructor
28445      *
28446      * @extends Shape
28447      */
28448     function Label() {
28449       Shape.call(this);
28450
28451       /**
28452        * The labeled element
28453        *
28454        * @name Label#labelTarget
28455        * @type Base
28456        */
28457       labelRefs.bind(this, 'labelTarget');
28458     }
28459
28460     inherits(Label, Shape);
28461
28462
28463     /**
28464      * A connection between two elements
28465      *
28466      * @class
28467      * @constructor
28468      *
28469      * @extends Base
28470      */
28471     function Connection() {
28472       Base.call(this);
28473
28474       /**
28475        * The element this connection originates from
28476        *
28477        * @name Connection#source
28478        * @type Base
28479        */
28480       outgoingRefs.bind(this, 'source');
28481
28482       /**
28483        * The element this connection points to
28484        *
28485        * @name Connection#target
28486        * @type Base
28487        */
28488       incomingRefs.bind(this, 'target');
28489     }
28490
28491     inherits(Connection, Base);
28492
28493
28494     var types = {
28495       connection: Connection,
28496       shape: Shape,
28497       label: Label,
28498       root: Root
28499     };
28500
28501     /**
28502      * Creates a new model element of the specified type
28503      *
28504      * @method create
28505      *
28506      * @example
28507      *
28508      * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100
28509      * }); var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height:
28510      * 100 });
28511      *
28512      * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 },
28513      * {x: 210, y: 55 } ] });
28514      *
28515      * @param {String}
28516      *            type lower-cased model name
28517      * @param {Object}
28518      *            attrs attributes to initialize the new model instance with
28519      *
28520      * @return {Base} the new model instance
28521      */
28522     module.exports.create = function(type, attrs) {
28523       var Type = types[type];
28524       if (!Type) {
28525         throw new Error('unknown type: <' + type + '>');
28526       }
28527       return assign(new Type(), attrs);
28528     };
28529
28530
28531     module.exports.Base = Base;
28532     module.exports.Root = Root;
28533     module.exports.Shape = Shape;
28534     module.exports.Connection = Connection;
28535     module.exports.Label = Label;
28536   }, {
28537     "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
28538     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
28539     "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js"
28540   }],
28541   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js": [function(require, module, exports) {
28542     'use strict';
28543
28544     var Cursor = require('../../util/Cursor'),
28545       ClickTrap = require('../../util/ClickTrap'),
28546       domEvent = require('min-dom/lib/event'),
28547       Event = require('../../util/Event');
28548
28549     function substract(p1, p2) {
28550       return {
28551         x: p1.x - p2.x,
28552         y: p1.y - p2.y
28553       };
28554     }
28555
28556     function length(point) {
28557       return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
28558     }
28559
28560
28561     var THRESHOLD = 15;
28562
28563
28564     function MoveCanvas(eventBus, canvas) {
28565
28566       var container = canvas._container,
28567         context;
28568
28569
28570       function handleMove(event) {
28571
28572         var start = context.start,
28573           position = Event.toPoint(event),
28574           delta = substract(position, start);
28575
28576         if (!context.dragging && length(delta) > THRESHOLD) {
28577           context.dragging = true;
28578
28579           // prevent mouse click in this
28580           // interaction sequence
28581           ClickTrap.install();
28582
28583           Cursor.set('move');
28584         }
28585
28586         if (context.dragging) {
28587
28588           var lastPosition = context.last || context.start;
28589
28590           delta = substract(position, lastPosition);
28591
28592           canvas.scroll({
28593             dx: delta.x,
28594             dy: delta.y
28595           });
28596
28597           context.last = position;
28598         }
28599
28600         // prevent select
28601         event.preventDefault();
28602       }
28603
28604
28605       function handleEnd(event) {
28606         domEvent.unbind(document, 'mousemove', handleMove);
28607         domEvent.unbind(document, 'mouseup', handleEnd);
28608
28609         context = null;
28610
28611         Cursor.unset();
28612
28613         // prevent select
28614         Event.stopEvent(event);
28615       }
28616
28617       function handleStart(event) {
28618
28619         // reject non-left left mouse button or modifier key
28620         if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
28621           return;
28622         }
28623
28624         context = {
28625           start: Event.toPoint(event)
28626         };
28627
28628         domEvent.bind(document, 'mousemove', handleMove);
28629         domEvent.bind(document, 'mouseup', handleEnd);
28630
28631         // prevent select
28632         Event.stopEvent(event);
28633       }
28634
28635       domEvent.bind(container, 'mousedown', handleStart);
28636     }
28637
28638
28639     MoveCanvas.$inject = ['eventBus', 'canvas'];
28640
28641     module.exports = MoveCanvas;
28642
28643   }, {
28644     "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
28645     "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
28646     "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28647     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28648   }],
28649   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js": [function(require, module, exports) {
28650     module.exports = {
28651       __init__: ['moveCanvas'],
28652       moveCanvas: ['type', require('./MoveCanvas')]
28653     };
28654   }, {
28655     "./MoveCanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js"
28656   }],
28657   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js": [function(require, module, exports) {
28658     module.exports = {
28659       __depends__: [require('../../features/touch')]
28660     };
28661   }, {
28662     "../../features/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js"
28663   }],
28664   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js": [function(require, module, exports) {
28665     'use strict';
28666
28667     var domEvent = require('min-dom/lib/event');
28668
28669     var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier,
28670       hasSecondaryModifier = require('../../util/Mouse').hasSecondaryModifier;
28671
28672     var isMac = require('../../util/Platform').isMac;
28673
28674
28675     function ZoomScroll(events, canvas) {
28676       var $canvas = $(canvas.getContainer()), //canvas.getContainer()
28677         $controls = $('<div></div>'),
28678         $zoomOut = $('<div><span class="glyphicon glyphicon-zoom-out"></span></div>'),
28679         $zoomIn = $('<div><span class="glyphicon glyphicon-zoom-in"></span></div>'),
28680         $zoomFit = $('<div><span class="glyphicon glyphicon-fullscreen"></span></div>'),
28681         zlevel = 1,
28682         zstep = 0.2;
28683
28684       $canvas.append($controls);
28685       $controls.append($zoomIn);
28686       $controls.append($zoomOut);
28687       $controls.append($zoomFit);
28688
28689       $controls.addClass('zoom-controls');
28690       $zoomOut.addClass('zoom zoom-out');
28691       $zoomIn.addClass('zoom zoom-in');
28692       $zoomFit.addClass('zoom zoom-fit');
28693
28694       $zoomOut.attr('title', 'Zoom out');
28695       $zoomIn.attr('title', 'Zoom in');
28696       $zoomFit.attr('title', 'Fit to viewport');
28697
28698       // set initial zoom level
28699       //canvas.zoom( zlevel, 'auto' );
28700
28701       // update our zoom level on viewbox change
28702       events.on('canvas.viewbox.changed', function(evt) {
28703         zlevel = evt.viewbox.scale;
28704       });
28705
28706       // define click handlers for controls
28707       $zoomFit.on('click', function() {
28708         canvas.zoom('fit-viewport', 'auto');
28709       });
28710
28711       $zoomOut.on('click', function() {
28712         zlevel = Math.max(zlevel - zstep, zstep);
28713         canvas.zoom(zlevel, 'auto');
28714       });
28715
28716       $zoomIn.on('click', function() {
28717         zlevel = Math.min(zlevel + zstep, 7);
28718         canvas.zoom(zlevel, 'auto');
28719       });
28720
28721       $(".TCS").click(function() {
28722         console.log($(this).data("stuff"));
28723         var modelElements = $(this).data("stuff").modelElements;
28724         var modelName = $(this).data("model").name;
28725         var hElements = [];
28726         modelElements.forEach(function(mElement) {
28727           if (hElements.indexOf(mElement.elementID) == -1) {
28728             hElements.push(mElement.elementID);
28729           }
28730         });
28731         highlightPath(hElements);
28732       });
28733
28734       function highlightPath(hElements) {
28735         clear();
28736         var elementRegistry = canvas._elementRegistry;
28737         //console.log(elementRegistry);
28738         hElements.forEach(function(hElement) {
28739           try {
28740             //console.log(hElement);
28741             var activityShape = elementRegistry.get(hElement);
28742             var outgoing = activityShape.incoming;
28743
28744             if (canvas.hasMarker(hElement, 'highlight')) {
28745               canvas.removeMarker(hElement, 'highlight');
28746               outgoing.forEach(function(flow) {
28747                 var outgoingGfx = elementRegistry.getGraphics(flow.id);
28748                 if (hElements.indexOf(flow.id) != -1) {
28749                   outgoingGfx.select('path').attr({
28750                     stroke: 'black'
28751                   });
28752                 }
28753               });
28754             } else {
28755               canvas.addMarker(hElement, 'highlight');
28756               outgoing.forEach(function(flow) {
28757                 var outgoingGfx = elementRegistry.getGraphics(flow.id);
28758                 if (hElements.indexOf(flow.id) != -1) {
28759                   outgoingGfx.select('path').attr({
28760                     stroke: 'blue'
28761                   });
28762                 }
28763               });
28764             }
28765           } catch (err) {
28766             //console.log(err);
28767           }
28768
28769         });
28770       }
28771
28772       function clear() {
28773         var elementRegistry = canvas._elementRegistry;
28774         elementRegistry.forEach(function(hElement) {
28775           try {
28776             canvas.removeMarker(hElement, 'highlight');
28777             var outgoing = hElement.incoming;
28778             outgoing.forEach(function(flow) {
28779               var outgoingGfx = elementRegistry.getGraphics(flow.id);
28780               outgoingGfx.select('path').attr({
28781                 stroke: 'black'
28782               });
28783             });
28784           } catch (err) {
28785
28786           }
28787         });
28788       }
28789
28790       //console.log('endzoom');
28791
28792
28793       var RANGE = {
28794         min: 0.2,
28795         max: 4
28796       };
28797
28798       function cap(scale) {
28799         return Math.max(RANGE.min, Math.min(RANGE.max, scale));
28800       }
28801
28802       function reset() {
28803         canvas.zoom('fit-viewport');
28804       }
28805
28806       function zoom(direction, position) {
28807
28808         var currentZoom = canvas.zoom();
28809         var factor = Math.pow(1 + Math.abs(direction), direction > 0 ? 1 : -1);
28810
28811         canvas.zoom(cap(currentZoom * factor), position);
28812       }
28813
28814       function scroll(delta) {
28815         canvas.scroll(delta);
28816       }
28817
28818       function init(element) {
28819
28820         domEvent.bind(element, 'wheel', function(event) {
28821           /*
28822
28823                               event.preventDefault();
28824
28825                               // mouse-event: SELECTION_KEY
28826                               // mouse-event: AND_KEY
28827                               var isVerticalScroll = hasPrimaryModifier(event),
28828                                   isHorizontalScroll = hasSecondaryModifier(event);
28829
28830                               var factor;
28831
28832                               if (isVerticalScroll || isHorizontalScroll) {
28833
28834                                   if (isMac) {
28835                                       factor = event.deltaMode === 0 ? 1.25 : 50;
28836                                   } else {
28837                                       factor = event.deltaMode === 0 ? 1 / 40 : 1 / 2;
28838                                   }
28839
28840                                   var delta = {};
28841
28842                                   if (isHorizontalScroll) {
28843                                       delta.dx = (factor * (event.deltaX || event.deltaY));
28844                                   } else {
28845                                       delta.dy = (factor * event.deltaY);
28846                                   }
28847
28848                                   scroll(delta);
28849                               } else {
28850                                   factor = (event.deltaMode === 0 ? 1 / 40 : 1 / 2);
28851
28852                                   var elementRect = element.getBoundingClientRect();
28853
28854                                   var offset = {
28855                                       x: event.clientX - elementRect.left,
28856                                       y: event.clientY - elementRect.top
28857                                   };
28858
28859                                   // zoom in relative to diagram {x,y} coordinates
28860                                   zoom(event.deltaY * factor / (-5), offset);
28861                               }
28862                           */
28863         });
28864       }
28865
28866       events.on('canvas.init', function(e) {
28867         init(canvas._container);
28868       });
28869
28870       // API
28871       this.zoom = zoom;
28872       this.reset = reset;
28873     }
28874
28875
28876     ZoomScroll.$inject = ['eventBus', 'canvas'];
28877
28878     module.exports = ZoomScroll;
28879
28880
28881   }, {
28882     "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
28883     "../../util/Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js",
28884     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28885   }],
28886   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js": [function(require, module, exports) {
28887     module.exports = {
28888       __init__: ['zoomScroll'],
28889       zoomScroll: ['type', require('./ZoomScroll')]
28890     };
28891   }, {
28892     "./ZoomScroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js"
28893   }],
28894   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js": [function(require, module, exports) {
28895     'use strict';
28896
28897     var domEvent = require('min-dom/lib/event'),
28898       stopEvent = require('./Event').stopEvent;
28899
28900     function trap(event) {
28901       stopEvent(event);
28902
28903       toggle(false);
28904     }
28905
28906     function toggle(active) {
28907       domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
28908     }
28909
28910     /**
28911      * Installs a click trap that prevents a ghost click following a dragging
28912      * operation.
28913      *
28914      * @return {Function} a function to immediately remove the installed trap.
28915      */
28916     function install() {
28917
28918       toggle(true);
28919
28920       return function() {
28921         toggle(false);
28922       };
28923     }
28924
28925     module.exports.install = install;
28926   }, {
28927     "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28928     "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28929   }],
28930   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js": [function(require, module, exports) {
28931     'use strict';
28932
28933     /**
28934      * Failsafe remove an element from a collection
28935      *
28936      * @param {Array
28937      *            <Object>} [collection]
28938      * @param {Object}
28939      *            [element]
28940      *
28941      * @return {Object} the element that got removed or undefined
28942      */
28943     module.exports.remove = function(collection, element) {
28944
28945       if (!collection || !element) {
28946         return;
28947       }
28948
28949       var idx = collection.indexOf(element);
28950       if (idx === -1) {
28951         return;
28952       }
28953
28954       collection.splice(idx, 1);
28955
28956       return element;
28957     };
28958
28959     /**
28960      * Fail save add an element to the given connection, ensuring it does not yet
28961      * exist.
28962      *
28963      * @param {Array
28964      *            <Object>} collection
28965      * @param {Object}
28966      *            element
28967      * @param {Number}
28968      *            idx
28969      */
28970     module.exports.add = function(collection, element, idx) {
28971
28972       if (!collection || !element) {
28973         return;
28974       }
28975
28976       if (isNaN(idx)) {
28977         idx = -1;
28978       }
28979
28980       var currentIdx = collection.indexOf(element);
28981
28982       if (currentIdx !== -1) {
28983
28984         if (currentIdx === idx) {
28985           // nothing to do, position has not changed
28986           return;
28987         } else {
28988
28989           if (idx !== -1) {
28990             // remove from current position
28991             collection.splice(currentIdx, 1);
28992           } else {
28993             // already exists in collection
28994             return;
28995           }
28996         }
28997       }
28998
28999       if (idx !== -1) {
29000         // insert at specified position
29001         collection.splice(idx, 0, element);
29002       } else {
29003         // push to end
29004         collection.push(element);
29005       }
29006     };
29007
29008
29009     /**
29010      * Fail get the index of an element in a collection.
29011      *
29012      * @param {Array
29013      *            <Object>} collection
29014      * @param {Object}
29015      *            element
29016      *
29017      * @return {Number} the index or -1 if collection or element do not exist or the
29018      *         element is not contained.
29019      */
29020     module.exports.indexOf = function(collection, element) {
29021
29022       if (!collection || !element) {
29023         return -1;
29024       }
29025
29026       return collection.indexOf(element);
29027     };
29028
29029   }, {}],
29030   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js": [function(require, module, exports) {
29031     'use strict';
29032
29033     var domClasses = require('min-dom/lib/classes');
29034
29035     var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
29036
29037
29038     module.exports.set = function(mode) {
29039       var classes = domClasses(document.body);
29040
29041       classes.removeMatching(CURSOR_CLS_PATTERN);
29042
29043       if (mode) {
29044         classes.add('djs-cursor-' + mode);
29045       }
29046     };
29047
29048     module.exports.unset = function() {
29049       this.set(null);
29050     };
29051   }, {
29052     "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js"
29053   }],
29054   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js": [function(require, module, exports) {
29055     'use strict';
29056
29057     var isArray = require('lodash/lang/isArray'),
29058       isNumber = require('lodash/lang/isNumber'),
29059       groupBy = require('lodash/collection/groupBy'),
29060       forEach = require('lodash/collection/forEach');
29061
29062     /**
29063      * Adds an element to a collection and returns true if the element was added.
29064      *
29065      * @param {Array
29066      *            <Object>} elements
29067      * @param {Object}
29068      *            e
29069      * @param {Boolean}
29070      *            unique
29071      */
29072     function add(elements, e, unique) {
29073       var canAdd = !unique || elements.indexOf(e) === -1;
29074
29075       if (canAdd) {
29076         elements.push(e);
29077       }
29078
29079       return canAdd;
29080     }
29081
29082     function eachElement(elements, fn, depth) {
29083
29084       depth = depth || 0;
29085
29086       forEach(elements, function(s, i) {
29087         var filter = fn(s, i, depth);
29088
29089         if (isArray(filter) && filter.length) {
29090           eachElement(filter, fn, depth + 1);
29091         }
29092       });
29093     }
29094
29095     /**
29096      * Collects self + child elements up to a given depth from a list of elements.
29097      *
29098      * @param {Array
29099      *            <djs.model.Base>} elements the elements to select the children
29100      *            from
29101      * @param {Boolean}
29102      *            unique whether to return a unique result set (no duplicates)
29103      * @param {Number}
29104      *            maxDepth the depth to search through or -1 for infinite
29105      *
29106      * @return {Array<djs.model.Base>} found elements
29107      */
29108     function selfAndChildren(elements, unique, maxDepth) {
29109       var result = [],
29110         processedChildren = [];
29111
29112       eachElement(elements, function(element, i, depth) {
29113         add(result, element, unique);
29114
29115         var children = element.children;
29116
29117         // max traversal depth not reached yet
29118         if (maxDepth === -1 || depth < maxDepth) {
29119
29120           // children exist && children not yet processed
29121           if (children && add(processedChildren, children, unique)) {
29122             return children;
29123           }
29124         }
29125       });
29126
29127       return result;
29128     }
29129
29130     /**
29131      * Return self + direct children for a number of elements
29132      *
29133      * @param {Array
29134      *            <djs.model.Base>} elements to query
29135      * @param {Boolean}
29136      *            allowDuplicates to allow duplicates in the result set
29137      *
29138      * @return {Array<djs.model.Base>} the collected elements
29139      */
29140     function selfAndDirectChildren(elements, allowDuplicates) {
29141       return selfAndChildren(elements, !allowDuplicates, 1);
29142     }
29143
29144     /**
29145      * Return self + ALL children for a number of elements
29146      *
29147      * @param {Array
29148      *            <djs.model.Base>} elements to query
29149      * @param {Boolean}
29150      *            allowDuplicates to allow duplicates in the result set
29151      *
29152      * @return {Array<djs.model.Base>} the collected elements
29153      */
29154     function selfAndAllChildren(elements, allowDuplicates) {
29155       return selfAndChildren(elements, !allowDuplicates, -1);
29156     }
29157
29158     /**
29159      * Gets the the closure fo all selected elements, their connections and
29160      *
29161      * @param {Array
29162      *            <djs.model.Base>} elements
29163      * @return {Object} enclosure
29164      */
29165     function getClosure(elements) {
29166
29167       // original elements passed to this function
29168       var topLevel = groupBy(elements, function(e) {
29169         return e.id;
29170       });
29171
29172       var allShapes = {},
29173         allConnections = {},
29174         enclosedElements = {},
29175         enclosedConnections = {};
29176
29177       function handleConnection(c) {
29178         if (topLevel[c.source.id] && topLevel[c.target.id]) {
29179           topLevel[c.id] = c;
29180         }
29181
29182         // not enclosed as a child, but maybe logically
29183         // (connecting two moved elements?)
29184         if (allShapes[c.source.id] && allShapes[c.target.id]) {
29185           enclosedConnections[c.id] = enclosedElements[c.id] = c;
29186         }
29187
29188         allConnections[c.id] = c;
29189       }
29190
29191       function handleElement(element) {
29192
29193         enclosedElements[element.id] = element;
29194
29195         if (element.waypoints) {
29196           // remember connection
29197           enclosedConnections[element.id] = allConnections[element.id] = element;
29198         } else {
29199           // remember shape
29200           allShapes[element.id] = element;
29201
29202           // remember all connections
29203           forEach(element.incoming, handleConnection);
29204
29205           forEach(element.outgoing, handleConnection);
29206
29207           // recurse into children
29208           return element.children;
29209         }
29210       }
29211
29212       eachElement(elements, handleElement);
29213
29214       return {
29215         allShapes: allShapes,
29216         allConnections: allConnections,
29217         topLevel: topLevel,
29218         enclosedConnections: enclosedConnections,
29219         enclosedElements: enclosedElements
29220       };
29221     }
29222
29223     /**
29224      * Returns the surrounding bbox for all elements in the array or the element
29225      * primitive.
29226      */
29227     function getBBox(elements, stopRecursion) {
29228
29229       stopRecursion = !!stopRecursion;
29230       if (!isArray(elements)) {
29231         elements = [elements];
29232       }
29233
29234       var minX,
29235         minY,
29236         maxX,
29237         maxY;
29238
29239       forEach(elements, function(element) {
29240
29241         // If element is a connection the bbox must be computed first
29242         var bbox = element;
29243         if (element.waypoints && !stopRecursion) {
29244           bbox = getBBox(element.waypoints, true);
29245         }
29246
29247         var x = bbox.x,
29248           y = bbox.y,
29249           height = bbox.height || 0,
29250           width = bbox.width || 0;
29251
29252         if (x < minX || minX === undefined) {
29253           minX = x;
29254         }
29255         if (y < minY || minY === undefined) {
29256           minY = y;
29257         }
29258
29259         if ((x + width) > maxX || maxX === undefined) {
29260           maxX = x + width;
29261         }
29262         if ((y + height) > maxY || maxY === undefined) {
29263           maxY = y + height;
29264         }
29265       });
29266
29267       return {
29268         x: minX,
29269         y: minY,
29270         height: maxY - minY,
29271         width: maxX - minX
29272       };
29273     }
29274
29275
29276     /**
29277      * Returns all elements that are enclosed from the bounding box.
29278      *
29279      * @param {Array
29280      *            <Object>} elements List of Elements to search through
29281      * @param {Object}
29282      *            bbox the enclosing bbox.
29283      *            <ul>
29284      *            <li>If bbox.(width|height) is not specified the method returns
29285      *            all elements with element.x/y &gt; bbox.x/y </li>
29286      *            <li>If only bbox.x or bbox.y is specified, method return all
29287      *            elements with e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
29288      *            </ul>
29289      *
29290      */
29291     function getEnclosedElements(elements, bbox) {
29292
29293       var filteredElements = {};
29294
29295       forEach(elements, function(element) {
29296
29297         var e = element;
29298
29299         if (e.waypoints) {
29300           e = getBBox(e);
29301         }
29302
29303         if (!isNumber(bbox.y) && (e.x > bbox.x)) {
29304           filteredElements[element.id] = element;
29305         }
29306         if (!isNumber(bbox.x) && (e.y > bbox.y)) {
29307           filteredElements[element.id] = element;
29308         }
29309         if (e.x > bbox.x && e.y > bbox.y) {
29310           if (isNumber(bbox.width) && isNumber(bbox.height) &&
29311             e.width + e.x < bbox.width + bbox.x &&
29312             e.height + e.y < bbox.height + bbox.y) {
29313
29314             filteredElements[element.id] = element;
29315           } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
29316             filteredElements[element.id] = element;
29317           }
29318         }
29319       });
29320
29321       return filteredElements;
29322     }
29323
29324
29325
29326     module.exports.eachElement = eachElement;
29327     module.exports.selfAndDirectChildren = selfAndDirectChildren;
29328     module.exports.selfAndAllChildren = selfAndAllChildren;
29329     module.exports.getBBox = getBBox;
29330     module.exports.getEnclosedElements = getEnclosedElements;
29331
29332     module.exports.getClosure = getClosure;
29333
29334   }, {
29335     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29336     "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
29337     "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
29338     "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js"
29339   }],
29340   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js": [function(require, module, exports) {
29341     'use strict';
29342
29343     function __preventDefault(event) {
29344       return event && event.preventDefault();
29345     }
29346
29347     function __stopPropagation(event, immediate) {
29348       if (!event) {
29349         return;
29350       }
29351
29352       if (event.stopPropagation) {
29353         event.stopPropagation();
29354       }
29355
29356       if (immediate && event.stopImmediatePropagation) {
29357         event.stopImmediatePropagation();
29358       }
29359     }
29360
29361
29362     function getOriginal(event) {
29363       return event.originalEvent || event.srcEvent;
29364     }
29365
29366     module.exports.getOriginal = getOriginal;
29367
29368
29369     function stopEvent(event, immediate) {
29370       stopPropagation(event, immediate);
29371       preventDefault(event);
29372     }
29373
29374     module.exports.stopEvent = stopEvent;
29375
29376
29377     function preventDefault(event) {
29378       __preventDefault(event);
29379       __preventDefault(getOriginal(event));
29380     }
29381
29382     module.exports.preventDefault = preventDefault;
29383
29384
29385     function stopPropagation(event, immediate) {
29386       __stopPropagation(event, immediate);
29387       __stopPropagation(getOriginal(event), immediate);
29388     }
29389
29390     module.exports.stopPropagation = stopPropagation;
29391
29392
29393     function toPoint(event) {
29394
29395       if (event.pointers && event.pointers.length) {
29396         event = event.pointers[0];
29397       }
29398
29399       if (event.touches && event.touches.length) {
29400         event = event.touches[0];
29401       }
29402
29403       return event ? {
29404         x: event.clientX,
29405         y: event.clientY
29406       } : null;
29407     }
29408
29409     module.exports.toPoint = toPoint;
29410
29411   }, {}],
29412   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js": [function(require, module, exports) {
29413     'use strict';
29414
29415     /**
29416      * Computes the distance between two points
29417      *
29418      * @param {Point}
29419      *            p
29420      * @param {Point}
29421      *            q
29422      *
29423      * @return {Number} distance
29424      */
29425     var distance = module.exports.distance = function(p, q) {
29426       return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));
29427     };
29428
29429     /**
29430      * Returns true if the point r is on the line between p and y
29431      *
29432      * @param {Point}
29433      *            p
29434      * @param {Point}
29435      *            q
29436      * @param {Point}
29437      *            r
29438      *
29439      * @return {Boolean}
29440      */
29441     module.exports.pointsOnLine = function(p, q, r) {
29442
29443       if (!p || !q || !r) {
29444         return false;
29445       }
29446
29447       var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
29448         dist = distance(p, q);
29449
29450       // @see http://stackoverflow.com/a/907491/412190
29451       return Math.abs(val / dist) < 5;
29452     };
29453
29454     module.exports.pointInRect = function(p, rect, tolerance) {
29455       tolerance = tolerance || 0;
29456
29457       return p.x > rect.x - tolerance &&
29458         p.y > rect.y - tolerance &&
29459         p.x < rect.x + rect.width + tolerance &&
29460         p.y < rect.y + rect.height + tolerance;
29461     };
29462   }, {}],
29463   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js": [function(require, module, exports) {
29464     'use strict';
29465
29466     /**
29467      * SVGs for elements are generated by the {@link GraphicsFactory}.
29468      *
29469      * This utility gives quick access to the important semantic parts of an
29470      * element.
29471      */
29472
29473     /**
29474      * Returns the visual part of a diagram element
29475      *
29476      * @param {Snap
29477      *            <SVGElement>} gfx
29478      *
29479      * @return {Snap<SVGElement>}
29480      */
29481     function getVisual(gfx) {
29482       return gfx.select('.djs-visual');
29483     }
29484
29485     /**
29486      * Returns the children for a given diagram element.
29487      *
29488      * @param {Snap
29489      *            <SVGElement>} gfx
29490      * @return {Snap<SVGElement>}
29491      */
29492     function getChildren(gfx) {
29493       return gfx.parent().children()[1];
29494     }
29495
29496     /**
29497      * Returns the visual bbox of an element
29498      *
29499      * @param {Snap
29500      *            <SVGElement>} gfx
29501      *
29502      * @return {Bounds}
29503      */
29504     function getBBox(gfx) {
29505       return getVisual(gfx).select('*').getBBox();
29506     }
29507
29508
29509     module.exports.getVisual = getVisual;
29510     module.exports.getChildren = getChildren;
29511     module.exports.getBBox = getBBox;
29512   }, {}],
29513   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js": [function(require, module, exports) {
29514     'use strict';
29515
29516     /**
29517      * Util that provides unique IDs.
29518      *
29519      * @class djs.util.IdGenerator
29520      * @constructor
29521      * @memberOf djs.util
29522      *
29523      * The ids can be customized via a given prefix and contain a random value to
29524      * avoid collisions.
29525      *
29526      * @param {String}
29527      *            prefix a prefix to prepend to generated ids (for better
29528      *            readability)
29529      */
29530     function IdGenerator(prefix) {
29531
29532       this._counter = 0;
29533       this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
29534     }
29535
29536     module.exports = IdGenerator;
29537
29538     /**
29539      * Returns a next unique ID.
29540      *
29541      * @method djs.util.IdGenerator#next
29542      *
29543      * @returns {String} the id
29544      */
29545     IdGenerator.prototype.next = function() {
29546       return this._prefix + (++this._counter);
29547     };
29548
29549   }, {}],
29550   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js": [function(require, module, exports) {
29551     'use strict';
29552
29553     var getOriginalEvent = require('./Event').getOriginal;
29554
29555     var isMac = require('./Platform').isMac;
29556
29557
29558     function isPrimaryButton(event) {
29559       // button === 0 -> left ÃƒÆ’ƒÂ¡ka primary mouse button
29560       return !(getOriginalEvent(event) || event).button;
29561     }
29562
29563     module.exports.isPrimaryButton = isPrimaryButton;
29564
29565     module.exports.isMac = isMac;
29566
29567     module.exports.hasPrimaryModifier = function(event) {
29568       var originalEvent = getOriginalEvent(event) || event;
29569
29570       if (!isPrimaryButton(event)) {
29571         return false;
29572       }
29573
29574       // Use alt as primary modifier key for mac OS
29575       if (isMac()) {
29576         return originalEvent.altKey;
29577       } else {
29578         return originalEvent.ctrlKey;
29579       }
29580     };
29581
29582
29583     module.exports.hasSecondaryModifier = function(event) {
29584       var originalEvent = getOriginalEvent(event) || event;
29585
29586       return isPrimaryButton(event) && originalEvent.shiftKey;
29587     };
29588
29589   }, {
29590     "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
29591     "./Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js"
29592   }],
29593   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js": [function(require, module, exports) {
29594     'use strict';
29595
29596     module.exports.isMac = function isMac() {
29597       return (/mac/i).test(navigator.platform);
29598     };
29599   }, {}],
29600   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js": [function(require, module, exports) {
29601     'use strict';
29602
29603     var isObject = require('lodash/lang/isObject'),
29604       assign = require('lodash/object/assign'),
29605       forEach = require('lodash/collection/forEach'),
29606       reduce = require('lodash/collection/reduce'),
29607       merge = require('lodash/object/merge');
29608
29609     var Snap = require('../../vendor/snapsvg');
29610
29611     var DEFAULT_BOX_PADDING = 0;
29612
29613     var DEFAULT_LABEL_SIZE = {
29614       width: 150,
29615       height: 50
29616     };
29617
29618
29619     function parseAlign(align) {
29620
29621       var parts = align.split('-');
29622
29623       return {
29624         horizontal: parts[0] || 'center',
29625         vertical: parts[1] || 'top'
29626       };
29627     }
29628
29629     function parsePadding(padding) {
29630
29631       if (isObject(padding)) {
29632         return assign({
29633           top: 0,
29634           left: 0,
29635           right: 0,
29636           bottom: 0
29637         }, padding);
29638       } else {
29639         return {
29640           top: padding,
29641           left: padding,
29642           right: padding,
29643           bottom: padding
29644         };
29645       }
29646     }
29647
29648     function getTextBBox(text, fakeText) {
29649       fakeText.textContent = text;
29650       return fakeText.getBBox();
29651     }
29652
29653
29654     /**
29655      * Layout the next line and return the layouted element.
29656      *
29657      * Alters the lines passed.
29658      *
29659      * @param {Array
29660      *            <String>} lines
29661      * @return {Object} the line descriptor, an object { width, height, text }
29662      */
29663     function layoutNext(lines, maxWidth, fakeText) {
29664
29665       var originalLine = lines.shift(),
29666         fitLine = originalLine;
29667
29668       var textBBox;
29669
29670       while (true) {
29671         textBBox = getTextBBox(fitLine, fakeText);
29672
29673         textBBox.width = fitLine ? textBBox.width : 0;
29674
29675         // try to fit
29676         if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
29677           return fit(lines, fitLine, originalLine, textBBox);
29678         }
29679
29680
29681         fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
29682       }
29683     }
29684
29685     function fit(lines, fitLine, originalLine, textBBox) {
29686       if (fitLine.length < originalLine.length) {
29687         var nextLine = lines[0] || '',
29688           remainder = originalLine.slice(fitLine.length).trim();
29689
29690         if (/-\s*$/.test(remainder)) {
29691           nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
29692         } else {
29693           nextLine = remainder + ' ' + nextLine;
29694         }
29695
29696         lines[0] = nextLine;
29697       }
29698       return {
29699         width: textBBox.width,
29700         height: textBBox.height,
29701         text: fitLine
29702       };
29703     }
29704
29705
29706     /**
29707      * Shortens a line based on spacing and hyphens. Returns the shortened result on
29708      * success.
29709      *
29710      * @param {String}
29711      *            line
29712      * @param {Number}
29713      *            maxLength the maximum characters of the string
29714      * @return {String} the shortened string
29715      */
29716     function semanticShorten(line, maxLength) {
29717       var parts = line.split(/(\s|-)/g),
29718         part,
29719         shortenedParts = [],
29720         length = 0;
29721
29722       // try to shorten via spaces + hyphens
29723       if (parts.length > 1) {
29724         while ((part = parts.shift())) {
29725           if (part.length + length < maxLength) {
29726             shortenedParts.push(part);
29727             length += part.length;
29728           } else {
29729             // remove previous part, too if hyphen does not fit anymore
29730             if (part === '-') {
29731               shortenedParts.pop();
29732             }
29733
29734             break;
29735           }
29736         }
29737       }
29738
29739       return shortenedParts.join('');
29740     }
29741
29742
29743     function shortenLine(line, width, maxWidth) {
29744       var length = Math.max(line.length * (maxWidth / width), 1);
29745
29746       // try to shorten semantically (i.e. based on spaces and hyphens)
29747       var shortenedLine = semanticShorten(line, length);
29748
29749       if (!shortenedLine) {
29750
29751         // force shorten by cutting the long word
29752         shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
29753       }
29754
29755       return shortenedLine;
29756     }
29757
29758
29759     /**
29760      * Creates a new label utility
29761      *
29762      * @param {Object}
29763      *            config
29764      * @param {Dimensions}
29765      *            config.size
29766      * @param {Number}
29767      *            config.padding
29768      * @param {Object}
29769      *            config.style
29770      * @param {String}
29771      *            config.align
29772      */
29773     function Text(config) {
29774
29775       this._config = assign({}, {
29776         size: DEFAULT_LABEL_SIZE,
29777         padding: DEFAULT_BOX_PADDING,
29778         style: {},
29779         align: 'center-top'
29780       }, config || {});
29781     }
29782
29783
29784     /**
29785      * Create a label in the parent node.
29786      *
29787      * @method Text#createText
29788      *
29789      * @param {SVGElement}
29790      *            parent the parent to draw the label on
29791      * @param {String}
29792      *            text the text to render on the label
29793      * @param {Object}
29794      *            options
29795      * @param {String}
29796      *            options.align how to align in the bounding box. Any of {
29797      *            'center-middle', 'center-top' }, defaults to 'center-top'.
29798      * @param {String}
29799      *            options.style style to be applied to the text
29800      *
29801      * @return {SVGText} the text element created
29802      */
29803     Text.prototype.createText = function(parent, text, options) {
29804
29805       var box = merge({}, this._config.size, options.box || {}),
29806         style = merge({}, this._config.style, options.style || {}),
29807         align = parseAlign(options.align || this._config.align),
29808         padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
29809
29810       var lines = text.split(/\r?\n/g),
29811         layouted = [];
29812
29813       var maxWidth = box.width - padding.left - padding.right;
29814
29815       // FF regression: ensure text is shown during rendering
29816       // by attaching it directly to the body
29817       var fakeText = parent.paper.text(0, 0, '').attr(style).node;
29818
29819       while (lines.length) {
29820         layouted.push(layoutNext(lines, maxWidth, fakeText));
29821       }
29822
29823       var totalHeight = reduce(layouted, function(sum, line, idx) {
29824         return sum + line.height;
29825       }, 0);
29826
29827       // the y position of the next line
29828       var y, x;
29829
29830       switch (align.vertical) {
29831         case 'middle':
29832           y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
29833           break;
29834
29835         default:
29836           y = padding.top;
29837       }
29838
29839       var textElement = parent.text().attr(style);
29840
29841       forEach(layouted, function(line) {
29842         y += line.height;
29843
29844         switch (align.horizontal) {
29845           case 'left':
29846             x = padding.left;
29847             break;
29848
29849           case 'right':
29850             x = (maxWidth - padding.right - line.width);
29851             break;
29852
29853           default:
29854             // aka center
29855             x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
29856         }
29857
29858
29859         var tspan = Snap.create('tspan', {
29860           x: x,
29861           y: y
29862         }).node;
29863         tspan.textContent = line.text;
29864
29865         textElement.append(tspan);
29866       });
29867
29868       // remove fake text
29869       fakeText.parentNode.removeChild(fakeText);
29870
29871       return textElement;
29872     };
29873
29874
29875     module.exports = Text;
29876   }, {
29877     "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
29878     "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29879     "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
29880     "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
29881     "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
29882     "lodash/object/merge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js"
29883   }],
29884   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js": [function(require, module, exports) {
29885
29886     var isArray = function(obj) {
29887       return Object.prototype.toString.call(obj) === '[object Array]';
29888     };
29889
29890     var annotate = function() {
29891       var args = Array.prototype.slice.call(arguments);
29892
29893       if (args.length === 1 && isArray(args[0])) {
29894         args = args[0];
29895       }
29896
29897       var fn = args.pop();
29898
29899       fn.$inject = args;
29900
29901       return fn;
29902     };
29903
29904
29905     // Current limitations:
29906     // - can't put into "function arg" comments
29907     // function /* (no parenthesis like this) */ (){}
29908     // function abc( /* xx (no parenthesis like this) */ a, b) {}
29909     //
29910     // Just put the comment before function or inside:
29911     // /* (((this is fine))) */ function(a, b) {}
29912     // function abc(a) { /* (((this is fine))) */}
29913
29914     var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
29915     var FN_ARG = /\/\*([^\*]*)\*\//m;
29916
29917     var parse = function(fn) {
29918       if (typeof fn !== 'function') {
29919         throw new Error('Cannot annotate "' + fn + '". Expected a function!');
29920       }
29921
29922       var match = fn.toString().match(FN_ARGS);
29923       return match[1] && match[1].split(',').map(function(arg) {
29924         match = arg.match(FN_ARG);
29925         return match ? match[1].trim() : arg.trim();
29926       }) || [];
29927     };
29928
29929
29930     exports.annotate = annotate;
29931     exports.parse = parse;
29932     exports.isArray = isArray;
29933
29934   }, {}],
29935   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js": [function(require, module, exports) {
29936     module.exports = {
29937       annotate: require('./annotation').annotate,
29938       Module: require('./module'),
29939       Injector: require('./injector')
29940     };
29941
29942   }, {
29943     "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
29944     "./injector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js",
29945     "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
29946   }],
29947   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js": [function(require, module, exports) {
29948     var Module = require('./module');
29949     var autoAnnotate = require('./annotation').parse;
29950     var annotate = require('./annotation').annotate;
29951     var isArray = require('./annotation').isArray;
29952
29953
29954     var Injector = function(modules, parent) {
29955       parent = parent || {
29956         get: function(name) {
29957           currentlyResolving.push(name);
29958           throw error('No provider for "' + name + '"!');
29959         }
29960       };
29961
29962       var currentlyResolving = [];
29963       var providers = this._providers = Object.create(parent._providers || null);
29964       var instances = this._instances = Object.create(null);
29965
29966       var self = instances.injector = this;
29967
29968       var error = function(msg) {
29969         var stack = currentlyResolving.join(' -> ');
29970         currentlyResolving.length = 0;
29971         return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
29972       };
29973
29974       var get = function(name) {
29975         if (!providers[name] && name.indexOf('.') !== -1) {
29976           var parts = name.split('.');
29977           var pivot = get(parts.shift());
29978
29979           while (parts.length) {
29980             pivot = pivot[parts.shift()];
29981           }
29982
29983           return pivot;
29984         }
29985
29986         if (Object.hasOwnProperty.call(instances, name)) {
29987           return instances[name];
29988         }
29989
29990         if (Object.hasOwnProperty.call(providers, name)) {
29991           if (currentlyResolving.indexOf(name) !== -1) {
29992             currentlyResolving.push(name);
29993             throw error('Cannot resolve circular dependency!');
29994           }
29995
29996           currentlyResolving.push(name);
29997           instances[name] = providers[name][0](providers[name][1]);
29998           currentlyResolving.pop();
29999
30000           return instances[name];
30001         }
30002
30003         return parent.get(name);
30004       };
30005
30006       var instantiate = function(Type) {
30007         var instance = Object.create(Type.prototype);
30008         var returned = invoke(Type, instance);
30009
30010         return typeof returned === 'object' ? returned : instance;
30011       };
30012
30013       var invoke = function(fn, context) {
30014         if (typeof fn !== 'function') {
30015           if (isArray(fn)) {
30016             fn = annotate(fn.slice());
30017           } else {
30018             throw new Error('Cannot invoke "' + fn + '". Expected a function!');
30019           }
30020         }
30021
30022         var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
30023         var dependencies = inject.map(function(dep) {
30024           return get(dep);
30025         });
30026
30027         // TODO(vojta): optimize without apply
30028         return fn.apply(context, dependencies);
30029       };
30030
30031
30032       var createPrivateInjectorFactory = function(privateChildInjector) {
30033         return annotate(function(key) {
30034           return privateChildInjector.get(key);
30035         });
30036       };
30037
30038       var createChild = function(modules, forceNewInstances) {
30039         if (forceNewInstances && forceNewInstances.length) {
30040           var fromParentModule = Object.create(null);
30041           var matchedScopes = Object.create(null);
30042
30043           var privateInjectorsCache = [];
30044           var privateChildInjectors = [];
30045           var privateChildFactories = [];
30046
30047           var provider;
30048           var cacheIdx;
30049           var privateChildInjector;
30050           var privateChildInjectorFactory;
30051           for (var name in providers) {
30052             provider = providers[name];
30053
30054             if (forceNewInstances.indexOf(name) !== -1) {
30055               if (provider[2] === 'private') {
30056                 cacheIdx = privateInjectorsCache.indexOf(provider[3]);
30057                 if (cacheIdx === -1) {
30058                   privateChildInjector = provider[3].createChild([], forceNewInstances);
30059                   privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
30060                   privateInjectorsCache.push(provider[3]);
30061                   privateChildInjectors.push(privateChildInjector);
30062                   privateChildFactories.push(privateChildInjectorFactory);
30063                   fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
30064                 } else {
30065                   fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
30066                 }
30067               } else {
30068                 fromParentModule[name] = [provider[2], provider[1]];
30069               }
30070               matchedScopes[name] = true;
30071             }
30072
30073             if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
30074               forceNewInstances.forEach(function(scope) {
30075                 if (provider[1].$scope.indexOf(scope) !== -1) {
30076                   fromParentModule[name] = [provider[2], provider[1]];
30077                   matchedScopes[scope] = true;
30078                 }
30079               });
30080             }
30081           }
30082
30083           forceNewInstances.forEach(function(scope) {
30084             if (!matchedScopes[scope]) {
30085               throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
30086             }
30087           });
30088
30089           modules.unshift(fromParentModule);
30090         }
30091
30092         return new Injector(modules, self);
30093       };
30094
30095       var factoryMap = {
30096         factory: invoke,
30097         type: instantiate,
30098         value: function(value) {
30099           return value;
30100         }
30101       };
30102
30103       modules.forEach(function(module) {
30104
30105         function arrayUnwrap(type, value) {
30106           if (type !== 'value' && isArray(value)) {
30107             value = annotate(value.slice());
30108           }
30109
30110           return value;
30111         }
30112
30113         // TODO(vojta): handle wrong inputs (modules)
30114         if (module instanceof Module) {
30115           module.forEach(function(provider) {
30116             var name = provider[0];
30117             var type = provider[1];
30118             var value = provider[2];
30119
30120             providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
30121           });
30122         } else if (typeof module === 'object') {
30123           if (module.__exports__) {
30124             var clonedModule = Object.keys(module).reduce(function(m, key) {
30125               if (key.substring(0, 2) !== '__') {
30126                 m[key] = module[key];
30127               }
30128               return m;
30129             }, Object.create(null));
30130
30131             var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
30132             var getFromPrivateInjector = annotate(function(key) {
30133               return privateInjector.get(key);
30134             });
30135             module.__exports__.forEach(function(key) {
30136               providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
30137             });
30138           } else {
30139             Object.keys(module).forEach(function(name) {
30140               if (module[name][2] === 'private') {
30141                 providers[name] = module[name];
30142                 return;
30143               }
30144
30145               var type = module[name][0];
30146               var value = module[name][1];
30147
30148               providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
30149             });
30150           }
30151         }
30152       });
30153
30154       // public API
30155       this.get = get;
30156       this.invoke = invoke;
30157       this.instantiate = instantiate;
30158       this.createChild = createChild;
30159     };
30160
30161     module.exports = Injector;
30162
30163   }, {
30164     "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
30165     "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
30166   }],
30167   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js": [function(require, module, exports) {
30168     var Module = function() {
30169       var providers = [];
30170
30171       this.factory = function(name, factory) {
30172         providers.push([name, 'factory', factory]);
30173         return this;
30174       };
30175
30176       this.value = function(name, value) {
30177         providers.push([name, 'value', value]);
30178         return this;
30179       };
30180
30181       this.type = function(name, type) {
30182         providers.push([name, 'type', type]);
30183         return this;
30184       };
30185
30186       this.forEach = function(iterator) {
30187         providers.forEach(iterator);
30188       };
30189     };
30190
30191     module.exports = Module;
30192
30193   }, {}],
30194   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js": [function(require, module, exports) {
30195     // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
30196     //
30197     // Licensed under the Apache License, Version 2.0 (the "License");
30198     // you may not use this file except in compliance with the License.
30199     // You may obtain a copy of the License at
30200     //
30201     // http://www.apache.org/licenses/LICENSE-2.0
30202     //
30203     // Unless required by applicable law or agreed to in writing, software
30204     // distributed under the License is distributed on an "AS IS" BASIS,
30205     // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30206     // See the License for the specific language governing permissions and
30207     // limitations under the License.
30208     // ÃƒÆ’¢â€�Ήâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Â�
30209     // \\
30210     // ÃƒÆ’¢â€�‚ Eve 0.4.2 - JavaScript Events Library ÃƒÆ’¢â€�‚ \\
30211     // ÃƒÆ’¢â€�ωâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�¤
30212     // \\
30213     // ÃƒÆ’¢â€�‚ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) ÃƒÆ’¢â€�‚
30214     // \\
30215     // ÃƒÆ’¢â€�â€�ââ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Ëœ
30216     // \\
30217
30218     (function(glob) {
30219       var version = "0.4.2",
30220         has = "hasOwnProperty",
30221         separator = /[\.\/]/,
30222         comaseparator = /\s*,\s*/,
30223         wildcard = "*",
30224         fun = function() {},
30225         numsort = function(a, b) {
30226           return a - b;
30227         },
30228         current_event,
30229         stop,
30230         events = {
30231           n: {}
30232         },
30233         firstDefined = function() {
30234           for (var i = 0, ii = this.length; i < ii; i++) {
30235             if (typeof this[i] != "undefined") {
30236               return this[i];
30237             }
30238           }
30239         },
30240         lastDefined = function() {
30241           var i = this.length;
30242           while (--i) {
30243             if (typeof this[i] != "undefined") {
30244               return this[i];
30245             }
30246           }
30247         },
30248         /*
30249          * \ eve [ method ]
30250          *
30251          * Fires event with given `name`, given scope and other parameters.
30252          *  > Arguments
30253          *  - name (string) name of the *event*, dot (`.`) or slash (`/`) separated -
30254          * scope (object) context for the event handlers - varargs (...) the rest of
30255          * arguments will be sent to event handlers
30256          *  = (object) array of returned values from the listeners. Array has two
30257          * methods `.firstDefined()` and `.lastDefined()` to get first or last not
30258          * `undefined` value. \
30259          */
30260         eve = function(name, scope) {
30261           name = String(name);
30262           var e = events,
30263             oldstop = stop,
30264             args = Array.prototype.slice.call(arguments, 2),
30265             listeners = eve.listeners(name),
30266             z = 0,
30267             f = false,
30268             l,
30269             indexed = [],
30270             queue = {},
30271             out = [],
30272             ce = current_event,
30273             errors = [];
30274           out.firstDefined = firstDefined;
30275           out.lastDefined = lastDefined;
30276           current_event = name;
30277           stop = 0;
30278           for (var i = 0, ii = listeners.length; i < ii; i++)
30279             if ("zIndex" in listeners[i]) {
30280               indexed.push(listeners[i].zIndex);
30281               if (listeners[i].zIndex < 0) {
30282                 queue[listeners[i].zIndex] = listeners[i];
30283               }
30284             }
30285           indexed.sort(numsort);
30286           while (indexed[z] < 0) {
30287             l = queue[indexed[z++]];
30288             out.push(l.apply(scope, args));
30289             if (stop) {
30290               stop = oldstop;
30291               return out;
30292             }
30293           }
30294           for (i = 0; i < ii; i++) {
30295             l = listeners[i];
30296             if ("zIndex" in l) {
30297               if (l.zIndex == indexed[z]) {
30298                 out.push(l.apply(scope, args));
30299                 if (stop) {
30300                   break;
30301                 }
30302                 do {
30303                   z++;
30304                   l = queue[indexed[z]];
30305                   l && out.push(l.apply(scope, args));
30306                   if (stop) {
30307                     break;
30308                   }
30309                 } while (l)
30310               } else {
30311                 queue[l.zIndex] = l;
30312               }
30313             } else {
30314               out.push(l.apply(scope, args));
30315               if (stop) {
30316                 break;
30317               }
30318             }
30319           }
30320           stop = oldstop;
30321           current_event = ce;
30322           return out;
30323         };
30324       // Undocumented. Debug only.
30325       eve._events = events;
30326       /*
30327        * \ eve.listeners [ method ]
30328        *
30329        * Internal method which gives you array of all event handlers that will be
30330        * triggered by the given `name`.
30331        *  > Arguments
30332        *  - name (string) name of the event, dot (`.`) or slash (`/`) separated
30333        *  = (array) array of event handlers \
30334        */
30335       eve.listeners = function(name) {
30336         var names = name.split(separator),
30337           e = events,
30338           item,
30339           items,
30340           k,
30341           i,
30342           ii,
30343           j,
30344           jj,
30345           nes,
30346           es = [e],
30347           out = [];
30348         for (i = 0, ii = names.length; i < ii; i++) {
30349           nes = [];
30350           for (j = 0, jj = es.length; j < jj; j++) {
30351             e = es[j].n;
30352             items = [e[names[i]], e[wildcard]];
30353             k = 2;
30354             while (k--) {
30355               item = items[k];
30356               if (item) {
30357                 nes.push(item);
30358                 out = out.concat(item.f || []);
30359               }
30360             }
30361           }
30362           es = nes;
30363         }
30364         return out;
30365       };
30366
30367       /*
30368        * \ eve.on [ method ] * Binds given event handler with a given name. You
30369        * can use wildcards ÃƒÆ’¢â‚¬Å“`*`� for the names: | eve.on("*.under.*",
30370        * f); | eve("mouse.under.floor"); // triggers f Use @eve to trigger the
30371        * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30372        * slash (`/`) separated, with optional wildcards - f (function) event
30373        * handler function * = (function) returned function accepts a single
30374        * numeric parameter that represents z-index of the handler. It is an
30375        * optional feature and only used when you need to ensure that some subset
30376        * of handlers will be invoked in a given order, despite of the order of
30377        * assignment. > Example: | eve.on("mouse", eatIt)(2); | eve.on("mouse",
30378        * scream); | eve.on("mouse", catchIt)(1); This will ensure that `catchIt`
30379        * function will be called before `eatIt`.
30380        *
30381        * If you want to put your handler before non-indexed handlers, specify a
30382        * negative value. Note: I assume most of the time you don’t need to
30383        * worry about z-index, but it’s nice to have this feature
30384        * ÃƒÆ’¢â‚¬Å“just in case�. \
30385        */
30386       eve.on = function(name, f) {
30387         name = String(name);
30388         if (typeof f != "function") {
30389           return function() {};
30390         }
30391         var names = name.split(comaseparator);
30392         for (var i = 0, ii = names.length; i < ii; i++) {
30393           (function(name) {
30394             var names = name.split(separator),
30395               e = events,
30396               exist;
30397             for (var i = 0, ii = names.length; i < ii; i++) {
30398               e = e.n;
30399               e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {
30400                 n: {}
30401               });
30402             }
30403             e.f = e.f || [];
30404             for (i = 0, ii = e.f.length; i < ii; i++)
30405               if (e.f[i] == f) {
30406                 exist = true;
30407                 break;
30408               }!exist && e.f.push(f);
30409           }(names[i]));
30410         }
30411         return function(zIndex) {
30412           if (+zIndex == +zIndex) {
30413             f.zIndex = +zIndex;
30414           }
30415         };
30416       };
30417       /*
30418        * \ eve.f [ method ] * Returns function that will fire given event with
30419        * optional arguments. Arguments that will be passed to the result function
30420        * will be also concated to the list of final arguments. | el.onclick =
30421        * eve.f("click", 1, 2); | eve.on("click", function (a, b, c) { |
30422        * console.log(a, b, c); // 1, 2, [event object] | }); > Arguments - event
30423        * (string) event name - varargs (…) and any other arguments =
30424        * (function) possible event handler function \
30425        */
30426       eve.f = function(event) {
30427         var attrs = [].slice.call(arguments, 1);
30428         return function() {
30429           eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
30430         };
30431       };
30432       /*
30433        * \ eve.stop [ method ] * Is used inside an event handler to stop the
30434        * event, preventing any subsequent listeners from firing. \
30435        */
30436       eve.stop = function() {
30437         stop = 1;
30438       };
30439       /*
30440        * \ eve.nt [ method ] * Could be used inside event handler to figure out
30441        * actual name of the event. * > Arguments * - subname (string) #optional
30442        * subname of the event * = (string) name of the event, if `subname` is not
30443        * specified or = (boolean) `true`, if current event’s name contains
30444        * `subname` \
30445        */
30446       eve.nt = function(subname) {
30447         if (subname) {
30448           return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
30449         }
30450         return current_event;
30451       };
30452       /*
30453        * \ eve.nts [ method ] * Could be used inside event handler to figure out
30454        * actual name of the event. * * = (array) names of the event \
30455        */
30456       eve.nts = function() {
30457         return current_event.split(separator);
30458       };
30459       /*
30460        * \ eve.off [ method ] * Removes given function from the list of event
30461        * listeners assigned to given name. If no arguments specified all the
30462        * events will be cleared. * > Arguments * - name (string) name of the
30463        * event, dot (`.`) or slash (`/`) separated, with optional wildcards - f
30464        * (function) event handler function \
30465        */
30466       /*
30467        * \ eve.unbind [ method ] * See @eve.off \
30468        */
30469       eve.off = eve.unbind = function(name, f) {
30470         if (!name) {
30471           eve._events = events = {
30472             n: {}
30473           };
30474           return;
30475         }
30476         var names = name.split(comaseparator);
30477         if (names.length > 1) {
30478           for (var i = 0, ii = names.length; i < ii; i++) {
30479             eve.off(names[i], f);
30480           }
30481           return;
30482         }
30483         names = name.split(separator);
30484         var e,
30485           key,
30486           splice,
30487           i, ii, j, jj,
30488           cur = [events];
30489         for (i = 0, ii = names.length; i < ii; i++) {
30490           for (j = 0; j < cur.length; j += splice.length - 2) {
30491             splice = [j, 1];
30492             e = cur[j].n;
30493             if (names[i] != wildcard) {
30494               if (e[names[i]]) {
30495                 splice.push(e[names[i]]);
30496               }
30497             } else {
30498               for (key in e)
30499                 if (e[has](key)) {
30500                   splice.push(e[key]);
30501                 }
30502             }
30503             cur.splice.apply(cur, splice);
30504           }
30505         }
30506         for (i = 0, ii = cur.length; i < ii; i++) {
30507           e = cur[i];
30508           while (e.n) {
30509             if (f) {
30510               if (e.f) {
30511                 for (j = 0, jj = e.f.length; j < jj; j++)
30512                   if (e.f[j] == f) {
30513                     e.f.splice(j, 1);
30514                     break;
30515                   }!e.f.length && delete e.f;
30516               }
30517               for (key in e.n)
30518                 if (e.n[has](key) && e.n[key].f) {
30519                   var funcs = e.n[key].f;
30520                   for (j = 0, jj = funcs.length; j < jj; j++)
30521                     if (funcs[j] == f) {
30522                       funcs.splice(j, 1);
30523                       break;
30524                     }!funcs.length && delete e.n[key].f;
30525                 }
30526             } else {
30527               delete e.f;
30528               for (key in e.n)
30529                 if (e.n[has](key) && e.n[key].f) {
30530                   delete e.n[key].f;
30531                 }
30532             }
30533             e = e.n;
30534           }
30535         }
30536       };
30537       /*
30538        * \ eve.once [ method ] * Binds given event handler with a given name to
30539        * only run once then unbind itself. | eve.once("login", f); | eve("login"); //
30540        * triggers f | eve("login"); // no listeners Use @eve to trigger the
30541        * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30542        * slash (`/`) separated, with optional wildcards - f (function) event
30543        * handler function * = (function) same return function as @eve.on \
30544        */
30545       eve.once = function(name, f) {
30546         var f2 = function() {
30547           eve.unbind(name, f2);
30548           return f.apply(this, arguments);
30549         };
30550         return eve.on(name, f2);
30551       };
30552       /*
30553        * \ eve.version [ property (string) ] * Current version of the library. \
30554        */
30555       eve.version = version;
30556       eve.toString = function() {
30557         return "You are running Eve " + version;
30558       };
30559       (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() {
30560         return eve;
30561       })) : (glob.eve = eve));
30562     })(this);
30563
30564   }, {}],
30565   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js": [function(require, module, exports) {
30566     /*
30567      * ! Hammer.JS - v2.0.4 - 2014-09-28 http://hammerjs.github.io/
30568      *
30569      * Copyright (c) 2014 Jorik Tangelder; Licensed under the MIT license
30570      */
30571     (function(window, document, exportName, undefined) {
30572       'use strict';
30573
30574       var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
30575       var TEST_ELEMENT = document.createElement('div');
30576
30577       var TYPE_FUNCTION = 'function';
30578
30579       var round = Math.round;
30580       var abs = Math.abs;
30581       var now = Date.now;
30582
30583       /**
30584        * set a timeout with a given scope
30585        *
30586        * @param {Function}
30587        *            fn
30588        * @param {Number}
30589        *            timeout
30590        * @param {Object}
30591        *            context
30592        * @returns {number}
30593        */
30594       function setTimeoutContext(fn, timeout, context) {
30595         return setTimeout(bindFn(fn, context), timeout);
30596       }
30597
30598       /**
30599        * if the argument is an array, we want to execute the fn on each entry if it
30600        * aint an array we don't want to do a thing. this is used by all the methods
30601        * that accept a single and array argument.
30602        *
30603        * @param {*|Array}
30604        *            arg
30605        * @param {String}
30606        *            fn
30607        * @param {Object}
30608        *            [context]
30609        * @returns {Boolean}
30610        */
30611       function invokeArrayArg(arg, fn, context) {
30612         if (Array.isArray(arg)) {
30613           each(arg, context[fn], context);
30614           return true;
30615         }
30616         return false;
30617       }
30618
30619       /**
30620        * walk objects and arrays
30621        *
30622        * @param {Object}
30623        *            obj
30624        * @param {Function}
30625        *            iterator
30626        * @param {Object}
30627        *            context
30628        */
30629       function each(obj, iterator, context) {
30630         var i;
30631
30632         if (!obj) {
30633           return;
30634         }
30635
30636         if (obj.forEach) {
30637           obj.forEach(iterator, context);
30638         } else if (obj.length !== undefined) {
30639           i = 0;
30640           while (i < obj.length) {
30641             iterator.call(context, obj[i], i, obj);
30642             i++;
30643           }
30644         } else {
30645           for (i in obj) {
30646             obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
30647           }
30648         }
30649       }
30650
30651       /**
30652        * extend object. means that properties in dest will be overwritten by the ones
30653        * in src.
30654        *
30655        * @param {Object}
30656        *            dest
30657        * @param {Object}
30658        *            src
30659        * @param {Boolean}
30660        *            [merge]
30661        * @returns {Object} dest
30662        */
30663       function extend(dest, src, merge) {
30664         var keys = Object.keys(src);
30665         var i = 0;
30666         while (i < keys.length) {
30667           if (!merge || (merge && dest[keys[i]] === undefined)) {
30668             dest[keys[i]] = src[keys[i]];
30669           }
30670           i++;
30671         }
30672         return dest;
30673       }
30674
30675       /**
30676        * merge the values from src in the dest. means that properties that exist in
30677        * dest will not be overwritten by src
30678        *
30679        * @param {Object}
30680        *            dest
30681        * @param {Object}
30682        *            src
30683        * @returns {Object} dest
30684        */
30685       function merge(dest, src) {
30686         return extend(dest, src, true);
30687       }
30688
30689       /**
30690        * simple class inheritance
30691        *
30692        * @param {Function}
30693        *            child
30694        * @param {Function}
30695        *            base
30696        * @param {Object}
30697        *            [properties]
30698        */
30699       function inherit(child, base, properties) {
30700         var baseP = base.prototype,
30701           childP;
30702
30703         childP = child.prototype = Object.create(baseP);
30704         childP.constructor = child;
30705         childP._super = baseP;
30706
30707         if (properties) {
30708           extend(childP, properties);
30709         }
30710       }
30711
30712       /**
30713        * simple function bind
30714        *
30715        * @param {Function}
30716        *            fn
30717        * @param {Object}
30718        *            context
30719        * @returns {Function}
30720        */
30721       function bindFn(fn, context) {
30722         return function boundFn() {
30723           return fn.apply(context, arguments);
30724         };
30725       }
30726
30727       /**
30728        * let a boolean value also be a function that must return a boolean this first
30729        * item in args will be used as the context
30730        *
30731        * @param {Boolean|Function}
30732        *            val
30733        * @param {Array}
30734        *            [args]
30735        * @returns {Boolean}
30736        */
30737       function boolOrFn(val, args) {
30738         if (typeof val == TYPE_FUNCTION) {
30739           return val.apply(args ? args[0] || undefined : undefined, args);
30740         }
30741         return val;
30742       }
30743
30744       /**
30745        * use the val2 when val1 is undefined
30746        *
30747        * @param {*}
30748        *            val1
30749        * @param {*}
30750        *            val2
30751        * @returns {*}
30752        */
30753       function ifUndefined(val1, val2) {
30754         return (val1 === undefined) ? val2 : val1;
30755       }
30756
30757       /**
30758        * addEventListener with multiple events at once
30759        *
30760        * @param {EventTarget}
30761        *            target
30762        * @param {String}
30763        *            types
30764        * @param {Function}
30765        *            handler
30766        */
30767       function addEventListeners(target, types, handler) {
30768         each(splitStr(types), function(type) {
30769           target.addEventListener(type, handler, false);
30770         });
30771       }
30772
30773       /**
30774        * removeEventListener with multiple events at once
30775        *
30776        * @param {EventTarget}
30777        *            target
30778        * @param {String}
30779        *            types
30780        * @param {Function}
30781        *            handler
30782        */
30783       function removeEventListeners(target, types, handler) {
30784         each(splitStr(types), function(type) {
30785           target.removeEventListener(type, handler, false);
30786         });
30787       }
30788
30789       /**
30790        * find if a node is in the given parent
30791        *
30792        * @method hasParent
30793        * @param {HTMLElement}
30794        *            node
30795        * @param {HTMLElement}
30796        *            parent
30797        * @return {Boolean} found
30798        */
30799       function hasParent(node, parent) {
30800         while (node) {
30801           if (node == parent) {
30802             return true;
30803           }
30804           node = node.parentNode;
30805         }
30806         return false;
30807       }
30808
30809       /**
30810        * small indexOf wrapper
30811        *
30812        * @param {String}
30813        *            str
30814        * @param {String}
30815        *            find
30816        * @returns {Boolean} found
30817        */
30818       function inStr(str, find) {
30819         return str.indexOf(find) > -1;
30820       }
30821
30822       /**
30823        * split string on whitespace
30824        *
30825        * @param {String}
30826        *            str
30827        * @returns {Array} words
30828        */
30829       function splitStr(str) {
30830         return str.trim().split(/\s+/g);
30831       }
30832
30833       /**
30834        * find if a array contains the object using indexOf or a simple polyFill
30835        *
30836        * @param {Array}
30837        *            src
30838        * @param {String}
30839        *            find
30840        * @param {String}
30841        *            [findByKey]
30842        * @return {Boolean|Number} false when not found, or the index
30843        */
30844       function inArray(src, find, findByKey) {
30845         if (src.indexOf && !findByKey) {
30846           return src.indexOf(find);
30847         } else {
30848           var i = 0;
30849           while (i < src.length) {
30850             if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
30851               return i;
30852             }
30853             i++;
30854           }
30855           return -1;
30856         }
30857       }
30858
30859       /**
30860        * convert array-like objects to real arrays
30861        *
30862        * @param {Object}
30863        *            obj
30864        * @returns {Array}
30865        */
30866       function toArray(obj) {
30867         return Array.prototype.slice.call(obj, 0);
30868       }
30869
30870       /**
30871        * unique array with objects based on a key (like 'id') or just by the array's
30872        * value
30873        *
30874        * @param {Array}
30875        *            src [{id:1},{id:2},{id:1}]
30876        * @param {String}
30877        *            [key]
30878        * @param {Boolean}
30879        *            [sort=False]
30880        * @returns {Array} [{id:1},{id:2}]
30881        */
30882       function uniqueArray(src, key, sort) {
30883         var results = [];
30884         var values = [];
30885         var i = 0;
30886
30887         while (i < src.length) {
30888           var val = key ? src[i][key] : src[i];
30889           if (inArray(values, val) < 0) {
30890             results.push(src[i]);
30891           }
30892           values[i] = val;
30893           i++;
30894         }
30895
30896         if (sort) {
30897           if (!key) {
30898             results = results.sort();
30899           } else {
30900             results = results.sort(function sortUniqueArray(a, b) {
30901               return a[key] > b[key];
30902             });
30903           }
30904         }
30905
30906         return results;
30907       }
30908
30909       /**
30910        * get the prefixed property
30911        *
30912        * @param {Object}
30913        *            obj
30914        * @param {String}
30915        *            property
30916        * @returns {String|Undefined} prefixed
30917        */
30918       function prefixed(obj, property) {
30919         var prefix, prop;
30920         var camelProp = property[0].toUpperCase() + property.slice(1);
30921
30922         var i = 0;
30923         while (i < VENDOR_PREFIXES.length) {
30924           prefix = VENDOR_PREFIXES[i];
30925           prop = (prefix) ? prefix + camelProp : property;
30926
30927           if (prop in obj) {
30928             return prop;
30929           }
30930           i++;
30931         }
30932         return undefined;
30933       }
30934
30935       /**
30936        * get a unique id
30937        *
30938        * @returns {number} uniqueId
30939        */
30940       var _uniqueId = 1;
30941
30942       function uniqueId() {
30943         return _uniqueId++;
30944       }
30945
30946       /**
30947        * get the window object of an element
30948        *
30949        * @param {HTMLElement}
30950        *            element
30951        * @returns {DocumentView|Window}
30952        */
30953       function getWindowForElement(element) {
30954         var doc = element.ownerDocument;
30955         return (doc.defaultView || doc.parentWindow);
30956       }
30957
30958       var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
30959
30960       var SUPPORT_TOUCH = ('ontouchstart' in window);
30961       var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
30962       var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
30963
30964       var INPUT_TYPE_TOUCH = 'touch';
30965       var INPUT_TYPE_PEN = 'pen';
30966       var INPUT_TYPE_MOUSE = 'mouse';
30967       var INPUT_TYPE_KINECT = 'kinect';
30968
30969       var COMPUTE_INTERVAL = 25;
30970
30971       var INPUT_START = 1;
30972       var INPUT_MOVE = 2;
30973       var INPUT_END = 4;
30974       var INPUT_CANCEL = 8;
30975
30976       var DIRECTION_NONE = 1;
30977       var DIRECTION_LEFT = 2;
30978       var DIRECTION_RIGHT = 4;
30979       var DIRECTION_UP = 8;
30980       var DIRECTION_DOWN = 16;
30981
30982       var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
30983       var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
30984       var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
30985
30986       var PROPS_XY = ['x', 'y'];
30987       var PROPS_CLIENT_XY = ['clientX', 'clientY'];
30988
30989       /**
30990        * create new input type manager
30991        *
30992        * @param {Manager}
30993        *            manager
30994        * @param {Function}
30995        *            callback
30996        * @returns {Input}
30997        * @constructor
30998        */
30999       function Input(manager, callback) {
31000         var self = this;
31001         this.manager = manager;
31002         this.callback = callback;
31003         this.element = manager.element;
31004         this.target = manager.options.inputTarget;
31005
31006         // smaller wrapper around the handler, for the scope and the enabled state
31007         // of the manager,
31008         // so when disabled the input events are completely bypassed.
31009         this.domHandler = function(ev) {
31010           if (boolOrFn(manager.options.enable, [manager])) {
31011             self.handler(ev);
31012           }
31013         };
31014
31015         this.init();
31016
31017       }
31018
31019       Input.prototype = {
31020         /**
31021          * should handle the inputEvent data and trigger the callback
31022          *
31023          * @virtual
31024          */
31025         handler: function() {},
31026
31027         /**
31028          * bind the events
31029          */
31030         init: function() {
31031           this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
31032           this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
31033           this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
31034         },
31035
31036         /**
31037          * unbind the events
31038          */
31039         destroy: function() {
31040           this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
31041           this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
31042           this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
31043         }
31044       };
31045
31046       /**
31047        * create new input type manager called by the Manager constructor
31048        *
31049        * @param {Hammer}
31050        *            manager
31051        * @returns {Input}
31052        */
31053       function createInputInstance(manager) {
31054         var Type;
31055         var inputClass = manager.options.inputClass;
31056
31057         if (inputClass) {
31058           Type = inputClass;
31059         } else if (SUPPORT_POINTER_EVENTS) {
31060           Type = PointerEventInput;
31061         } else if (SUPPORT_ONLY_TOUCH) {
31062           Type = TouchInput;
31063         } else if (!SUPPORT_TOUCH) {
31064           Type = MouseInput;
31065         } else {
31066           Type = TouchMouseInput;
31067         }
31068         return new(Type)(manager, inputHandler);
31069       }
31070
31071       /**
31072        * handle input events
31073        *
31074        * @param {Manager}
31075        *            manager
31076        * @param {String}
31077        *            eventType
31078        * @param {Object}
31079        *            input
31080        */
31081       function inputHandler(manager, eventType, input) {
31082         var pointersLen = input.pointers.length;
31083         var changedPointersLen = input.changedPointers.length;
31084         var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
31085         var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
31086
31087         input.isFirst = !!isFirst;
31088         input.isFinal = !!isFinal;
31089
31090         if (isFirst) {
31091           manager.session = {};
31092         }
31093
31094         // source event is the normalized value of the domEvents
31095         // like 'touchstart, mouseup, pointerdown'
31096         input.eventType = eventType;
31097
31098         // compute scale, rotation etc
31099         computeInputData(manager, input);
31100
31101         // emit secret event
31102         manager.emit('hammer.input', input);
31103
31104         manager.recognize(input);
31105         manager.session.prevInput = input;
31106       }
31107
31108       /**
31109        * extend the data with some usable properties like scale, rotate, velocity etc
31110        *
31111        * @param {Object}
31112        *            manager
31113        * @param {Object}
31114        *            input
31115        */
31116       function computeInputData(manager, input) {
31117         var session = manager.session;
31118         var pointers = input.pointers;
31119         var pointersLength = pointers.length;
31120
31121         // store the first input to calculate the distance and direction
31122         if (!session.firstInput) {
31123           session.firstInput = simpleCloneInputData(input);
31124         }
31125
31126         // to compute scale and rotation we need to store the multiple touches
31127         if (pointersLength > 1 && !session.firstMultiple) {
31128           session.firstMultiple = simpleCloneInputData(input);
31129         } else if (pointersLength === 1) {
31130           session.firstMultiple = false;
31131         }
31132
31133         var firstInput = session.firstInput;
31134         var firstMultiple = session.firstMultiple;
31135         var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
31136
31137         var center = input.center = getCenter(pointers);
31138         input.timeStamp = now();
31139         input.deltaTime = input.timeStamp - firstInput.timeStamp;
31140
31141         input.angle = getAngle(offsetCenter, center);
31142         input.distance = getDistance(offsetCenter, center);
31143
31144         computeDeltaXY(session, input);
31145         input.offsetDirection = getDirection(input.deltaX, input.deltaY);
31146
31147         input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
31148         input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
31149
31150         computeIntervalInputData(session, input);
31151
31152         // find the correct target
31153         var target = manager.element;
31154         if (hasParent(input.srcEvent.target, target)) {
31155           target = input.srcEvent.target;
31156         }
31157         input.target = target;
31158       }
31159
31160       function computeDeltaXY(session, input) {
31161         var center = input.center;
31162         var offset = session.offsetDelta || {};
31163         var prevDelta = session.prevDelta || {};
31164         var prevInput = session.prevInput || {};
31165
31166         if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
31167           prevDelta = session.prevDelta = {
31168             x: prevInput.deltaX || 0,
31169             y: prevInput.deltaY || 0
31170           };
31171
31172           offset = session.offsetDelta = {
31173             x: center.x,
31174             y: center.y
31175           };
31176         }
31177
31178         input.deltaX = prevDelta.x + (center.x - offset.x);
31179         input.deltaY = prevDelta.y + (center.y - offset.y);
31180       }
31181
31182       /**
31183        * velocity is calculated every x ms
31184        *
31185        * @param {Object}
31186        *            session
31187        * @param {Object}
31188        *            input
31189        */
31190       function computeIntervalInputData(session, input) {
31191         var last = session.lastInterval || input,
31192           deltaTime = input.timeStamp - last.timeStamp,
31193           velocity, velocityX, velocityY, direction;
31194
31195         if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
31196           var deltaX = last.deltaX - input.deltaX;
31197           var deltaY = last.deltaY - input.deltaY;
31198
31199           var v = getVelocity(deltaTime, deltaX, deltaY);
31200           velocityX = v.x;
31201           velocityY = v.y;
31202           velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
31203           direction = getDirection(deltaX, deltaY);
31204
31205           session.lastInterval = input;
31206         } else {
31207           // use latest velocity info if it doesn't overtake a minimum period
31208           velocity = last.velocity;
31209           velocityX = last.velocityX;
31210           velocityY = last.velocityY;
31211           direction = last.direction;
31212         }
31213
31214         input.velocity = velocity;
31215         input.velocityX = velocityX;
31216         input.velocityY = velocityY;
31217         input.direction = direction;
31218       }
31219
31220       /**
31221        * create a simple clone from the input used for storage of firstInput and
31222        * firstMultiple
31223        *
31224        * @param {Object}
31225        *            input
31226        * @returns {Object} clonedInputData
31227        */
31228       function simpleCloneInputData(input) {
31229         // make a simple copy of the pointers because we will get a reference if we
31230         // don't
31231         // we only need clientXY for the calculations
31232         var pointers = [];
31233         var i = 0;
31234         while (i < input.pointers.length) {
31235           pointers[i] = {
31236             clientX: round(input.pointers[i].clientX),
31237             clientY: round(input.pointers[i].clientY)
31238           };
31239           i++;
31240         }
31241
31242         return {
31243           timeStamp: now(),
31244           pointers: pointers,
31245           center: getCenter(pointers),
31246           deltaX: input.deltaX,
31247           deltaY: input.deltaY
31248         };
31249       }
31250
31251       /**
31252        * get the center of all the pointers
31253        *
31254        * @param {Array}
31255        *            pointers
31256        * @return {Object} center contains `x` and `y` properties
31257        */
31258       function getCenter(pointers) {
31259         var pointersLength = pointers.length;
31260
31261         // no need to loop when only one touch
31262         if (pointersLength === 1) {
31263           return {
31264             x: round(pointers[0].clientX),
31265             y: round(pointers[0].clientY)
31266           };
31267         }
31268
31269         var x = 0,
31270           y = 0,
31271           i = 0;
31272         while (i < pointersLength) {
31273           x += pointers[i].clientX;
31274           y += pointers[i].clientY;
31275           i++;
31276         }
31277
31278         return {
31279           x: round(x / pointersLength),
31280           y: round(y / pointersLength)
31281         };
31282       }
31283
31284       /**
31285        * calculate the velocity between two points. unit is in px per ms.
31286        *
31287        * @param {Number}
31288        *            deltaTime
31289        * @param {Number}
31290        *            x
31291        * @param {Number}
31292        *            y
31293        * @return {Object} velocity `x` and `y`
31294        */
31295       function getVelocity(deltaTime, x, y) {
31296         return {
31297           x: x / deltaTime || 0,
31298           y: y / deltaTime || 0
31299         };
31300       }
31301
31302       /**
31303        * get the direction between two points
31304        *
31305        * @param {Number}
31306        *            x
31307        * @param {Number}
31308        *            y
31309        * @return {Number} direction
31310        */
31311       function getDirection(x, y) {
31312         if (x === y) {
31313           return DIRECTION_NONE;
31314         }
31315
31316         if (abs(x) >= abs(y)) {
31317           return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
31318         }
31319         return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
31320       }
31321
31322       /**
31323        * calculate the absolute distance between two points
31324        *
31325        * @param {Object}
31326        *            p1 {x, y}
31327        * @param {Object}
31328        *            p2 {x, y}
31329        * @param {Array}
31330        *            [props] containing x and y keys
31331        * @return {Number} distance
31332        */
31333       function getDistance(p1, p2, props) {
31334         if (!props) {
31335           props = PROPS_XY;
31336         }
31337         var x = p2[props[0]] - p1[props[0]],
31338           y = p2[props[1]] - p1[props[1]];
31339
31340         return Math.sqrt((x * x) + (y * y));
31341       }
31342
31343       /**
31344        * calculate the angle between two coordinates
31345        *
31346        * @param {Object}
31347        *            p1
31348        * @param {Object}
31349        *            p2
31350        * @param {Array}
31351        *            [props] containing x and y keys
31352        * @return {Number} angle
31353        */
31354       function getAngle(p1, p2, props) {
31355         if (!props) {
31356           props = PROPS_XY;
31357         }
31358         var x = p2[props[0]] - p1[props[0]],
31359           y = p2[props[1]] - p1[props[1]];
31360         return Math.atan2(y, x) * 180 / Math.PI;
31361       }
31362
31363       /**
31364        * calculate the rotation degrees between two pointersets
31365        *
31366        * @param {Array}
31367        *            start array of pointers
31368        * @param {Array}
31369        *            end array of pointers
31370        * @return {Number} rotation
31371        */
31372       function getRotation(start, end) {
31373         return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
31374       }
31375
31376       /**
31377        * calculate the scale factor between two pointersets no scale is 1, and goes
31378        * down to 0 when pinched together, and bigger when pinched out
31379        *
31380        * @param {Array}
31381        *            start array of pointers
31382        * @param {Array}
31383        *            end array of pointers
31384        * @return {Number} scale
31385        */
31386       function getScale(start, end) {
31387         return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
31388       }
31389
31390       var MOUSE_INPUT_MAP = {
31391         mousedown: INPUT_START,
31392         mousemove: INPUT_MOVE,
31393         mouseup: INPUT_END
31394       };
31395
31396       var MOUSE_ELEMENT_EVENTS = 'mousedown';
31397       var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
31398
31399       /**
31400        * Mouse events input
31401        *
31402        * @constructor
31403        * @extends Input
31404        */
31405       function MouseInput() {
31406         this.evEl = MOUSE_ELEMENT_EVENTS;
31407         this.evWin = MOUSE_WINDOW_EVENTS;
31408
31409         this.allow = true; // used by Input.TouchMouse to disable mouse events
31410         this.pressed = false; // mousedown state
31411
31412         Input.apply(this, arguments);
31413       }
31414
31415       inherit(MouseInput, Input, {
31416         /**
31417          * handle mouse events
31418          *
31419          * @param {Object}
31420          *            ev
31421          */
31422         handler: function MEhandler(ev) {
31423           var eventType = MOUSE_INPUT_MAP[ev.type];
31424
31425           // on start we want to have the left mouse button down
31426           if (eventType & INPUT_START && ev.button === 0) {
31427             this.pressed = true;
31428           }
31429
31430           if (eventType & INPUT_MOVE && ev.which !== 1) {
31431             eventType = INPUT_END;
31432           }
31433
31434           // mouse must be down, and mouse events are allowed (see the TouchMouse
31435           // input)
31436           if (!this.pressed || !this.allow) {
31437             return;
31438           }
31439
31440           if (eventType & INPUT_END) {
31441             this.pressed = false;
31442           }
31443
31444           this.callback(this.manager, eventType, {
31445             pointers: [ev],
31446             changedPointers: [ev],
31447             pointerType: INPUT_TYPE_MOUSE,
31448             srcEvent: ev
31449           });
31450         }
31451       });
31452
31453       var POINTER_INPUT_MAP = {
31454         pointerdown: INPUT_START,
31455         pointermove: INPUT_MOVE,
31456         pointerup: INPUT_END,
31457         pointercancel: INPUT_CANCEL,
31458         pointerout: INPUT_CANCEL
31459       };
31460
31461       // in IE10 the pointer types is defined as an enum
31462       var IE10_POINTER_TYPE_ENUM = {
31463         2: INPUT_TYPE_TOUCH,
31464         3: INPUT_TYPE_PEN,
31465         4: INPUT_TYPE_MOUSE,
31466         5: INPUT_TYPE_KINECT // see
31467         // https://twitter.com/jacobrossi/status/480596438489890816
31468       };
31469
31470       var POINTER_ELEMENT_EVENTS = 'pointerdown';
31471       var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
31472
31473       // IE10 has prefixed support, and case-sensitive
31474       if (window.MSPointerEvent) {
31475         POINTER_ELEMENT_EVENTS = 'MSPointerDown';
31476         POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
31477       }
31478
31479       /**
31480        * Pointer events input
31481        *
31482        * @constructor
31483        * @extends Input
31484        */
31485       function PointerEventInput() {
31486         this.evEl = POINTER_ELEMENT_EVENTS;
31487         this.evWin = POINTER_WINDOW_EVENTS;
31488
31489         Input.apply(this, arguments);
31490
31491         this.store = (this.manager.session.pointerEvents = []);
31492       }
31493
31494       inherit(PointerEventInput, Input, {
31495         /**
31496          * handle mouse events
31497          *
31498          * @param {Object}
31499          *            ev
31500          */
31501         handler: function PEhandler(ev) {
31502           var store = this.store;
31503           var removePointer = false;
31504
31505           var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
31506           var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
31507           var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
31508
31509           var isTouch = (pointerType == INPUT_TYPE_TOUCH);
31510
31511           // get index of the event in the store
31512           var storeIndex = inArray(store, ev.pointerId, 'pointerId');
31513
31514           // start and mouse must be down
31515           if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
31516             if (storeIndex < 0) {
31517               store.push(ev);
31518               storeIndex = store.length - 1;
31519             }
31520           } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
31521             removePointer = true;
31522           }
31523
31524           // it not found, so the pointer hasn't been down (so it's probably a
31525           // hover)
31526           if (storeIndex < 0) {
31527             return;
31528           }
31529
31530           // update the event in the store
31531           store[storeIndex] = ev;
31532
31533           this.callback(this.manager, eventType, {
31534             pointers: store,
31535             changedPointers: [ev],
31536             pointerType: pointerType,
31537             srcEvent: ev
31538           });
31539
31540           if (removePointer) {
31541             // remove from the store
31542             store.splice(storeIndex, 1);
31543           }
31544         }
31545       });
31546
31547       var SINGLE_TOUCH_INPUT_MAP = {
31548         touchstart: INPUT_START,
31549         touchmove: INPUT_MOVE,
31550         touchend: INPUT_END,
31551         touchcancel: INPUT_CANCEL
31552       };
31553
31554       var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
31555       var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
31556
31557       /**
31558        * Touch events input
31559        *
31560        * @constructor
31561        * @extends Input
31562        */
31563       function SingleTouchInput() {
31564         this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
31565         this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
31566         this.started = false;
31567
31568         Input.apply(this, arguments);
31569       }
31570
31571       inherit(SingleTouchInput, Input, {
31572         handler: function TEhandler(ev) {
31573           var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
31574
31575           // should we handle the touch events?
31576           if (type === INPUT_START) {
31577             this.started = true;
31578           }
31579
31580           if (!this.started) {
31581             return;
31582           }
31583
31584           var touches = normalizeSingleTouches.call(this, ev, type);
31585
31586           // when done, reset the started state
31587           if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
31588             this.started = false;
31589           }
31590
31591           this.callback(this.manager, type, {
31592             pointers: touches[0],
31593             changedPointers: touches[1],
31594             pointerType: INPUT_TYPE_TOUCH,
31595             srcEvent: ev
31596           });
31597         }
31598       });
31599
31600       /**
31601        * @this {TouchInput}
31602        * @param {Object}
31603        *            ev
31604        * @param {Number}
31605        *            type flag
31606        * @returns {undefined|Array} [all, changed]
31607        */
31608       function normalizeSingleTouches(ev, type) {
31609         var all = toArray(ev.touches);
31610         var changed = toArray(ev.changedTouches);
31611
31612         if (type & (INPUT_END | INPUT_CANCEL)) {
31613           all = uniqueArray(all.concat(changed), 'identifier', true);
31614         }
31615
31616         return [all, changed];
31617       }
31618
31619       var TOUCH_INPUT_MAP = {
31620         touchstart: INPUT_START,
31621         touchmove: INPUT_MOVE,
31622         touchend: INPUT_END,
31623         touchcancel: INPUT_CANCEL
31624       };
31625
31626       var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
31627
31628       /**
31629        * Multi-user touch events input
31630        *
31631        * @constructor
31632        * @extends Input
31633        */
31634       function TouchInput() {
31635         this.evTarget = TOUCH_TARGET_EVENTS;
31636         this.targetIds = {};
31637
31638         Input.apply(this, arguments);
31639       }
31640
31641       inherit(TouchInput, Input, {
31642         handler: function MTEhandler(ev) {
31643           var type = TOUCH_INPUT_MAP[ev.type];
31644           var touches = getTouches.call(this, ev, type);
31645           if (!touches) {
31646             return;
31647           }
31648
31649           this.callback(this.manager, type, {
31650             pointers: touches[0],
31651             changedPointers: touches[1],
31652             pointerType: INPUT_TYPE_TOUCH,
31653             srcEvent: ev
31654           });
31655         }
31656       });
31657
31658       /**
31659        * @this {TouchInput}
31660        * @param {Object}
31661        *            ev
31662        * @param {Number}
31663        *            type flag
31664        * @returns {undefined|Array} [all, changed]
31665        */
31666       function getTouches(ev, type) {
31667         var allTouches = toArray(ev.touches);
31668         var targetIds = this.targetIds;
31669
31670         // when there is only one touch, the process can be simplified
31671         if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
31672           targetIds[allTouches[0].identifier] = true;
31673           return [allTouches, allTouches];
31674         }
31675
31676         var i,
31677           targetTouches,
31678           changedTouches = toArray(ev.changedTouches),
31679           changedTargetTouches = [],
31680           target = this.target;
31681
31682         // get target touches from touches
31683         targetTouches = allTouches.filter(function(touch) {
31684           return hasParent(touch.target, target);
31685         });
31686
31687         // collect touches
31688         if (type === INPUT_START) {
31689           i = 0;
31690           while (i < targetTouches.length) {
31691             targetIds[targetTouches[i].identifier] = true;
31692             i++;
31693           }
31694         }
31695
31696         // filter changed touches to only contain touches that exist in the
31697         // collected target ids
31698         i = 0;
31699         while (i < changedTouches.length) {
31700           if (targetIds[changedTouches[i].identifier]) {
31701             changedTargetTouches.push(changedTouches[i]);
31702           }
31703
31704           // cleanup removed touches
31705           if (type & (INPUT_END | INPUT_CANCEL)) {
31706             delete targetIds[changedTouches[i].identifier];
31707           }
31708           i++;
31709         }
31710
31711         if (!changedTargetTouches.length) {
31712           return;
31713         }
31714
31715         return [
31716           // merge targetTouches with changedTargetTouches so it contains ALL
31717           // touches, including 'end' and 'cancel'
31718           uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
31719           changedTargetTouches
31720         ];
31721       }
31722
31723       /**
31724        * Combined touch and mouse input
31725        *
31726        * Touch has a higher priority then mouse, and while touching no mouse events
31727        * are allowed. This because touch devices also emit mouse events while doing a
31728        * touch.
31729        *
31730        * @constructor
31731        * @extends Input
31732        */
31733       function TouchMouseInput() {
31734         Input.apply(this, arguments);
31735
31736         var handler = bindFn(this.handler, this);
31737         this.touch = new TouchInput(this.manager, handler);
31738         this.mouse = new MouseInput(this.manager, handler);
31739       }
31740
31741       inherit(TouchMouseInput, Input, {
31742         /**
31743          * handle mouse and touch events
31744          *
31745          * @param {Hammer}
31746          *            manager
31747          * @param {String}
31748          *            inputEvent
31749          * @param {Object}
31750          *            inputData
31751          */
31752         handler: function TMEhandler(manager, inputEvent, inputData) {
31753           var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
31754             isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
31755
31756           // when we're in a touch event, so block all upcoming mouse events
31757           // most mobile browser also emit mouseevents, right after touchstart
31758           if (isTouch) {
31759             this.mouse.allow = false;
31760           } else if (isMouse && !this.mouse.allow) {
31761             return;
31762           }
31763
31764           // reset the allowMouse when we're done
31765           if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
31766             this.mouse.allow = true;
31767           }
31768
31769           this.callback(manager, inputEvent, inputData);
31770         },
31771
31772         /**
31773          * remove the event listeners
31774          */
31775         destroy: function destroy() {
31776           this.touch.destroy();
31777           this.mouse.destroy();
31778         }
31779       });
31780
31781       var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
31782       var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
31783
31784       // magical touchAction value
31785       var TOUCH_ACTION_COMPUTE = 'compute';
31786       var TOUCH_ACTION_AUTO = 'auto';
31787       var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
31788       var TOUCH_ACTION_NONE = 'none';
31789       var TOUCH_ACTION_PAN_X = 'pan-x';
31790       var TOUCH_ACTION_PAN_Y = 'pan-y';
31791
31792       /**
31793        * Touch Action sets the touchAction property or uses the js alternative
31794        *
31795        * @param {Manager}
31796        *            manager
31797        * @param {String}
31798        *            value
31799        * @constructor
31800        */
31801       function TouchAction(manager, value) {
31802         this.manager = manager;
31803         this.set(value);
31804       }
31805
31806       TouchAction.prototype = {
31807         /**
31808          * set the touchAction value on the element or enable the polyfill
31809          *
31810          * @param {String}
31811          *            value
31812          */
31813         set: function(value) {
31814           // find out the touch-action by the event handlers
31815           if (value == TOUCH_ACTION_COMPUTE) {
31816             value = this.compute();
31817           }
31818
31819           if (NATIVE_TOUCH_ACTION) {
31820             this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
31821           }
31822           this.actions = value.toLowerCase().trim();
31823         },
31824
31825         /**
31826          * just re-set the touchAction value
31827          */
31828         update: function() {
31829           this.set(this.manager.options.touchAction);
31830         },
31831
31832         /**
31833          * compute the value for the touchAction property based on the recognizer's
31834          * settings
31835          *
31836          * @returns {String} value
31837          */
31838         compute: function() {
31839           var actions = [];
31840           each(this.manager.recognizers, function(recognizer) {
31841             if (boolOrFn(recognizer.options.enable, [recognizer])) {
31842               actions = actions.concat(recognizer.getTouchAction());
31843             }
31844           });
31845           return cleanTouchActions(actions.join(' '));
31846         },
31847
31848         /**
31849          * this method is called on each input cycle and provides the preventing of
31850          * the browser behavior
31851          *
31852          * @param {Object}
31853          *            input
31854          */
31855         preventDefaults: function(input) {
31856           // not needed with native support for the touchAction property
31857           if (NATIVE_TOUCH_ACTION) {
31858             return;
31859           }
31860
31861           var srcEvent = input.srcEvent;
31862           var direction = input.offsetDirection;
31863
31864           // if the touch action did prevented once this session
31865           if (this.manager.session.prevented) {
31866             srcEvent.preventDefault();
31867             return;
31868           }
31869
31870           var actions = this.actions;
31871           var hasNone = inStr(actions, TOUCH_ACTION_NONE);
31872           var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31873           var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31874
31875           if (hasNone ||
31876             (hasPanY && direction & DIRECTION_HORIZONTAL) ||
31877             (hasPanX && direction & DIRECTION_VERTICAL)) {
31878             return this.preventSrc(srcEvent);
31879           }
31880         },
31881
31882         /**
31883          * call preventDefault to prevent the browser's default behavior (scrolling
31884          * in most cases)
31885          *
31886          * @param {Object}
31887          *            srcEvent
31888          */
31889         preventSrc: function(srcEvent) {
31890           this.manager.session.prevented = true;
31891           srcEvent.preventDefault();
31892         }
31893       };
31894
31895       /**
31896        * when the touchActions are collected they are not a valid value, so we need to
31897        * clean things up. *
31898        *
31899        * @param {String}
31900        *            actions
31901        * @returns {*}
31902        */
31903       function cleanTouchActions(actions) {
31904         // none
31905         if (inStr(actions, TOUCH_ACTION_NONE)) {
31906           return TOUCH_ACTION_NONE;
31907         }
31908
31909         var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31910         var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31911
31912         // pan-x and pan-y can be combined
31913         if (hasPanX && hasPanY) {
31914           return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
31915         }
31916
31917         // pan-x OR pan-y
31918         if (hasPanX || hasPanY) {
31919           return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
31920         }
31921
31922         // manipulation
31923         if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
31924           return TOUCH_ACTION_MANIPULATION;
31925         }
31926
31927         return TOUCH_ACTION_AUTO;
31928       }
31929
31930       /**
31931        * Recognizer flow explained; * All recognizers have the initial state of
31932        * POSSIBLE when a input session starts. The definition of a input session is
31933        * from the first input until the last input, with all it's movement in it. *
31934        * Example session for mouse-input: mousedown -> mousemove -> mouseup
31935        *
31936        * On each recognizing cycle (see Manager.recognize) the .recognize() method is
31937        * executed which determines with state it should be.
31938        *
31939        * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals
31940        * ENDED), it is reset to POSSIBLE to give it another change on the next cycle.
31941        *
31942        * Possible | +-----+---------------+ | | +-----+-----+ | | | | Failed Cancelled |
31943        * +-------+------+ | | Recognized Began | Changed | Ended/Recognized
31944        */
31945       var STATE_POSSIBLE = 1;
31946       var STATE_BEGAN = 2;
31947       var STATE_CHANGED = 4;
31948       var STATE_ENDED = 8;
31949       var STATE_RECOGNIZED = STATE_ENDED;
31950       var STATE_CANCELLED = 16;
31951       var STATE_FAILED = 32;
31952
31953       /**
31954        * Recognizer Every recognizer needs to extend from this class.
31955        *
31956        * @constructor
31957        * @param {Object}
31958        *            options
31959        */
31960       function Recognizer(options) {
31961         this.id = uniqueId();
31962
31963         this.manager = null;
31964         this.options = merge(options || {}, this.defaults);
31965
31966         // default is enable true
31967         this.options.enable = ifUndefined(this.options.enable, true);
31968
31969         this.state = STATE_POSSIBLE;
31970
31971         this.simultaneous = {};
31972         this.requireFail = [];
31973       }
31974
31975       Recognizer.prototype = {
31976         /**
31977          * @virtual
31978          * @type {Object}
31979          */
31980         defaults: {},
31981
31982         /**
31983          * set options
31984          *
31985          * @param {Object}
31986          *            options
31987          * @return {Recognizer}
31988          */
31989         set: function(options) {
31990           extend(this.options, options);
31991
31992           // also update the touchAction, in case something changed about the
31993           // directions/enabled state
31994           this.manager && this.manager.touchAction.update();
31995           return this;
31996         },
31997
31998         /**
31999          * recognize simultaneous with an other recognizer.
32000          *
32001          * @param {Recognizer}
32002          *            otherRecognizer
32003          * @returns {Recognizer} this
32004          */
32005         recognizeWith: function(otherRecognizer) {
32006           if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
32007             return this;
32008           }
32009
32010           var simultaneous = this.simultaneous;
32011           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32012           if (!simultaneous[otherRecognizer.id]) {
32013             simultaneous[otherRecognizer.id] = otherRecognizer;
32014             otherRecognizer.recognizeWith(this);
32015           }
32016           return this;
32017         },
32018
32019         /**
32020          * drop the simultaneous link. it doesnt remove the link on the other
32021          * recognizer.
32022          *
32023          * @param {Recognizer}
32024          *            otherRecognizer
32025          * @returns {Recognizer} this
32026          */
32027         dropRecognizeWith: function(otherRecognizer) {
32028           if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
32029             return this;
32030           }
32031
32032           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32033           delete this.simultaneous[otherRecognizer.id];
32034           return this;
32035         },
32036
32037         /**
32038          * recognizer can only run when an other is failing
32039          *
32040          * @param {Recognizer}
32041          *            otherRecognizer
32042          * @returns {Recognizer} this
32043          */
32044         requireFailure: function(otherRecognizer) {
32045           if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
32046             return this;
32047           }
32048
32049           var requireFail = this.requireFail;
32050           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32051           if (inArray(requireFail, otherRecognizer) === -1) {
32052             requireFail.push(otherRecognizer);
32053             otherRecognizer.requireFailure(this);
32054           }
32055           return this;
32056         },
32057
32058         /**
32059          * drop the requireFailure link. it does not remove the link on the other
32060          * recognizer.
32061          *
32062          * @param {Recognizer}
32063          *            otherRecognizer
32064          * @returns {Recognizer} this
32065          */
32066         dropRequireFailure: function(otherRecognizer) {
32067           if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
32068             return this;
32069           }
32070
32071           otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
32072           var index = inArray(this.requireFail, otherRecognizer);
32073           if (index > -1) {
32074             this.requireFail.splice(index, 1);
32075           }
32076           return this;
32077         },
32078
32079         /**
32080          * has require failures boolean
32081          *
32082          * @returns {boolean}
32083          */
32084         hasRequireFailures: function() {
32085           return this.requireFail.length > 0;
32086         },
32087
32088         /**
32089          * if the recognizer can recognize simultaneous with an other recognizer
32090          *
32091          * @param {Recognizer}
32092          *            otherRecognizer
32093          * @returns {Boolean}
32094          */
32095         canRecognizeWith: function(otherRecognizer) {
32096           return !!this.simultaneous[otherRecognizer.id];
32097         },
32098
32099         /**
32100          * You should use `tryEmit` instead of `emit` directly to check that all the
32101          * needed recognizers has failed before emitting.
32102          *
32103          * @param {Object}
32104          *            input
32105          */
32106         emit: function(input) {
32107           var self = this;
32108           var state = this.state;
32109
32110           function emit(withState) {
32111             self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
32112           }
32113
32114           // 'panstart' and 'panmove'
32115           if (state < STATE_ENDED) {
32116             emit(true);
32117           }
32118
32119           emit(); // simple 'eventName' events
32120
32121           // panend and pancancel
32122           if (state >= STATE_ENDED) {
32123             emit(true);
32124           }
32125         },
32126
32127         /**
32128          * Check that all the require failure recognizers has failed, if true, it
32129          * emits a gesture event, otherwise, setup the state to FAILED.
32130          *
32131          * @param {Object}
32132          *            input
32133          */
32134         tryEmit: function(input) {
32135           if (this.canEmit()) {
32136             return this.emit(input);
32137           }
32138           // it's failing anyway
32139           this.state = STATE_FAILED;
32140         },
32141
32142         /**
32143          * can we emit?
32144          *
32145          * @returns {boolean}
32146          */
32147         canEmit: function() {
32148           var i = 0;
32149           while (i < this.requireFail.length) {
32150             if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
32151               return false;
32152             }
32153             i++;
32154           }
32155           return true;
32156         },
32157
32158         /**
32159          * update the recognizer
32160          *
32161          * @param {Object}
32162          *            inputData
32163          */
32164         recognize: function(inputData) {
32165           // make a new copy of the inputData
32166           // so we can change the inputData without messing up the other
32167           // recognizers
32168           var inputDataClone = extend({}, inputData);
32169
32170           // is is enabled and allow recognizing?
32171           if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
32172             this.reset();
32173             this.state = STATE_FAILED;
32174             return;
32175           }
32176
32177           // reset when we've reached the end
32178           if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
32179             this.state = STATE_POSSIBLE;
32180           }
32181
32182           this.state = this.process(inputDataClone);
32183
32184           // the recognizer has recognized a gesture
32185           // so trigger an event
32186           if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
32187             this.tryEmit(inputDataClone);
32188           }
32189         },
32190
32191         /**
32192          * return the state of the recognizer the actual recognizing happens in this
32193          * method
32194          *
32195          * @virtual
32196          * @param {Object}
32197          *            inputData
32198          * @returns {Const} STATE
32199          */
32200         process: function(inputData) {}, // jshint ignore:line
32201
32202         /**
32203          * return the preferred touch-action
32204          *
32205          * @virtual
32206          * @returns {Array}
32207          */
32208         getTouchAction: function() {},
32209
32210         /**
32211          * called when the gesture isn't allowed to recognize like when another is
32212          * being recognized or it is disabled
32213          *
32214          * @virtual
32215          */
32216         reset: function() {}
32217       };
32218
32219       /**
32220        * get a usable string, used as event postfix
32221        *
32222        * @param {Const}
32223        *            state
32224        * @returns {String} state
32225        */
32226       function stateStr(state) {
32227         if (state & STATE_CANCELLED) {
32228           return 'cancel';
32229         } else if (state & STATE_ENDED) {
32230           return 'end';
32231         } else if (state & STATE_CHANGED) {
32232           return 'move';
32233         } else if (state & STATE_BEGAN) {
32234           return 'start';
32235         }
32236         return '';
32237       }
32238
32239       /**
32240        * direction cons to string
32241        *
32242        * @param {Const}
32243        *            direction
32244        * @returns {String}
32245        */
32246       function directionStr(direction) {
32247         if (direction == DIRECTION_DOWN) {
32248           return 'down';
32249         } else if (direction == DIRECTION_UP) {
32250           return 'up';
32251         } else if (direction == DIRECTION_LEFT) {
32252           return 'left';
32253         } else if (direction == DIRECTION_RIGHT) {
32254           return 'right';
32255         }
32256         return '';
32257       }
32258
32259       /**
32260        * get a recognizer by name if it is bound to a manager
32261        *
32262        * @param {Recognizer|String}
32263        *            otherRecognizer
32264        * @param {Recognizer}
32265        *            recognizer
32266        * @returns {Recognizer}
32267        */
32268       function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
32269         var manager = recognizer.manager;
32270         if (manager) {
32271           return manager.get(otherRecognizer);
32272         }
32273         return otherRecognizer;
32274       }
32275
32276       /**
32277        * This recognizer is just used as a base for the simple attribute recognizers.
32278        *
32279        * @constructor
32280        * @extends Recognizer
32281        */
32282       function AttrRecognizer() {
32283         Recognizer.apply(this, arguments);
32284       }
32285
32286       inherit(AttrRecognizer, Recognizer, {
32287         /**
32288          * @namespace
32289          * @memberof AttrRecognizer
32290          */
32291         defaults: {
32292           /**
32293            * @type {Number}
32294            * @default 1
32295            */
32296           pointers: 1
32297         },
32298
32299         /**
32300          * Used to check if it the recognizer receives valid input, like
32301          * input.distance > 10.
32302          *
32303          * @memberof AttrRecognizer
32304          * @param {Object}
32305          *            input
32306          * @returns {Boolean} recognized
32307          */
32308         attrTest: function(input) {
32309           var optionPointers = this.options.pointers;
32310           return optionPointers === 0 || input.pointers.length === optionPointers;
32311         },
32312
32313         /**
32314          * Process the input and return the state for the recognizer
32315          *
32316          * @memberof AttrRecognizer
32317          * @param {Object}
32318          *            input
32319          * @returns {*} State
32320          */
32321         process: function(input) {
32322           var state = this.state;
32323           var eventType = input.eventType;
32324
32325           var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
32326           var isValid = this.attrTest(input);
32327
32328           // on cancel input and we've recognized before, return STATE_CANCELLED
32329           if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
32330             return state | STATE_CANCELLED;
32331           } else if (isRecognized || isValid) {
32332             if (eventType & INPUT_END) {
32333               return state | STATE_ENDED;
32334             } else if (!(state & STATE_BEGAN)) {
32335               return STATE_BEGAN;
32336             }
32337             return state | STATE_CHANGED;
32338           }
32339           return STATE_FAILED;
32340         }
32341       });
32342
32343       /**
32344        * Pan Recognized when the pointer is down and moved in the allowed direction.
32345        *
32346        * @constructor
32347        * @extends AttrRecognizer
32348        */
32349       function PanRecognizer() {
32350         AttrRecognizer.apply(this, arguments);
32351
32352         this.pX = null;
32353         this.pY = null;
32354       }
32355
32356       inherit(PanRecognizer, AttrRecognizer, {
32357         /**
32358          * @namespace
32359          * @memberof PanRecognizer
32360          */
32361         defaults: {
32362           event: 'pan',
32363           threshold: 10,
32364           pointers: 1,
32365           direction: DIRECTION_ALL
32366         },
32367
32368         getTouchAction: function() {
32369           var direction = this.options.direction;
32370           var actions = [];
32371           if (direction & DIRECTION_HORIZONTAL) {
32372             actions.push(TOUCH_ACTION_PAN_Y);
32373           }
32374           if (direction & DIRECTION_VERTICAL) {
32375             actions.push(TOUCH_ACTION_PAN_X);
32376           }
32377           return actions;
32378         },
32379
32380         directionTest: function(input) {
32381           var options = this.options;
32382           var hasMoved = true;
32383           var distance = input.distance;
32384           var direction = input.direction;
32385           var x = input.deltaX;
32386           var y = input.deltaY;
32387
32388           // lock to axis?
32389           if (!(direction & options.direction)) {
32390             if (options.direction & DIRECTION_HORIZONTAL) {
32391               direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
32392               hasMoved = x != this.pX;
32393               distance = Math.abs(input.deltaX);
32394             } else {
32395               direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
32396               hasMoved = y != this.pY;
32397               distance = Math.abs(input.deltaY);
32398             }
32399           }
32400           input.direction = direction;
32401           return hasMoved && distance > options.threshold && direction & options.direction;
32402         },
32403
32404         attrTest: function(input) {
32405           return AttrRecognizer.prototype.attrTest.call(this, input) &&
32406             (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
32407         },
32408
32409         emit: function(input) {
32410           this.pX = input.deltaX;
32411           this.pY = input.deltaY;
32412
32413           var direction = directionStr(input.direction);
32414           if (direction) {
32415             this.manager.emit(this.options.event + direction, input);
32416           }
32417
32418           this._super.emit.call(this, input);
32419         }
32420       });
32421
32422       /**
32423        * Pinch Recognized when two or more pointers are moving toward (zoom-in) or
32424        * away from each other (zoom-out).
32425        *
32426        * @constructor
32427        * @extends AttrRecognizer
32428        */
32429       function PinchRecognizer() {
32430         AttrRecognizer.apply(this, arguments);
32431       }
32432
32433       inherit(PinchRecognizer, AttrRecognizer, {
32434         /**
32435          * @namespace
32436          * @memberof PinchRecognizer
32437          */
32438         defaults: {
32439           event: 'pinch',
32440           threshold: 0,
32441           pointers: 2
32442         },
32443
32444         getTouchAction: function() {
32445           return [TOUCH_ACTION_NONE];
32446         },
32447
32448         attrTest: function(input) {
32449           return this._super.attrTest.call(this, input) &&
32450             (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
32451         },
32452
32453         emit: function(input) {
32454           this._super.emit.call(this, input);
32455           if (input.scale !== 1) {
32456             var inOut = input.scale < 1 ? 'in' : 'out';
32457             this.manager.emit(this.options.event + inOut, input);
32458           }
32459         }
32460       });
32461
32462       /**
32463        * Press Recognized when the pointer is down for x ms without any movement.
32464        *
32465        * @constructor
32466        * @extends Recognizer
32467        */
32468       function PressRecognizer() {
32469         Recognizer.apply(this, arguments);
32470
32471         this._timer = null;
32472         this._input = null;
32473       }
32474
32475       inherit(PressRecognizer, Recognizer, {
32476         /**
32477          * @namespace
32478          * @memberof PressRecognizer
32479          */
32480         defaults: {
32481           event: 'press',
32482           pointers: 1,
32483           time: 500, // minimal time of the pointer to be pressed
32484           threshold: 5 // a minimal movement is ok, but keep it low
32485         },
32486
32487         getTouchAction: function() {
32488           return [TOUCH_ACTION_AUTO];
32489         },
32490
32491         process: function(input) {
32492           var options = this.options;
32493           var validPointers = input.pointers.length === options.pointers;
32494           var validMovement = input.distance < options.threshold;
32495           var validTime = input.deltaTime > options.time;
32496
32497           this._input = input;
32498
32499           // we only allow little movement
32500           // and we've reached an end event, so a tap is possible
32501           if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
32502             this.reset();
32503           } else if (input.eventType & INPUT_START) {
32504             this.reset();
32505             this._timer = setTimeoutContext(function() {
32506               this.state = STATE_RECOGNIZED;
32507               this.tryEmit();
32508             }, options.time, this);
32509           } else if (input.eventType & INPUT_END) {
32510             return STATE_RECOGNIZED;
32511           }
32512           return STATE_FAILED;
32513         },
32514
32515         reset: function() {
32516           clearTimeout(this._timer);
32517         },
32518
32519         emit: function(input) {
32520           if (this.state !== STATE_RECOGNIZED) {
32521             return;
32522           }
32523
32524           if (input && (input.eventType & INPUT_END)) {
32525             this.manager.emit(this.options.event + 'up', input);
32526           } else {
32527             this._input.timeStamp = now();
32528             this.manager.emit(this.options.event, this._input);
32529           }
32530         }
32531       });
32532
32533       /**
32534        * Rotate Recognized when two or more pointer are moving in a circular motion.
32535        *
32536        * @constructor
32537        * @extends AttrRecognizer
32538        */
32539       function RotateRecognizer() {
32540         AttrRecognizer.apply(this, arguments);
32541       }
32542
32543       inherit(RotateRecognizer, AttrRecognizer, {
32544         /**
32545          * @namespace
32546          * @memberof RotateRecognizer
32547          */
32548         defaults: {
32549           event: 'rotate',
32550           threshold: 0,
32551           pointers: 2
32552         },
32553
32554         getTouchAction: function() {
32555           return [TOUCH_ACTION_NONE];
32556         },
32557
32558         attrTest: function(input) {
32559           return this._super.attrTest.call(this, input) &&
32560             (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
32561         }
32562       });
32563
32564       /**
32565        * Swipe Recognized when the pointer is moving fast (velocity), with enough
32566        * distance in the allowed direction.
32567        *
32568        * @constructor
32569        * @extends AttrRecognizer
32570        */
32571       function SwipeRecognizer() {
32572         AttrRecognizer.apply(this, arguments);
32573       }
32574
32575       inherit(SwipeRecognizer, AttrRecognizer, {
32576         /**
32577          * @namespace
32578          * @memberof SwipeRecognizer
32579          */
32580         defaults: {
32581           event: 'swipe',
32582           threshold: 10,
32583           velocity: 0.65,
32584           direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
32585           pointers: 1
32586         },
32587
32588         getTouchAction: function() {
32589           return PanRecognizer.prototype.getTouchAction.call(this);
32590         },
32591
32592         attrTest: function(input) {
32593           var direction = this.options.direction;
32594           var velocity;
32595
32596           if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
32597             velocity = input.velocity;
32598           } else if (direction & DIRECTION_HORIZONTAL) {
32599             velocity = input.velocityX;
32600           } else if (direction & DIRECTION_VERTICAL) {
32601             velocity = input.velocityY;
32602           }
32603
32604           return this._super.attrTest.call(this, input) &&
32605             direction & input.direction &&
32606             input.distance > this.options.threshold &&
32607             abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
32608         },
32609
32610         emit: function(input) {
32611           var direction = directionStr(input.direction);
32612           if (direction) {
32613             this.manager.emit(this.options.event + direction, input);
32614           }
32615
32616           this.manager.emit(this.options.event, input);
32617         }
32618       });
32619
32620       /**
32621        * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps
32622        * are recognized if they occur between the given interval and position. The
32623        * delay option can be used to recognize multi-taps without firing a single tap.
32624        *
32625        * The eventData from the emitted event contains the property `tapCount`, which
32626        * contains the amount of multi-taps being recognized.
32627        *
32628        * @constructor
32629        * @extends Recognizer
32630        */
32631       function TapRecognizer() {
32632         Recognizer.apply(this, arguments);
32633
32634         // previous time and center,
32635         // used for tap counting
32636         this.pTime = false;
32637         this.pCenter = false;
32638
32639         this._timer = null;
32640         this._input = null;
32641         this.count = 0;
32642       }
32643
32644       inherit(TapRecognizer, Recognizer, {
32645         /**
32646          * @namespace
32647          * @memberof PinchRecognizer
32648          */
32649         defaults: {
32650           event: 'tap',
32651           pointers: 1,
32652           taps: 1,
32653           interval: 300, // max time between the multi-tap taps
32654           time: 250, // max time of the pointer to be down (like finger on the
32655           // screen)
32656           threshold: 2, // a minimal movement is ok, but keep it low
32657           posThreshold: 10 // a multi-tap can be a bit off the initial position
32658         },
32659
32660         getTouchAction: function() {
32661           return [TOUCH_ACTION_MANIPULATION];
32662         },
32663
32664         process: function(input) {
32665           var options = this.options;
32666
32667           var validPointers = input.pointers.length === options.pointers;
32668           var validMovement = input.distance < options.threshold;
32669           var validTouchTime = input.deltaTime < options.time;
32670
32671           this.reset();
32672
32673           if ((input.eventType & INPUT_START) && (this.count === 0)) {
32674             return this.failTimeout();
32675           }
32676
32677           // we only allow little movement
32678           // and we've reached an end event, so a tap is possible
32679           if (validMovement && validTouchTime && validPointers) {
32680             if (input.eventType != INPUT_END) {
32681               return this.failTimeout();
32682             }
32683
32684             var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
32685             var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
32686
32687             this.pTime = input.timeStamp;
32688             this.pCenter = input.center;
32689
32690             if (!validMultiTap || !validInterval) {
32691               this.count = 1;
32692             } else {
32693               this.count += 1;
32694             }
32695
32696             this._input = input;
32697
32698             // if tap count matches we have recognized it,
32699             // else it has began recognizing...
32700             var tapCount = this.count % options.taps;
32701             if (tapCount === 0) {
32702               // no failing requirements, immediately trigger the tap event
32703               // or wait as long as the multitap interval to trigger
32704               if (!this.hasRequireFailures()) {
32705                 return STATE_RECOGNIZED;
32706               } else {
32707                 this._timer = setTimeoutContext(function() {
32708                   this.state = STATE_RECOGNIZED;
32709                   this.tryEmit();
32710                 }, options.interval, this);
32711                 return STATE_BEGAN;
32712               }
32713             }
32714           }
32715           return STATE_FAILED;
32716         },
32717
32718         failTimeout: function() {
32719           this._timer = setTimeoutContext(function() {
32720             this.state = STATE_FAILED;
32721           }, this.options.interval, this);
32722           return STATE_FAILED;
32723         },
32724
32725         reset: function() {
32726           clearTimeout(this._timer);
32727         },
32728
32729         emit: function() {
32730           if (this.state == STATE_RECOGNIZED) {
32731             this._input.tapCount = this.count;
32732             this.manager.emit(this.options.event, this._input);
32733           }
32734         }
32735       });
32736
32737       /**
32738        * Simple way to create an manager with a default set of recognizers.
32739        *
32740        * @param {HTMLElement}
32741        *            element
32742        * @param {Object}
32743        *            [options]
32744        * @constructor
32745        */
32746       function Hammer(element, options) {
32747         options = options || {};
32748         options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
32749         return new Manager(element, options);
32750       }
32751
32752       /**
32753        * @const {string}
32754        */
32755       Hammer.VERSION = '2.0.4';
32756
32757       /**
32758        * default settings
32759        *
32760        * @namespace
32761        */
32762       Hammer.defaults = {
32763         /**
32764          * set if DOM events are being triggered. But this is slower and unused by
32765          * simple implementations, so disabled by default.
32766          *
32767          * @type {Boolean}
32768          * @default false
32769          */
32770         domEvents: false,
32771
32772         /**
32773          * The value for the touchAction property/fallback. When set to `compute` it
32774          * will magically set the correct value based on the added recognizers.
32775          *
32776          * @type {String}
32777          * @default compute
32778          */
32779         touchAction: TOUCH_ACTION_COMPUTE,
32780
32781         /**
32782          * @type {Boolean}
32783          * @default true
32784          */
32785         enable: true,
32786
32787         /**
32788          * EXPERIMENTAL FEATURE -- can be removed/changed Change the parent input
32789          * target element. If Null, then it is being set the to main element.
32790          *
32791          * @type {Null|EventTarget}
32792          * @default null
32793          */
32794         inputTarget: null,
32795
32796         /**
32797          * force an input class
32798          *
32799          * @type {Null|Function}
32800          * @default null
32801          */
32802         inputClass: null,
32803
32804         /**
32805          * Default recognizer setup when calling `Hammer()` When creating a new
32806          * Manager these will be skipped.
32807          *
32808          * @type {Array}
32809          */
32810         preset: [
32811           // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
32812           [RotateRecognizer, {
32813             enable: false
32814           }],
32815           [PinchRecognizer, {
32816               enable: false
32817             },
32818             ['rotate']
32819           ],
32820           [SwipeRecognizer, {
32821             direction: DIRECTION_HORIZONTAL
32822           }],
32823           [PanRecognizer, {
32824               direction: DIRECTION_HORIZONTAL
32825             },
32826             ['swipe']
32827           ],
32828           [TapRecognizer],
32829           [TapRecognizer, {
32830               event: 'doubletap',
32831               taps: 2
32832             },
32833             ['tap']
32834           ],
32835           [PressRecognizer]
32836         ],
32837
32838         /**
32839          * Some CSS properties can be used to improve the working of Hammer. Add
32840          * them to this method and they will be set when creating a new Manager.
32841          *
32842          * @namespace
32843          */
32844         cssProps: {
32845           /**
32846            * Disables text selection to improve the dragging gesture. Mainly for
32847            * desktop browsers.
32848            *
32849            * @type {String}
32850            * @default 'none'
32851            */
32852           userSelect: 'none',
32853
32854           /**
32855            * Disable the Windows Phone grippers when pressing an element.
32856            *
32857            * @type {String}
32858            * @default 'none'
32859            */
32860           touchSelect: 'none',
32861
32862           /**
32863            * Disables the default callout shown when you touch and hold a touch
32864            * target. On iOS, when you touch and hold a touch target such as a
32865            * link, Safari displays a callout containing information about the
32866            * link. This property allows you to disable that callout.
32867            *
32868            * @type {String}
32869            * @default 'none'
32870            */
32871           touchCallout: 'none',
32872
32873           /**
32874            * Specifies whether zooming is enabled. Used by IE10>
32875            *
32876            * @type {String}
32877            * @default 'none'
32878            */
32879           contentZooming: 'none',
32880
32881           /**
32882            * Specifies that an entire element should be draggable instead of its
32883            * contents. Mainly for desktop browsers.
32884            *
32885            * @type {String}
32886            * @default 'none'
32887            */
32888           userDrag: 'none',
32889
32890           /**
32891            * Overrides the highlight color shown when the user taps a link or a
32892            * JavaScript clickable element in iOS. This property obeys the alpha
32893            * value, if specified.
32894            *
32895            * @type {String}
32896            * @default 'rgba(0,0,0,0)'
32897            */
32898           tapHighlightColor: 'rgba(0,0,0,0)'
32899         }
32900       };
32901
32902       var STOP = 1;
32903       var FORCED_STOP = 2;
32904
32905       /**
32906        * Manager
32907        *
32908        * @param {HTMLElement}
32909        *            element
32910        * @param {Object}
32911        *            [options]
32912        * @constructor
32913        */
32914       function Manager(element, options) {
32915         options = options || {};
32916
32917         this.options = merge(options, Hammer.defaults);
32918         this.options.inputTarget = this.options.inputTarget || element;
32919
32920         this.handlers = {};
32921         this.session = {};
32922         this.recognizers = [];
32923
32924         this.element = element;
32925         this.input = createInputInstance(this);
32926         this.touchAction = new TouchAction(this, this.options.touchAction);
32927
32928         toggleCssProps(this, true);
32929
32930         each(options.recognizers, function(item) {
32931           var recognizer = this.add(new(item[0])(item[1]));
32932           item[2] && recognizer.recognizeWith(item[2]);
32933           item[3] && recognizer.requireFailure(item[3]);
32934         }, this);
32935       }
32936
32937       Manager.prototype = {
32938         /**
32939          * set options
32940          *
32941          * @param {Object}
32942          *            options
32943          * @returns {Manager}
32944          */
32945         set: function(options) {
32946           extend(this.options, options);
32947
32948           // Options that need a little more setup
32949           if (options.touchAction) {
32950             this.touchAction.update();
32951           }
32952           if (options.inputTarget) {
32953             // Clean up existing event listeners and reinitialize
32954             this.input.destroy();
32955             this.input.target = options.inputTarget;
32956             this.input.init();
32957           }
32958           return this;
32959         },
32960
32961         /**
32962          * stop recognizing for this session. This session will be discarded, when a
32963          * new [input]start event is fired. When forced, the recognizer cycle is
32964          * stopped immediately.
32965          *
32966          * @param {Boolean}
32967          *            [force]
32968          */
32969         stop: function(force) {
32970           this.session.stopped = force ? FORCED_STOP : STOP;
32971         },
32972
32973         /**
32974          * run the recognizers! called by the inputHandler function on every
32975          * movement of the pointers (touches) it walks through all the recognizers
32976          * and tries to detect the gesture that is being made
32977          *
32978          * @param {Object}
32979          *            inputData
32980          */
32981         recognize: function(inputData) {
32982           var session = this.session;
32983           if (session.stopped) {
32984             return;
32985           }
32986
32987           // run the touch-action polyfill
32988           this.touchAction.preventDefaults(inputData);
32989
32990           var recognizer;
32991           var recognizers = this.recognizers;
32992
32993           // this holds the recognizer that is being recognized.
32994           // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or
32995           // RECOGNIZED
32996           // if no recognizer is detecting a thing, it is set to `null`
32997           var curRecognizer = session.curRecognizer;
32998
32999           // reset when the last recognizer is recognized
33000           // or when we're in a new session
33001           if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
33002             curRecognizer = session.curRecognizer = null;
33003           }
33004
33005           var i = 0;
33006           while (i < recognizers.length) {
33007             recognizer = recognizers[i];
33008
33009             // find out if we are allowed try to recognize the input for this
33010             // one.
33011             // 1. allow if the session is NOT forced stopped (see the .stop()
33012             // method)
33013             // 2. allow if we still haven't recognized a gesture in this
33014             // session, or the this recognizer is the one
33015             // that is being recognized.
33016             // 3. allow if the recognizer is allowed to run simultaneous with
33017             // the current recognized recognizer.
33018             // this can be setup with the `recognizeWith()` method on the
33019             // recognizer.
33020             if (session.stopped !== FORCED_STOP && ( // 1
33021                 !curRecognizer || recognizer == curRecognizer || // 2
33022                 recognizer.canRecognizeWith(curRecognizer))) { // 3
33023               recognizer.recognize(inputData);
33024             } else {
33025               recognizer.reset();
33026             }
33027
33028             // if the recognizer has been recognizing the input as a valid
33029             // gesture, we want to store this one as the
33030             // current active recognizer. but only if we don't already have an
33031             // active recognizer
33032             if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
33033               curRecognizer = session.curRecognizer = recognizer;
33034             }
33035             i++;
33036           }
33037         },
33038
33039         /**
33040          * get a recognizer by its event name.
33041          *
33042          * @param {Recognizer|String}
33043          *            recognizer
33044          * @returns {Recognizer|Null}
33045          */
33046         get: function(recognizer) {
33047           if (recognizer instanceof Recognizer) {
33048             return recognizer;
33049           }
33050
33051           var recognizers = this.recognizers;
33052           for (var i = 0; i < recognizers.length; i++) {
33053             if (recognizers[i].options.event == recognizer) {
33054               return recognizers[i];
33055             }
33056           }
33057           return null;
33058         },
33059
33060         /**
33061          * add a recognizer to the manager existing recognizers with the same event
33062          * name will be removed
33063          *
33064          * @param {Recognizer}
33065          *            recognizer
33066          * @returns {Recognizer|Manager}
33067          */
33068         add: function(recognizer) {
33069           if (invokeArrayArg(recognizer, 'add', this)) {
33070             return this;
33071           }
33072
33073           // remove existing
33074           var existing = this.get(recognizer.options.event);
33075           if (existing) {
33076             this.remove(existing);
33077           }
33078
33079           this.recognizers.push(recognizer);
33080           recognizer.manager = this;
33081
33082           this.touchAction.update();
33083           return recognizer;
33084         },
33085
33086         /**
33087          * remove a recognizer by name or instance
33088          *
33089          * @param {Recognizer|String}
33090          *            recognizer
33091          * @returns {Manager}
33092          */
33093         remove: function(recognizer) {
33094           if (invokeArrayArg(recognizer, 'remove', this)) {
33095             return this;
33096           }
33097
33098           var recognizers = this.recognizers;
33099           recognizer = this.get(recognizer);
33100           recognizers.splice(inArray(recognizers, recognizer), 1);
33101
33102           this.touchAction.update();
33103           return this;
33104         },
33105
33106         /**
33107          * bind event
33108          *
33109          * @param {String}
33110          *            events
33111          * @param {Function}
33112          *            handler
33113          * @returns {EventEmitter} this
33114          */
33115         on: function(events, handler) {
33116           var handlers = this.handlers;
33117           each(splitStr(events), function(event) {
33118             handlers[event] = handlers[event] || [];
33119             handlers[event].push(handler);
33120           });
33121           return this;
33122         },
33123
33124         /**
33125          * unbind event, leave emit blank to remove all handlers
33126          *
33127          * @param {String}
33128          *            events
33129          * @param {Function}
33130          *            [handler]
33131          * @returns {EventEmitter} this
33132          */
33133         off: function(events, handler) {
33134           var handlers = this.handlers;
33135           each(splitStr(events), function(event) {
33136             if (!handler) {
33137               delete handlers[event];
33138             } else {
33139               handlers[event].splice(inArray(handlers[event], handler), 1);
33140             }
33141           });
33142           return this;
33143         },
33144
33145         /**
33146          * emit event to the listeners
33147          *
33148          * @param {String}
33149          *            event
33150          * @param {Object}
33151          *            data
33152          */
33153         emit: function(event, data) {
33154           // we also want to trigger dom events
33155           if (this.options.domEvents) {
33156             triggerDomEvent(event, data);
33157           }
33158
33159           // no handlers, so skip it all
33160           var handlers = this.handlers[event] && this.handlers[event].slice();
33161           if (!handlers || !handlers.length) {
33162             return;
33163           }
33164
33165           data.type = event;
33166           data.preventDefault = function() {
33167             data.srcEvent.preventDefault();
33168           };
33169
33170           var i = 0;
33171           while (i < handlers.length) {
33172             handlers[i](data);
33173             i++;
33174           }
33175         },
33176
33177         /**
33178          * destroy the manager and unbinds all events it doesn't unbind dom events,
33179          * that is the user own responsibility
33180          */
33181         destroy: function() {
33182           this.element && toggleCssProps(this, false);
33183
33184           this.handlers = {};
33185           this.session = {};
33186           this.input.destroy();
33187           this.element = null;
33188         }
33189       };
33190
33191       /**
33192        * add/remove the css properties as defined in manager.options.cssProps
33193        *
33194        * @param {Manager}
33195        *            manager
33196        * @param {Boolean}
33197        *            add
33198        */
33199       function toggleCssProps(manager, add) {
33200         var element = manager.element;
33201         each(manager.options.cssProps, function(value, name) {
33202           element.style[prefixed(element.style, name)] = add ? value : '';
33203         });
33204       }
33205
33206       /**
33207        * trigger dom event
33208        *
33209        * @param {String}
33210        *            event
33211        * @param {Object}
33212        *            data
33213        */
33214       function triggerDomEvent(event, data) {
33215         var gestureEvent = document.createEvent('Event');
33216         gestureEvent.initEvent(event, true, true);
33217         gestureEvent.gesture = data;
33218         data.target.dispatchEvent(gestureEvent);
33219       }
33220
33221       extend(Hammer, {
33222         INPUT_START: INPUT_START,
33223         INPUT_MOVE: INPUT_MOVE,
33224         INPUT_END: INPUT_END,
33225         INPUT_CANCEL: INPUT_CANCEL,
33226
33227         STATE_POSSIBLE: STATE_POSSIBLE,
33228         STATE_BEGAN: STATE_BEGAN,
33229         STATE_CHANGED: STATE_CHANGED,
33230         STATE_ENDED: STATE_ENDED,
33231         STATE_RECOGNIZED: STATE_RECOGNIZED,
33232         STATE_CANCELLED: STATE_CANCELLED,
33233         STATE_FAILED: STATE_FAILED,
33234
33235         DIRECTION_NONE: DIRECTION_NONE,
33236         DIRECTION_LEFT: DIRECTION_LEFT,
33237         DIRECTION_RIGHT: DIRECTION_RIGHT,
33238         DIRECTION_UP: DIRECTION_UP,
33239         DIRECTION_DOWN: DIRECTION_DOWN,
33240         DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
33241         DIRECTION_VERTICAL: DIRECTION_VERTICAL,
33242         DIRECTION_ALL: DIRECTION_ALL,
33243
33244         Manager: Manager,
33245         Input: Input,
33246         TouchAction: TouchAction,
33247
33248         TouchInput: TouchInput,
33249         MouseInput: MouseInput,
33250         PointerEventInput: PointerEventInput,
33251         TouchMouseInput: TouchMouseInput,
33252         SingleTouchInput: SingleTouchInput,
33253
33254         Recognizer: Recognizer,
33255         AttrRecognizer: AttrRecognizer,
33256         Tap: TapRecognizer,
33257         Pan: PanRecognizer,
33258         Swipe: SwipeRecognizer,
33259         Pinch: PinchRecognizer,
33260         Rotate: RotateRecognizer,
33261         Press: PressRecognizer,
33262
33263         on: addEventListeners,
33264         off: removeEventListeners,
33265         each: each,
33266         merge: merge,
33267         extend: extend,
33268         inherit: inherit,
33269         bindFn: bindFn,
33270         prefixed: prefixed
33271       });
33272
33273       if (typeof define == TYPE_FUNCTION && define.amd) {
33274         define(function() {
33275           return Hammer;
33276         });
33277       } else if (typeof module != 'undefined' && module.exports) {
33278         module.exports = Hammer;
33279       } else {
33280         window[exportName] = Hammer;
33281       }
33282
33283     })(window, document, 'Hammer');
33284
33285   }, {}],
33286   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
33287     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"][0].apply(exports, arguments)
33288   }, {}],
33289   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js": [function(require, module, exports) {
33290     /**
33291      * Set attribute `name` to `val`, or get attr `name`.
33292      *
33293      * @param {Element}
33294      *            el
33295      * @param {String}
33296      *            name
33297      * @param {String}
33298      *            [val]
33299      * @api public
33300      */
33301
33302     module.exports = function(el, name, val) {
33303       // get
33304       if (arguments.length == 2) {
33305         return el.getAttribute(name);
33306       }
33307
33308       // remove
33309       if (val === null) {
33310         return el.removeAttribute(name);
33311       }
33312
33313       // set
33314       el.setAttribute(name, val);
33315
33316       return el;
33317     };
33318   }, {}],
33319   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js": [function(require, module, exports) {
33320     module.exports = require('component-classes');
33321   }, {
33322     "component-classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js"
33323   }],
33324   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js": [function(require, module, exports) {
33325     module.exports = function(el) {
33326
33327       var c;
33328
33329       while (el.childNodes.length) {
33330         c = el.childNodes[0];
33331         el.removeChild(c);
33332       }
33333
33334       return el;
33335     };
33336   }, {}],
33337   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js": [function(require, module, exports) {
33338     module.exports = require('component-closest');
33339   }, {
33340     "component-closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js"
33341   }],
33342   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js": [function(require, module, exports) {
33343     module.exports = require('component-delegate');
33344   }, {
33345     "component-delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js"
33346   }],
33347   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
33348     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js"][0].apply(exports, arguments)
33349   }, {
33350     "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
33351   }],
33352   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
33353     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js"][0].apply(exports, arguments)
33354   }, {
33355     "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33356   }],
33357   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js": [function(require, module, exports) {
33358     module.exports = require('component-matches-selector');
33359   }, {
33360     "component-matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33361   }],
33362   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
33363     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js"][0].apply(exports, arguments)
33364   }, {
33365     "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33366   }],
33367   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
33368     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"][0].apply(exports, arguments)
33369   }, {}],
33370   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js": [function(require, module, exports) {
33371     /**
33372      * Module dependencies.
33373      */
33374
33375     var index = require('indexof');
33376
33377     /**
33378      * Whitespace regexp.
33379      */
33380
33381     var re = /\s+/;
33382
33383     /**
33384      * toString reference.
33385      */
33386
33387     var toString = Object.prototype.toString;
33388
33389     /**
33390      * Wrap `el` in a `ClassList`.
33391      *
33392      * @param {Element}
33393      *            el
33394      * @return {ClassList}
33395      * @api public
33396      */
33397
33398     module.exports = function(el) {
33399       return new ClassList(el);
33400     };
33401
33402     /**
33403      * Initialize a new ClassList for `el`.
33404      *
33405      * @param {Element}
33406      *            el
33407      * @api private
33408      */
33409
33410     function ClassList(el) {
33411       if (!el || !el.nodeType) {
33412         throw new Error('A DOM element reference is required');
33413       }
33414       this.el = el;
33415       this.list = el.classList;
33416     }
33417
33418     /**
33419      * Add class `name` if not already present.
33420      *
33421      * @param {String}
33422      *            name
33423      * @return {ClassList}
33424      * @api public
33425      */
33426
33427     ClassList.prototype.add = function(name) {
33428       // classList
33429       if (this.list) {
33430         this.list.add(name);
33431         return this;
33432       }
33433
33434       // fallback
33435       var arr = this.array();
33436       var i = index(arr, name);
33437       if (!~i) arr.push(name);
33438       this.el.className = arr.join(' ');
33439       return this;
33440     };
33441
33442     /**
33443      * Remove class `name` when present, or pass a regular expression to remove any
33444      * which match.
33445      *
33446      * @param {String|RegExp}
33447      *            name
33448      * @return {ClassList}
33449      * @api public
33450      */
33451
33452     ClassList.prototype.remove = function(name) {
33453       if ('[object RegExp]' == toString.call(name)) {
33454         return this.removeMatching(name);
33455       }
33456
33457       // classList
33458       if (this.list) {
33459         this.list.remove(name);
33460         return this;
33461       }
33462
33463       // fallback
33464       var arr = this.array();
33465       var i = index(arr, name);
33466       if (~i) arr.splice(i, 1);
33467       this.el.className = arr.join(' ');
33468       return this;
33469     };
33470
33471     /**
33472      * Remove all classes matching `re`.
33473      *
33474      * @param {RegExp}
33475      *            re
33476      * @return {ClassList}
33477      * @api private
33478      */
33479
33480     ClassList.prototype.removeMatching = function(re) {
33481       var arr = this.array();
33482       for (var i = 0; i < arr.length; i++) {
33483         if (re.test(arr[i])) {
33484           this.remove(arr[i]);
33485         }
33486       }
33487       return this;
33488     };
33489
33490     /**
33491      * Toggle class `name`, can force state via `force`.
33492      *
33493      * For browsers that support classList, but do not support `force` yet, the
33494      * mistake will be detected and corrected.
33495      *
33496      * @param {String}
33497      *            name
33498      * @param {Boolean}
33499      *            force
33500      * @return {ClassList}
33501      * @api public
33502      */
33503
33504     ClassList.prototype.toggle = function(name, force) {
33505       // classList
33506       if (this.list) {
33507         if ("undefined" !== typeof force) {
33508           if (force !== this.list.toggle(name, force)) {
33509             this.list.toggle(name); // toggle again to correct
33510           }
33511         } else {
33512           this.list.toggle(name);
33513         }
33514         return this;
33515       }
33516
33517       // fallback
33518       if ("undefined" !== typeof force) {
33519         if (!force) {
33520           this.remove(name);
33521         } else {
33522           this.add(name);
33523         }
33524       } else {
33525         if (this.has(name)) {
33526           this.remove(name);
33527         } else {
33528           this.add(name);
33529         }
33530       }
33531
33532       return this;
33533     };
33534
33535     /**
33536      * Return an array of classes.
33537      *
33538      * @return {Array}
33539      * @api public
33540      */
33541
33542     ClassList.prototype.array = function() {
33543       var className = this.el.getAttribute('class') || '';
33544       var str = className.replace(/^\s+|\s+$/g, '');
33545       var arr = str.split(re);
33546       if ('' === arr[0]) arr.shift();
33547       return arr;
33548     };
33549
33550     /**
33551      * Check if class `name` is present.
33552      *
33553      * @param {String}
33554      *            name
33555      * @return {ClassList}
33556      * @api public
33557      */
33558
33559     ClassList.prototype.has =
33560       ClassList.prototype.contains = function(name) {
33561         return this.list ? this.list.contains(name) : !!~index(this.array(), name);
33562       };
33563
33564   }, {
33565     "indexof": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js"
33566   }],
33567   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js": [function(require, module, exports) {
33568     module.exports = function(arr, obj) {
33569       if (arr.indexOf) return arr.indexOf(obj);
33570       for (var i = 0; i < arr.length; ++i) {
33571         if (arr[i] === obj) return i;
33572       }
33573       return -1;
33574     };
33575   }, {}],
33576   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js": [function(require, module, exports) {
33577     var matches = require('matches-selector')
33578
33579     module.exports = function(element, selector, checkYoSelf, root) {
33580       element = checkYoSelf ? {
33581         parentNode: element
33582       } : element
33583
33584       root = root || document
33585
33586       // Make sure `element !== document` and `element != null`
33587       // otherwise we get an illegal invocation
33588       while ((element = element.parentNode) && element !== document) {
33589         if (matches(element, selector))
33590           return element
33591         // After `matches` on the edge case that
33592         // the selector matches the root
33593         // (when the root is not the document)
33594         if (element === root)
33595           return
33596       }
33597     }
33598
33599   }, {
33600     "matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33601   }],
33602   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js": [function(require, module, exports) {
33603     /**
33604      * Module dependencies.
33605      */
33606
33607     var closest = require('closest'),
33608       event = require('event');
33609
33610     /**
33611      * Delegate event `type` to `selector` and invoke `fn(e)`. A callback function
33612      * is returned which may be passed to `.unbind()`.
33613      *
33614      * @param {Element}
33615      *            el
33616      * @param {String}
33617      *            selector
33618      * @param {String}
33619      *            type
33620      * @param {Function}
33621      *            fn
33622      * @param {Boolean}
33623      *            capture
33624      * @return {Function}
33625      * @api public
33626      */
33627
33628     exports.bind = function(el, selector, type, fn, capture) {
33629       return event.bind(el, type, function(e) {
33630         var target = e.target || e.srcElement;
33631         e.delegateTarget = closest(target, selector, true, el);
33632         if (e.delegateTarget) fn.call(el, e);
33633       }, capture);
33634     };
33635
33636     /**
33637      * Unbind event `type`'s callback `fn`.
33638      *
33639      * @param {Element}
33640      *            el
33641      * @param {String}
33642      *            type
33643      * @param {Function}
33644      *            fn
33645      * @param {Boolean}
33646      *            capture
33647      * @api public
33648      */
33649
33650     exports.unbind = function(el, type, fn, capture) {
33651       event.unbind(el, type, fn, capture);
33652     };
33653
33654   }, {
33655     "closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js",
33656     "event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33657   }],
33658   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
33659     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"][0].apply(exports, arguments)
33660   }, {}],
33661   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js": [function(require, module, exports) {
33662     /**
33663      * Module dependencies.
33664      */
33665
33666     var query = require('query');
33667
33668     /**
33669      * Element prototype.
33670      */
33671
33672     var proto = Element.prototype;
33673
33674     /**
33675      * Vendor function.
33676      */
33677
33678     var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;
33679
33680     /**
33681      * Expose `match()`.
33682      */
33683
33684     module.exports = match;
33685
33686     /**
33687      * Match `el` to `selector`.
33688      *
33689      * @param {Element}
33690      *            el
33691      * @param {String}
33692      *            selector
33693      * @return {Boolean}
33694      * @api public
33695      */
33696
33697     function match(el, selector) {
33698       if (!el || el.nodeType !== 1) return false;
33699       if (vendor) return vendor.call(el, selector);
33700       var nodes = query.all(selector, el.parentNode);
33701       for (var i = 0; i < nodes.length; ++i) {
33702         if (nodes[i] == el) return true;
33703       }
33704       return false;
33705     }
33706
33707   }, {
33708     "query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33709   }],
33710   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
33711     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"][0].apply(exports, arguments)
33712   }, {}],
33713   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
33714     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"][0].apply(exports, arguments)
33715   }, {}],
33716   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
33717     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"][0].apply(exports, arguments)
33718   }, {
33719     "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js",
33720     "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js"
33721   }],
33722   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
33723     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"][0].apply(exports, arguments)
33724   }, {}],
33725   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
33726     arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"][0].apply(exports, arguments)
33727   }, {
33728     "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js"
33729   }],
33730   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js": [function(require, module, exports) {
33731     // Snap.svg 0.3.0
33732     //
33733     // Copyright (c) 2013 ÃƒÆ’¢â‚¬â€œ 2014 Adobe Systems Incorporated. All rights
33734     // reserved.
33735     //
33736     // Licensed under the Apache License, Version 2.0 (the "License");
33737     // you may not use this file except in compliance with the License.
33738     // You may obtain a copy of the License at
33739     //
33740     // http://www.apache.org/licenses/LICENSE-2.0
33741     //
33742     // Unless required by applicable law or agreed to in writing, software
33743     // distributed under the License is distributed on an "AS IS" BASIS,
33744     // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33745     // See the License for the specific language governing permissions and
33746     // limitations under the License.
33747     //
33748     // build: 2014-09-08
33749
33750     (function(glob, factory) {
33751       // AMD support
33752       if (typeof define === "function" && define.amd) {
33753         // Define as an anonymous module
33754         define(["eve"], function(eve) {
33755           return factory(glob, eve);
33756         });
33757       } else if (typeof exports !== 'undefined') {
33758         // Next for Node.js or CommonJS
33759         var eve = require('eve');
33760         module.exports = factory(glob, eve);
33761       } else {
33762         // Browser globals (glob is window)
33763         // Snap adds itself to window
33764         factory(glob, glob.eve);
33765       }
33766     }(window || this, function(window, eve) {
33767
33768       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33769       //
33770       // Licensed under the Apache License, Version 2.0 (the "License");
33771       // you may not use this file except in compliance with the License.
33772       // You may obtain a copy of the License at
33773       //
33774       // http://www.apache.org/licenses/LICENSE-2.0
33775       //
33776       // Unless required by applicable law or agreed to in writing, software
33777       // distributed under the License is distributed on an "AS IS" BASIS,
33778       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33779       // See the License for the specific language governing permissions and
33780       // limitations under the License.
33781       var mina = (function(eve) {
33782         var animations = {},
33783           requestAnimFrame = window.requestAnimationFrame ||
33784           window.webkitRequestAnimationFrame ||
33785           window.mozRequestAnimationFrame ||
33786           window.oRequestAnimationFrame ||
33787           window.msRequestAnimationFrame ||
33788           function(callback) {
33789             setTimeout(callback, 16);
33790           },
33791           isArray = Array.isArray || function(a) {
33792             return a instanceof Array ||
33793               Object.prototype.toString.call(a) == "[object Array]";
33794           },
33795           idgen = 0,
33796           idprefix = "M" + (+new Date).toString(36),
33797           ID = function() {
33798             return idprefix + (idgen++).toString(36);
33799           },
33800           diff = function(a, b, A, B) {
33801             if (isArray(a)) {
33802               res = [];
33803               for (var i = 0, ii = a.length; i < ii; i++) {
33804                 res[i] = diff(a[i], b, A[i], B);
33805               }
33806               return res;
33807             }
33808             var dif = (A - a) / (B - b);
33809             return function(bb) {
33810               return a + dif * (bb - b);
33811             };
33812           },
33813           timer = Date.now || function() {
33814             return +new Date;
33815           },
33816           sta = function(val) {
33817             var a = this;
33818             if (val == null) {
33819               return a.s;
33820             }
33821             var ds = a.s - val;
33822             a.b += a.dur * ds;
33823             a.B += a.dur * ds;
33824             a.s = val;
33825           },
33826           speed = function(val) {
33827             var a = this;
33828             if (val == null) {
33829               return a.spd;
33830             }
33831             a.spd = val;
33832           },
33833           duration = function(val) {
33834             var a = this;
33835             if (val == null) {
33836               return a.dur;
33837             }
33838             a.s = a.s * val / a.dur;
33839             a.dur = val;
33840           },
33841           stopit = function() {
33842             var a = this;
33843             delete animations[a.id];
33844             a.update();
33845             eve("mina.stop." + a.id, a);
33846           },
33847           pause = function() {
33848             var a = this;
33849             if (a.pdif) {
33850               return;
33851             }
33852             delete animations[a.id];
33853             a.update();
33854             a.pdif = a.get() - a.b;
33855           },
33856           resume = function() {
33857             var a = this;
33858             if (!a.pdif) {
33859               return;
33860             }
33861             a.b = a.get() - a.pdif;
33862             delete a.pdif;
33863             animations[a.id] = a;
33864           },
33865           update = function() {
33866             var a = this,
33867               res;
33868             if (isArray(a.start)) {
33869               res = [];
33870               for (var j = 0, jj = a.start.length; j < jj; j++) {
33871                 res[j] = +a.start[j] +
33872                   (a.end[j] - a.start[j]) * a.easing(a.s);
33873               }
33874             } else {
33875               res = +a.start + (a.end - a.start) * a.easing(a.s);
33876             }
33877             a.set(res);
33878           },
33879           frame = function() {
33880             var len = 0;
33881             for (var i in animations)
33882               if (animations.hasOwnProperty(i)) {
33883                 var a = animations[i],
33884                   b = a.get(),
33885                   res;
33886                 len++;
33887                 a.s = (b - a.b) / (a.dur / a.spd);
33888                 if (a.s >= 1) {
33889                   delete animations[i];
33890                   a.s = 1;
33891                   len--;
33892                   (function(a) {
33893                     setTimeout(function() {
33894                       eve("mina.finish." + a.id, a);
33895                     });
33896                   }(a));
33897                 }
33898                 a.update();
33899               }
33900             len && requestAnimFrame(frame);
33901           },
33902           /*
33903            * \ mina [ method ] * Generic animation of numbers * - a (number) start
33904            * _slave_ number - A (number) end _slave_ number - b (number) start
33905            * _master_ number (start time in general case) - B (number) end _master_
33906            * number (end time in gereal case) - get (function) getter of _master_
33907            * number (see @mina.time) - set (function) setter of _slave_ number -
33908            * easing (function) #optional easing function, default is @mina.linear =
33909            * (object) animation descriptor o { o id (string) animation id, o start
33910            * (number) start _slave_ number, o end (number) end _slave_ number, o b
33911            * (number) start _master_ number, o s (number) animation status (0..1), o
33912            * dur (number) animation duration, o spd (number) animation speed, o get
33913            * (function) getter of _master_ number (see @mina.time), o set (function)
33914            * setter of _slave_ number, o easing (function) easing function, default is
33915            * @mina.linear, o status (function) status getter/setter, o speed
33916            * (function) speed getter/setter, o duration (function) duration
33917            * getter/setter, o stop (function) animation stopper o pause (function)
33918            * pauses the animation o resume (function) resumes the animation o update
33919            * (function) calles setter with the right value of the animation o } \
33920            */
33921           mina = function(a, A, b, B, get, set, easing) {
33922             var anim = {
33923               id: ID(),
33924               start: a,
33925               end: A,
33926               b: b,
33927               s: 0,
33928               dur: B - b,
33929               spd: 1,
33930               get: get,
33931               set: set,
33932               easing: easing || mina.linear,
33933               status: sta,
33934               speed: speed,
33935               duration: duration,
33936               stop: stopit,
33937               pause: pause,
33938               resume: resume,
33939               update: update
33940             };
33941             animations[anim.id] = anim;
33942             var len = 0,
33943               i;
33944             for (i in animations)
33945               if (animations.hasOwnProperty(i)) {
33946                 len++;
33947                 if (len == 2) {
33948                   break;
33949                 }
33950               }
33951             len == 1 && requestAnimFrame(frame);
33952             return anim;
33953           };
33954         /*
33955          * \ mina.time [ method ] * Returns the current time. Equivalent to: |
33956          * function () { | return (new Date).getTime(); | } \
33957          */
33958         mina.time = timer;
33959         /*
33960          * \ mina.getById [ method ] * Returns an animation by its id - id (string)
33961          * animation's id = (object) See @mina \
33962          */
33963         mina.getById = function(id) {
33964           return animations[id] || null;
33965         };
33966
33967         /*
33968          * \ mina.linear [ method ] * Default linear easing - n (number) input 0..1 =
33969          * (number) output 0..1 \
33970          */
33971         mina.linear = function(n) {
33972           return n;
33973         };
33974         /*
33975          * \ mina.easeout [ method ] * Easeout easing - n (number) input 0..1 =
33976          * (number) output 0..1 \
33977          */
33978         mina.easeout = function(n) {
33979           return Math.pow(n, 1.7);
33980         };
33981         /*
33982          * \ mina.easein [ method ] * Easein easing - n (number) input 0..1 =
33983          * (number) output 0..1 \
33984          */
33985         mina.easein = function(n) {
33986           return Math.pow(n, .48);
33987         };
33988         /*
33989          * \ mina.easeinout [ method ] * Easeinout easing - n (number) input 0..1 =
33990          * (number) output 0..1 \
33991          */
33992         mina.easeinout = function(n) {
33993           if (n == 1) {
33994             return 1;
33995           }
33996           if (n == 0) {
33997             return 0;
33998           }
33999           var q = .48 - n / 1.04,
34000             Q = Math.sqrt(.1734 + q * q),
34001             x = Q - q,
34002             X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
34003             y = -Q - q,
34004             Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
34005             t = X + Y + .5;
34006           return (1 - t) * 3 * t * t + t * t * t;
34007         };
34008         /*
34009          * \ mina.backin [ method ] * Backin easing - n (number) input 0..1 =
34010          * (number) output 0..1 \
34011          */
34012         mina.backin = function(n) {
34013           if (n == 1) {
34014             return 1;
34015           }
34016           var s = 1.70158;
34017           return n * n * ((s + 1) * n - s);
34018         };
34019         /*
34020          * \ mina.backout [ method ] * Backout easing - n (number) input 0..1 =
34021          * (number) output 0..1 \
34022          */
34023         mina.backout = function(n) {
34024           if (n == 0) {
34025             return 0;
34026           }
34027           n = n - 1;
34028           var s = 1.70158;
34029           return n * n * ((s + 1) * n + s) + 1;
34030         };
34031         /*
34032          * \ mina.elastic [ method ] * Elastic easing - n (number) input 0..1 =
34033          * (number) output 0..1 \
34034          */
34035         mina.elastic = function(n) {
34036           if (n == !!n) {
34037             return n;
34038           }
34039           return Math.pow(2, -10 * n) * Math.sin((n - .075) *
34040             (2 * Math.PI) / .3) + 1;
34041         };
34042         /*
34043          * \ mina.bounce [ method ] * Bounce easing - n (number) input 0..1 =
34044          * (number) output 0..1 \
34045          */
34046         mina.bounce = function(n) {
34047           var s = 7.5625,
34048             p = 2.75,
34049             l;
34050           if (n < (1 / p)) {
34051             l = s * n * n;
34052           } else {
34053             if (n < (2 / p)) {
34054               n -= (1.5 / p);
34055               l = s * n * n + .75;
34056             } else {
34057               if (n < (2.5 / p)) {
34058                 n -= (2.25 / p);
34059                 l = s * n * n + .9375;
34060               } else {
34061                 n -= (2.625 / p);
34062                 l = s * n * n + .984375;
34063               }
34064             }
34065           }
34066           return l;
34067         };
34068         window.mina = mina;
34069         return mina;
34070       })(typeof eve == "undefined" ? function() {} : eve);
34071       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
34072       //
34073       // Licensed under the Apache License, Version 2.0 (the "License");
34074       // you may not use this file except in compliance with the License.
34075       // You may obtain a copy of the License at
34076       //
34077       // http://www.apache.org/licenses/LICENSE-2.0
34078       //
34079       // Unless required by applicable law or agreed to in writing, software
34080       // distributed under the License is distributed on an "AS IS" BASIS,
34081       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34082       // See the License for the specific language governing permissions and
34083       // limitations under the License.
34084
34085       var Snap = (function(root) {
34086         Snap.version = "0.3.0";
34087         /*
34088          * \ Snap [ method ] * Creates a drawing surface or wraps existing SVG element. * -
34089          * width (number|string) width of surface - height (number|string) height of
34090          * surface or - DOM (SVGElement) element to be wrapped into Snap structure or -
34091          * array (array) array of elements (will return set of elements) or - query
34092          * (string) CSS query selector = (object) @Element \
34093          */
34094         function Snap(w, h) {
34095           if (w) {
34096             if (w.tagName) {
34097               return wrap(w);
34098             }
34099             if (is(w, "array") && Snap.set) {
34100               return Snap.set.apply(Snap, w);
34101             }
34102             if (w instanceof Element) {
34103               return w;
34104             }
34105             if (h == null) {
34106               w = glob.doc.querySelector(w);
34107               return wrap(w);
34108             }
34109           }
34110           w = w == null ? "100%" : w;
34111           h = h == null ? "100%" : h;
34112           return new Paper(w, h);
34113         }
34114         Snap.toString = function() {
34115           return "Snap v" + this.version;
34116         };
34117         Snap._ = {};
34118         var glob = {
34119           win: root.window,
34120           doc: root.window.document
34121         };
34122         Snap._.glob = glob;
34123         var has = "hasOwnProperty",
34124           Str = String,
34125           toFloat = parseFloat,
34126           toInt = parseInt,
34127           math = Math,
34128           mmax = math.max,
34129           mmin = math.min,
34130           abs = math.abs,
34131           pow = math.pow,
34132           PI = math.PI,
34133           round = math.round,
34134           E = "",
34135           S = " ",
34136           objectToString = Object.prototype.toString,
34137           ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
34138           colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
34139           bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
34140           reURLValue = /^url\(#?([^)]+)\)$/,
34141           separator = Snap._.separator = /[,\s]+/,
34142           whitespace = /[\s]/g,
34143           commaSpaces = /[\s]*,[\s]*/,
34144           hsrg = {
34145             hs: 1,
34146             rg: 1
34147           },
34148           pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
34149           tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
34150           pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
34151           idgen = 0,
34152           idprefix = "S" + (+new Date).toString(36),
34153           ID = function(el) {
34154             return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
34155           },
34156           xlink = "http://www.w3.org/1999/xlink",
34157           xmlns = "http://www.w3.org/2000/svg",
34158           hub = {},
34159           URL = Snap.url = function(url) {
34160             return "url('#" + url + "')";
34161           };
34162
34163         function $(el, attr) {
34164           if (attr) {
34165             if (el == "#text") {
34166               el = glob.doc.createTextNode(attr.text || "");
34167             }
34168             if (typeof el == "string") {
34169               el = $(el);
34170             }
34171             if (typeof attr == "string") {
34172               if (attr.substring(0, 6) == "xlink:") {
34173                 return el.getAttributeNS(xlink, attr.substring(6));
34174               }
34175               if (attr.substring(0, 4) == "xml:") {
34176                 return el.getAttributeNS(xmlns, attr.substring(4));
34177               }
34178               return el.getAttribute(attr);
34179             }
34180             for (var key in attr)
34181               if (attr[has](key)) {
34182                 var val = Str(attr[key]);
34183                 if (val) {
34184                   if (key.substring(0, 6) == "xlink:") {
34185                     el.setAttributeNS(xlink, key.substring(6), val);
34186                   } else if (key.substring(0, 4) == "xml:") {
34187                     el.setAttributeNS(xmlns, key.substring(4), val);
34188                   } else {
34189                     el.setAttribute(key, val);
34190                   }
34191                 } else {
34192                   el.removeAttribute(key);
34193                 }
34194               }
34195           } else {
34196             el = glob.doc.createElementNS(xmlns, el);
34197           }
34198           return el;
34199         }
34200         Snap._.$ = $;
34201         Snap._.id = ID;
34202
34203         function getAttrs(el) {
34204           var attrs = el.attributes,
34205             name,
34206             out = {};
34207           for (var i = 0; i < attrs.length; i++) {
34208             if (attrs[i].namespaceURI == xlink) {
34209               name = "xlink:";
34210             } else {
34211               name = "";
34212             }
34213             name += attrs[i].name;
34214             out[name] = attrs[i].textContent;
34215           }
34216           return out;
34217         }
34218
34219         function is(o, type) {
34220           type = Str.prototype.toLowerCase.call(type);
34221           if (type == "finite") {
34222             return isFinite(o);
34223           }
34224           if (type == "array" &&
34225             (o instanceof Array || Array.isArray && Array.isArray(o))) {
34226             return true;
34227           }
34228           return (type == "null" && o === null) ||
34229             (type == typeof o && o !== null) ||
34230             (type == "object" && o === Object(o)) ||
34231             objectToString.call(o).slice(8, -1).toLowerCase() == type;
34232         }
34233         /*
34234          * \ Snap.format [ method ] * Replaces construction of type `{<name>}` to the
34235          * corresponding argument * - token (string) string to format - json (object)
34236          * object which properties are used as a replacement = (string) formatted string >
34237          * Usage | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" |
34238          * paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative
34239          * width']}z", { | x: 10, | y: 20, | dim: { | width: 40, | height: 50, |
34240          * "negative width": -40 | } | })); \
34241          */
34242         Snap.format = (function() {
34243           var tokenRegex = /\{([^\}]+)\}/g,
34244             objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches
34245             // .xxxxx
34246             // or
34247             // ["xxxxx"]
34248             // to
34249             // run
34250             // over
34251             // object
34252             // properties
34253             replacer = function(all, key, obj) {
34254               var res = obj;
34255               key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
34256                 name = name || quotedName;
34257                 if (res) {
34258                   if (name in res) {
34259                     res = res[name];
34260                   }
34261                   typeof res == "function" && isFunc && (res = res());
34262                 }
34263               });
34264               res = (res == null || res == obj ? all : res) + "";
34265               return res;
34266             };
34267           return function(str, obj) {
34268             return Str(str).replace(tokenRegex, function(all, key) {
34269               return replacer(all, key, obj);
34270             });
34271           };
34272         })();
34273
34274         function clone(obj) {
34275           if (typeof obj == "function" || Object(obj) !== obj) {
34276             return obj;
34277           }
34278           var res = new obj.constructor;
34279           for (var key in obj)
34280             if (obj[has](key)) {
34281               res[key] = clone(obj[key]);
34282             }
34283           return res;
34284         }
34285         Snap._.clone = clone;
34286
34287         function repush(array, item) {
34288           for (var i = 0, ii = array.length; i < ii; i++)
34289             if (array[i] === item) {
34290               return array.push(array.splice(i, 1)[0]);
34291             }
34292         }
34293
34294         function cacher(f, scope, postprocessor) {
34295           function newf() {
34296             var arg = Array.prototype.slice.call(arguments, 0),
34297               args = arg.join("\u2400"),
34298               cache = newf.cache = newf.cache || {},
34299               count = newf.count = newf.count || [];
34300             if (cache[has](args)) {
34301               repush(count, args);
34302               return postprocessor ? postprocessor(cache[args]) : cache[args];
34303             }
34304             count.length >= 1e3 && delete cache[count.shift()];
34305             count.push(args);
34306             cache[args] = f.apply(scope, arg);
34307             return postprocessor ? postprocessor(cache[args]) : cache[args];
34308           }
34309           return newf;
34310         }
34311         Snap._.cacher = cacher;
34312
34313         function angle(x1, y1, x2, y2, x3, y3) {
34314           if (x3 == null) {
34315             var x = x1 - x2,
34316               y = y1 - y2;
34317             if (!x && !y) {
34318               return 0;
34319             }
34320             return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
34321           } else {
34322             return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
34323           }
34324         }
34325
34326         function rad(deg) {
34327           return deg % 360 * PI / 180;
34328         }
34329
34330         function deg(rad) {
34331           return rad * 180 / PI % 360;
34332         }
34333
34334         function x_y() {
34335           return this.x + S + this.y;
34336         }
34337
34338         function x_y_w_h() {
34339           return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
34340         }
34341
34342         /*
34343          * \ Snap.rad [ method ] * Transform angle to radians - deg (number) angle in
34344          * degrees = (number) angle in radians \
34345          */
34346         Snap.rad = rad;
34347         /*
34348          * \ Snap.deg [ method ] * Transform angle to degrees - rad (number) angle in
34349          * radians = (number) angle in degrees \
34350          */
34351         Snap.deg = deg;
34352         /*
34353          * \ Snap.angle [ method ] * Returns an angle between two or three points >
34354          * Parameters - x1 (number) x coord of first point - y1 (number) y coord of
34355          * first point - x2 (number) x coord of second point - y2 (number) y coord of
34356          * second point - x3 (number) #optional x coord of third point - y3 (number)
34357          * #optional y coord of third point = (number) angle in degrees \
34358          */
34359         Snap.angle = angle;
34360         /*
34361          * \ Snap.is [ method ] * Handy replacement for the `typeof` operator - o
34362          * (…) any object or primitive - type (string) name of the type, e.g.,
34363          * `string`, `function`, `number`, etc. = (boolean) `true` if given value is of
34364          * given type \
34365          */
34366         Snap.is = is;
34367         /*
34368          * \ Snap.snapTo [ method ] * Snaps given value to given grid - values
34369          * (array|number) given array of values or step of the grid - value (number)
34370          * value to adjust - tolerance (number) #optional maximum distance to the target
34371          * value that would trigger the snap. Default is `10`. = (number) adjusted value \
34372          */
34373         Snap.snapTo = function(values, value, tolerance) {
34374           tolerance = is(tolerance, "finite") ? tolerance : 10;
34375           if (is(values, "array")) {
34376             var i = values.length;
34377             while (i--)
34378               if (abs(values[i] - value) <= tolerance) {
34379                 return values[i];
34380               }
34381           } else {
34382             values = +values;
34383             var rem = value % values;
34384             if (rem < tolerance) {
34385               return value - rem;
34386             }
34387             if (rem > values - tolerance) {
34388               return value - rem + values;
34389             }
34390           }
34391           return value;
34392         };
34393         // Colour
34394         /*
34395          * \ Snap.getRGB [ method ] * Parses color string as RGB object - color (string)
34396          * color string in one of the following formats: # <ul> # <li>Color name (<code>red</code>,
34397          * <code>green</code>, <code>cornflowerblue</code>, etc)</li> # <li>#•••
34398          * ÃƒÆ’¢â‚¬â€� shortened HTML color: (<code>#000</code>, <code>#fc0</code>,
34399          * etc.)</li> # <li>#•••••• ÃƒÆ’¢â‚¬â€� full
34400          * length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li> #
34401          * <li>rgb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34402          * ÃƒÆ’¢â‚¬â€� red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li> #
34403          * <li>rgba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34404          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34405          * <li>rgb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34406          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li> #
34407          * <li>rgba(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34408          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34409          * <li>hsb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34410          * ÃƒÆ’¢â‚¬â€� hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li> #
34411          * <li>hsba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34412          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34413          * <li>hsb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34414          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsba(•••%,
34415          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34416          * ÃƒÆ’¢â‚¬â€� also with opacity</li> # <li>hsl(•••,
34417          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� hue, saturation and
34418          * luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li> #
34419          * <li>hsla(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34420          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34421          * <li>hsl(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34422          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsla(•••%,
34423          * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34424          * ÃƒÆ’¢â‚¬â€� also with opacity</li> # </ul> Note that `%` can be used any time:
34425          * `rgb(20%, 255, 50%)`. = (object) RGB object in the following format: o { o r
34426          * (number) red, o g (number) green, o b (number) blue, o hex (string) color in
34427          * HTML/CSS format: #••••••, o error
34428          * (boolean) true if string can't be parsed o } \
34429          */
34430         Snap.getRGB = cacher(function(colour) {
34431           if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
34432             return {
34433               r: -1,
34434               g: -1,
34435               b: -1,
34436               hex: "none",
34437               error: 1,
34438               toString: rgbtoString
34439             };
34440           }
34441           if (colour == "none") {
34442             return {
34443               r: -1,
34444               g: -1,
34445               b: -1,
34446               hex: "none",
34447               toString: rgbtoString
34448             };
34449           }!(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
34450           if (!colour) {
34451             return {
34452               r: -1,
34453               g: -1,
34454               b: -1,
34455               hex: "none",
34456               error: 1,
34457               toString: rgbtoString
34458             };
34459           }
34460           var res,
34461             red,
34462             green,
34463             blue,
34464             opacity,
34465             t,
34466             values,
34467             rgb = colour.match(colourRegExp);
34468           if (rgb) {
34469             if (rgb[2]) {
34470               blue = toInt(rgb[2].substring(5), 16);
34471               green = toInt(rgb[2].substring(3, 5), 16);
34472               red = toInt(rgb[2].substring(1, 3), 16);
34473             }
34474             if (rgb[3]) {
34475               blue = toInt((t = rgb[3].charAt(3)) + t, 16);
34476               green = toInt((t = rgb[3].charAt(2)) + t, 16);
34477               red = toInt((t = rgb[3].charAt(1)) + t, 16);
34478             }
34479             if (rgb[4]) {
34480               values = rgb[4].split(commaSpaces);
34481               red = toFloat(values[0]);
34482               values[0].slice(-1) == "%" && (red *= 2.55);
34483               green = toFloat(values[1]);
34484               values[1].slice(-1) == "%" && (green *= 2.55);
34485               blue = toFloat(values[2]);
34486               values[2].slice(-1) == "%" && (blue *= 2.55);
34487               rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
34488               values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34489             }
34490             if (rgb[5]) {
34491               values = rgb[5].split(commaSpaces);
34492               red = toFloat(values[0]);
34493               values[0].slice(-1) == "%" && (red /= 100);
34494               green = toFloat(values[1]);
34495               values[1].slice(-1) == "%" && (green /= 100);
34496               blue = toFloat(values[2]);
34497               values[2].slice(-1) == "%" && (blue /= 100);
34498               (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34499               rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
34500               values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34501               return Snap.hsb2rgb(red, green, blue, opacity);
34502             }
34503             if (rgb[6]) {
34504               values = rgb[6].split(commaSpaces);
34505               red = toFloat(values[0]);
34506               values[0].slice(-1) == "%" && (red /= 100);
34507               green = toFloat(values[1]);
34508               values[1].slice(-1) == "%" && (green /= 100);
34509               blue = toFloat(values[2]);
34510               values[2].slice(-1) == "%" && (blue /= 100);
34511               (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34512               rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
34513               values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34514               return Snap.hsl2rgb(red, green, blue, opacity);
34515             }
34516             red = mmin(math.round(red), 255);
34517             green = mmin(math.round(green), 255);
34518             blue = mmin(math.round(blue), 255);
34519             opacity = mmin(mmax(opacity, 0), 1);
34520             rgb = {
34521               r: red,
34522               g: green,
34523               b: blue,
34524               toString: rgbtoString
34525             };
34526             rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
34527             rgb.opacity = is(opacity, "finite") ? opacity : 1;
34528             return rgb;
34529           }
34530           return {
34531             r: -1,
34532             g: -1,
34533             b: -1,
34534             hex: "none",
34535             error: 1,
34536             toString: rgbtoString
34537           };
34538         }, Snap);
34539         // SIERRA It seems odd that the following 3 conversion methods are not expressed
34540         // as .this2that(), like the others.
34541         /*
34542          * \ Snap.hsb [ method ] * Converts HSB values to a hex representation of the
34543          * color - h (number) hue - s (number) saturation - b (number) value or
34544          * brightness = (string) hex representation of the color \
34545          */
34546         Snap.hsb = cacher(function(h, s, b) {
34547           return Snap.hsb2rgb(h, s, b).hex;
34548         });
34549         /*
34550          * \ Snap.hsl [ method ] * Converts HSL values to a hex representation of the
34551          * color - h (number) hue - s (number) saturation - l (number) luminosity =
34552          * (string) hex representation of the color \
34553          */
34554         Snap.hsl = cacher(function(h, s, l) {
34555           return Snap.hsl2rgb(h, s, l).hex;
34556         });
34557         /*
34558          * \ Snap.rgb [ method ] * Converts RGB values to a hex representation of the
34559          * color - r (number) red - g (number) green - b (number) blue = (string) hex
34560          * representation of the color \
34561          */
34562         Snap.rgb = cacher(function(r, g, b, o) {
34563           if (is(o, "finite")) {
34564             var round = math.round;
34565             return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
34566           }
34567           return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
34568         });
34569         var toHex = function(color) {
34570             var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
34571               red = "rgb(255, 0, 0)";
34572             toHex = cacher(function(color) {
34573               if (color.toLowerCase() == "red") {
34574                 return red;
34575               }
34576               i.style.color = red;
34577               i.style.color = color;
34578               var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
34579               return out == red ? null : out;
34580             });
34581             return toHex(color);
34582           },
34583           hsbtoString = function() {
34584             return "hsb(" + [this.h, this.s, this.b] + ")";
34585           },
34586           hsltoString = function() {
34587             return "hsl(" + [this.h, this.s, this.l] + ")";
34588           },
34589           rgbtoString = function() {
34590             return this.opacity == 1 || this.opacity == null ?
34591               this.hex :
34592               "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
34593           },
34594           prepareRGB = function(r, g, b) {
34595             if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
34596               b = r.b;
34597               g = r.g;
34598               r = r.r;
34599             }
34600             if (g == null && is(r, string)) {
34601               var clr = Snap.getRGB(r);
34602               r = clr.r;
34603               g = clr.g;
34604               b = clr.b;
34605             }
34606             if (r > 1 || g > 1 || b > 1) {
34607               r /= 255;
34608               g /= 255;
34609               b /= 255;
34610             }
34611
34612             return [r, g, b];
34613           },
34614           packageRGB = function(r, g, b, o) {
34615             r = math.round(r * 255);
34616             g = math.round(g * 255);
34617             b = math.round(b * 255);
34618             var rgb = {
34619               r: r,
34620               g: g,
34621               b: b,
34622               opacity: is(o, "finite") ? o : 1,
34623               hex: Snap.rgb(r, g, b),
34624               toString: rgbtoString
34625             };
34626             is(o, "finite") && (rgb.opacity = o);
34627             return rgb;
34628           };
34629         // SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g.,
34630         // can you specify a semi-transparent value for Snap.filter.shadow()?
34631         /*
34632          * \ Snap.color [ method ] * Parses the color string and returns an object
34633          * featuring the color's component values - clr (string) color string in one of
34634          * the supported formats (see @Snap.getRGB) = (object) Combined RGB/HSB object
34635          * in the following format: o { o r (number) red, o g (number) green, o b
34636          * (number) blue, o hex (string) color in HTML/CSS format:
34637          * #••••••, o error (boolean) `true` if
34638          * string can't be parsed, o h (number) hue, o s (number) saturation, o v
34639          * (number) value (brightness), o l (number) lightness o } \
34640          */
34641         Snap.color = function(clr) {
34642           var rgb;
34643           if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
34644             rgb = Snap.hsb2rgb(clr);
34645             clr.r = rgb.r;
34646             clr.g = rgb.g;
34647             clr.b = rgb.b;
34648             clr.opacity = 1;
34649             clr.hex = rgb.hex;
34650           } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
34651             rgb = Snap.hsl2rgb(clr);
34652             clr.r = rgb.r;
34653             clr.g = rgb.g;
34654             clr.b = rgb.b;
34655             clr.opacity = 1;
34656             clr.hex = rgb.hex;
34657           } else {
34658             if (is(clr, "string")) {
34659               clr = Snap.getRGB(clr);
34660             }
34661             if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
34662               rgb = Snap.rgb2hsl(clr);
34663               clr.h = rgb.h;
34664               clr.s = rgb.s;
34665               clr.l = rgb.l;
34666               rgb = Snap.rgb2hsb(clr);
34667               clr.v = rgb.b;
34668             } else {
34669               clr = {
34670                 hex: "none"
34671               };
34672               clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
34673               clr.error = 1;
34674             }
34675           }
34676           clr.toString = rgbtoString;
34677           return clr;
34678         };
34679         /*
34680          * \ Snap.hsb2rgb [ method ] * Converts HSB values to an RGB object - h (number)
34681          * hue - s (number) saturation - v (number) value or brightness = (object) RGB
34682          * object in the following format: o { o r (number) red, o g (number) green, o b
34683          * (number) blue, o hex (string) color in HTML/CSS format:
34684          * #•••••• o } \
34685          */
34686         Snap.hsb2rgb = function(h, s, v, o) {
34687           if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
34688             v = h.b;
34689             s = h.s;
34690             h = h.h;
34691             o = h.o;
34692           }
34693           h *= 360;
34694           var R, G, B, X, C;
34695           h = (h % 360) / 60;
34696           C = v * s;
34697           X = C * (1 - abs(h % 2 - 1));
34698           R = G = B = v - C;
34699
34700           h = ~~h;
34701           R += [C, X, 0, 0, X, C][h];
34702           G += [X, C, C, X, 0, 0][h];
34703           B += [0, 0, X, C, C, X][h];
34704           return packageRGB(R, G, B, o);
34705         };
34706         /*
34707          * \ Snap.hsl2rgb [ method ] * Converts HSL values to an RGB object - h (number)
34708          * hue - s (number) saturation - l (number) luminosity = (object) RGB object in
34709          * the following format: o { o r (number) red, o g (number) green, o b (number)
34710          * blue, o hex (string) color in HTML/CSS format:
34711          * #•••••• o } \
34712          */
34713         Snap.hsl2rgb = function(h, s, l, o) {
34714           if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
34715             l = h.l;
34716             s = h.s;
34717             h = h.h;
34718           }
34719           if (h > 1 || s > 1 || l > 1) {
34720             h /= 360;
34721             s /= 100;
34722             l /= 100;
34723           }
34724           h *= 360;
34725           var R, G, B, X, C;
34726           h = (h % 360) / 60;
34727           C = 2 * s * (l < .5 ? l : 1 - l);
34728           X = C * (1 - abs(h % 2 - 1));
34729           R = G = B = l - C / 2;
34730
34731           h = ~~h;
34732           R += [C, X, 0, 0, X, C][h];
34733           G += [X, C, C, X, 0, 0][h];
34734           B += [0, 0, X, C, C, X][h];
34735           return packageRGB(R, G, B, o);
34736         };
34737         /*
34738          * \ Snap.rgb2hsb [ method ] * Converts RGB values to an HSB object - r (number)
34739          * red - g (number) green - b (number) blue = (object) HSB object in the
34740          * following format: o { o h (number) hue, o s (number) saturation, o b (number)
34741          * brightness o } \
34742          */
34743         Snap.rgb2hsb = function(r, g, b) {
34744           b = prepareRGB(r, g, b);
34745           r = b[0];
34746           g = b[1];
34747           b = b[2];
34748
34749           var H, S, V, C;
34750           V = mmax(r, g, b);
34751           C = V - mmin(r, g, b);
34752           H = (C == 0 ? null :
34753             V == r ? (g - b) / C :
34754             V == g ? (b - r) / C + 2 :
34755             (r - g) / C + 4
34756           );
34757           H = ((H + 360) % 6) * 60 / 360;
34758           S = C == 0 ? 0 : C / V;
34759           return {
34760             h: H,
34761             s: S,
34762             b: V,
34763             toString: hsbtoString
34764           };
34765         };
34766         /*
34767          * \ Snap.rgb2hsl [ method ] * Converts RGB values to an HSL object - r (number)
34768          * red - g (number) green - b (number) blue = (object) HSL object in the
34769          * following format: o { o h (number) hue, o s (number) saturation, o l (number)
34770          * luminosity o } \
34771          */
34772         Snap.rgb2hsl = function(r, g, b) {
34773           b = prepareRGB(r, g, b);
34774           r = b[0];
34775           g = b[1];
34776           b = b[2];
34777
34778           var H, S, L, M, m, C;
34779           M = mmax(r, g, b);
34780           m = mmin(r, g, b);
34781           C = M - m;
34782           H = (C == 0 ? null :
34783             M == r ? (g - b) / C :
34784             M == g ? (b - r) / C + 2 :
34785             (r - g) / C + 4);
34786           H = ((H + 360) % 6) * 60 / 360;
34787           L = (M + m) / 2;
34788           S = (C == 0 ? 0 :
34789             L < .5 ? C / (2 * L) :
34790             C / (2 - 2 * L));
34791           return {
34792             h: H,
34793             s: S,
34794             l: L,
34795             toString: hsltoString
34796           };
34797         };
34798
34799         // Transformations
34800         // SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a
34801         // format like this for two separate segments? [ ["M10,10","L90,90"],
34802         // ["M90,10","L10,90"] ] Otherwise how is each command structured?
34803         /*
34804          * \ Snap.parsePathString [ method ] * Utility method * Parses given path string
34805          * into an array of arrays of path segments - pathString (string|array) path
34806          * string or array of segments (in the last case it is returned straight away) =
34807          * (array) array of segments \
34808          */
34809         Snap.parsePathString = function(pathString) {
34810           if (!pathString) {
34811             return null;
34812           }
34813           var pth = Snap.path(pathString);
34814           if (pth.arr) {
34815             return Snap.path.clone(pth.arr);
34816           }
34817
34818           var paramCounts = {
34819               a: 7,
34820               c: 6,
34821               o: 2,
34822               h: 1,
34823               l: 2,
34824               m: 2,
34825               r: 4,
34826               q: 4,
34827               s: 4,
34828               t: 2,
34829               v: 1,
34830               u: 3,
34831               z: 0
34832             },
34833             data = [];
34834           if (is(pathString, "array") && is(pathString[0], "array")) { // rough
34835             // assumption
34836             data = Snap.path.clone(pathString);
34837           }
34838           if (!data.length) {
34839             Str(pathString).replace(pathCommand, function(a, b, c) {
34840               var params = [],
34841                 name = b.toLowerCase();
34842               c.replace(pathValues, function(a, b) {
34843                 b && params.push(+b);
34844               });
34845               if (name == "m" && params.length > 2) {
34846                 data.push([b].concat(params.splice(0, 2)));
34847                 name = "l";
34848                 b = b == "m" ? "l" : "L";
34849               }
34850               if (name == "o" && params.length == 1) {
34851                 data.push([b, params[0]]);
34852               }
34853               if (name == "r") {
34854                 data.push([b].concat(params));
34855               } else
34856                 while (params.length >= paramCounts[name]) {
34857                   data.push([b].concat(params.splice(0, paramCounts[name])));
34858                   if (!paramCounts[name]) {
34859                     break;
34860                   }
34861                 }
34862             });
34863           }
34864           data.toString = Snap.path.toString;
34865           pth.arr = Snap.path.clone(data);
34866           return data;
34867         };
34868         /*
34869          * \ Snap.parseTransformString [ method ] * Utility method * Parses given
34870          * transform string into an array of transformations - TString (string|array)
34871          * transform string or array of transformations (in the last case it is returned
34872          * straight away) = (array) array of transformations \
34873          */
34874         var parseTransformString = Snap.parseTransformString = function(TString) {
34875           if (!TString) {
34876             return null;
34877           }
34878           var paramCounts = {
34879               r: 3,
34880               s: 4,
34881               t: 2,
34882               m: 6
34883             },
34884             data = [];
34885           if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
34886             data = Snap.path.clone(TString);
34887           }
34888           if (!data.length) {
34889             Str(TString).replace(tCommand, function(a, b, c) {
34890               var params = [],
34891                 name = b.toLowerCase();
34892               c.replace(pathValues, function(a, b) {
34893                 b && params.push(+b);
34894               });
34895               data.push([b].concat(params));
34896             });
34897           }
34898           data.toString = Snap.path.toString;
34899           return data;
34900         };
34901
34902         function svgTransform2string(tstr) {
34903           var res = [];
34904           tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function(all, name, params) {
34905             params = params.split(/\s*,\s*|\s+/);
34906             if (name == "rotate" && params.length == 1) {
34907               params.push(0, 0);
34908             }
34909             if (name == "scale") {
34910               if (params.length > 2) {
34911                 params = params.slice(0, 2);
34912               } else if (params.length == 2) {
34913                 params.push(0, 0);
34914               }
34915               if (params.length == 1) {
34916                 params.push(params[0], 0, 0);
34917               }
34918             }
34919             if (name == "skewX") {
34920               res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
34921             } else if (name == "skewY") {
34922               res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
34923             } else {
34924               res.push([name.charAt(0)].concat(params));
34925             }
34926             return all;
34927           });
34928           return res;
34929         }
34930         Snap._.svgTransform2string = svgTransform2string;
34931         Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
34932
34933         function transform2matrix(tstr, bbox) {
34934           var tdata = parseTransformString(tstr),
34935             m = new Snap.Matrix;
34936           if (tdata) {
34937             for (var i = 0, ii = tdata.length; i < ii; i++) {
34938               var t = tdata[i],
34939                 tlen = t.length,
34940                 command = Str(t[0]).toLowerCase(),
34941                 absolute = t[0] != command,
34942                 inver = absolute ? m.invert() : 0,
34943                 x1,
34944                 y1,
34945                 x2,
34946                 y2,
34947                 bb;
34948               if (command == "t" && tlen == 2) {
34949                 m.translate(t[1], 0);
34950               } else if (command == "t" && tlen == 3) {
34951                 if (absolute) {
34952                   x1 = inver.x(0, 0);
34953                   y1 = inver.y(0, 0);
34954                   x2 = inver.x(t[1], t[2]);
34955                   y2 = inver.y(t[1], t[2]);
34956                   m.translate(x2 - x1, y2 - y1);
34957                 } else {
34958                   m.translate(t[1], t[2]);
34959                 }
34960               } else if (command == "r") {
34961                 if (tlen == 2) {
34962                   bb = bb || bbox;
34963                   m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34964                 } else if (tlen == 4) {
34965                   if (absolute) {
34966                     x2 = inver.x(t[2], t[3]);
34967                     y2 = inver.y(t[2], t[3]);
34968                     m.rotate(t[1], x2, y2);
34969                   } else {
34970                     m.rotate(t[1], t[2], t[3]);
34971                   }
34972                 }
34973               } else if (command == "s") {
34974                 if (tlen == 2 || tlen == 3) {
34975                   bb = bb || bbox;
34976                   m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34977                 } else if (tlen == 4) {
34978                   if (absolute) {
34979                     x2 = inver.x(t[2], t[3]);
34980                     y2 = inver.y(t[2], t[3]);
34981                     m.scale(t[1], t[1], x2, y2);
34982                   } else {
34983                     m.scale(t[1], t[1], t[2], t[3]);
34984                   }
34985                 } else if (tlen == 5) {
34986                   if (absolute) {
34987                     x2 = inver.x(t[3], t[4]);
34988                     y2 = inver.y(t[3], t[4]);
34989                     m.scale(t[1], t[2], x2, y2);
34990                   } else {
34991                     m.scale(t[1], t[2], t[3], t[4]);
34992                   }
34993                 }
34994               } else if (command == "m" && tlen == 7) {
34995                 m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
34996               }
34997             }
34998           }
34999           return m;
35000         }
35001         Snap._.transform2matrix = transform2matrix;
35002         Snap._unit2px = unit2px;
35003         var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
35004           function(a, b) {
35005             var adown = a.nodeType == 9 ? a.documentElement : a,
35006               bup = b && b.parentNode;
35007             return a == bup || !!(bup && bup.nodeType == 1 && (
35008               adown.contains ?
35009               adown.contains(bup) :
35010               a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
35011             ));
35012           } :
35013           function(a, b) {
35014             if (b) {
35015               while (b) {
35016                 b = b.parentNode;
35017                 if (b == a) {
35018                   return true;
35019                 }
35020               }
35021             }
35022             return false;
35023           };
35024
35025         function getSomeDefs(el) {
35026           var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
35027             (el.node.parentNode && wrap(el.node.parentNode)) ||
35028             Snap.select("svg") ||
35029             Snap(0, 0),
35030             pdefs = p.select("defs"),
35031             defs = pdefs == null ? false : pdefs.node;
35032           if (!defs) {
35033             defs = make("defs", p.node).node;
35034           }
35035           return defs;
35036         }
35037
35038         function getSomeSVG(el) {
35039           return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
35040         }
35041         Snap._.getSomeDefs = getSomeDefs;
35042         Snap._.getSomeSVG = getSomeSVG;
35043
35044         function unit2px(el, name, value) {
35045           var svg = getSomeSVG(el).node,
35046             out = {},
35047             mgr = svg.querySelector(".svg---mgr");
35048           if (!mgr) {
35049             mgr = $("rect");
35050             $(mgr, {
35051               x: -9e9,
35052               y: -9e9,
35053               width: 10,
35054               height: 10,
35055               "class": "svg---mgr",
35056               fill: "none"
35057             });
35058             svg.appendChild(mgr);
35059           }
35060
35061           function getW(val) {
35062             if (val == null) {
35063               return E;
35064             }
35065             if (val == +val) {
35066               return val;
35067             }
35068             $(mgr, {
35069               width: val
35070             });
35071             try {
35072               return mgr.getBBox().width;
35073             } catch (e) {
35074               return 0;
35075             }
35076           }
35077
35078           function getH(val) {
35079             if (val == null) {
35080               return E;
35081             }
35082             if (val == +val) {
35083               return val;
35084             }
35085             $(mgr, {
35086               height: val
35087             });
35088             try {
35089               return mgr.getBBox().height;
35090             } catch (e) {
35091               return 0;
35092             }
35093           }
35094
35095           function set(nam, f) {
35096             if (name == null) {
35097               out[nam] = f(el.attr(nam) || 0);
35098             } else if (nam == name) {
35099               out = f(value == null ? el.attr(nam) || 0 : value);
35100             }
35101           }
35102           switch (el.type) {
35103             case "rect":
35104               set("rx", getW);
35105               set("ry", getH);
35106             case "image":
35107               set("width", getW);
35108               set("height", getH);
35109             case "text":
35110               set("x", getW);
35111               set("y", getH);
35112               break;
35113             case "circle":
35114               set("cx", getW);
35115               set("cy", getH);
35116               set("r", getW);
35117               break;
35118             case "ellipse":
35119               set("cx", getW);
35120               set("cy", getH);
35121               set("rx", getW);
35122               set("ry", getH);
35123               break;
35124             case "line":
35125               set("x1", getW);
35126               set("x2", getW);
35127               set("y1", getH);
35128               set("y2", getH);
35129               break;
35130             case "marker":
35131               set("refX", getW);
35132               set("markerWidth", getW);
35133               set("refY", getH);
35134               set("markerHeight", getH);
35135               break;
35136             case "radialGradient":
35137               set("fx", getW);
35138               set("fy", getH);
35139               break;
35140             case "tspan":
35141               set("dx", getW);
35142               set("dy", getH);
35143               break;
35144             default:
35145               set(name, getW);
35146           }
35147           svg.removeChild(mgr);
35148           return out;
35149         }
35150         /*
35151          * \ Snap.select [ method ] * Wraps a DOM element specified by CSS selector as
35152          * @Element - query (string) CSS selector of the element = (Element) the current
35153          * element \
35154          */
35155         Snap.select = function(query) {
35156           query = Str(query).replace(/([^\\]):/g, "$1\\:");
35157           return wrap(glob.doc.querySelector(query));
35158         };
35159         /*
35160          * \ Snap.selectAll [ method ] * Wraps DOM elements specified by CSS selector as
35161          * set or array of @Element - query (string) CSS selector of the element =
35162          * (Element) the current element \
35163          */
35164         Snap.selectAll = function(query) {
35165           var nodelist = glob.doc.querySelectorAll(query),
35166             set = (Snap.set || Array)();
35167           for (var i = 0; i < nodelist.length; i++) {
35168             set.push(wrap(nodelist[i]));
35169           }
35170           return set;
35171         };
35172
35173         function add2group(list) {
35174           if (!is(list, "array")) {
35175             list = Array.prototype.slice.call(arguments, 0);
35176           }
35177           var i = 0,
35178             j = 0,
35179             node = this.node;
35180           while (this[i]) delete this[i++];
35181           for (i = 0; i < list.length; i++) {
35182             if (list[i].type == "set") {
35183               list[i].forEach(function(el) {
35184                 node.appendChild(el.node);
35185               });
35186             } else {
35187               node.appendChild(list[i].node);
35188             }
35189           }
35190           var children = node.childNodes;
35191           for (i = 0; i < children.length; i++) {
35192             this[j++] = wrap(children[i]);
35193           }
35194           return this;
35195         }
35196         // Hub garbage collector every 10s
35197         setInterval(function() {
35198           for (var key in hub)
35199             if (hub[has](key)) {
35200               var el = hub[key],
35201                 node = el.node;
35202               if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
35203                 delete hub[key];
35204               }
35205             }
35206         }, 1e4);
35207
35208         function Element(el) {
35209           if (el.snap in hub) {
35210             return hub[el.snap];
35211           }
35212           var svg;
35213           try {
35214             svg = el.ownerSVGElement;
35215           } catch (e) {}
35216           /*
35217            * \ Element.node [ property (object) ] * Gives you a reference to the DOM
35218            * object, so you can assign event handlers or just mess around. > Usage | //
35219            * draw a circle at coordinate 10,10 with radius of 10 | var c =
35220            * paper.circle(10, 10, 10); | c.node.onclick = function () { |
35221            * c.attr("fill", "red"); | }; \
35222            */
35223           this.node = el;
35224           if (svg) {
35225             this.paper = new Paper(svg);
35226           }
35227           /*
35228            * \ Element.type [ property (string) ] * SVG tag name of the given element. \
35229            */
35230           this.type = el.tagName;
35231           var id = this.id = ID(this);
35232           this.anims = {};
35233           this._ = {
35234             transform: []
35235           };
35236           el.snap = id;
35237           hub[id] = this;
35238           if (this.type == "g") {
35239             this.add = add2group;
35240           }
35241           if (this.type in {
35242               g: 1,
35243               mask: 1,
35244               pattern: 1,
35245               symbol: 1
35246             }) {
35247             for (var method in Paper.prototype)
35248               if (Paper.prototype[has](method)) {
35249                 this[method] = Paper.prototype[method];
35250               }
35251           }
35252         }
35253         /*
35254          * \ Element.attr [ method ] * Gets or sets given attributes of the element. * -
35255          * params (object) contains key-value pairs of attributes you want to set or -
35256          * param (string) name of the attribute = (Element) the current element or =
35257          * (string) value of attribute > Usage | el.attr({ | fill: "#fc0", | stroke:
35258          * "#000", | strokeWidth: 2, // CamelCase... | "fill-opacity": 0.5, // or
35259          * dash-separated names | width: "*=2" // prefixed values | }); |
35260          * console.log(el.attr("fill")); // #fc0 Prefixed values in format `"+=10"`
35261          * supported. All four operations (`+`, `-`, `*` and `/`) could be used.
35262          * Optionally you can use units for `+` and `-`: `"+=2em"`. \
35263          */
35264         Element.prototype.attr = function(params, value) {
35265           var el = this,
35266             node = el.node;
35267           if (!params) {
35268             return el;
35269           }
35270           if (is(params, "string")) {
35271             if (arguments.length > 1) {
35272               var json = {};
35273               json[params] = value;
35274               params = json;
35275             } else {
35276               return eve("snap.util.getattr." + params, el).firstDefined();
35277             }
35278           }
35279           for (var att in params) {
35280             if (params[has](att)) {
35281               eve("snap.util.attr." + att, el, params[att]);
35282             }
35283           }
35284           return el;
35285         };
35286         /*
35287          * \ Snap.parse [ method ] * Parses SVG fragment and converts it into a
35288          * @Fragment * - svg (string) SVG string = (Fragment) the @Fragment \
35289          */
35290         Snap.parse = function(svg) {
35291           var f = glob.doc.createDocumentFragment(),
35292             full = true,
35293             div = glob.doc.createElement("div");
35294           svg = Str(svg);
35295           if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
35296             svg = "<svg>" + svg + "</svg>";
35297             full = false;
35298           }
35299           div.innerHTML = svg;
35300           svg = div.getElementsByTagName("svg")[0];
35301           if (svg) {
35302             if (full) {
35303               f = svg;
35304             } else {
35305               while (svg.firstChild) {
35306                 f.appendChild(svg.firstChild);
35307               }
35308               div.innerHTML = E;
35309             }
35310           }
35311           return new Fragment(f);
35312         };
35313
35314         function Fragment(frag) {
35315           this.node = frag;
35316         }
35317         // SIERRA Snap.fragment() could especially use a code example
35318         /*
35319          * \ Snap.fragment [ method ] * Creates a DOM fragment from a given list of
35320          * elements or strings * - varargs (…) SVG string = (Fragment) the
35321          * @Fragment \
35322          */
35323         Snap.fragment = function() {
35324           var args = Array.prototype.slice.call(arguments, 0),
35325             f = glob.doc.createDocumentFragment();
35326           for (var i = 0, ii = args.length; i < ii; i++) {
35327             var item = args[i];
35328             if (item.node && item.node.nodeType) {
35329               f.appendChild(item.node);
35330             }
35331             if (item.nodeType) {
35332               f.appendChild(item);
35333             }
35334             if (typeof item == "string") {
35335               f.appendChild(Snap.parse(item).node);
35336             }
35337           }
35338           return new Fragment(f);
35339         };
35340
35341         function make(name, parent) {
35342           var res = $(name);
35343           parent.appendChild(res);
35344           var el = wrap(res);
35345           return el;
35346         }
35347
35348         function Paper(w, h) {
35349           var res,
35350             desc,
35351             defs,
35352             proto = Paper.prototype;
35353           if (w && w.tagName == "svg") {
35354             if (w.snap in hub) {
35355               return hub[w.snap];
35356             }
35357             var doc = w.ownerDocument;
35358             res = new Element(w);
35359             desc = w.getElementsByTagName("desc")[0];
35360             defs = w.getElementsByTagName("defs")[0];
35361             if (!desc) {
35362               desc = $("desc");
35363               desc.appendChild(doc.createTextNode("Created with Snap"));
35364               res.node.appendChild(desc);
35365             }
35366             if (!defs) {
35367               defs = $("defs");
35368               res.node.appendChild(defs);
35369             }
35370             res.defs = defs;
35371             for (var key in proto)
35372               if (proto[has](key)) {
35373                 res[key] = proto[key];
35374               }
35375             res.paper = res.root = res;
35376           } else {
35377             res = make("svg", glob.doc.body);
35378             $(res.node, {
35379               height: h,
35380               version: 1.1,
35381               width: w,
35382               xmlns: xmlns
35383             });
35384           }
35385           return res;
35386         }
35387
35388         function wrap(dom) {
35389           if (!dom) {
35390             return dom;
35391           }
35392           if (dom instanceof Element || dom instanceof Fragment) {
35393             return dom;
35394           }
35395           if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
35396             return new Paper(dom);
35397           }
35398           if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
35399             return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
35400           }
35401           return new Element(dom);
35402         }
35403
35404         Snap._.make = make;
35405         Snap._.wrap = wrap;
35406         /*
35407          * \ Paper.el [ method ] * Creates an element on paper with a given name and no
35408          * attributes * - name (string) tag name - attr (object) attributes = (Element)
35409          * the current element > Usage | var c = paper.circle(10, 10, 10); // is the
35410          * same as... | var c = paper.el("circle").attr({ | cx: 10, | cy: 10, | r: 10 |
35411          * }); | // and the same as | var c = paper.el("circle", { | cx: 10, | cy: 10, |
35412          * r: 10 | }); \
35413          */
35414         Paper.prototype.el = function(name, attr) {
35415           var el = make(name, this.node);
35416           attr && el.attr(attr);
35417           return el;
35418         };
35419         // default
35420         eve.on("snap.util.getattr", function() {
35421           var att = eve.nt();
35422           att = att.substring(att.lastIndexOf(".") + 1);
35423           var css = att.replace(/[A-Z]/g, function(letter) {
35424             return "-" + letter.toLowerCase();
35425           });
35426           if (cssAttr[has](css)) {
35427             return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
35428           } else {
35429             return $(this.node, att);
35430           }
35431         });
35432         var cssAttr = {
35433           "alignment-baseline": 0,
35434           "baseline-shift": 0,
35435           "clip": 0,
35436           "clip-path": 0,
35437           "clip-rule": 0,
35438           "color": 0,
35439           "color-interpolation": 0,
35440           "color-interpolation-filters": 0,
35441           "color-profile": 0,
35442           "color-rendering": 0,
35443           "cursor": 0,
35444           "direction": 0,
35445           "display": 0,
35446           "dominant-baseline": 0,
35447           "enable-background": 0,
35448           "fill": 0,
35449           "fill-opacity": 0,
35450           "fill-rule": 0,
35451           "filter": 0,
35452           "flood-color": 0,
35453           "flood-opacity": 0,
35454           "font": 0,
35455           "font-family": 0,
35456           "font-size": 0,
35457           "font-size-adjust": 0,
35458           "font-stretch": 0,
35459           "font-style": 0,
35460           "font-variant": 0,
35461           "font-weight": 0,
35462           "glyph-orientation-horizontal": 0,
35463           "glyph-orientation-vertical": 0,
35464           "image-rendering": 0,
35465           "kerning": 0,
35466           "letter-spacing": 0,
35467           "lighting-color": 0,
35468           "marker": 0,
35469           "marker-end": 0,
35470           "marker-mid": 0,
35471           "marker-start": 0,
35472           "mask": 0,
35473           "opacity": 0,
35474           "overflow": 0,
35475           "pointer-events": 0,
35476           "shape-rendering": 0,
35477           "stop-color": 0,
35478           "stop-opacity": 0,
35479           "stroke": 0,
35480           "stroke-dasharray": 0,
35481           "stroke-dashoffset": 0,
35482           "stroke-linecap": 0,
35483           "stroke-linejoin": 0,
35484           "stroke-miterlimit": 0,
35485           "stroke-opacity": 0,
35486           "stroke-width": 0,
35487           "text-anchor": 0,
35488           "text-decoration": 0,
35489           "text-rendering": 0,
35490           "unicode-bidi": 0,
35491           "visibility": 0,
35492           "word-spacing": 0,
35493           "writing-mode": 0
35494         };
35495
35496         eve.on("snap.util.attr", function(value) {
35497           var att = eve.nt(),
35498             attr = {};
35499           att = att.substring(att.lastIndexOf(".") + 1);
35500           attr[att] = value;
35501           var style = att.replace(/-(\w)/gi, function(all, letter) {
35502               return letter.toUpperCase();
35503             }),
35504             css = att.replace(/[A-Z]/g, function(letter) {
35505               return "-" + letter.toLowerCase();
35506             });
35507           if (cssAttr[has](css)) {
35508             this.node.style[style] = value == null ? E : value;
35509           } else {
35510             $(this.node, attr);
35511           }
35512         });
35513         (function(proto) {}(Paper.prototype));
35514
35515         // simple ajax
35516         /*
35517          * \ Snap.ajax [ method ] * Simple implementation of Ajax * - url (string) URL -
35518          * postData (object|string) data for post request - callback (function) callback -
35519          * scope (object) #optional scope of callback or - url (string) URL - callback
35520          * (function) callback - scope (object) #optional scope of callback =
35521          * (XMLHttpRequest) the XMLHttpRequest object, just in case \
35522          */
35523         Snap.ajax = function(url, postData, callback, scope) {
35524           var req = new XMLHttpRequest,
35525             id = ID();
35526           if (req) {
35527             if (is(postData, "function")) {
35528               scope = callback;
35529               callback = postData;
35530               postData = null;
35531             } else if (is(postData, "object")) {
35532               var pd = [];
35533               for (var key in postData)
35534                 if (postData.hasOwnProperty(key)) {
35535                   pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
35536                 }
35537               postData = pd.join("&");
35538             }
35539             req.open((postData ? "POST" : "GET"), url, true);
35540             if (postData) {
35541               req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
35542               req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
35543             }
35544             if (callback) {
35545               eve.once("snap.ajax." + id + ".0", callback);
35546               eve.once("snap.ajax." + id + ".200", callback);
35547               eve.once("snap.ajax." + id + ".304", callback);
35548             }
35549             req.onreadystatechange = function() {
35550               if (req.readyState != 4) return;
35551               eve("snap.ajax." + id + "." + req.status, scope, req);
35552             };
35553             if (req.readyState == 4) {
35554               return req;
35555             }
35556             req.send(postData);
35557             return req;
35558           }
35559         };
35560         /*
35561          * \ Snap.load [ method ] * Loads external SVG file as a @Fragment (see
35562          * @Snap.ajax for more advanced AJAX) * - url (string) URL - callback (function)
35563          * callback - scope (object) #optional scope of callback \
35564          */
35565         Snap.load = function(url, callback, scope) {
35566           Snap.ajax(url, function(req) {
35567             var f = Snap.parse(req.responseText);
35568             scope ? callback.call(scope, f) : callback(f);
35569           });
35570         };
35571         var getOffset = function(elem) {
35572           var box = elem.getBoundingClientRect(),
35573             doc = elem.ownerDocument,
35574             body = doc.body,
35575             docElem = doc.documentElement,
35576             clientTop = docElem.clientTop || body.clientTop || 0,
35577             clientLeft = docElem.clientLeft || body.clientLeft || 0,
35578             top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,
35579             left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
35580           return {
35581             y: top,
35582             x: left
35583           };
35584         };
35585         /*
35586          * \ Snap.getElementByPoint [ method ] * Returns you topmost element under given
35587          * point. * = (object) Snap element object - x (number) x coordinate from the
35588          * top left corner of the window - y (number) y coordinate from the top left
35589          * corner of the window > Usage | Snap.getElementByPoint(mouseX,
35590          * mouseY).attr({stroke: "#f00"}); \
35591          */
35592         Snap.getElementByPoint = function(x, y) {
35593           var paper = this,
35594             svg = paper.canvas,
35595             target = glob.doc.elementFromPoint(x, y);
35596           if (glob.win.opera && target.tagName == "svg") {
35597             var so = getOffset(target),
35598               sr = target.createSVGRect();
35599             sr.x = x - so.x;
35600             sr.y = y - so.y;
35601             sr.width = sr.height = 1;
35602             var hits = target.getIntersectionList(sr, null);
35603             if (hits.length) {
35604               target = hits[hits.length - 1];
35605             }
35606           }
35607           if (!target) {
35608             return null;
35609           }
35610           return wrap(target);
35611         };
35612         /*
35613          * \ Snap.plugin [ method ] * Let you write plugins. You pass in a function with
35614          * four arguments, like this: | Snap.plugin(function (Snap, Element, Paper,
35615          * global, Fragment) { | Snap.newmethod = function () {}; |
35616          * Element.prototype.newmethod = function () {}; | Paper.prototype.newmethod =
35617          * function () {}; | }); Inside the function you have access to all main objects
35618          * (and their prototypes). This allow you to extend anything you want. * - f
35619          * (function) your plugin body \
35620          */
35621         Snap.plugin = function(f) {
35622           f(Snap, Element, Paper, glob, Fragment);
35623         };
35624         glob.win.Snap = Snap;
35625         return Snap;
35626       }(window || this));
35627       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
35628       //
35629       // Licensed under the Apache License, Version 2.0 (the "License");
35630       // you may not use this file except in compliance with the License.
35631       // You may obtain a copy of the License at
35632       //
35633       // http://www.apache.org/licenses/LICENSE-2.0
35634       //
35635       // Unless required by applicable law or agreed to in writing, software
35636       // distributed under the License is distributed on an "AS IS" BASIS,
35637       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35638       // See the License for the specific language governing permissions and
35639       // limitations under the License.
35640       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
35641         var elproto = Element.prototype,
35642           is = Snap.is,
35643           Str = String,
35644           unit2px = Snap._unit2px,
35645           $ = Snap._.$,
35646           make = Snap._.make,
35647           getSomeDefs = Snap._.getSomeDefs,
35648           has = "hasOwnProperty",
35649           wrap = Snap._.wrap;
35650         /*
35651          * \ Element.getBBox [ method ] * Returns the bounding box descriptor for
35652          * the given element * = (object) bounding box descriptor: o { o cx:
35653          * (number) x of the center, o cy: (number) x of the center, o h: (number)
35654          * height, o height: (number) height, o path: (string) path command for the
35655          * box, o r0: (number) radius of a circle that fully encloses the box, o r1:
35656          * (number) radius of the smallest circle that can be enclosed, o r2:
35657          * (number) radius of the largest circle that can be enclosed, o vb:
35658          * (string) box as a viewbox command, o w: (number) width, o width: (number)
35659          * width, o x2: (number) x of the right side, o x: (number) x of the left
35660          * side, o y2: (number) y of the bottom edge, o y: (number) y of the top
35661          * edge o } \
35662          */
35663         elproto.getBBox = function(isWithoutTransform) {
35664           if (!Snap.Matrix || !Snap.path) {
35665             return this.node.getBBox();
35666           }
35667           var el = this,
35668             m = new Snap.Matrix;
35669           if (el.removed) {
35670             return Snap._.box();
35671           }
35672           while (el.type == "use") {
35673             if (!isWithoutTransform) {
35674               m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
35675             }
35676             if (el.original) {
35677               el = el.original;
35678             } else {
35679               var href = el.attr("xlink:href");
35680               el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
35681             }
35682           }
35683           var _ = el._,
35684             pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
35685           try {
35686             if (isWithoutTransform) {
35687               _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
35688               return Snap._.box(_.bboxwt);
35689             } else {
35690               el.realPath = pathfinder(el);
35691               el.matrix = el.transform().localMatrix;
35692               _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
35693               return Snap._.box(_.bbox);
35694             }
35695           } catch (e) {
35696             // Firefox doesn’t give you bbox of hidden element
35697             return Snap._.box();
35698           }
35699         };
35700         var propString = function() {
35701           return this.string;
35702         };
35703
35704         function extractTransform(el, tstr) {
35705           if (tstr == null) {
35706             var doReturn = true;
35707             if (el.type == "linearGradient" || el.type == "radialGradient") {
35708               tstr = el.node.getAttribute("gradientTransform");
35709             } else if (el.type == "pattern") {
35710               tstr = el.node.getAttribute("patternTransform");
35711             } else {
35712               tstr = el.node.getAttribute("transform");
35713             }
35714             if (!tstr) {
35715               return new Snap.Matrix;
35716             }
35717             tstr = Snap._.svgTransform2string(tstr);
35718           } else {
35719             if (!Snap._.rgTransform.test(tstr)) {
35720               tstr = Snap._.svgTransform2string(tstr);
35721             } else {
35722               tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
35723             }
35724             if (is(tstr, "array")) {
35725               tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
35726             }
35727             el._.transform = tstr;
35728           }
35729           var m = Snap._.transform2matrix(tstr, el.getBBox(1));
35730           if (doReturn) {
35731             return m;
35732           } else {
35733             el.matrix = m;
35734           }
35735         }
35736         /*
35737          * \ Element.transform [ method ] * Gets or sets transformation of the
35738          * element * - tstr (string) transform string in Snap or SVG format =
35739          * (Element) the current element or = (object) transformation descriptor: o {
35740          * o string (string) transform string, o globalMatrix (Matrix) matrix of all
35741          * transformations applied to element or its parents, o localMatrix (Matrix)
35742          * matrix of transformations applied only to the element, o diffMatrix
35743          * (Matrix) matrix of difference between global and local transformations, o
35744          * global (string) global transformation as string, o local (string) local
35745          * transformation as string, o toString (function) returns `string` property
35746          * o } \
35747          */
35748         elproto.transform = function(tstr) {
35749           var _ = this._;
35750           if (tstr == null) {
35751             var papa = this,
35752               global = new Snap.Matrix(this.node.getCTM()),
35753               local = extractTransform(this),
35754               ms = [local],
35755               m = new Snap.Matrix,
35756               i,
35757               localString = local.toTransformString(),
35758               string = Str(local) == Str(this.matrix) ?
35759               Str(_.transform) : localString;
35760             while (papa.type != "svg" && (papa = papa.parent())) {
35761               ms.push(extractTransform(papa));
35762             }
35763             i = ms.length;
35764             while (i--) {
35765               m.add(ms[i]);
35766             }
35767             return {
35768               string: string,
35769               globalMatrix: global,
35770               totalMatrix: m,
35771               localMatrix: local,
35772               diffMatrix: global.clone().add(local.invert()),
35773               global: global.toTransformString(),
35774               total: m.toTransformString(),
35775               local: localString,
35776               toString: propString
35777             };
35778           }
35779           if (tstr instanceof Snap.Matrix) {
35780             this.matrix = tstr;
35781             this._.transform = tstr.toTransformString();
35782           } else {
35783             extractTransform(this, tstr);
35784           }
35785
35786           if (this.node) {
35787             if (this.type == "linearGradient" || this.type == "radialGradient") {
35788               $(this.node, {
35789                 gradientTransform: this.matrix
35790               });
35791             } else if (this.type == "pattern") {
35792               $(this.node, {
35793                 patternTransform: this.matrix
35794               });
35795             } else {
35796               $(this.node, {
35797                 transform: this.matrix
35798               });
35799             }
35800           }
35801
35802           return this;
35803         };
35804         /*
35805          * \ Element.parent [ method ] * Returns the element's parent * = (Element)
35806          * the parent element \
35807          */
35808         elproto.parent = function() {
35809           return wrap(this.node.parentNode);
35810         };
35811         /*
35812          * \ Element.append [ method ] * Appends the given element to current one * -
35813          * el (Element|Set) element to append = (Element) the parent element \
35814          */
35815         /*
35816          * \ Element.add [ method ] * See @Element.append \
35817          */
35818         elproto.append = elproto.add = function(el) {
35819           if (el) {
35820             if (el.type == "set") {
35821               var it = this;
35822               el.forEach(function(el) {
35823                 it.add(el);
35824               });
35825               return this;
35826             }
35827             el = wrap(el);
35828             this.node.appendChild(el.node);
35829             el.paper = this.paper;
35830           }
35831           return this;
35832         };
35833         /*
35834          * \ Element.appendTo [ method ] * Appends the current element to the given
35835          * one * - el (Element) parent element to append to = (Element) the child
35836          * element \
35837          */
35838         elproto.appendTo = function(el) {
35839           if (el) {
35840             el = wrap(el);
35841             el.append(this);
35842           }
35843           return this;
35844         };
35845         /*
35846          * \ Element.prepend [ method ] * Prepends the given element to the current
35847          * one * - el (Element) element to prepend = (Element) the parent element \
35848          */
35849         elproto.prepend = function(el) {
35850           if (el) {
35851             if (el.type == "set") {
35852               var it = this,
35853                 first;
35854               el.forEach(function(el) {
35855                 if (first) {
35856                   first.after(el);
35857                 } else {
35858                   it.prepend(el);
35859                 }
35860                 first = el;
35861               });
35862               return this;
35863             }
35864             el = wrap(el);
35865             var parent = el.parent();
35866             this.node.insertBefore(el.node, this.node.firstChild);
35867             this.add && this.add();
35868             el.paper = this.paper;
35869             this.parent() && this.parent().add();
35870             parent && parent.add();
35871           }
35872           return this;
35873         };
35874         /*
35875          * \ Element.prependTo [ method ] * Prepends the current element to the
35876          * given one * - el (Element) parent element to prepend to = (Element) the
35877          * child element \
35878          */
35879         elproto.prependTo = function(el) {
35880           el = wrap(el);
35881           el.prepend(this);
35882           return this;
35883         };
35884         /*
35885          * \ Element.before [ method ] * Inserts given element before the current
35886          * one * - el (Element) element to insert = (Element) the parent element \
35887          */
35888         elproto.before = function(el) {
35889           if (el.type == "set") {
35890             var it = this;
35891             el.forEach(function(el) {
35892               var parent = el.parent();
35893               it.node.parentNode.insertBefore(el.node, it.node);
35894               parent && parent.add();
35895             });
35896             this.parent().add();
35897             return this;
35898           }
35899           el = wrap(el);
35900           var parent = el.parent();
35901           this.node.parentNode.insertBefore(el.node, this.node);
35902           this.parent() && this.parent().add();
35903           parent && parent.add();
35904           el.paper = this.paper;
35905           return this;
35906         };
35907         /*
35908          * \ Element.after [ method ] * Inserts given element after the current one * -
35909          * el (Element) element to insert = (Element) the parent element \
35910          */
35911         elproto.after = function(el) {
35912           el = wrap(el);
35913           var parent = el.parent();
35914           if (this.node.nextSibling) {
35915             this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
35916           } else {
35917             this.node.parentNode.appendChild(el.node);
35918           }
35919           this.parent() && this.parent().add();
35920           parent && parent.add();
35921           el.paper = this.paper;
35922           return this;
35923         };
35924         /*
35925          * \ Element.insertBefore [ method ] * Inserts the element after the given
35926          * one * - el (Element) element next to whom insert to = (Element) the
35927          * parent element \
35928          */
35929         elproto.insertBefore = function(el) {
35930           el = wrap(el);
35931           var parent = this.parent();
35932           el.node.parentNode.insertBefore(this.node, el.node);
35933           this.paper = el.paper;
35934           parent && parent.add();
35935           el.parent() && el.parent().add();
35936           return this;
35937         };
35938         /*
35939          * \ Element.insertAfter [ method ] * Inserts the element after the given
35940          * one * - el (Element) element next to whom insert to = (Element) the
35941          * parent element \
35942          */
35943         elproto.insertAfter = function(el) {
35944           el = wrap(el);
35945           var parent = this.parent();
35946           el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
35947           this.paper = el.paper;
35948           parent && parent.add();
35949           el.parent() && el.parent().add();
35950           return this;
35951         };
35952         /*
35953          * \ Element.remove [ method ] * Removes element from the DOM = (Element)
35954          * the detached element \
35955          */
35956         elproto.remove = function() {
35957           var parent = this.parent();
35958           this.node.parentNode && this.node.parentNode.removeChild(this.node);
35959           delete this.paper;
35960           this.removed = true;
35961           parent && parent.add();
35962           return this;
35963         };
35964         /*
35965          * \ Element.select [ method ] * Gathers the nested @Element matching the
35966          * given set of CSS selectors * - query (string) CSS selector = (Element)
35967          * result of query selection \
35968          */
35969         elproto.select = function(query) {
35970           query = Str(query).replace(/([^\\]):/g, "$1\\:");
35971           return wrap(this.node.querySelector(query));
35972         };
35973         /*
35974          * \ Element.selectAll [ method ] * Gathers nested @Element objects matching
35975          * the given set of CSS selectors * - query (string) CSS selector =
35976          * (Set|array) result of query selection \
35977          */
35978         elproto.selectAll = function(query) {
35979           var nodelist = this.node.querySelectorAll(query),
35980             set = (Snap.set || Array)();
35981           for (var i = 0; i < nodelist.length; i++) {
35982             set.push(wrap(nodelist[i]));
35983           }
35984           return set;
35985         };
35986         /*
35987          * \ Element.asPX [ method ] * Returns given attribute of the element as a
35988          * `px` value (not %, em, etc.) * - attr (string) attribute name - value
35989          * (string) #optional attribute value = (Element) result of query selection \
35990          */
35991         elproto.asPX = function(attr, value) {
35992           if (value == null) {
35993             value = this.attr(attr);
35994           }
35995           return +unit2px(this, attr, value);
35996         };
35997         // SIERRA Element.use(): I suggest adding a note about how to access the
35998         // original element the returned <use> instantiates. It's a part of SVG with
35999         // which ordinary web developers may be least familiar.
36000         /*
36001          * \ Element.use [ method ] * Creates a `<use>` element linked to the
36002          * current element * = (Element) the `<use>` element \
36003          */
36004         elproto.use = function() {
36005           var use,
36006             id = this.node.id;
36007           if (!id) {
36008             id = this.id;
36009             $(this.node, {
36010               id: id
36011             });
36012           }
36013           if (this.type == "linearGradient" || this.type == "radialGradient" ||
36014             this.type == "pattern") {
36015             use = make(this.type, this.node.parentNode);
36016           } else {
36017             use = make("use", this.node.parentNode);
36018           }
36019           $(use.node, {
36020             "xlink:href": "#" + id
36021           });
36022           use.original = this;
36023           return use;
36024         };
36025
36026         function fixids(el) {
36027           var els = el.selectAll("*"),
36028             it,
36029             url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
36030             ids = [],
36031             uses = {};
36032
36033           function urltest(it, name) {
36034             var val = $(it.node, name);
36035             val = val && val.match(url);
36036             val = val && val[2];
36037             if (val && val.charAt() == "#") {
36038               val = val.substring(1);
36039             } else {
36040               return;
36041             }
36042             if (val) {
36043               uses[val] = (uses[val] || []).concat(function(id) {
36044                 var attr = {};
36045                 attr[name] = URL(id);
36046                 $(it.node, attr);
36047               });
36048             }
36049           }
36050
36051           function linktest(it) {
36052             var val = $(it.node, "xlink:href");
36053             if (val && val.charAt() == "#") {
36054               val = val.substring(1);
36055             } else {
36056               return;
36057             }
36058             if (val) {
36059               uses[val] = (uses[val] || []).concat(function(id) {
36060                 it.attr("xlink:href", "#" + id);
36061               });
36062             }
36063           }
36064           for (var i = 0, ii = els.length; i < ii; i++) {
36065             it = els[i];
36066             urltest(it, "fill");
36067             urltest(it, "stroke");
36068             urltest(it, "filter");
36069             urltest(it, "mask");
36070             urltest(it, "clip-path");
36071             linktest(it);
36072             var oldid = $(it.node, "id");
36073             if (oldid) {
36074               $(it.node, {
36075                 id: it.id
36076               });
36077               ids.push({
36078                 old: oldid,
36079                 id: it.id
36080               });
36081             }
36082           }
36083           for (i = 0, ii = ids.length; i < ii; i++) {
36084             var fs = uses[ids[i].old];
36085             if (fs) {
36086               for (var j = 0, jj = fs.length; j < jj; j++) {
36087                 fs[j](ids[i].id);
36088               }
36089             }
36090           }
36091         }
36092         /*
36093          * \ Element.clone [ method ] * Creates a clone of the element and inserts
36094          * it after the element * = (Element) the clone \
36095          */
36096         elproto.clone = function() {
36097           var clone = wrap(this.node.cloneNode(true));
36098           if ($(clone.node, "id")) {
36099             $(clone.node, {
36100               id: clone.id
36101             });
36102           }
36103           fixids(clone);
36104           clone.insertAfter(this);
36105           return clone;
36106         };
36107         /*
36108          * \ Element.toDefs [ method ] * Moves element to the shared `<defs>` area * =
36109          * (Element) the element \
36110          */
36111         elproto.toDefs = function() {
36112           var defs = getSomeDefs(this);
36113           defs.appendChild(this.node);
36114           return this;
36115         };
36116         /*
36117          * \ Element.toPattern [ method ] * Creates a `<pattern>` element from the
36118          * current element * To create a pattern you have to specify the pattern
36119          * rect: - x (string|number) - y (string|number) - width (string|number) -
36120          * height (string|number) = (Element) the `<pattern>` element You can use
36121          * pattern later on as an argument for `fill` attribute: | var p =
36122          * paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({ | fill: "none", |
36123          * stroke: "#bada55", | strokeWidth: 5 | }).pattern(0, 0, 10, 10), | c =
36124          * paper.circle(200, 200, 100); | c.attr({ | fill: p | }); \
36125          */
36126         elproto.pattern = elproto.toPattern = function(x, y, width, height) {
36127           var p = make("pattern", getSomeDefs(this));
36128           if (x == null) {
36129             x = this.getBBox();
36130           }
36131           if (is(x, "object") && "x" in x) {
36132             y = x.y;
36133             width = x.width;
36134             height = x.height;
36135             x = x.x;
36136           }
36137           $(p.node, {
36138             x: x,
36139             y: y,
36140             width: width,
36141             height: height,
36142             patternUnits: "userSpaceOnUse",
36143             id: p.id,
36144             viewBox: [x, y, width, height].join(" ")
36145           });
36146           p.node.appendChild(this.node);
36147           return p;
36148         };
36149         // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you
36150         // offset the object from its edge such as when centering it over a path.
36151         // SIERRA Element.marker(): I suggest the method should accept default reference
36152         // point values. Perhaps centered with (refX = width/2) and (refY = height/2)?
36153         // Also, couldn't it assume the element's current _width_ and _height_? And
36154         // please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't
36155         // they also be assigned default values?
36156         /*
36157          * \ Element.marker [ method ] * Creates a `<marker>` element from the
36158          * current element * To create a marker you have to specify the bounding
36159          * rect and reference point: - x (number) - y (number) - width (number) -
36160          * height (number) - refX (number) - refY (number) = (Element) the `<marker>`
36161          * element You can specify the marker later as an argument for
36162          * `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The
36163          * `marker` attribute places the marker at every point along the path, and
36164          * `marker-mid` places them at every point except the start and end. \
36165          */
36166         // TODO add usage for markers
36167         elproto.marker = function(x, y, width, height, refX, refY) {
36168           var p = make("marker", getSomeDefs(this));
36169           if (x == null) {
36170             x = this.getBBox();
36171           }
36172           if (is(x, "object") && "x" in x) {
36173             y = x.y;
36174             width = x.width;
36175             height = x.height;
36176             refX = x.refX || x.cx;
36177             refY = x.refY || x.cy;
36178             x = x.x;
36179           }
36180           $(p.node, {
36181             viewBox: [x, y, width, height].join(" "),
36182             markerWidth: width,
36183             markerHeight: height,
36184             orient: "auto",
36185             refX: refX || 0,
36186             refY: refY || 0,
36187             id: p.id
36188           });
36189           p.node.appendChild(this.node);
36190           return p;
36191         };
36192         // animation
36193         function slice(from, to, f) {
36194           return function(arr) {
36195             var res = arr.slice(from, to);
36196             if (res.length == 1) {
36197               res = res[0];
36198             }
36199             return f ? f(res) : res;
36200           };
36201         }
36202         var Animation = function(attr, ms, easing, callback) {
36203           if (typeof easing == "function" && !easing.length) {
36204             callback = easing;
36205             easing = mina.linear;
36206           }
36207           this.attr = attr;
36208           this.dur = ms;
36209           easing && (this.easing = easing);
36210           callback && (this.callback = callback);
36211         };
36212         Snap._.Animation = Animation;
36213         /*
36214          * \ Snap.animation [ method ] * Creates an animation object * - attr
36215          * (object) attributes of final destination - duration (number) duration of
36216          * the animation, in milliseconds - easing (function) #optional one of
36217          * easing functions of @mina or custom one - callback (function) #optional
36218          * callback function that fires when animation ends = (object) animation
36219          * object \
36220          */
36221         Snap.animation = function(attr, ms, easing, callback) {
36222           return new Animation(attr, ms, easing, callback);
36223         };
36224         /*
36225          * \ Element.inAnim [ method ] * Returns a set of animations that may be
36226          * able to manipulate the current element * = (object) in format: o { o anim
36227          * (object) animation object, o mina (object) @mina object, o curStatus
36228          * (number) 0..1 ÃƒÆ’¢â‚¬â€� status of the animation: 0 ÃƒÆ’¢â‚¬â€� just started,
36229          * 1 ÃƒÆ’¢â‚¬â€� just finished, o status (function) gets or sets the status of
36230          * the animation, o stop (function) stops the animation o } \
36231          */
36232         elproto.inAnim = function() {
36233           var el = this,
36234             res = [];
36235           for (var id in el.anims)
36236             if (el.anims[has](id)) {
36237               (function(a) {
36238                 res.push({
36239                   anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
36240                   mina: a,
36241                   curStatus: a.status(),
36242                   status: function(val) {
36243                     return a.status(val);
36244                   },
36245                   stop: function() {
36246                     a.stop();
36247                   }
36248                 });
36249               }(el.anims[id]));
36250             }
36251           return res;
36252         };
36253         /*
36254          * \ Snap.animate [ method ] * Runs generic animation of one number into
36255          * another with a caring function * - from (number|array) number or array of
36256          * numbers - to (number|array) number or array of numbers - setter
36257          * (function) caring function that accepts one number argument - duration
36258          * (number) duration, in milliseconds - easing (function) #optional easing
36259          * function from @mina or custom - callback (function) #optional callback
36260          * function to execute when animation ends = (object) animation object in
36261          * @mina format o { o id (string) animation id, consider it read-only, o
36262          * duration (function) gets or sets the duration of the animation, o easing
36263          * (function) easing, o speed (function) gets or sets the speed of the
36264          * animation, o status (function) gets or sets the status of the animation,
36265          * o stop (function) stops the animation o } | var rect = Snap().rect(0, 0,
36266          * 10, 10); | Snap.animate(0, 10, function (val) { | rect.attr({ | x: val |
36267          * }); | }, 1000); | // in given context is equivalent to | rect.animate({x:
36268          * 10}, 1000); \
36269          */
36270         Snap.animate = function(from, to, setter, ms, easing, callback) {
36271           if (typeof easing == "function" && !easing.length) {
36272             callback = easing;
36273             easing = mina.linear;
36274           }
36275           var now = mina.time(),
36276             anim = mina(from, to, now, now + ms, mina.time, setter, easing);
36277           callback && eve.once("mina.finish." + anim.id, callback);
36278           return anim;
36279         };
36280         /*
36281          * \ Element.stop [ method ] * Stops all the animations for the current
36282          * element * = (Element) the current element \
36283          */
36284         elproto.stop = function() {
36285           var anims = this.inAnim();
36286           for (var i = 0, ii = anims.length; i < ii; i++) {
36287             anims[i].stop();
36288           }
36289           return this;
36290         };
36291         /*
36292          * \ Element.animate [ method ] * Animates the given attributes of the
36293          * element * - attrs (object) key-value pairs of destination attributes -
36294          * duration (number) duration of the animation in milliseconds - easing
36295          * (function) #optional easing function from @mina or custom - callback
36296          * (function) #optional callback function that executes when the animation
36297          * ends = (Element) the current element \
36298          */
36299         elproto.animate = function(attrs, ms, easing, callback) {
36300           if (typeof easing == "function" && !easing.length) {
36301             callback = easing;
36302             easing = mina.linear;
36303           }
36304           if (attrs instanceof Animation) {
36305             callback = attrs.callback;
36306             easing = attrs.easing;
36307             ms = easing.dur;
36308             attrs = attrs.attr;
36309           }
36310           var fkeys = [],
36311             tkeys = [],
36312             keys = {},
36313             from, to, f, eq,
36314             el = this;
36315           for (var key in attrs)
36316             if (attrs[has](key)) {
36317               if (el.equal) {
36318                 eq = el.equal(key, Str(attrs[key]));
36319                 from = eq.from;
36320                 to = eq.to;
36321                 f = eq.f;
36322               } else {
36323                 from = +el.attr(key);
36324                 to = +attrs[key];
36325               }
36326               var len = is(from, "array") ? from.length : 1;
36327               keys[key] = slice(fkeys.length, fkeys.length + len, f);
36328               fkeys = fkeys.concat(from);
36329               tkeys = tkeys.concat(to);
36330             }
36331           var now = mina.time(),
36332             anim = mina(fkeys, tkeys, now, now + ms, mina.time, function(val) {
36333               var attr = {};
36334               for (var key in keys)
36335                 if (keys[has](key)) {
36336                   attr[key] = keys[key](val);
36337                 }
36338               el.attr(attr);
36339             }, easing);
36340           el.anims[anim.id] = anim;
36341           anim._attrs = attrs;
36342           anim._callback = callback;
36343           eve("snap.animcreated." + el.id, anim);
36344           eve.once("mina.finish." + anim.id, function() {
36345             delete el.anims[anim.id];
36346             callback && callback.call(el);
36347           });
36348           eve.once("mina.stop." + anim.id, function() {
36349             delete el.anims[anim.id];
36350           });
36351           return el;
36352         };
36353         var eldata = {};
36354         /*
36355          * \ Element.data [ method ] * Adds or retrieves given value associated with
36356          * given key. (Don’t confuse with `data-` attributes)
36357          *
36358          * See also @Element.removeData - key (string) key to store data - value
36359          * (any) #optional value to store = (object) @Element or, if value is not
36360          * specified: = (any) value > Usage | for (var i = 0, i < 5, i++) { |
36361          * paper.circle(10 + 15 * i, 10, 10) | .attr({fill: "#000"}) | .data("i", i) |
36362          * .click(function () { | alert(this.data("i")); | }); | } \
36363          */
36364         elproto.data = function(key, value) {
36365           var data = eldata[this.id] = eldata[this.id] || {};
36366           if (arguments.length == 0) {
36367             eve("snap.data.get." + this.id, this, data, null);
36368             return data;
36369           }
36370           if (arguments.length == 1) {
36371             if (Snap.is(key, "object")) {
36372               for (var i in key)
36373                 if (key[has](i)) {
36374                   this.data(i, key[i]);
36375                 }
36376               return this;
36377             }
36378             eve("snap.data.get." + this.id, this, data[key], key);
36379             return data[key];
36380           }
36381           data[key] = value;
36382           eve("snap.data.set." + this.id, this, value, key);
36383           return this;
36384         };
36385         /*
36386          * \ Element.removeData [ method ] * Removes value associated with an
36387          * element by given key. If key is not provided, removes all the data of the
36388          * element. - key (string) #optional key = (object) @Element \
36389          */
36390         elproto.removeData = function(key) {
36391           if (key == null) {
36392             eldata[this.id] = {};
36393           } else {
36394             eldata[this.id] && delete eldata[this.id][key];
36395           }
36396           return this;
36397         };
36398         /*
36399          * \ Element.outerSVG [ method ] * Returns SVG code for the element,
36400          * equivalent to HTML's `outerHTML`.
36401          *
36402          * See also @Element.innerSVG = (string) SVG code for the element \
36403          */
36404         /*
36405          * \ Element.toString [ method ] * See @Element.outerSVG \
36406          */
36407         elproto.outerSVG = elproto.toString = toString(1);
36408         /*
36409          * \ Element.innerSVG [ method ] * Returns SVG code for the element's
36410          * contents, equivalent to HTML's `innerHTML` = (string) SVG code for the
36411          * element \
36412          */
36413         elproto.innerSVG = toString();
36414
36415         function toString(type) {
36416           return function() {
36417             var res = type ? "<" + this.type : "",
36418               attr = this.node.attributes,
36419               chld = this.node.childNodes;
36420             if (type) {
36421               for (var i = 0, ii = attr.length; i < ii; i++) {
36422                 res += " " + attr[i].name + '="' +
36423                   attr[i].value.replace(/"/g, '\\"') + '"';
36424               }
36425             }
36426             if (chld.length) {
36427               type && (res += ">");
36428               for (i = 0, ii = chld.length; i < ii; i++) {
36429                 if (chld[i].nodeType == 3) {
36430                   res += chld[i].nodeValue;
36431                 } else if (chld[i].nodeType == 1) {
36432                   res += wrap(chld[i]).toString();
36433                 }
36434               }
36435               type && (res += "</" + this.type + ">");
36436             } else {
36437               type && (res += "/>");
36438             }
36439             return res;
36440           };
36441         }
36442         elproto.toDataURL = function() {
36443           if (window && window.btoa) {
36444             var bb = this.getBBox(),
36445               svg = Snap.format('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="{width}" height="{height}" viewBox="{x} {y} {width} {height}">{contents}</svg>', {
36446                 x: +bb.x.toFixed(3),
36447                 y: +bb.y.toFixed(3),
36448                 width: +bb.width.toFixed(3),
36449                 height: +bb.height.toFixed(3),
36450                 contents: this.outerSVG()
36451               });
36452             return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
36453           }
36454         };
36455         /*
36456          * \ Fragment.select [ method ] * See @Element.select \
36457          */
36458         Fragment.prototype.select = elproto.select;
36459         /*
36460          * \ Fragment.selectAll [ method ] * See @Element.selectAll \
36461          */
36462         Fragment.prototype.selectAll = elproto.selectAll;
36463       });
36464
36465       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36466       //
36467       // Licensed under the Apache License, Version 2.0 (the "License");
36468       // you may not use this file except in compliance with the License.
36469       // You may obtain a copy of the License at
36470       //
36471       // http://www.apache.org/licenses/LICENSE-2.0
36472       //
36473       // Unless required by applicable law or agreed to in writing, software
36474       // distributed under the License is distributed on an "AS IS" BASIS,
36475       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36476       // See the License for the specific language governing permissions and
36477       // limitations under the License.
36478       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36479         var objectToString = Object.prototype.toString,
36480           Str = String,
36481           math = Math,
36482           E = "";
36483
36484         function Matrix(a, b, c, d, e, f) {
36485           if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
36486             this.a = a.a;
36487             this.b = a.b;
36488             this.c = a.c;
36489             this.d = a.d;
36490             this.e = a.e;
36491             this.f = a.f;
36492             return;
36493           }
36494           if (a != null) {
36495             this.a = +a;
36496             this.b = +b;
36497             this.c = +c;
36498             this.d = +d;
36499             this.e = +e;
36500             this.f = +f;
36501           } else {
36502             this.a = 1;
36503             this.b = 0;
36504             this.c = 0;
36505             this.d = 1;
36506             this.e = 0;
36507             this.f = 0;
36508           }
36509         }
36510         (function(matrixproto) {
36511           /*
36512            * \ Matrix.add [ method ] * Adds the given matrix to existing one - a
36513            * (number) - b (number) - c (number) - d (number) - e (number) - f
36514            * (number) or - matrix (object) @Matrix \
36515            */
36516           matrixproto.add = function(a, b, c, d, e, f) {
36517             var out = [
36518                 [],
36519                 [],
36520                 []
36521               ],
36522               m = [
36523                 [this.a, this.c, this.e],
36524                 [this.b, this.d, this.f],
36525                 [0, 0, 1]
36526               ],
36527               matrix = [
36528                 [a, c, e],
36529                 [b, d, f],
36530                 [0, 0, 1]
36531               ],
36532               x, y, z, res;
36533
36534             if (a && a instanceof Matrix) {
36535               matrix = [
36536                 [a.a, a.c, a.e],
36537                 [a.b, a.d, a.f],
36538                 [0, 0, 1]
36539               ];
36540             }
36541
36542             for (x = 0; x < 3; x++) {
36543               for (y = 0; y < 3; y++) {
36544                 res = 0;
36545                 for (z = 0; z < 3; z++) {
36546                   res += m[x][z] * matrix[z][y];
36547                 }
36548                 out[x][y] = res;
36549               }
36550             }
36551             this.a = out[0][0];
36552             this.b = out[1][0];
36553             this.c = out[0][1];
36554             this.d = out[1][1];
36555             this.e = out[0][2];
36556             this.f = out[1][2];
36557             return this;
36558           };
36559           /*
36560            * \ Matrix.invert [ method ] * Returns an inverted version of the
36561            * matrix = (object) @Matrix \
36562            */
36563           matrixproto.invert = function() {
36564             var me = this,
36565               x = me.a * me.d - me.b * me.c;
36566             return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
36567           };
36568           /*
36569            * \ Matrix.clone [ method ] * Returns a copy of the matrix = (object)
36570            * @Matrix \
36571            */
36572           matrixproto.clone = function() {
36573             return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
36574           };
36575           /*
36576            * \ Matrix.translate [ method ] * Translate the matrix - x (number)
36577            * horizontal offset distance - y (number) vertical offset distance \
36578            */
36579           matrixproto.translate = function(x, y) {
36580             return this.add(1, 0, 0, 1, x, y);
36581           };
36582           /*
36583            * \ Matrix.scale [ method ] * Scales the matrix - x (number) amount to
36584            * be scaled, with `1` resulting in no change - y (number) #optional
36585            * amount to scale along the vertical axis. (Otherwise `x` applies to
36586            * both axes.) - cx (number) #optional horizontal origin point from
36587            * which to scale - cy (number) #optional vertical origin point from
36588            * which to scale Default cx, cy is the middle point of the element. \
36589            */
36590           matrixproto.scale = function(x, y, cx, cy) {
36591             y == null && (y = x);
36592             (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
36593             this.add(x, 0, 0, y, 0, 0);
36594             (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
36595             return this;
36596           };
36597           /*
36598            * \ Matrix.rotate [ method ] * Rotates the matrix - a (number) angle of
36599            * rotation, in degrees - x (number) horizontal origin point from which
36600            * to rotate - y (number) vertical origin point from which to rotate \
36601            */
36602           matrixproto.rotate = function(a, x, y) {
36603             a = Snap.rad(a);
36604             x = x || 0;
36605             y = y || 0;
36606             var cos = +math.cos(a).toFixed(9),
36607               sin = +math.sin(a).toFixed(9);
36608             this.add(cos, sin, -sin, cos, x, y);
36609             return this.add(1, 0, 0, 1, -x, -y);
36610           };
36611           /*
36612            * \ Matrix.x [ method ] * Returns x coordinate for given point after
36613            * transformation described by the matrix. See also @Matrix.y - x
36614            * (number) - y (number) = (number) x \
36615            */
36616           matrixproto.x = function(x, y) {
36617             return x * this.a + y * this.c + this.e;
36618           };
36619           /*
36620            * \ Matrix.y [ method ] * Returns y coordinate for given point after
36621            * transformation described by the matrix. See also @Matrix.x - x
36622            * (number) - y (number) = (number) y \
36623            */
36624           matrixproto.y = function(x, y) {
36625             return x * this.b + y * this.d + this.f;
36626           };
36627           matrixproto.get = function(i) {
36628             return +this[Str.fromCharCode(97 + i)].toFixed(4);
36629           };
36630           matrixproto.toString = function() {
36631             return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
36632           };
36633           matrixproto.offset = function() {
36634             return [this.e.toFixed(4), this.f.toFixed(4)];
36635           };
36636
36637           function norm(a) {
36638             return a[0] * a[0] + a[1] * a[1];
36639           }
36640
36641           function normalize(a) {
36642             var mag = math.sqrt(norm(a));
36643             a[0] && (a[0] /= mag);
36644             a[1] && (a[1] /= mag);
36645           }
36646           /*
36647            * \ Matrix.determinant [ method ] * Finds determinant of the given
36648            * matrix. = (number) determinant \
36649            */
36650           matrixproto.determinant = function() {
36651             return this.a * this.d - this.b * this.c;
36652           };
36653           /*
36654            * \ Matrix.split [ method ] * Splits matrix into primitive
36655            * transformations = (object) in format: o dx (number) translation by x
36656            * o dy (number) translation by y o scalex (number) scale by x o scaley
36657            * (number) scale by y o shear (number) shear o rotate (number) rotation
36658            * in deg o isSimple (boolean) could it be represented via simple
36659            * transformations \
36660            */
36661           matrixproto.split = function() {
36662             var out = {};
36663             // translation
36664             out.dx = this.e;
36665             out.dy = this.f;
36666
36667             // scale and shear
36668             var row = [
36669               [this.a, this.c],
36670               [this.b, this.d]
36671             ];
36672             out.scalex = math.sqrt(norm(row[0]));
36673             normalize(row[0]);
36674
36675             out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
36676             row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
36677
36678             out.scaley = math.sqrt(norm(row[1]));
36679             normalize(row[1]);
36680             out.shear /= out.scaley;
36681
36682             if (this.determinant() < 0) {
36683               out.scalex = -out.scalex;
36684             }
36685
36686             // rotation
36687             var sin = -row[0][1],
36688               cos = row[1][1];
36689             if (cos < 0) {
36690               out.rotate = Snap.deg(math.acos(cos));
36691               if (sin < 0) {
36692                 out.rotate = 360 - out.rotate;
36693               }
36694             } else {
36695               out.rotate = Snap.deg(math.asin(sin));
36696             }
36697
36698             out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
36699             out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
36700             out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
36701             return out;
36702           };
36703           /*
36704            * \ Matrix.toTransformString [ method ] * Returns transform string that
36705            * represents given matrix = (string) transform string \
36706            */
36707           matrixproto.toTransformString = function(shorter) {
36708             var s = shorter || this.split();
36709             if (!+s.shear.toFixed(9)) {
36710               s.scalex = +s.scalex.toFixed(4);
36711               s.scaley = +s.scaley.toFixed(4);
36712               s.rotate = +s.rotate.toFixed(4);
36713               return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
36714                 (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
36715                 (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
36716             } else {
36717               return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
36718             }
36719           };
36720         })(Matrix.prototype);
36721         /*
36722          * \ Snap.Matrix [ method ] * Matrix constructor, extend on your own risk.
36723          * To create matrices use @Snap.matrix. \
36724          */
36725         Snap.Matrix = Matrix;
36726         /*
36727          * \ Snap.matrix [ method ] * Utility method * Returns a matrix based on the
36728          * given parameters - a (number) - b (number) - c (number) - d (number) - e
36729          * (number) - f (number) or - svgMatrix (SVGMatrix) = (object) @Matrix \
36730          */
36731         Snap.matrix = function(a, b, c, d, e, f) {
36732           return new Matrix(a, b, c, d, e, f);
36733         };
36734       });
36735       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36736       //
36737       // Licensed under the Apache License, Version 2.0 (the "License");
36738       // you may not use this file except in compliance with the License.
36739       // You may obtain a copy of the License at
36740       //
36741       // http://www.apache.org/licenses/LICENSE-2.0
36742       //
36743       // Unless required by applicable law or agreed to in writing, software
36744       // distributed under the License is distributed on an "AS IS" BASIS,
36745       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36746       // See the License for the specific language governing permissions and
36747       // limitations under the License.
36748       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36749         var has = "hasOwnProperty",
36750           make = Snap._.make,
36751           wrap = Snap._.wrap,
36752           is = Snap.is,
36753           getSomeDefs = Snap._.getSomeDefs,
36754           reURLValue = /^url\(#?([^)]+)\)$/,
36755           $ = Snap._.$,
36756           URL = Snap.url,
36757           Str = String,
36758           separator = Snap._.separator,
36759           E = "";
36760         // Attributes event handlers
36761         eve.on("snap.util.attr.mask", function(value) {
36762           if (value instanceof Element || value instanceof Fragment) {
36763             eve.stop();
36764             if (value instanceof Fragment && value.node.childNodes.length == 1) {
36765               value = value.node.firstChild;
36766               getSomeDefs(this).appendChild(value);
36767               value = wrap(value);
36768             }
36769             if (value.type == "mask") {
36770               var mask = value;
36771             } else {
36772               mask = make("mask", getSomeDefs(this));
36773               mask.node.appendChild(value.node);
36774             }!mask.node.id && $(mask.node, {
36775               id: mask.id
36776             });
36777             $(this.node, {
36778               mask: URL(mask.id)
36779             });
36780           }
36781         });
36782         (function(clipIt) {
36783           eve.on("snap.util.attr.clip", clipIt);
36784           eve.on("snap.util.attr.clip-path", clipIt);
36785           eve.on("snap.util.attr.clipPath", clipIt);
36786         }(function(value) {
36787           if (value instanceof Element || value instanceof Fragment) {
36788             eve.stop();
36789             if (value.type == "clipPath") {
36790               var clip = value;
36791             } else {
36792               clip = make("clipPath", getSomeDefs(this));
36793               clip.node.appendChild(value.node);
36794               !clip.node.id && $(clip.node, {
36795                 id: clip.id
36796               });
36797             }
36798             $(this.node, {
36799               "clip-path": URL(clip.node.id || clip.id)
36800             });
36801           }
36802         }));
36803
36804         function fillStroke(name) {
36805           return function(value) {
36806             eve.stop();
36807             if (value instanceof Fragment && value.node.childNodes.length == 1 &&
36808               (value.node.firstChild.tagName == "radialGradient" ||
36809                 value.node.firstChild.tagName == "linearGradient" ||
36810                 value.node.firstChild.tagName == "pattern")) {
36811               value = value.node.firstChild;
36812               getSomeDefs(this).appendChild(value);
36813               value = wrap(value);
36814             }
36815             if (value instanceof Element) {
36816               if (value.type == "radialGradient" || value.type == "linearGradient" || value.type == "pattern") {
36817                 if (!value.node.id) {
36818                   $(value.node, {
36819                     id: value.id
36820                   });
36821                 }
36822                 var fill = URL(value.node.id);
36823               } else {
36824                 fill = value.attr(name);
36825               }
36826             } else {
36827               fill = Snap.color(value);
36828               if (fill.error) {
36829                 var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
36830                 if (grad) {
36831                   if (!grad.node.id) {
36832                     $(grad.node, {
36833                       id: grad.id
36834                     });
36835                   }
36836                   fill = URL(grad.node.id);
36837                 } else {
36838                   fill = value;
36839                 }
36840               } else {
36841                 fill = Str(fill);
36842               }
36843             }
36844             var attrs = {};
36845             attrs[name] = fill;
36846             $(this.node, attrs);
36847             this.node.style[name] = E;
36848           };
36849         }
36850         eve.on("snap.util.attr.fill", fillStroke("fill"));
36851         eve.on("snap.util.attr.stroke", fillStroke("stroke"));
36852         var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
36853         eve.on("snap.util.grad.parse", function parseGrad(string) {
36854           string = Str(string);
36855           var tokens = string.match(gradrg);
36856           if (!tokens) {
36857             return null;
36858           }
36859           var type = tokens[1],
36860             params = tokens[2],
36861             stops = tokens[3];
36862           params = params.split(/\s*,\s*/).map(function(el) {
36863             return +el == el ? +el : el;
36864           });
36865           if (params.length == 1 && params[0] == 0) {
36866             params = [];
36867           }
36868           stops = stops.split("-");
36869           stops = stops.map(function(el) {
36870             el = el.split(":");
36871             var out = {
36872               color: el[0]
36873             };
36874             if (el[1]) {
36875               out.offset = parseFloat(el[1]);
36876             }
36877             return out;
36878           });
36879           return {
36880             type: type,
36881             params: params,
36882             stops: stops
36883           };
36884         });
36885
36886         eve.on("snap.util.attr.d", function(value) {
36887           eve.stop();
36888           if (is(value, "array") && is(value[0], "array")) {
36889             value = Snap.path.toString.call(value);
36890           }
36891           value = Str(value);
36892           if (value.match(/[ruo]/i)) {
36893             value = Snap.path.toAbsolute(value);
36894           }
36895           $(this.node, {
36896             d: value
36897           });
36898         })(-1);
36899         eve.on("snap.util.attr.#text", function(value) {
36900           eve.stop();
36901           value = Str(value);
36902           var txt = glob.doc.createTextNode(value);
36903           while (this.node.firstChild) {
36904             this.node.removeChild(this.node.firstChild);
36905           }
36906           this.node.appendChild(txt);
36907         })(-1);
36908         eve.on("snap.util.attr.path", function(value) {
36909           eve.stop();
36910           this.attr({
36911             d: value
36912           });
36913         })(-1);
36914         eve.on("snap.util.attr.class", function(value) {
36915           eve.stop();
36916           this.node.className.baseVal = value;
36917         })(-1);
36918         eve.on("snap.util.attr.viewBox", function(value) {
36919           var vb;
36920           if (is(value, "object") && "x" in value) {
36921             vb = [value.x, value.y, value.width, value.height].join(" ");
36922           } else if (is(value, "array")) {
36923             vb = value.join(" ");
36924           } else {
36925             vb = value;
36926           }
36927           $(this.node, {
36928             viewBox: vb
36929           });
36930           eve.stop();
36931         })(-1);
36932         eve.on("snap.util.attr.transform", function(value) {
36933           this.transform(value);
36934           eve.stop();
36935         })(-1);
36936         eve.on("snap.util.attr.r", function(value) {
36937           if (this.type == "rect") {
36938             eve.stop();
36939             $(this.node, {
36940               rx: value,
36941               ry: value
36942             });
36943           }
36944         })(-1);
36945         eve.on("snap.util.attr.textpath", function(value) {
36946           eve.stop();
36947           if (this.type == "text") {
36948             var id, tp, node;
36949             if (!value && this.textPath) {
36950               tp = this.textPath;
36951               while (tp.node.firstChild) {
36952                 this.node.appendChild(tp.node.firstChild);
36953               }
36954               tp.remove();
36955               delete this.textPath;
36956               return;
36957             }
36958             if (is(value, "string")) {
36959               var defs = getSomeDefs(this),
36960                 path = wrap(defs.parentNode).path(value);
36961               defs.appendChild(path.node);
36962               id = path.id;
36963               path.attr({
36964                 id: id
36965               });
36966             } else {
36967               value = wrap(value);
36968               if (value instanceof Element) {
36969                 id = value.attr("id");
36970                 if (!id) {
36971                   id = value.id;
36972                   value.attr({
36973                     id: id
36974                   });
36975                 }
36976               }
36977             }
36978             if (id) {
36979               tp = this.textPath;
36980               node = this.node;
36981               if (tp) {
36982                 tp.attr({
36983                   "xlink:href": "#" + id
36984                 });
36985               } else {
36986                 tp = $("textPath", {
36987                   "xlink:href": "#" + id
36988                 });
36989                 while (node.firstChild) {
36990                   tp.appendChild(node.firstChild);
36991                 }
36992                 node.appendChild(tp);
36993                 this.textPath = wrap(tp);
36994               }
36995             }
36996           }
36997         })(-1);
36998         eve.on("snap.util.attr.text", function(value) {
36999           if (this.type == "text") {
37000             var i = 0,
37001               node = this.node,
37002               tuner = function(chunk) {
37003                 var out = $("tspan");
37004                 if (is(chunk, "array")) {
37005                   for (var i = 0; i < chunk.length; i++) {
37006                     out.appendChild(tuner(chunk[i]));
37007                   }
37008                 } else {
37009                   out.appendChild(glob.doc.createTextNode(chunk));
37010                 }
37011                 out.normalize && out.normalize();
37012                 return out;
37013               };
37014             while (node.firstChild) {
37015               node.removeChild(node.firstChild);
37016             }
37017             var tuned = tuner(value);
37018             while (tuned.firstChild) {
37019               node.appendChild(tuned.firstChild);
37020             }
37021           }
37022           eve.stop();
37023         })(-1);
37024
37025         function setFontSize(value) {
37026           eve.stop();
37027           if (value == +value) {
37028             value += "px";
37029           }
37030           this.node.style.fontSize = value;
37031         }
37032         eve.on("snap.util.attr.fontSize", setFontSize)(-1);
37033         eve.on("snap.util.attr.font-size", setFontSize)(-1);
37034
37035
37036         eve.on("snap.util.getattr.transform", function() {
37037           eve.stop();
37038           return this.transform();
37039         })(-1);
37040         eve.on("snap.util.getattr.textpath", function() {
37041           eve.stop();
37042           return this.textPath;
37043         })(-1);
37044         // Markers
37045         (function() {
37046           function getter(end) {
37047             return function() {
37048               eve.stop();
37049               var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
37050               if (style == "none") {
37051                 return style;
37052               } else {
37053                 return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
37054               }
37055             };
37056           }
37057
37058           function setter(end) {
37059             return function(value) {
37060               eve.stop();
37061               var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
37062               if (value == "" || !value) {
37063                 this.node.style[name] = "none";
37064                 return;
37065               }
37066               if (value.type == "marker") {
37067                 var id = value.node.id;
37068                 if (!id) {
37069                   $(value.node, {
37070                     id: value.id
37071                   });
37072                 }
37073                 this.node.style[name] = URL(id);
37074                 return;
37075               }
37076             };
37077           }
37078           eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
37079           eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
37080           eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
37081           eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
37082           eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
37083           eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
37084           eve.on("snap.util.attr.marker-end", setter("end"))(-1);
37085           eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
37086           eve.on("snap.util.attr.marker-start", setter("start"))(-1);
37087           eve.on("snap.util.attr.markerStart", setter("start"))(-1);
37088           eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
37089           eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
37090         }());
37091         eve.on("snap.util.getattr.r", function() {
37092           if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
37093             eve.stop();
37094             return $(this.node, "rx");
37095           }
37096         })(-1);
37097
37098         function textExtract(node) {
37099           var out = [];
37100           var children = node.childNodes;
37101           for (var i = 0, ii = children.length; i < ii; i++) {
37102             var chi = children[i];
37103             if (chi.nodeType == 3) {
37104               out.push(chi.nodeValue);
37105             }
37106             if (chi.tagName == "tspan") {
37107               if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
37108                 out.push(chi.firstChild.nodeValue);
37109               } else {
37110                 out.push(textExtract(chi));
37111               }
37112             }
37113           }
37114           return out;
37115         }
37116         eve.on("snap.util.getattr.text", function() {
37117           if (this.type == "text" || this.type == "tspan") {
37118             eve.stop();
37119             var out = textExtract(this.node);
37120             return out.length == 1 ? out[0] : out;
37121           }
37122         })(-1);
37123         eve.on("snap.util.getattr.#text", function() {
37124           return this.node.textContent;
37125         })(-1);
37126         eve.on("snap.util.getattr.viewBox", function() {
37127           eve.stop();
37128           var vb = $(this.node, "viewBox");
37129           if (vb) {
37130             vb = vb.split(separator);
37131             return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
37132           } else {
37133             return;
37134           }
37135         })(-1);
37136         eve.on("snap.util.getattr.points", function() {
37137           var p = $(this.node, "points");
37138           eve.stop();
37139           if (p) {
37140             return p.split(separator);
37141           } else {
37142             return;
37143           }
37144         })(-1);
37145         eve.on("snap.util.getattr.path", function() {
37146           var p = $(this.node, "d");
37147           eve.stop();
37148           return p;
37149         })(-1);
37150         eve.on("snap.util.getattr.class", function() {
37151           return this.node.className.baseVal;
37152         })(-1);
37153
37154         function getFontSize() {
37155           eve.stop();
37156           return this.node.style.fontSize;
37157         }
37158         eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
37159         eve.on("snap.util.getattr.font-size", getFontSize)(-1);
37160       });
37161
37162       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37163       //
37164       // Licensed under the Apache License, Version 2.0 (the "License");
37165       // you may not use this file except in compliance with the License.
37166       // You may obtain a copy of the License at
37167       //
37168       // http://www.apache.org/licenses/LICENSE-2.0
37169       //
37170       // Unless required by applicable law or agreed to in writing, software
37171       // distributed under the License is distributed on an "AS IS" BASIS,
37172       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37173       // See the License for the specific language governing permissions and
37174       // limitations under the License.
37175       Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
37176         var proto = Paper.prototype,
37177           is = Snap.is;
37178         /*
37179          * \ Paper.rect [ method ]
37180          *
37181          * Draws a rectangle * - x (number) x coordinate of the top left corner - y
37182          * (number) y coordinate of the top left corner - width (number) width -
37183          * height (number) height - rx (number) #optional horizontal radius for
37184          * rounded corners, default is 0 - ry (number) #optional vertical radius for
37185          * rounded corners, default is rx or 0 = (object) the `rect` element * >
37186          * Usage | // regular rectangle | var c = paper.rect(10, 10, 50, 50); | //
37187          * rectangle with rounded corners | var c = paper.rect(40, 40, 50, 50, 10); \
37188          */
37189         proto.rect = function(x, y, w, h, rx, ry) {
37190           var attr;
37191           if (ry == null) {
37192             ry = rx;
37193           }
37194           if (is(x, "object") && x == "[object Object]") {
37195             attr = x;
37196           } else if (x != null) {
37197             attr = {
37198               x: x,
37199               y: y,
37200               width: w,
37201               height: h
37202             };
37203             if (rx != null) {
37204               attr.rx = rx;
37205               attr.ry = ry;
37206             }
37207           }
37208           return this.el("rect", attr);
37209         };
37210         /*
37211          * \ Paper.circle [ method ] * Draws a circle * - x (number) x coordinate of
37212          * the centre - y (number) y coordinate of the centre - r (number) radius =
37213          * (object) the `circle` element * > Usage | var c = paper.circle(50, 50,
37214          * 40); \
37215          */
37216         proto.circle = function(cx, cy, r) {
37217           var attr;
37218           if (is(cx, "object") && cx == "[object Object]") {
37219             attr = cx;
37220           } else if (cx != null) {
37221             attr = {
37222               cx: cx,
37223               cy: cy,
37224               r: r
37225             };
37226           }
37227           return this.el("circle", attr);
37228         };
37229
37230         var preload = (function() {
37231           function onerror() {
37232             this.parentNode.removeChild(this);
37233           }
37234           return function(src, f) {
37235             var img = glob.doc.createElement("img"),
37236               body = glob.doc.body;
37237             img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
37238             img.onload = function() {
37239               f.call(img);
37240               img.onload = img.onerror = null;
37241               body.removeChild(img);
37242             };
37243             img.onerror = onerror;
37244             body.appendChild(img);
37245             img.src = src;
37246           };
37247         }());
37248
37249         /*
37250          * \ Paper.image [ method ] * Places an image on the surface * - src
37251          * (string) URI of the source image - x (number) x offset position - y
37252          * (number) y offset position - width (number) width of the image - height
37253          * (number) height of the image = (object) the `image` element or = (object)
37254          * Snap element object with type `image` * > Usage | var c =
37255          * paper.image("apple.png", 10, 10, 80, 80); \
37256          */
37257         proto.image = function(src, x, y, width, height) {
37258           var el = this.el("image");
37259           if (is(src, "object") && "src" in src) {
37260             el.attr(src);
37261           } else if (src != null) {
37262             var set = {
37263               "xlink:href": src,
37264               preserveAspectRatio: "none"
37265             };
37266             if (x != null && y != null) {
37267               set.x = x;
37268               set.y = y;
37269             }
37270             if (width != null && height != null) {
37271               set.width = width;
37272               set.height = height;
37273             } else {
37274               preload(src, function() {
37275                 Snap._.$(el.node, {
37276                   width: this.offsetWidth,
37277                   height: this.offsetHeight
37278                 });
37279               });
37280             }
37281             Snap._.$(el.node, set);
37282           }
37283           return el;
37284         };
37285         /*
37286          * \ Paper.ellipse [ method ] * Draws an ellipse * - x (number) x coordinate
37287          * of the centre - y (number) y coordinate of the centre - rx (number)
37288          * horizontal radius - ry (number) vertical radius = (object) the `ellipse`
37289          * element * > Usage | var c = paper.ellipse(50, 50, 40, 20); \
37290          */
37291         proto.ellipse = function(cx, cy, rx, ry) {
37292           var attr;
37293           if (is(cx, "object") && cx == "[object Object]") {
37294             attr = cx;
37295           } else if (cx != null) {
37296             attr = {
37297               cx: cx,
37298               cy: cy,
37299               rx: rx,
37300               ry: ry
37301             };
37302           }
37303           return this.el("ellipse", attr);
37304         };
37305         // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is,
37306         // and why it would make life any easier.
37307         /*
37308          * \ Paper.path [ method ] * Creates a `<path>` element using the given
37309          * string as the path's definition - pathString (string) #optional path
37310          * string in SVG format Path string consists of one-letter commands,
37311          * followed by comma seprarated arguments in numerical form. Example: |
37312          * "M10,20L30,40" This example features two commands: `M`, with arguments
37313          * `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands
37314          * express coordinates in absolute terms, while lowercase commands express
37315          * them in relative terms from the most recently declared coordinates.
37316          *  # <p>Here is short list of commands available, for more details see <a
37317          * href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a
37318          * path's data attribute's format are described in the SVG
37319          * specification.">SVG path string format</a> or <a
37320          * href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about
37321          * path strings at MDN</a>.</p> # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody> #
37322          * <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr> # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr> #
37323          * <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr> # <tr><td>H</td><td>horizontal
37324          * lineto</td><td>x+</td></tr> # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr> #
37325          * <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr> #
37326          * <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr> #
37327          * <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x
37328          * y)+</td></tr> # <tr><td>T</td><td>smooth quadratic Bézier
37329          * curveto</td><td>(x y)+</td></tr> # <tr><td>A</td><td>elliptical
37330          * arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr> #
37331          * <tr><td>R</td><td><a
37332          * href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom
37333          * curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table> *
37334          * _Catmull-Rom curveto_ is a not standard SVG command and added to make
37335          * life easier. Note: there is a special case when a path consists of only
37336          * three commands: `M10,10R…z`. In this case the path connects back to
37337          * its starting point. > Usage | var c = paper.path("M10 10L90 90"); | //
37338          * draw a diagonal line: | // move to 10,10, line to 90,90 \
37339          */
37340         proto.path = function(d) {
37341           var attr;
37342           if (is(d, "object") && !is(d, "array")) {
37343             attr = d;
37344           } else if (d) {
37345             attr = {
37346               d: d
37347             };
37348           }
37349           return this.el("path", attr);
37350         };
37351         /*
37352          * \ Paper.g [ method ] * Creates a group element * - varargs (…)
37353          * #optional elements to nest within the group = (object) the `g` element * >
37354          * Usage | var c1 = paper.circle(), | c2 = paper.rect(), | g = paper.g(c2,
37355          * c1); // note that the order of elements is different or | var c1 =
37356          * paper.circle(), | c2 = paper.rect(), | g = paper.g(); | g.add(c2, c1); \
37357          */
37358         /*
37359          * \ Paper.group [ method ] * See @Paper.g \
37360          */
37361         proto.group = proto.g = function(first) {
37362           var attr,
37363             el = this.el("g");
37364           if (arguments.length == 1 && first && !first.type) {
37365             el.attr(first);
37366           } else if (arguments.length) {
37367             el.add(Array.prototype.slice.call(arguments, 0));
37368           }
37369           return el;
37370         };
37371         /*
37372          * \ Paper.svg [ method ] * Creates a nested SVG element. - x (number)
37373          * @optional X of the element - y (number) @optional Y of the element -
37374          * width (number) @optional width of the element - height (number) @optional
37375          * height of the element - vbx (number) @optional viewbox X - vby (number)
37376          * @optional viewbox Y - vbw (number) @optional viewbox width - vbh (number)
37377          * @optional viewbox height * = (object) the `svg` element * \
37378          */
37379         proto.svg = function(x, y, width, height, vbx, vby, vbw, vbh) {
37380           var attrs = {};
37381           if (is(x, "object") && y == null) {
37382             attrs = x;
37383           } else {
37384             if (x != null) {
37385               attrs.x = x;
37386             }
37387             if (y != null) {
37388               attrs.y = y;
37389             }
37390             if (width != null) {
37391               attrs.width = width;
37392             }
37393             if (height != null) {
37394               attrs.height = height;
37395             }
37396             if (vbx != null && vby != null && vbw != null && vbh != null) {
37397               attrs.viewBox = [vbx, vby, vbw, vbh];
37398             }
37399           }
37400           return this.el("svg", attrs);
37401         };
37402         /*
37403          * \ Paper.mask [ method ] * Equivalent in behaviour to @Paper.g, except
37404          * it’s a mask. * = (object) the `mask` element * \
37405          */
37406         proto.mask = function(first) {
37407           var attr,
37408             el = this.el("mask");
37409           if (arguments.length == 1 && first && !first.type) {
37410             el.attr(first);
37411           } else if (arguments.length) {
37412             el.add(Array.prototype.slice.call(arguments, 0));
37413           }
37414           return el;
37415         };
37416         /*
37417          * \ Paper.ptrn [ method ] * Equivalent in behaviour to @Paper.g, except
37418          * it’s a pattern. - x (number) @optional X of the element - y
37419          * (number) @optional Y of the element - width (number) @optional width of
37420          * the element - height (number) @optional height of the element - vbx
37421          * (number) @optional viewbox X - vby (number) @optional viewbox Y - vbw
37422          * (number) @optional viewbox width - vbh (number) @optional viewbox height * =
37423          * (object) the `pattern` element * \
37424          */
37425         proto.ptrn = function(x, y, width, height, vx, vy, vw, vh) {
37426           if (is(x, "object")) {
37427             var attr = x;
37428           } else {
37429             attr = {
37430               patternUnits: "userSpaceOnUse"
37431             };
37432             if (x) {
37433               attr.x = x;
37434             }
37435             if (y) {
37436               attr.y = y;
37437             }
37438             if (width != null) {
37439               attr.width = width;
37440             }
37441             if (height != null) {
37442               attr.height = height;
37443             }
37444             if (vx != null && vy != null && vw != null && vh != null) {
37445               attr.viewBox = [vx, vy, vw, vh];
37446             }
37447           }
37448           return this.el("pattern", attr);
37449         };
37450         /*
37451          * \ Paper.use [ method ] * Creates a <use> element. - id (string) @optional
37452          * id of element to link or - id (Element) @optional element to link * =
37453          * (object) the `use` element * \
37454          */
37455         proto.use = function(id) {
37456           if (id != null) {
37457             if (id instanceof Element) {
37458               if (!id.attr("id")) {
37459                 id.attr({
37460                   id: Snap._.id(id)
37461                 });
37462               }
37463               id = id.attr("id");
37464             }
37465             if (String(id).charAt() == "#") {
37466               id = id.substring(1);
37467             }
37468             return this.el("use", {
37469               "xlink:href": "#" + id
37470             });
37471           } else {
37472             return Element.prototype.use.call(this);
37473           }
37474         };
37475         /*
37476          * \ Paper.symbol [ method ] * Creates a <symbol> element. - vbx (number)
37477          * @optional viewbox X - vby (number) @optional viewbox Y - vbw (number)
37478          * @optional viewbox width - vbh (number) @optional viewbox height =
37479          * (object) the `symbol` element * \
37480          */
37481         proto.symbol = function(vx, vy, vw, vh) {
37482           var attr = {};
37483           if (vx != null && vy != null && vw != null && vh != null) {
37484             attr.viewBox = [vx, vy, vw, vh];
37485           }
37486
37487           return this.el("symbol", attr);
37488         };
37489         /*
37490          * \ Paper.text [ method ] * Draws a text string * - x (number) x coordinate
37491          * position - y (number) y coordinate position - text (string|array) The
37492          * text string to draw or array of strings to nest within separate `<tspan>`
37493          * elements = (object) the `text` element * > Usage | var t1 =
37494          * paper.text(50, 50, "Snap"); | var t2 = paper.text(50, 50,
37495          * ["S","n","a","p"]); | // Text path usage | t1.attr({textpath:
37496          * "M10,10L100,100"}); | // or | var pth = paper.path("M10,10L100,100"); |
37497          * t1.attr({textpath: pth}); \
37498          */
37499         proto.text = function(x, y, text) {
37500           var attr = {};
37501           if (is(x, "object")) {
37502             attr = x;
37503           } else if (x != null) {
37504             attr = {
37505               x: x,
37506               y: y,
37507               text: text || ""
37508             };
37509           }
37510           return this.el("text", attr);
37511         };
37512         /*
37513          * \ Paper.line [ method ] * Draws a line * - x1 (number) x coordinate
37514          * position of the start - y1 (number) y coordinate position of the start -
37515          * x2 (number) x coordinate position of the end - y2 (number) y coordinate
37516          * position of the end = (object) the `line` element * > Usage | var t1 =
37517          * paper.line(50, 50, 100, 100); \
37518          */
37519         proto.line = function(x1, y1, x2, y2) {
37520           var attr = {};
37521           if (is(x1, "object")) {
37522             attr = x1;
37523           } else if (x1 != null) {
37524             attr = {
37525               x1: x1,
37526               x2: x2,
37527               y1: y1,
37528               y2: y2
37529             };
37530           }
37531           return this.el("line", attr);
37532         };
37533         /*
37534          * \ Paper.polyline [ method ] * Draws a polyline * - points (array) array
37535          * of points or - varargs (…) points = (object) the `polyline` element * >
37536          * Usage | var p1 = paper.polyline([10, 10, 100, 100]); | var p2 =
37537          * paper.polyline(10, 10, 100, 100); \
37538          */
37539         proto.polyline = function(points) {
37540           if (arguments.length > 1) {
37541             points = Array.prototype.slice.call(arguments, 0);
37542           }
37543           var attr = {};
37544           if (is(points, "object") && !is(points, "array")) {
37545             attr = points;
37546           } else if (points != null) {
37547             attr = {
37548               points: points
37549             };
37550           }
37551           return this.el("polyline", attr);
37552         };
37553         /*
37554          * \ Paper.polygon [ method ] * Draws a polygon. See @Paper.polyline \
37555          */
37556         proto.polygon = function(points) {
37557           if (arguments.length > 1) {
37558             points = Array.prototype.slice.call(arguments, 0);
37559           }
37560           var attr = {};
37561           if (is(points, "object") && !is(points, "array")) {
37562             attr = points;
37563           } else if (points != null) {
37564             attr = {
37565               points: points
37566             };
37567           }
37568           return this.el("polygon", attr);
37569         };
37570         // gradients
37571         (function() {
37572           var $ = Snap._.$;
37573           // gradients' helpers
37574           function Gstops() {
37575             return this.selectAll("stop");
37576           }
37577
37578           function GaddStop(color, offset) {
37579             var stop = $("stop"),
37580               attr = {
37581                 offset: +offset + "%"
37582               };
37583             color = Snap.color(color);
37584             attr["stop-color"] = color.hex;
37585             if (color.opacity < 1) {
37586               attr["stop-opacity"] = color.opacity;
37587             }
37588             $(stop, attr);
37589             this.node.appendChild(stop);
37590             return this;
37591           }
37592
37593           function GgetBBox() {
37594             if (this.type == "linearGradient") {
37595               var x1 = $(this.node, "x1") || 0,
37596                 x2 = $(this.node, "x2") || 1,
37597                 y1 = $(this.node, "y1") || 0,
37598                 y2 = $(this.node, "y2") || 0;
37599               return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
37600             } else {
37601               var cx = this.node.cx || .5,
37602                 cy = this.node.cy || .5,
37603                 r = this.node.r || 0;
37604               return Snap._.box(cx - r, cy - r, r * 2, r * 2);
37605             }
37606           }
37607
37608           function gradient(defs, str) {
37609             var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
37610               el;
37611             if (!grad) {
37612               return null;
37613             }
37614             grad.params.unshift(defs);
37615             if (grad.type.toLowerCase() == "l") {
37616               el = gradientLinear.apply(0, grad.params);
37617             } else {
37618               el = gradientRadial.apply(0, grad.params);
37619             }
37620             if (grad.type != grad.type.toLowerCase()) {
37621               $(el.node, {
37622                 gradientUnits: "userSpaceOnUse"
37623               });
37624             }
37625             var stops = grad.stops,
37626               len = stops.length,
37627               start = 0,
37628               j = 0;
37629
37630             function seed(i, end) {
37631               var step = (end - start) / (i - j);
37632               for (var k = j; k < i; k++) {
37633                 stops[k].offset = +(+start + step * (k - j)).toFixed(2);
37634               }
37635               j = i;
37636               start = end;
37637             }
37638             len--;
37639             for (var i = 0; i < len; i++)
37640               if ("offset" in stops[i]) {
37641                 seed(i, stops[i].offset);
37642               }
37643             stops[len].offset = stops[len].offset || 100;
37644             seed(len, stops[len].offset);
37645             for (i = 0; i <= len; i++) {
37646               var stop = stops[i];
37647               el.addStop(stop.color, stop.offset);
37648             }
37649             return el;
37650           }
37651
37652           function gradientLinear(defs, x1, y1, x2, y2) {
37653             var el = Snap._.make("linearGradient", defs);
37654             el.stops = Gstops;
37655             el.addStop = GaddStop;
37656             el.getBBox = GgetBBox;
37657             if (x1 != null) {
37658               $(el.node, {
37659                 x1: x1,
37660                 y1: y1,
37661                 x2: x2,
37662                 y2: y2
37663               });
37664             }
37665             return el;
37666           }
37667
37668           function gradientRadial(defs, cx, cy, r, fx, fy) {
37669             var el = Snap._.make("radialGradient", defs);
37670             el.stops = Gstops;
37671             el.addStop = GaddStop;
37672             el.getBBox = GgetBBox;
37673             if (cx != null) {
37674               $(el.node, {
37675                 cx: cx,
37676                 cy: cy,
37677                 r: r
37678               });
37679             }
37680             if (fx != null && fy != null) {
37681               $(el.node, {
37682                 fx: fx,
37683                 fy: fy
37684               });
37685             }
37686             return el;
37687           }
37688           /*
37689            * \ Paper.gradient [ method ] * Creates a gradient element * - gradient
37690            * (string) gradient descriptor > Gradient Descriptor The gradient
37691            * descriptor is an expression formatted as follows: `<type>(<coords>)<colors>`.
37692            * The `<type>` can be either linear or radial. The uppercase `L` or
37693            * `R` letters indicate absolute coordinates offset from the SVG
37694            * surface. Lowercase `l` or `r` letters indicate coordinates calculated
37695            * relative to the element to which the gradient is applied. Coordinates
37696            * specify a linear gradient vector as `x1`, `y1`, `x2`, `y2`, or a
37697            * radial gradient as `cx`, `cy`, `r` and optional `fx`, `fy` specifying
37698            * a focal point away from the center of the circle. Specify `<colors>`
37699            * as a list of dash-separated CSS color values. Each color may be
37700            * followed by a custom offset value, separated with a colon character. >
37701            * Examples Linear gradient, relative from top-left corner to
37702            * bottom-right corner, from black through red to white: | var g =
37703            * paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); Linear gradient,
37704            * absolute from (0, 0) to (100, 100), from black through red at 25% to
37705            * white: | var g = paper.gradient("L(0, 0, 100,
37706            * 100)#000-#f00:25-#fff"); Radial gradient, relative from the center of
37707            * the element with radius half the width, from black to white: | var g =
37708            * paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); To apply the gradient: |
37709            * paper.circle(50, 50, 40).attr({ | fill: g | }); = (object) the
37710            * `gradient` element \
37711            */
37712           proto.gradient = function(str) {
37713             return gradient(this.defs, str);
37714           };
37715           proto.gradientLinear = function(x1, y1, x2, y2) {
37716             return gradientLinear(this.defs, x1, y1, x2, y2);
37717           };
37718           proto.gradientRadial = function(cx, cy, r, fx, fy) {
37719             return gradientRadial(this.defs, cx, cy, r, fx, fy);
37720           };
37721           /*
37722            * \ Paper.toString [ method ] * Returns SVG code for the @Paper =
37723            * (string) SVG code for the @Paper \
37724            */
37725           proto.toString = function() {
37726             var doc = this.node.ownerDocument,
37727               f = doc.createDocumentFragment(),
37728               d = doc.createElement("div"),
37729               svg = this.node.cloneNode(true),
37730               res;
37731             f.appendChild(d);
37732             d.appendChild(svg);
37733             Snap._.$(svg, {
37734               xmlns: "http://www.w3.org/2000/svg"
37735             });
37736             res = d.innerHTML;
37737             f.removeChild(f.firstChild);
37738             return res;
37739           };
37740           /*
37741            * \ Paper.toDataURL [ method ] * Returns SVG code for the @Paper as
37742            * Data URI string. = (string) Data URI string \
37743            */
37744           proto.toDataURL = function() {
37745             if (window && window.btoa) {
37746               return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
37747             }
37748           };
37749           /*
37750            * \ Paper.clear [ method ] * Removes all child nodes of the paper,
37751            * except <defs>. \
37752            */
37753           proto.clear = function() {
37754             var node = this.node.firstChild,
37755               next;
37756             while (node) {
37757               next = node.nextSibling;
37758               if (node.tagName != "defs") {
37759                 node.parentNode.removeChild(node);
37760               } else {
37761                 proto.clear.call({
37762                   node: node
37763                 });
37764               }
37765               node = next;
37766             }
37767           };
37768         }());
37769       });
37770
37771       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37772       //
37773       // Licensed under the Apache License, Version 2.0 (the "License");
37774       // you may not use this file except in compliance with the License.
37775       // You may obtain a copy of the License at
37776       //
37777       // http://www.apache.org/licenses/LICENSE-2.0
37778       //
37779       // Unless required by applicable law or agreed to in writing, software
37780       // distributed under the License is distributed on an "AS IS" BASIS,
37781       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37782       // See the License for the specific language governing permissions and
37783       // limitations under the License.
37784       Snap.plugin(function(Snap, Element, Paper, glob) {
37785         var elproto = Element.prototype,
37786           is = Snap.is,
37787           clone = Snap._.clone,
37788           has = "hasOwnProperty",
37789           p2s = /,?([a-z]),?/gi,
37790           toFloat = parseFloat,
37791           math = Math,
37792           PI = math.PI,
37793           mmin = math.min,
37794           mmax = math.max,
37795           pow = math.pow,
37796           abs = math.abs;
37797
37798         function paths(ps) {
37799           var p = paths.ps = paths.ps || {};
37800           if (p[ps]) {
37801             p[ps].sleep = 100;
37802           } else {
37803             p[ps] = {
37804               sleep: 100
37805             };
37806           }
37807           setTimeout(function() {
37808             for (var key in p)
37809               if (p[has](key) && key != ps) {
37810                 p[key].sleep--;
37811                 !p[key].sleep && delete p[key];
37812               }
37813           });
37814           return p[ps];
37815         }
37816
37817         function box(x, y, width, height) {
37818           if (x == null) {
37819             x = y = width = height = 0;
37820           }
37821           if (y == null) {
37822             y = x.y;
37823             width = x.width;
37824             height = x.height;
37825             x = x.x;
37826           }
37827           return {
37828             x: x,
37829             y: y,
37830             width: width,
37831             w: width,
37832             height: height,
37833             h: height,
37834             x2: x + width,
37835             y2: y + height,
37836             cx: x + width / 2,
37837             cy: y + height / 2,
37838             r1: math.min(width, height) / 2,
37839             r2: math.max(width, height) / 2,
37840             r0: math.sqrt(width * width + height * height) / 2,
37841             path: rectPath(x, y, width, height),
37842             vb: [x, y, width, height].join(" ")
37843           };
37844         }
37845
37846         function toString() {
37847           return this.join(",").replace(p2s, "$1");
37848         }
37849
37850         function pathClone(pathArray) {
37851           var res = clone(pathArray);
37852           res.toString = toString;
37853           return res;
37854         }
37855
37856         function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
37857           if (length == null) {
37858             return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
37859           } else {
37860             return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
37861               getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
37862           }
37863         }
37864
37865         function getLengthFactory(istotal, subpath) {
37866           function O(val) {
37867             return +(+val).toFixed(3);
37868           }
37869           return Snap._.cacher(function(path, length, onlystart) {
37870             if (path instanceof Element) {
37871               path = path.attr("d");
37872             }
37873             path = path2curve(path);
37874             var x, y, p, l, sp = "",
37875               subpaths = {},
37876               point,
37877               len = 0;
37878             for (var i = 0, ii = path.length; i < ii; i++) {
37879               p = path[i];
37880               if (p[0] == "M") {
37881                 x = +p[1];
37882                 y = +p[2];
37883               } else {
37884                 l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
37885                 if (len + l > length) {
37886                   if (subpath && !subpaths.start) {
37887                     point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37888                     sp += [
37889                       "C" + O(point.start.x),
37890                       O(point.start.y),
37891                       O(point.m.x),
37892                       O(point.m.y),
37893                       O(point.x),
37894                       O(point.y)
37895                     ];
37896                     if (onlystart) {
37897                       return sp;
37898                     }
37899                     subpaths.start = sp;
37900                     sp = [
37901                       "M" + O(point.x),
37902                       O(point.y) + "C" + O(point.n.x),
37903                       O(point.n.y),
37904                       O(point.end.x),
37905                       O(point.end.y),
37906                       O(p[5]),
37907                       O(p[6])
37908                     ].join();
37909                     len += l;
37910                     x = +p[5];
37911                     y = +p[6];
37912                     continue;
37913                   }
37914                   if (!istotal && !subpath) {
37915                     point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37916                     return point;
37917                   }
37918                 }
37919                 len += l;
37920                 x = +p[5];
37921                 y = +p[6];
37922               }
37923               sp += p.shift() + p;
37924             }
37925             subpaths.end = sp;
37926             point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
37927             return point;
37928           }, null, Snap._.clone);
37929         }
37930         var getTotalLength = getLengthFactory(1),
37931           getPointAtLength = getLengthFactory(),
37932           getSubpathsAtLength = getLengthFactory(0, 1);
37933
37934         function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
37935           var t1 = 1 - t,
37936             t13 = pow(t1, 3),
37937             t12 = pow(t1, 2),
37938             t2 = t * t,
37939             t3 = t2 * t,
37940             x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
37941             y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
37942             mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
37943             my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
37944             nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
37945             ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
37946             ax = t1 * p1x + t * c1x,
37947             ay = t1 * p1y + t * c1y,
37948             cx = t1 * c2x + t * p2x,
37949             cy = t1 * c2y + t * p2y,
37950             alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
37951           // (mx > nx || my < ny) && (alpha += 180);
37952           return {
37953             x: x,
37954             y: y,
37955             m: {
37956               x: mx,
37957               y: my
37958             },
37959             n: {
37960               x: nx,
37961               y: ny
37962             },
37963             start: {
37964               x: ax,
37965               y: ay
37966             },
37967             end: {
37968               x: cx,
37969               y: cy
37970             },
37971             alpha: alpha
37972           };
37973         }
37974
37975         function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
37976           if (!Snap.is(p1x, "array")) {
37977             p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
37978           }
37979           var bbox = curveDim.apply(null, p1x);
37980           return box(
37981             bbox.min.x,
37982             bbox.min.y,
37983             bbox.max.x - bbox.min.x,
37984             bbox.max.y - bbox.min.y
37985           );
37986         }
37987
37988         function isPointInsideBBox(bbox, x, y) {
37989           return x >= bbox.x &&
37990             x <= bbox.x + bbox.width &&
37991             y >= bbox.y &&
37992             y <= bbox.y + bbox.height;
37993         }
37994
37995         function isBBoxIntersect(bbox1, bbox2) {
37996           bbox1 = box(bbox1);
37997           bbox2 = box(bbox2);
37998           return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);
37999         }
38000
38001         function base3(t, p1, p2, p3, p4) {
38002           var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
38003             t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
38004           return t * t2 - 3 * p1 + 3 * p2;
38005         }
38006
38007         function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
38008           if (z == null) {
38009             z = 1;
38010           }
38011           z = z > 1 ? 1 : z < 0 ? 0 : z;
38012           var z2 = z / 2,
38013             n = 12,
38014             Tvalues = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816],
38015             Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472],
38016             sum = 0;
38017           for (var i = 0; i < n; i++) {
38018             var ct = z2 * Tvalues[i] + z2,
38019               xbase = base3(ct, x1, x2, x3, x4),
38020               ybase = base3(ct, y1, y2, y3, y4),
38021               comb = xbase * xbase + ybase * ybase;
38022             sum += Cvalues[i] * math.sqrt(comb);
38023           }
38024           return z2 * sum;
38025         }
38026
38027         function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
38028           if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
38029             return;
38030           }
38031           var t = 1,
38032             step = t / 2,
38033             t2 = t - step,
38034             l,
38035             e = .01;
38036           l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
38037           while (abs(l - ll) > e) {
38038             step /= 2;
38039             t2 += (l < ll ? 1 : -1) * step;
38040             l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
38041           }
38042           return t2;
38043         }
38044
38045         function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
38046           if (
38047             mmax(x1, x2) < mmin(x3, x4) ||
38048             mmin(x1, x2) > mmax(x3, x4) ||
38049             mmax(y1, y2) < mmin(y3, y4) ||
38050             mmin(y1, y2) > mmax(y3, y4)
38051           ) {
38052             return;
38053           }
38054           var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
38055             ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
38056             denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
38057
38058           if (!denominator) {
38059             return;
38060           }
38061           var px = nx / denominator,
38062             py = ny / denominator,
38063             px2 = +px.toFixed(2),
38064             py2 = +py.toFixed(2);
38065           if (
38066             px2 < +mmin(x1, x2).toFixed(2) ||
38067             px2 > +mmax(x1, x2).toFixed(2) ||
38068             px2 < +mmin(x3, x4).toFixed(2) ||
38069             px2 > +mmax(x3, x4).toFixed(2) ||
38070             py2 < +mmin(y1, y2).toFixed(2) ||
38071             py2 > +mmax(y1, y2).toFixed(2) ||
38072             py2 < +mmin(y3, y4).toFixed(2) ||
38073             py2 > +mmax(y3, y4).toFixed(2)
38074           ) {
38075             return;
38076           }
38077           return {
38078             x: px,
38079             y: py
38080           };
38081         }
38082
38083         function inter(bez1, bez2) {
38084           return interHelper(bez1, bez2);
38085         }
38086
38087         function interCount(bez1, bez2) {
38088           return interHelper(bez1, bez2, 1);
38089         }
38090
38091         function interHelper(bez1, bez2, justCount) {
38092           var bbox1 = bezierBBox(bez1),
38093             bbox2 = bezierBBox(bez2);
38094           if (!isBBoxIntersect(bbox1, bbox2)) {
38095             return justCount ? 0 : [];
38096           }
38097           var l1 = bezlen.apply(0, bez1),
38098             l2 = bezlen.apply(0, bez2),
38099             n1 = ~~(l1 / 8),
38100             n2 = ~~(l2 / 8),
38101             dots1 = [],
38102             dots2 = [],
38103             xy = {},
38104             res = justCount ? 0 : [];
38105           for (var i = 0; i < n1 + 1; i++) {
38106             var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
38107             dots1.push({
38108               x: p.x,
38109               y: p.y,
38110               t: i / n1
38111             });
38112           }
38113           for (i = 0; i < n2 + 1; i++) {
38114             p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
38115             dots2.push({
38116               x: p.x,
38117               y: p.y,
38118               t: i / n2
38119             });
38120           }
38121           for (i = 0; i < n1; i++) {
38122             for (var j = 0; j < n2; j++) {
38123               var di = dots1[i],
38124                 di1 = dots1[i + 1],
38125                 dj = dots2[j],
38126                 dj1 = dots2[j + 1],
38127                 ci = abs(di1.x - di.x) < .001 ? "y" : "x",
38128                 cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
38129                 is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
38130               if (is) {
38131                 if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
38132                   continue;
38133                 }
38134                 xy[is.x.toFixed(4)] = is.y.toFixed(4);
38135                 var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
38136                   t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
38137                 if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
38138                   if (justCount) {
38139                     res++;
38140                   } else {
38141                     res.push({
38142                       x: is.x,
38143                       y: is.y,
38144                       t1: t1,
38145                       t2: t2
38146                     });
38147                   }
38148                 }
38149               }
38150             }
38151           }
38152           return res;
38153         }
38154
38155         function pathIntersection(path1, path2) {
38156           return interPathHelper(path1, path2);
38157         }
38158
38159         function pathIntersectionNumber(path1, path2) {
38160           return interPathHelper(path1, path2, 1);
38161         }
38162
38163         function interPathHelper(path1, path2, justCount) {
38164           path1 = path2curve(path1);
38165           path2 = path2curve(path2);
38166           var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
38167             res = justCount ? 0 : [];
38168           for (var i = 0, ii = path1.length; i < ii; i++) {
38169             var pi = path1[i];
38170             if (pi[0] == "M") {
38171               x1 = x1m = pi[1];
38172               y1 = y1m = pi[2];
38173             } else {
38174               if (pi[0] == "C") {
38175                 bez1 = [x1, y1].concat(pi.slice(1));
38176                 x1 = bez1[6];
38177                 y1 = bez1[7];
38178               } else {
38179                 bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
38180                 x1 = x1m;
38181                 y1 = y1m;
38182               }
38183               for (var j = 0, jj = path2.length; j < jj; j++) {
38184                 var pj = path2[j];
38185                 if (pj[0] == "M") {
38186                   x2 = x2m = pj[1];
38187                   y2 = y2m = pj[2];
38188                 } else {
38189                   if (pj[0] == "C") {
38190                     bez2 = [x2, y2].concat(pj.slice(1));
38191                     x2 = bez2[6];
38192                     y2 = bez2[7];
38193                   } else {
38194                     bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
38195                     x2 = x2m;
38196                     y2 = y2m;
38197                   }
38198                   var intr = interHelper(bez1, bez2, justCount);
38199                   if (justCount) {
38200                     res += intr;
38201                   } else {
38202                     for (var k = 0, kk = intr.length; k < kk; k++) {
38203                       intr[k].segment1 = i;
38204                       intr[k].segment2 = j;
38205                       intr[k].bez1 = bez1;
38206                       intr[k].bez2 = bez2;
38207                     }
38208                     res = res.concat(intr);
38209                   }
38210                 }
38211               }
38212             }
38213           }
38214           return res;
38215         }
38216
38217         function isPointInsidePath(path, x, y) {
38218           var bbox = pathBBox(path);
38219           return isPointInsideBBox(bbox, x, y) &&
38220             interPathHelper(path, [
38221               ["M", x, y],
38222               ["H", bbox.x2 + 10]
38223             ], 1) % 2 == 1;
38224         }
38225
38226         function pathBBox(path) {
38227           var pth = paths(path);
38228           if (pth.bbox) {
38229             return clone(pth.bbox);
38230           }
38231           if (!path) {
38232             return box();
38233           }
38234           path = path2curve(path);
38235           var x = 0,
38236             y = 0,
38237             X = [],
38238             Y = [],
38239             p;
38240           for (var i = 0, ii = path.length; i < ii; i++) {
38241             p = path[i];
38242             if (p[0] == "M") {
38243               x = p[1];
38244               y = p[2];
38245               X.push(x);
38246               Y.push(y);
38247             } else {
38248               var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
38249               X = X.concat(dim.min.x, dim.max.x);
38250               Y = Y.concat(dim.min.y, dim.max.y);
38251               x = p[5];
38252               y = p[6];
38253             }
38254           }
38255           var xmin = mmin.apply(0, X),
38256             ymin = mmin.apply(0, Y),
38257             xmax = mmax.apply(0, X),
38258             ymax = mmax.apply(0, Y),
38259             bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
38260           pth.bbox = clone(bb);
38261           return bb;
38262         }
38263
38264         function rectPath(x, y, w, h, r) {
38265           if (r) {
38266             return [
38267               ["M", +x + (+r), y],
38268               ["l", w - r * 2, 0],
38269               ["a", r, r, 0, 0, 1, r, r],
38270               ["l", 0, h - r * 2],
38271               ["a", r, r, 0, 0, 1, -r, r],
38272               ["l", r * 2 - w, 0],
38273               ["a", r, r, 0, 0, 1, -r, -r],
38274               ["l", 0, r * 2 - h],
38275               ["a", r, r, 0, 0, 1, r, -r],
38276               ["z"]
38277             ];
38278           }
38279           var res = [
38280             ["M", x, y],
38281             ["l", w, 0],
38282             ["l", 0, h],
38283             ["l", -w, 0],
38284             ["z"]
38285           ];
38286           res.toString = toString;
38287           return res;
38288         }
38289
38290         function ellipsePath(x, y, rx, ry, a) {
38291           if (a == null && ry == null) {
38292             ry = rx;
38293           }
38294           x = +x;
38295           y = +y;
38296           rx = +rx;
38297           ry = +ry;
38298           if (a != null) {
38299             var rad = Math.PI / 180,
38300               x1 = x + rx * Math.cos(-ry * rad),
38301               x2 = x + rx * Math.cos(-a * rad),
38302               y1 = y + rx * Math.sin(-ry * rad),
38303               y2 = y + rx * Math.sin(-a * rad),
38304               res = [
38305                 ["M", x1, y1],
38306                 ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]
38307               ];
38308           } else {
38309             res = [
38310               ["M", x, y],
38311               ["m", 0, -ry],
38312               ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
38313               ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
38314               ["z"]
38315             ];
38316           }
38317           res.toString = toString;
38318           return res;
38319         }
38320         var unit2px = Snap._unit2px,
38321           getPath = {
38322             path: function(el) {
38323               return el.attr("path");
38324             },
38325             circle: function(el) {
38326               var attr = unit2px(el);
38327               return ellipsePath(attr.cx, attr.cy, attr.r);
38328             },
38329             ellipse: function(el) {
38330               var attr = unit2px(el);
38331               return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
38332             },
38333             rect: function(el) {
38334               var attr = unit2px(el);
38335               return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
38336             },
38337             image: function(el) {
38338               var attr = unit2px(el);
38339               return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
38340             },
38341             line: function(el) {
38342               return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
38343             },
38344             polyline: function(el) {
38345               return "M" + el.attr("points");
38346             },
38347             polygon: function(el) {
38348               return "M" + el.attr("points") + "z";
38349             },
38350             deflt: function(el) {
38351               var bbox = el.node.getBBox();
38352               return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
38353             }
38354           };
38355
38356         function pathToRelative(pathArray) {
38357           var pth = paths(pathArray),
38358             lowerCase = String.prototype.toLowerCase;
38359           if (pth.rel) {
38360             return pathClone(pth.rel);
38361           }
38362           if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
38363             pathArray = Snap.parsePathString(pathArray);
38364           }
38365           var res = [],
38366             x = 0,
38367             y = 0,
38368             mx = 0,
38369             my = 0,
38370             start = 0;
38371           if (pathArray[0][0] == "M") {
38372             x = pathArray[0][1];
38373             y = pathArray[0][2];
38374             mx = x;
38375             my = y;
38376             start++;
38377             res.push(["M", x, y]);
38378           }
38379           for (var i = start, ii = pathArray.length; i < ii; i++) {
38380             var r = res[i] = [],
38381               pa = pathArray[i];
38382             if (pa[0] != lowerCase.call(pa[0])) {
38383               r[0] = lowerCase.call(pa[0]);
38384               switch (r[0]) {
38385                 case "a":
38386                   r[1] = pa[1];
38387                   r[2] = pa[2];
38388                   r[3] = pa[3];
38389                   r[4] = pa[4];
38390                   r[5] = pa[5];
38391                   r[6] = +(pa[6] - x).toFixed(3);
38392                   r[7] = +(pa[7] - y).toFixed(3);
38393                   break;
38394                 case "v":
38395                   r[1] = +(pa[1] - y).toFixed(3);
38396                   break;
38397                 case "m":
38398                   mx = pa[1];
38399                   my = pa[2];
38400                 default:
38401                   for (var j = 1, jj = pa.length; j < jj; j++) {
38402                     r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
38403                   }
38404               }
38405             } else {
38406               r = res[i] = [];
38407               if (pa[0] == "m") {
38408                 mx = pa[1] + x;
38409                 my = pa[2] + y;
38410               }
38411               for (var k = 0, kk = pa.length; k < kk; k++) {
38412                 res[i][k] = pa[k];
38413               }
38414             }
38415             var len = res[i].length;
38416             switch (res[i][0]) {
38417               case "z":
38418                 x = mx;
38419                 y = my;
38420                 break;
38421               case "h":
38422                 x += +res[i][len - 1];
38423                 break;
38424               case "v":
38425                 y += +res[i][len - 1];
38426                 break;
38427               default:
38428                 x += +res[i][len - 2];
38429                 y += +res[i][len - 1];
38430             }
38431           }
38432           res.toString = toString;
38433           pth.rel = pathClone(res);
38434           return res;
38435         }
38436
38437         function pathToAbsolute(pathArray) {
38438           var pth = paths(pathArray);
38439           if (pth.abs) {
38440             return pathClone(pth.abs);
38441           }
38442           if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough
38443             // assumption
38444             pathArray = Snap.parsePathString(pathArray);
38445           }
38446           if (!pathArray || !pathArray.length) {
38447             return [
38448               ["M", 0, 0]
38449             ];
38450           }
38451           var res = [],
38452             x = 0,
38453             y = 0,
38454             mx = 0,
38455             my = 0,
38456             start = 0,
38457             pa0;
38458           if (pathArray[0][0] == "M") {
38459             x = +pathArray[0][1];
38460             y = +pathArray[0][2];
38461             mx = x;
38462             my = y;
38463             start++;
38464             res[0] = ["M", x, y];
38465           }
38466           var crz = pathArray.length == 3 &&
38467             pathArray[0][0] == "M" &&
38468             pathArray[1][0].toUpperCase() == "R" &&
38469             pathArray[2][0].toUpperCase() == "Z";
38470           for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
38471             res.push(r = []);
38472             pa = pathArray[i];
38473             pa0 = pa[0];
38474             if (pa0 != pa0.toUpperCase()) {
38475               r[0] = pa0.toUpperCase();
38476               switch (r[0]) {
38477                 case "A":
38478                   r[1] = pa[1];
38479                   r[2] = pa[2];
38480                   r[3] = pa[3];
38481                   r[4] = pa[4];
38482                   r[5] = pa[5];
38483                   r[6] = +pa[6] + x;
38484                   r[7] = +pa[7] + y;
38485                   break;
38486                 case "V":
38487                   r[1] = +pa[1] + y;
38488                   break;
38489                 case "H":
38490                   r[1] = +pa[1] + x;
38491                   break;
38492                 case "R":
38493                   var dots = [x, y].concat(pa.slice(1));
38494                   for (var j = 2, jj = dots.length; j < jj; j++) {
38495                     dots[j] = +dots[j] + x;
38496                     dots[++j] = +dots[j] + y;
38497                   }
38498                   res.pop();
38499                   res = res.concat(catmullRom2bezier(dots, crz));
38500                   break;
38501                 case "O":
38502                   res.pop();
38503                   dots = ellipsePath(x, y, pa[1], pa[2]);
38504                   dots.push(dots[0]);
38505                   res = res.concat(dots);
38506                   break;
38507                 case "U":
38508                   res.pop();
38509                   res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38510                   r = ["U"].concat(res[res.length - 1].slice(-2));
38511                   break;
38512                 case "M":
38513                   mx = +pa[1] + x;
38514                   my = +pa[2] + y;
38515                 default:
38516                   for (j = 1, jj = pa.length; j < jj; j++) {
38517                     r[j] = +pa[j] + ((j % 2) ? x : y);
38518                   }
38519               }
38520             } else if (pa0 == "R") {
38521               dots = [x, y].concat(pa.slice(1));
38522               res.pop();
38523               res = res.concat(catmullRom2bezier(dots, crz));
38524               r = ["R"].concat(pa.slice(-2));
38525             } else if (pa0 == "O") {
38526               res.pop();
38527               dots = ellipsePath(x, y, pa[1], pa[2]);
38528               dots.push(dots[0]);
38529               res = res.concat(dots);
38530             } else if (pa0 == "U") {
38531               res.pop();
38532               res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38533               r = ["U"].concat(res[res.length - 1].slice(-2));
38534             } else {
38535               for (var k = 0, kk = pa.length; k < kk; k++) {
38536                 r[k] = pa[k];
38537               }
38538             }
38539             pa0 = pa0.toUpperCase();
38540             if (pa0 != "O") {
38541               switch (r[0]) {
38542                 case "Z":
38543                   x = +mx;
38544                   y = +my;
38545                   break;
38546                 case "H":
38547                   x = r[1];
38548                   break;
38549                 case "V":
38550                   y = r[1];
38551                   break;
38552                 case "M":
38553                   mx = r[r.length - 2];
38554                   my = r[r.length - 1];
38555                 default:
38556                   x = r[r.length - 2];
38557                   y = r[r.length - 1];
38558               }
38559             }
38560           }
38561           res.toString = toString;
38562           pth.abs = pathClone(res);
38563           return res;
38564         }
38565
38566         function l2c(x1, y1, x2, y2) {
38567           return [x1, y1, x2, y2, x2, y2];
38568         }
38569
38570         function q2c(x1, y1, ax, ay, x2, y2) {
38571           var _13 = 1 / 3,
38572             _23 = 2 / 3;
38573           return [
38574             _13 * x1 + _23 * ax,
38575             _13 * y1 + _23 * ay,
38576             _13 * x2 + _23 * ax,
38577             _13 * y2 + _23 * ay,
38578             x2,
38579             y2
38580           ];
38581         }
38582
38583         function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
38584           // for more information of where this math came from visit:
38585           // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
38586           var _120 = PI * 120 / 180,
38587             rad = PI / 180 * (+angle || 0),
38588             res = [],
38589             xy,
38590             rotate = Snap._.cacher(function(x, y, rad) {
38591               var X = x * math.cos(rad) - y * math.sin(rad),
38592                 Y = x * math.sin(rad) + y * math.cos(rad);
38593               return {
38594                 x: X,
38595                 y: Y
38596               };
38597             });
38598           if (!recursive) {
38599             xy = rotate(x1, y1, -rad);
38600             x1 = xy.x;
38601             y1 = xy.y;
38602             xy = rotate(x2, y2, -rad);
38603             x2 = xy.x;
38604             y2 = xy.y;
38605             var cos = math.cos(PI / 180 * angle),
38606               sin = math.sin(PI / 180 * angle),
38607               x = (x1 - x2) / 2,
38608               y = (y1 - y2) / 2;
38609             var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
38610             if (h > 1) {
38611               h = math.sqrt(h);
38612               rx = h * rx;
38613               ry = h * ry;
38614             }
38615             var rx2 = rx * rx,
38616               ry2 = ry * ry,
38617               k = (large_arc_flag == sweep_flag ? -1 : 1) *
38618               math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
38619               cx = k * rx * y / ry + (x1 + x2) / 2,
38620               cy = k * -ry * x / rx + (y1 + y2) / 2,
38621               f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
38622               f2 = math.asin(((y2 - cy) / ry).toFixed(9));
38623
38624             f1 = x1 < cx ? PI - f1 : f1;
38625             f2 = x2 < cx ? PI - f2 : f2;
38626             f1 < 0 && (f1 = PI * 2 + f1);
38627             f2 < 0 && (f2 = PI * 2 + f2);
38628             if (sweep_flag && f1 > f2) {
38629               f1 = f1 - PI * 2;
38630             }
38631             if (!sweep_flag && f2 > f1) {
38632               f2 = f2 - PI * 2;
38633             }
38634           } else {
38635             f1 = recursive[0];
38636             f2 = recursive[1];
38637             cx = recursive[2];
38638             cy = recursive[3];
38639           }
38640           var df = f2 - f1;
38641           if (abs(df) > _120) {
38642             var f2old = f2,
38643               x2old = x2,
38644               y2old = y2;
38645             f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
38646             x2 = cx + rx * math.cos(f2);
38647             y2 = cy + ry * math.sin(f2);
38648             res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
38649           }
38650           df = f2 - f1;
38651           var c1 = math.cos(f1),
38652             s1 = math.sin(f1),
38653             c2 = math.cos(f2),
38654             s2 = math.sin(f2),
38655             t = math.tan(df / 4),
38656             hx = 4 / 3 * rx * t,
38657             hy = 4 / 3 * ry * t,
38658             m1 = [x1, y1],
38659             m2 = [x1 + hx * s1, y1 - hy * c1],
38660             m3 = [x2 + hx * s2, y2 - hy * c2],
38661             m4 = [x2, y2];
38662           m2[0] = 2 * m1[0] - m2[0];
38663           m2[1] = 2 * m1[1] - m2[1];
38664           if (recursive) {
38665             return [m2, m3, m4].concat(res);
38666           } else {
38667             res = [m2, m3, m4].concat(res).join().split(",");
38668             var newres = [];
38669             for (var i = 0, ii = res.length; i < ii; i++) {
38670               newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
38671             }
38672             return newres;
38673           }
38674         }
38675
38676         function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
38677           var t1 = 1 - t;
38678           return {
38679             x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
38680             y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
38681           };
38682         }
38683
38684         // Returns bounding box of cubic bezier curve.
38685         // Source:
38686         // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
38687         // Original version: NISHIO Hirokazu
38688         // Modifications: https://github.com/timo22345
38689         function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
38690           var tvalues = [],
38691             bounds = [
38692               [],
38693               []
38694             ],
38695             a, b, c, t, t1, t2, b2ac, sqrtb2ac;
38696           for (var i = 0; i < 2; ++i) {
38697             if (i == 0) {
38698               b = 6 * x0 - 12 * x1 + 6 * x2;
38699               a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
38700               c = 3 * x1 - 3 * x0;
38701             } else {
38702               b = 6 * y0 - 12 * y1 + 6 * y2;
38703               a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
38704               c = 3 * y1 - 3 * y0;
38705             }
38706             if (abs(a) < 1e-12) {
38707               if (abs(b) < 1e-12) {
38708                 continue;
38709               }
38710               t = -c / b;
38711               if (0 < t && t < 1) {
38712                 tvalues.push(t);
38713               }
38714               continue;
38715             }
38716             b2ac = b * b - 4 * c * a;
38717             sqrtb2ac = math.sqrt(b2ac);
38718             if (b2ac < 0) {
38719               continue;
38720             }
38721             t1 = (-b + sqrtb2ac) / (2 * a);
38722             if (0 < t1 && t1 < 1) {
38723               tvalues.push(t1);
38724             }
38725             t2 = (-b - sqrtb2ac) / (2 * a);
38726             if (0 < t2 && t2 < 1) {
38727               tvalues.push(t2);
38728             }
38729           }
38730
38731           var x, y, j = tvalues.length,
38732             jlen = j,
38733             mt;
38734           while (j--) {
38735             t = tvalues[j];
38736             mt = 1 - t;
38737             bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
38738             bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
38739           }
38740
38741           bounds[0][jlen] = x0;
38742           bounds[1][jlen] = y0;
38743           bounds[0][jlen + 1] = x3;
38744           bounds[1][jlen + 1] = y3;
38745           bounds[0].length = bounds[1].length = jlen + 2;
38746
38747
38748           return {
38749             min: {
38750               x: mmin.apply(0, bounds[0]),
38751               y: mmin.apply(0, bounds[1])
38752             },
38753             max: {
38754               x: mmax.apply(0, bounds[0]),
38755               y: mmax.apply(0, bounds[1])
38756             }
38757           };
38758         }
38759
38760         function path2curve(path, path2) {
38761           var pth = !path2 && paths(path);
38762           if (!path2 && pth.curve) {
38763             return pathClone(pth.curve);
38764           }
38765           var p = pathToAbsolute(path),
38766             p2 = path2 && pathToAbsolute(path2),
38767             attrs = {
38768               x: 0,
38769               y: 0,
38770               bx: 0,
38771               by: 0,
38772               X: 0,
38773               Y: 0,
38774               qx: null,
38775               qy: null
38776             },
38777             attrs2 = {
38778               x: 0,
38779               y: 0,
38780               bx: 0,
38781               by: 0,
38782               X: 0,
38783               Y: 0,
38784               qx: null,
38785               qy: null
38786             },
38787             processPath = function(path, d, pcom) {
38788               var nx, ny;
38789               if (!path) {
38790                 return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
38791               }!(path[0] in {
38792                 T: 1,
38793                 Q: 1
38794               }) && (d.qx = d.qy = null);
38795               switch (path[0]) {
38796                 case "M":
38797                   d.X = path[1];
38798                   d.Y = path[2];
38799                   break;
38800                 case "A":
38801                   path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
38802                   break;
38803                 case "S":
38804                   if (pcom == "C" || pcom == "S") { // In "S" case we
38805                     // have to take into
38806                     // account, if the
38807                     // previous command
38808                     // is C/S.
38809                     nx = d.x * 2 - d.bx; // And reflect the
38810                     // previous
38811                     ny = d.y * 2 - d.by; // command's control
38812                     // point relative to
38813                     // the current
38814                     // point.
38815                   } else { // or some else or
38816                     // nothing
38817                     nx = d.x;
38818                     ny = d.y;
38819                   }
38820                   path = ["C", nx, ny].concat(path.slice(1));
38821                   break;
38822                 case "T":
38823                   if (pcom == "Q" || pcom == "T") { // In "T" case we
38824                     // have to take into
38825                     // account, if the
38826                     // previous command
38827                     // is Q/T.
38828                     d.qx = d.x * 2 - d.qx; // And make a
38829                     // reflection
38830                     // similar
38831                     d.qy = d.y * 2 - d.qy; // to case "S".
38832                   } else { // or something else
38833                     // or nothing
38834                     d.qx = d.x;
38835                     d.qy = d.y;
38836                   }
38837                   path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
38838                   break;
38839                 case "Q":
38840                   d.qx = path[1];
38841                   d.qy = path[2];
38842                   path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
38843                   break;
38844                 case "L":
38845                   path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
38846                   break;
38847                 case "H":
38848                   path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
38849                   break;
38850                 case "V":
38851                   path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
38852                   break;
38853                 case "Z":
38854                   path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
38855                   break;
38856               }
38857               return path;
38858             },
38859             fixArc = function(pp, i) {
38860               if (pp[i].length > 7) {
38861                 pp[i].shift();
38862                 var pi = pp[i];
38863                 while (pi.length) {
38864                   pcoms1[i] = "A"; // if created multiple C:s, their
38865                   // original seg is saved
38866                   p2 && (pcoms2[i] = "A"); // the same as above
38867                   pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
38868                 }
38869                 pp.splice(i, 1);
38870                 ii = mmax(p.length, p2 && p2.length || 0);
38871               }
38872             },
38873             fixM = function(path1, path2, a1, a2, i) {
38874               if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
38875                 path2.splice(i, 0, ["M", a2.x, a2.y]);
38876                 a1.bx = 0;
38877                 a1.by = 0;
38878                 a1.x = path1[i][1];
38879                 a1.y = path1[i][2];
38880                 ii = mmax(p.length, p2 && p2.length || 0);
38881               }
38882             },
38883             pcoms1 = [], // path commands of original path p
38884             pcoms2 = [], // path commands of original path p2
38885             pfirst = "", // temporary holder for original path command
38886             pcom = ""; // holder for previous path command of original path
38887           for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
38888             p[i] && (pfirst = p[i][0]); // save current path command
38889
38890             if (pfirst != "C") // C is not saved yet, because it may be result
38891             // of conversion
38892             {
38893               pcoms1[i] = pfirst; // Save current path command
38894               i && (pcom = pcoms1[i - 1]); // Get previous path command
38895               // pcom
38896             }
38897             p[i] = processPath(p[i], attrs, pcom); // Previous path command is
38898             // inputted to processPath
38899
38900             if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the
38901             // only
38902             // command
38903             // which may produce multiple C:s
38904             // so we have to make sure that C is also C in original path
38905
38906             fixArc(p, i); // fixArc adds also the right amount of A:s to
38907             // pcoms1
38908
38909             if (p2) { // the same procedures is done to p2
38910               p2[i] && (pfirst = p2[i][0]);
38911               if (pfirst != "C") {
38912                 pcoms2[i] = pfirst;
38913                 i && (pcom = pcoms2[i - 1]);
38914               }
38915               p2[i] = processPath(p2[i], attrs2, pcom);
38916
38917               if (pcoms2[i] != "A" && pfirst == "C") {
38918                 pcoms2[i] = "C";
38919               }
38920
38921               fixArc(p2, i);
38922             }
38923             fixM(p, p2, attrs, attrs2, i);
38924             fixM(p2, p, attrs2, attrs, i);
38925             var seg = p[i],
38926               seg2 = p2 && p2[i],
38927               seglen = seg.length,
38928               seg2len = p2 && seg2.length;
38929             attrs.x = seg[seglen - 2];
38930             attrs.y = seg[seglen - 1];
38931             attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
38932             attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
38933             attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
38934             attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
38935             attrs2.x = p2 && seg2[seg2len - 2];
38936             attrs2.y = p2 && seg2[seg2len - 1];
38937           }
38938           if (!p2) {
38939             pth.curve = pathClone(p);
38940           }
38941           return p2 ? [p, p2] : p;
38942         }
38943
38944         function mapPath(path, matrix) {
38945           if (!matrix) {
38946             return path;
38947           }
38948           var x, y, i, j, ii, jj, pathi;
38949           path = path2curve(path);
38950           for (i = 0, ii = path.length; i < ii; i++) {
38951             pathi = path[i];
38952             for (j = 1, jj = pathi.length; j < jj; j += 2) {
38953               x = matrix.x(pathi[j], pathi[j + 1]);
38954               y = matrix.y(pathi[j], pathi[j + 1]);
38955               pathi[j] = x;
38956               pathi[j + 1] = y;
38957             }
38958           }
38959           return path;
38960         }
38961
38962         // http://schepers.cc/getting-to-the-point
38963         function catmullRom2bezier(crp, z) {
38964           var d = [];
38965           for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
38966             var p = [{
38967               x: +crp[i - 2],
38968               y: +crp[i - 1]
38969             }, {
38970               x: +crp[i],
38971               y: +crp[i + 1]
38972             }, {
38973               x: +crp[i + 2],
38974               y: +crp[i + 3]
38975             }, {
38976               x: +crp[i + 4],
38977               y: +crp[i + 5]
38978             }];
38979             if (z) {
38980               if (!i) {
38981                 p[0] = {
38982                   x: +crp[iLen - 2],
38983                   y: +crp[iLen - 1]
38984                 };
38985               } else if (iLen - 4 == i) {
38986                 p[3] = {
38987                   x: +crp[0],
38988                   y: +crp[1]
38989                 };
38990               } else if (iLen - 2 == i) {
38991                 p[2] = {
38992                   x: +crp[0],
38993                   y: +crp[1]
38994                 };
38995                 p[3] = {
38996                   x: +crp[2],
38997                   y: +crp[3]
38998                 };
38999               }
39000             } else {
39001               if (iLen - 4 == i) {
39002                 p[3] = p[2];
39003               } else if (!i) {
39004                 p[0] = {
39005                   x: +crp[i],
39006                   y: +crp[i + 1]
39007                 };
39008               }
39009             }
39010             d.push(["C", (-p[0].x + 6 * p[1].x + p[2].x) / 6, (-p[0].y + 6 * p[1].y + p[2].y) / 6, (p[1].x + 6 * p[2].x - p[3].x) / 6, (p[1].y + 6 * p[2].y - p[3].y) / 6,
39011               p[2].x,
39012               p[2].y
39013             ]);
39014           }
39015
39016           return d;
39017         }
39018
39019         // export
39020         Snap.path = paths;
39021
39022         /*
39023          * \ Snap.path.getTotalLength [ method ] * Returns the length of the given
39024          * path in pixels * - path (string) SVG path string * = (number) length \
39025          */
39026         Snap.path.getTotalLength = getTotalLength;
39027         /*
39028          * \ Snap.path.getPointAtLength [ method ] * Returns the coordinates of the
39029          * point located at the given length along the given path * - path (string)
39030          * SVG path string - length (number) length, in pixels, from the start of
39031          * the path, excluding non-rendering jumps * = (object) representation of
39032          * the point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
39033          * alpha: (number) angle of derivative o } \
39034          */
39035         Snap.path.getPointAtLength = getPointAtLength;
39036         /*
39037          * \ Snap.path.getSubpath [ method ] * Returns the subpath of a given path
39038          * between given start and end lengths * - path (string) SVG path string -
39039          * from (number) length, in pixels, from the start of the path to the start
39040          * of the segment - to (number) length, in pixels, from the start of the
39041          * path to the end of the segment * = (string) path string definition for
39042          * the segment \
39043          */
39044         Snap.path.getSubpath = function(path, from, to) {
39045           if (this.getTotalLength(path) - to < 1e-6) {
39046             return getSubpathsAtLength(path, from).end;
39047           }
39048           var a = getSubpathsAtLength(path, to, 1);
39049           return from ? getSubpathsAtLength(a, from).end : a;
39050         };
39051         /*
39052          * \ Element.getTotalLength [ method ] * Returns the length of the path in
39053          * pixels (only works for `path` elements) = (number) length \
39054          */
39055         elproto.getTotalLength = function() {
39056           if (this.node.getTotalLength) {
39057             return this.node.getTotalLength();
39058           }
39059         };
39060         // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path>
39061         // is broken into different segments, is the jump distance to the new
39062         // coordinates set by the _M_ or _m_ commands calculated as part of the
39063         // path's total length?
39064         /*
39065          * \ Element.getPointAtLength [ method ] * Returns coordinates of the point
39066          * located at the given length on the given path (only works for `path`
39067          * elements) * - length (number) length, in pixels, from the start of the
39068          * path, excluding non-rendering jumps * = (object) representation of the
39069          * point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
39070          * alpha: (number) angle of derivative o } \
39071          */
39072         elproto.getPointAtLength = function(length) {
39073           return getPointAtLength(this.attr("d"), length);
39074         };
39075         // SIERRA Element.getSubpath(): Similar to the problem for
39076         // Element.getPointAtLength(). Unclear how this would work for a segmented
39077         // path. Overall, the concept of _subpath_ and what I'm calling a _segment_
39078         // (series of non-_M_ or _Z_ commands) is unclear.
39079         /*
39080          * \ Element.getSubpath [ method ] * Returns subpath of a given element from
39081          * given start and end lengths (only works for `path` elements) * - from
39082          * (number) length, in pixels, from the start of the path to the start of
39083          * the segment - to (number) length, in pixels, from the start of the path
39084          * to the end of the segment * = (string) path string definition for the
39085          * segment \
39086          */
39087         elproto.getSubpath = function(from, to) {
39088           return Snap.path.getSubpath(this.attr("d"), from, to);
39089         };
39090         Snap._.box = box;
39091         /*
39092          * \ Snap.path.findDotsAtSegment [ method ] * Utility method * Finds dot
39093          * coordinates on the given cubic beziér curve at the given t - p1x
39094          * (number) x of the first point of the curve - p1y (number) y of the first
39095          * point of the curve - c1x (number) x of the first anchor of the curve -
39096          * c1y (number) y of the first anchor of the curve - c2x (number) x of the
39097          * second anchor of the curve - c2y (number) y of the second anchor of the
39098          * curve - p2x (number) x of the second point of the curve - p2y (number) y
39099          * of the second point of the curve - t (number) position on the curve
39100          * (0..1) = (object) point information in format: o { o x: (number) x
39101          * coordinate of the point, o y: (number) y coordinate of the point, o m: {
39102          * o x: (number) x coordinate of the left anchor, o y: (number) y coordinate
39103          * of the left anchor o }, o n: { o x: (number) x coordinate of the right
39104          * anchor, o y: (number) y coordinate of the right anchor o }, o start: { o
39105          * x: (number) x coordinate of the start of the curve, o y: (number) y
39106          * coordinate of the start of the curve o }, o end: { o x: (number) x
39107          * coordinate of the end of the curve, o y: (number) y coordinate of the end
39108          * of the curve o }, o alpha: (number) angle of the curve derivative at the
39109          * point o } \
39110          */
39111         Snap.path.findDotsAtSegment = findDotsAtSegment;
39112         /*
39113          * \ Snap.path.bezierBBox [ method ] * Utility method * Returns the bounding
39114          * box of a given cubic beziér curve - p1x (number) x of the first point
39115          * of the curve - p1y (number) y of the first point of the curve - c1x
39116          * (number) x of the first anchor of the curve - c1y (number) y of the first
39117          * anchor of the curve - c2x (number) x of the second anchor of the curve -
39118          * c2y (number) y of the second anchor of the curve - p2x (number) x of the
39119          * second point of the curve - p2y (number) y of the second point of the
39120          * curve or - bez (array) array of six points for beziér curve = (object)
39121          * bounding box o { o x: (number) x coordinate of the left top point of the
39122          * box, o y: (number) y coordinate of the left top point of the box, o x2:
39123          * (number) x coordinate of the right bottom point of the box, o y2:
39124          * (number) y coordinate of the right bottom point of the box, o width:
39125          * (number) width of the box, o height: (number) height of the box o } \
39126          */
39127         Snap.path.bezierBBox = bezierBBox;
39128         /*
39129          * \ Snap.path.isPointInsideBBox [ method ] * Utility method * Returns
39130          * `true` if given point is inside bounding box - bbox (string) bounding box -
39131          * x (string) x coordinate of the point - y (string) y coordinate of the
39132          * point = (boolean) `true` if point is inside \
39133          */
39134         Snap.path.isPointInsideBBox = isPointInsideBBox;
39135         /*
39136          * \ Snap.path.isBBoxIntersect [ method ] * Utility method * Returns `true`
39137          * if two bounding boxes intersect - bbox1 (string) first bounding box -
39138          * bbox2 (string) second bounding box = (boolean) `true` if bounding boxes
39139          * intersect \
39140          */
39141         Snap.path.isBBoxIntersect = isBBoxIntersect;
39142         /*
39143          * \ Snap.path.intersection [ method ] * Utility method * Finds
39144          * intersections of two paths - path1 (string) path string - path2 (string)
39145          * path string = (array) dots of intersection o [ o { o x: (number) x
39146          * coordinate of the point, o y: (number) y coordinate of the point, o t1:
39147          * (number) t value for segment of path1, o t2: (number) t value for segment
39148          * of path2, o segment1: (number) order number for segment of path1, o
39149          * segment2: (number) order number for segment of path2, o bez1: (array)
39150          * eight coordinates representing beziér curve for the segment of path1,
39151          * o bez2: (array) eight coordinates representing beziér curve for the
39152          * segment of path2 o } o ] \
39153          */
39154         Snap.path.intersection = pathIntersection;
39155         Snap.path.intersectionNumber = pathIntersectionNumber;
39156         /*
39157          * \ Snap.path.isPointInside [ method ] * Utility method * Returns `true` if
39158          * given point is inside a given closed path.
39159          *
39160          * Note: fill mode doesn’t affect the result of this method. - path
39161          * (string) path string - x (number) x of the point - y (number) y of the
39162          * point = (boolean) `true` if point is inside the path \
39163          */
39164         Snap.path.isPointInside = isPointInsidePath;
39165         /*
39166          * \ Snap.path.getBBox [ method ] * Utility method * Returns the bounding
39167          * box of a given path - path (string) path string = (object) bounding box o {
39168          * o x: (number) x coordinate of the left top point of the box, o y:
39169          * (number) y coordinate of the left top point of the box, o x2: (number) x
39170          * coordinate of the right bottom point of the box, o y2: (number) y
39171          * coordinate of the right bottom point of the box, o width: (number) width
39172          * of the box, o height: (number) height of the box o } \
39173          */
39174         Snap.path.getBBox = pathBBox;
39175         Snap.path.get = getPath;
39176         /*
39177          * \ Snap.path.toRelative [ method ] * Utility method * Converts path
39178          * coordinates into relative values - path (string) path string = (array)
39179          * path string \
39180          */
39181         Snap.path.toRelative = pathToRelative;
39182         /*
39183          * \ Snap.path.toAbsolute [ method ] * Utility method * Converts path
39184          * coordinates into absolute values - path (string) path string = (array)
39185          * path string \
39186          */
39187         Snap.path.toAbsolute = pathToAbsolute;
39188         /*
39189          * \ Snap.path.toCubic [ method ] * Utility method * Converts path to a new
39190          * path where all segments are cubic beziér curves - pathString
39191          * (string|array) path string or array of segments = (array) array of
39192          * segments \
39193          */
39194         Snap.path.toCubic = path2curve;
39195         /*
39196          * \ Snap.path.map [ method ] * Transform the path string with the given
39197          * matrix - path (string) path string - matrix (object) see @Matrix =
39198          * (string) transformed path string \
39199          */
39200         Snap.path.map = mapPath;
39201         Snap.path.toString = toString;
39202         Snap.path.clone = pathClone;
39203       });
39204       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39205       //
39206       // Licensed under the Apache License, Version 2.0 (the "License");
39207       // you may not use this file except in compliance with the License.
39208       // You may obtain a copy of the License at
39209       //
39210       // http://www.apache.org/licenses/LICENSE-2.0
39211       //
39212       // Unless required by applicable law or agreed to in writing, software
39213       // distributed under the License is distributed on an "AS IS" BASIS,
39214       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39215       // See the License for the specific language governing permissions and
39216       // limitations under the License.
39217       Snap.plugin(function(Snap, Element, Paper, glob) {
39218         var elproto = Element.prototype,
39219           has = "hasOwnProperty",
39220           supportsTouch = "createTouch" in glob.doc,
39221           events = [
39222             "click", "dblclick", "mousedown", "mousemove", "mouseout",
39223             "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
39224             "touchcancel", "keyup"
39225           ],
39226           touchMap = {
39227             mousedown: "touchstart",
39228             mousemove: "touchmove",
39229             mouseup: "touchend"
39230           },
39231           getScroll = function(xy, el) {
39232             var name = xy == "y" ? "scrollTop" : "scrollLeft",
39233               doc = el && el.node ? el.node.ownerDocument : glob.doc;
39234             return doc[name in doc.documentElement ? "documentElement" : "body"][name];
39235           },
39236           preventDefault = function() {
39237             this.returnValue = false;
39238           },
39239           preventTouch = function() {
39240             return this.originalEvent.preventDefault();
39241           },
39242           stopPropagation = function() {
39243             this.cancelBubble = true;
39244           },
39245           stopTouch = function() {
39246             return this.originalEvent.stopPropagation();
39247           },
39248           addEvent = (function() {
39249             if (glob.doc.addEventListener) {
39250               return function(obj, type, fn, element) {
39251                 var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
39252                   f = function(e) {
39253                     var scrollY = getScroll("y", element),
39254                       scrollX = getScroll("x", element);
39255                     if (supportsTouch && touchMap[has](type)) {
39256                       for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
39257                         if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
39258                           var olde = e;
39259                           e = e.targetTouches[i];
39260                           e.originalEvent = olde;
39261                           e.preventDefault = preventTouch;
39262                           e.stopPropagation = stopTouch;
39263                           break;
39264                         }
39265                       }
39266                     }
39267                     var x = e.clientX + scrollX,
39268                       y = e.clientY + scrollY;
39269                     return fn.call(element, e, x, y);
39270                   };
39271
39272                 if (type !== realName) {
39273                   obj.addEventListener(type, f, false);
39274                 }
39275
39276                 obj.addEventListener(realName, f, false);
39277
39278                 return function() {
39279                   if (type !== realName) {
39280                     obj.removeEventListener(type, f, false);
39281                   }
39282
39283                   obj.removeEventListener(realName, f, false);
39284                   return true;
39285                 };
39286               };
39287             } else if (glob.doc.attachEvent) {
39288               return function(obj, type, fn, element) {
39289                 var f = function(e) {
39290                   e = e || element.node.ownerDocument.window.event;
39291                   var scrollY = getScroll("y", element),
39292                     scrollX = getScroll("x", element),
39293                     x = e.clientX + scrollX,
39294                     y = e.clientY + scrollY;
39295                   e.preventDefault = e.preventDefault || preventDefault;
39296                   e.stopPropagation = e.stopPropagation || stopPropagation;
39297                   return fn.call(element, e, x, y);
39298                 };
39299                 obj.attachEvent("on" + type, f);
39300                 var detacher = function() {
39301                   obj.detachEvent("on" + type, f);
39302                   return true;
39303                 };
39304                 return detacher;
39305               };
39306             }
39307           })(),
39308           drag = [],
39309           dragMove = function(e) {
39310             var x = e.clientX,
39311               y = e.clientY,
39312               scrollY = getScroll("y"),
39313               scrollX = getScroll("x"),
39314               dragi,
39315               j = drag.length;
39316             while (j--) {
39317               dragi = drag[j];
39318               if (supportsTouch) {
39319                 var i = e.touches && e.touches.length,
39320                   touch;
39321                 while (i--) {
39322                   touch = e.touches[i];
39323                   if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
39324                     x = touch.clientX;
39325                     y = touch.clientY;
39326                     (e.originalEvent ? e.originalEvent : e).preventDefault();
39327                     break;
39328                   }
39329                 }
39330               } else {
39331                 e.preventDefault();
39332               }
39333               var node = dragi.el.node,
39334                 o,
39335                 next = node.nextSibling,
39336                 parent = node.parentNode,
39337                 display = node.style.display;
39338               // glob.win.opera && parent.removeChild(node);
39339               // node.style.display = "none";
39340               // o = dragi.el.paper.getElementByPoint(x, y);
39341               // node.style.display = display;
39342               // glob.win.opera && (next ? parent.insertBefore(node, next) :
39343               // parent.appendChild(node));
39344               // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
39345               x += scrollX;
39346               y += scrollY;
39347               eve("snap.drag.move." + dragi.el.id, dragi.move_scope || dragi.el, x - dragi.el._drag.x, y - dragi.el._drag.y, x, y, e);
39348             }
39349           },
39350           dragUp = function(e) {
39351             Snap.unmousemove(dragMove).unmouseup(dragUp);
39352             var i = drag.length,
39353               dragi;
39354             while (i--) {
39355               dragi = drag[i];
39356               dragi.el._drag = {};
39357               eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
39358             }
39359             drag = [];
39360           };
39361         /*
39362          * \ Element.click [ method ] * Adds a click event handler to the element -
39363          * handler (function) handler for the event = (object) @Element \
39364          */
39365         /*
39366          * \ Element.unclick [ method ] * Removes a click event handler from the
39367          * element - handler (function) handler for the event = (object) @Element \
39368          */
39369
39370         /*
39371          * \ Element.dblclick [ method ] * Adds a double click event handler to the
39372          * element - handler (function) handler for the event = (object) @Element \
39373          */
39374         /*
39375          * \ Element.undblclick [ method ] * Removes a double click event handler
39376          * from the element - handler (function) handler for the event = (object)
39377          * @Element \
39378          */
39379
39380         /*
39381          * \ Element.mousedown [ method ] * Adds a mousedown event handler to the
39382          * element - handler (function) handler for the event = (object) @Element \
39383          */
39384         /*
39385          * \ Element.unmousedown [ method ] * Removes a mousedown event handler from
39386          * the element - handler (function) handler for the event = (object)
39387          * @Element \
39388          */
39389
39390         /*
39391          * \ Element.mousemove [ method ] * Adds a mousemove event handler to the
39392          * element - handler (function) handler for the event = (object) @Element \
39393          */
39394         /*
39395          * \ Element.unmousemove [ method ] * Removes a mousemove event handler from
39396          * the element - handler (function) handler for the event = (object)
39397          * @Element \
39398          */
39399
39400         /*
39401          * \ Element.mouseout [ method ] * Adds a mouseout event handler to the
39402          * element - handler (function) handler for the event = (object) @Element \
39403          */
39404         /*
39405          * \ Element.unmouseout [ method ] * Removes a mouseout event handler from
39406          * the element - handler (function) handler for the event = (object)
39407          * @Element \
39408          */
39409
39410         /*
39411          * \ Element.mouseover [ method ] * Adds a mouseover event handler to the
39412          * element - handler (function) handler for the event = (object) @Element \
39413          */
39414         /*
39415          * \ Element.unmouseover [ method ] * Removes a mouseover event handler from
39416          * the element - handler (function) handler for the event = (object)
39417          * @Element \
39418          */
39419
39420         /*
39421          * \ Element.mouseup [ method ] * Adds a mouseup event handler to the
39422          * element - handler (function) handler for the event = (object) @Element \
39423          */
39424         /*
39425          * \ Element.unmouseup [ method ] * Removes a mouseup event handler from the
39426          * element - handler (function) handler for the event = (object) @Element \
39427          */
39428
39429         /*
39430          * \ Element.touchstart [ method ] * Adds a touchstart event handler to the
39431          * element - handler (function) handler for the event = (object) @Element \
39432          */
39433         /*
39434          * \ Element.untouchstart [ method ] * Removes a touchstart event handler
39435          * from the element - handler (function) handler for the event = (object)
39436          * @Element \
39437          */
39438
39439         /*
39440          * \ Element.touchmove [ method ] * Adds a touchmove event handler to the
39441          * element - handler (function) handler for the event = (object) @Element \
39442          */
39443         /*
39444          * \ Element.untouchmove [ method ] * Removes a touchmove event handler from
39445          * the element - handler (function) handler for the event = (object)
39446          * @Element \
39447          */
39448
39449         /*
39450          * \ Element.touchend [ method ] * Adds a touchend event handler to the
39451          * element - handler (function) handler for the event = (object) @Element \
39452          */
39453         /*
39454          * \ Element.untouchend [ method ] * Removes a touchend event handler from
39455          * the element - handler (function) handler for the event = (object)
39456          * @Element \
39457          */
39458
39459         /*
39460          * \ Element.touchcancel [ method ] * Adds a touchcancel event handler to
39461          * the element - handler (function) handler for the event = (object)
39462          * @Element \
39463          */
39464         /*
39465          * \ Element.untouchcancel [ method ] * Removes a touchcancel event handler
39466          * from the element - handler (function) handler for the event = (object)
39467          * @Element \
39468          */
39469         for (var i = events.length; i--;) {
39470           (function(eventName) {
39471             Snap[eventName] = elproto[eventName] = function(fn, scope) {
39472               if (Snap.is(fn, "function")) {
39473                 this.events = this.events || [];
39474                 this.events.push({
39475                   name: eventName,
39476                   f: fn,
39477                   unbind: addEvent(this.node || document, eventName, fn, scope || this)
39478                 });
39479               }
39480               return this;
39481             };
39482             Snap["un" + eventName] =
39483               elproto["un" + eventName] = function(fn) {
39484                 var events = this.events || [],
39485                   l = events.length;
39486                 while (l--)
39487                   if (events[l].name == eventName &&
39488                     (events[l].f == fn || !fn)) {
39489                     events[l].unbind();
39490                     events.splice(l, 1);
39491                     !events.length && delete this.events;
39492                     return this;
39493                   }
39494                 return this;
39495               };
39496           })(events[i]);
39497         }
39498         /*
39499          * \ Element.hover [ method ] * Adds hover event handlers to the element -
39500          * f_in (function) handler for hover in - f_out (function) handler for hover
39501          * out - icontext (object) #optional context for hover in handler - ocontext
39502          * (object) #optional context for hover out handler = (object) @Element \
39503          */
39504         elproto.hover = function(f_in, f_out, scope_in, scope_out) {
39505           return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
39506         };
39507         /*
39508          * \ Element.unhover [ method ] * Removes hover event handlers from the
39509          * element - f_in (function) handler for hover in - f_out (function) handler
39510          * for hover out = (object) @Element \
39511          */
39512         elproto.unhover = function(f_in, f_out) {
39513           return this.unmouseover(f_in).unmouseout(f_out);
39514         };
39515         var draggable = [];
39516         // SIERRA unclear what _context_ refers to for starting, ending, moving the
39517         // drag gesture.
39518         // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y
39519         // values offset from?
39520         // SIERRA Element.drag(): much of this member's doc appears to be duplicated
39521         // for some reason.
39522         // SIERRA Unclear about this sentence: _Additionally following drag events
39523         // will be triggered: drag.start.<id> on start, drag.end.<id> on end and
39524         // drag.move.<id> on every move._ Is there a global _drag_ object to which
39525         // you can assign handlers keyed by an element's ID?
39526         /*
39527          * \ Element.drag [ method ] * Adds event handlers for an element's drag
39528          * gesture * - onmove (function) handler for moving - onstart (function)
39529          * handler for drag start - onend (function) handler for drag end - mcontext
39530          * (object) #optional context for moving handler - scontext (object)
39531          * #optional context for drag start handler - econtext (object) #optional
39532          * context for drag end handler Additionaly following `drag` events are
39533          * triggered: `drag.start.<id>` on start, `drag.end.<id>` on end and
39534          * `drag.move.<id>` on every move. When element is dragged over another
39535          * element `drag.over.<id>` fires as well.
39536          *
39537          * Start event and start handler are called in specified context or in
39538          * context of the element with following parameters: o x (number) x position
39539          * of the mouse o y (number) y position of the mouse o event (object) DOM
39540          * event object Move event and move handler are called in specified context
39541          * or in context of the element with following parameters: o dx (number)
39542          * shift by x from the start point o dy (number) shift by y from the start
39543          * point o x (number) x position of the mouse o y (number) y position of the
39544          * mouse o event (object) DOM event object End event and end handler are
39545          * called in specified context or in context of the element with following
39546          * parameters: o event (object) DOM event object = (object) @Element \
39547          */
39548         elproto.drag = function(onmove, onstart, onend, move_scope, start_scope, end_scope) {
39549           if (!arguments.length) {
39550             var origTransform;
39551             return this.drag(function(dx, dy) {
39552               this.attr({
39553                 transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
39554               });
39555             }, function() {
39556               origTransform = this.transform().local;
39557             });
39558           }
39559
39560           function start(e, x, y) {
39561             (e.originalEvent || e).preventDefault();
39562             this._drag.x = x;
39563             this._drag.y = y;
39564             this._drag.id = e.identifier;
39565             !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
39566             drag.push({
39567               el: this,
39568               move_scope: move_scope,
39569               start_scope: start_scope,
39570               end_scope: end_scope
39571             });
39572             onstart && eve.on("snap.drag.start." + this.id, onstart);
39573             onmove && eve.on("snap.drag.move." + this.id, onmove);
39574             onend && eve.on("snap.drag.end." + this.id, onend);
39575             eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
39576           }
39577           this._drag = {};
39578           draggable.push({
39579             el: this,
39580             start: start
39581           });
39582           this.mousedown(start);
39583           return this;
39584         };
39585         /*
39586          * Element.onDragOver [ method ] * Shortcut to assign event handler for
39587          * `drag.over.<id>` event, where `id` is the element's `id` (see
39588          * @Element.id) - f (function) handler for event, first argument would be
39589          * the element you are dragging over \
39590          */
39591         // elproto.onDragOver = function (f) {
39592         // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over."
39593         // + this.id);
39594         // };
39595         /*
39596          * \ Element.undrag [ method ] * Removes all drag event handlers from the
39597          * given element \
39598          */
39599         elproto.undrag = function() {
39600           var i = draggable.length;
39601           while (i--)
39602             if (draggable[i].el == this) {
39603               this.unmousedown(draggable[i].start);
39604               draggable.splice(i, 1);
39605               eve.unbind("snap.drag.*." + this.id);
39606             }!draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
39607           return this;
39608         };
39609       });
39610       // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39611       //
39612       // Licensed under the Apache License, Version 2.0 (the "License");
39613       // you may not use this file except in compliance with the License.
39614       // You may obtain a copy of the License at
39615       //
39616       // http://www.apache.org/licenses/LICENSE-2.0
39617       //
39618       // Unless required by applicable law or agreed to in writing, software
39619       // distributed under the License is distributed on an "AS IS" BASIS,
39620       // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39621       // See the License for the specific language governing permissions and
39622       // limitations under the License.
39623       Snap.plugin(function(Snap, Element, Paper, glob) {
39624         var elproto = Element.prototype,
39625           pproto = Paper.prototype,
39626           rgurl = /^\s*url\((.+)\)/,
39627           Str = String,
39628           $ = Snap._.$;
39629         Snap.filter = {};
39630         /*
39631          * \ Paper.filter [ method ] * Creates a `<filter>` element * - filstr
39632          * (string) SVG fragment of filter provided as a string = (object) @Element
39633          * Note: It is recommended to use filters embedded into the page inside an
39634          * empty SVG element. > Usage | var f = paper.filter('<feGaussianBlur
39635          * stdDeviation="2"/>'), | c = paper.circle(10, 10, 10).attr({ | filter: f |
39636          * }); \
39637          */
39638         pproto.filter = function(filstr) {
39639           var paper = this;
39640           if (paper.type != "svg") {
39641             paper = paper.paper;
39642           }
39643           var f = Snap.parse(Str(filstr)),
39644             id = Snap._.id(),
39645             width = paper.node.offsetWidth,
39646             height = paper.node.offsetHeight,
39647             filter = $("filter");
39648           $(filter, {
39649             id: id,
39650             filterUnits: "userSpaceOnUse"
39651           });
39652           filter.appendChild(f.node);
39653           paper.defs.appendChild(filter);
39654           return new Element(filter);
39655         };
39656
39657         eve.on("snap.util.getattr.filter", function() {
39658           eve.stop();
39659           var p = $(this.node, "filter");
39660           if (p) {
39661             var match = Str(p).match(rgurl);
39662             return match && Snap.select(match[1]);
39663           }
39664         });
39665         eve.on("snap.util.attr.filter", function(value) {
39666           if (value instanceof Element && value.type == "filter") {
39667             eve.stop();
39668             var id = value.node.id;
39669             if (!id) {
39670               $(value.node, {
39671                 id: value.id
39672               });
39673               id = value.id;
39674             }
39675             $(this.node, {
39676               filter: Snap.url(id)
39677             });
39678           }
39679           if (!value || value == "none") {
39680             eve.stop();
39681             this.node.removeAttribute("filter");
39682           }
39683         });
39684         /*
39685          * \ Snap.filter.blur [ method ] * Returns an SVG markup string for the blur
39686          * filter * - x (number) amount of horizontal blur, in pixels - y (number)
39687          * #optional amount of vertical blur, in pixels = (string) filter
39688          * representation > Usage | var f = paper.filter(Snap.filter.blur(5, 10)), |
39689          * c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39690          */
39691         Snap.filter.blur = function(x, y) {
39692           if (x == null) {
39693             x = 2;
39694           }
39695           var def = y == null ? x : [x, y];
39696           return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
39697             def: def
39698           });
39699         };
39700         Snap.filter.blur.toString = function() {
39701           return this();
39702         };
39703         /*
39704          * \ Snap.filter.shadow [ method ] * Returns an SVG markup string for the
39705          * shadow filter * - dx (number) #optional horizontal shift of the shadow,
39706          * in pixels - dy (number) #optional vertical shift of the shadow, in pixels -
39707          * blur (number) #optional amount of blur - color (string) #optional color
39708          * of the shadow - opacity (number) #optional `0..1` opacity of the shadow
39709          * or - dx (number) #optional horizontal shift of the shadow, in pixels - dy
39710          * (number) #optional vertical shift of the shadow, in pixels - color
39711          * (string) #optional color of the shadow - opacity (number) #optional
39712          * `0..1` opacity of the shadow which makes blur default to `4`. Or - dx
39713          * (number) #optional horizontal shift of the shadow, in pixels - dy
39714          * (number) #optional vertical shift of the shadow, in pixels - opacity
39715          * (number) #optional `0..1` opacity of the shadow = (string) filter
39716          * representation > Usage | var f = paper.filter(Snap.filter.shadow(0, 2,
39717          * 3)), | c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39718          */
39719         Snap.filter.shadow = function(dx, dy, blur, color, opacity) {
39720           if (typeof blur == "string") {
39721             color = blur;
39722             opacity = color;
39723             blur = 4;
39724           }
39725           if (typeof color != "string") {
39726             opacity = color;
39727             color = "#000";
39728           }
39729           color = color || "#000";
39730           if (blur == null) {
39731             blur = 4;
39732           }
39733           if (opacity == null) {
39734             opacity = 1;
39735           }
39736           if (dx == null) {
39737             dx = 0;
39738             dy = 2;
39739           }
39740           if (dy == null) {
39741             dy = dx;
39742           }
39743           color = Snap.color(color);
39744           return Snap.format('<feGaussianBlur in="SourceAlpha" stdDeviation="{blur}"/><feOffset dx="{dx}" dy="{dy}" result="offsetblur"/><feFlood flood-color="{color}"/><feComposite in2="offsetblur" operator="in"/><feComponentTransfer><feFuncA type="linear" slope="{opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>', {
39745             color: color,
39746             dx: dx,
39747             dy: dy,
39748             blur: blur,
39749             opacity: opacity
39750           });
39751         };
39752         Snap.filter.shadow.toString = function() {
39753           return this();
39754         };
39755         /*
39756          * \ Snap.filter.grayscale [ method ] * Returns an SVG markup string for the
39757          * grayscale filter * - amount (number) amount of filter (`0..1`) = (string)
39758          * filter representation \
39759          */
39760         Snap.filter.grayscale = function(amount) {
39761           if (amount == null) {
39762             amount = 1;
39763           }
39764           return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
39765             a: 0.2126 + 0.7874 * (1 - amount),
39766             b: 0.7152 - 0.7152 * (1 - amount),
39767             c: 0.0722 - 0.0722 * (1 - amount),
39768             d: 0.2126 - 0.2126 * (1 - amount),
39769             e: 0.7152 + 0.2848 * (1 - amount),
39770             f: 0.0722 - 0.0722 * (1 - amount),
39771             g: 0.2126 - 0.2126 * (1 - amount),
39772             h: 0.0722 + 0.9278 * (1 - amount)
39773           });
39774         };
39775         Snap.filter.grayscale.toString = function() {
39776           return this();
39777         };
39778         /*
39779          * \ Snap.filter.sepia [ method ] * Returns an SVG markup string for the
39780          * sepia filter * - amount (number) amount of filter (`0..1`) = (string)
39781          * filter representation \
39782          */
39783         Snap.filter.sepia = function(amount) {
39784           if (amount == null) {
39785             amount = 1;
39786           }
39787           return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
39788             a: 0.393 + 0.607 * (1 - amount),
39789             b: 0.769 - 0.769 * (1 - amount),
39790             c: 0.189 - 0.189 * (1 - amount),
39791             d: 0.349 - 0.349 * (1 - amount),
39792             e: 0.686 + 0.314 * (1 - amount),
39793             f: 0.168 - 0.168 * (1 - amount),
39794             g: 0.272 - 0.272 * (1 - amount),
39795             h: 0.534 - 0.534 * (1 - amount),
39796             i: 0.131 + 0.869 * (1 - amount)
39797           });
39798         };
39799         Snap.filter.sepia.toString = function() {
39800           return this();
39801         };
39802         /*
39803          * \ Snap.filter.saturate [ method ] * Returns an SVG markup string for the
39804          * saturate filter * - amount (number) amount of filter (`0..1`) = (string)
39805          * filter representation \
39806          */
39807         Snap.filter.saturate = function(amount) {
39808           if (amount == null) {
39809             amount = 1;
39810           }
39811           return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
39812             amount: 1 - amount
39813           });
39814         };
39815         Snap.filter.saturate.toString = function() {
39816           return this();
39817         };
39818         /*
39819          * \ Snap.filter.hueRotate [ method ] * Returns an SVG markup string for the
39820          * hue-rotate filter * - angle (number) angle of rotation = (string) filter
39821          * representation \
39822          */
39823         Snap.filter.hueRotate = function(angle) {
39824           angle = angle || 0;
39825           return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
39826             angle: angle
39827           });
39828         };
39829         Snap.filter.hueRotate.toString = function() {
39830           return this();
39831         };
39832         /*
39833          * \ Snap.filter.invert [ method ] * Returns an SVG markup string for the
39834          * invert filter * - amount (number) amount of filter (`0..1`) = (string)
39835          * filter representation \
39836          */
39837         Snap.filter.invert = function(amount) {
39838           if (amount == null) {
39839             amount = 1;
39840           }
39841           return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
39842             amount: amount,
39843             amount2: 1 - amount
39844           });
39845         };
39846         Snap.filter.invert.toString = function() {
39847           return this();
39848         };
39849         /*
39850          * \ Snap.filter.brightness [ method ] * Returns an SVG markup string for
39851          * the brightness filter * - amount (number) amount of filter (`0..1`) =
39852          * (string) filter representation \
39853          */
39854         Snap.filter.brightness = function(amount) {
39855           if (amount == null) {
39856             amount = 1;
39857           }
39858           return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
39859             amount: amount
39860           });
39861         };
39862         Snap.filter.brightness.toString = function() {
39863           return this();
39864         };
39865         /*
39866          * \ Snap.filter.contrast [ method ] * Returns an SVG markup string for the
39867          * contrast filter * - amount (number) amount of filter (`0..1`) = (string)
39868          * filter representation \
39869          */
39870         Snap.filter.contrast = function(amount) {
39871           if (amount == null) {
39872             amount = 1;
39873           }
39874           return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}" intercept="{amount2}"/><feFuncG type="linear" slope="{amount}" intercept="{amount2}"/><feFuncB type="linear" slope="{amount}" intercept="{amount2}"/></feComponentTransfer>', {
39875             amount: amount,
39876             amount2: .5 - amount / 2
39877           });
39878         };
39879         Snap.filter.contrast.toString = function() {
39880           return this();
39881         };
39882       });
39883
39884       return Snap;
39885     }));
39886   }, {
39887     "eve": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js"
39888   }],
39889   "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js": [function(require, module, exports) {
39890     'use strict';
39891
39892     var snapsvg = module.exports = require('snapsvg');
39893
39894     snapsvg.plugin(function(Snap, Element) {
39895
39896       /*
39897        * \ Element.children [ method ] * Returns array of all the children of the
39898        * element. = (array) array of Elements \
39899        */
39900       Element.prototype.children = function() {
39901         var out = [],
39902           ch = this.node.childNodes;
39903         for (var i = 0, ii = ch.length; i < ii; i++) {
39904           out[i] = new Snap(ch[i]);
39905         }
39906         return out;
39907       };
39908     });
39909
39910
39911     /**
39912      * @class ClassPlugin
39913      *
39914      * Extends snapsvg with methods to add and remove classes
39915      */
39916     snapsvg.plugin(function(Snap, Element, Paper, global) {
39917
39918       function split(str) {
39919         return str.split(/\s+/);
39920       }
39921
39922       function join(array) {
39923         return array.join(' ');
39924       }
39925
39926       function getClasses(e) {
39927         return split(e.attr('class') || '');
39928       }
39929
39930       function setClasses(e, classes) {
39931         e.attr('class', join(classes));
39932       }
39933
39934       /**
39935        * @method snapsvg.Element#addClass
39936        *
39937        * @example
39938        *
39939        * e.attr('class', 'selector');
39940        *
39941        * e.addClass('foo bar'); // adds classes foo and bar e.attr('class'); // ->
39942        * 'selector foo bar'
39943        *
39944        * e.addClass('fooBar'); e.attr('class'); // -> 'selector foo bar fooBar'
39945        *
39946        * @param {String}
39947        *            cls classes to be added to the element
39948        *
39949        * @return {snapsvg.Element} the element (this)
39950        */
39951       Element.prototype.addClass = function(cls) {
39952         var current = getClasses(this),
39953           add = split(cls),
39954           i, e;
39955
39956         for (i = 0, e; !!(e = add[i]); i++) {
39957           if (current.indexOf(e) === -1) {
39958             current.push(e);
39959           }
39960         }
39961
39962         setClasses(this, current);
39963
39964         return this;
39965       };
39966
39967       /**
39968        * @method snapsvg.Element#hasClass
39969        *
39970        * @param {String}
39971        *            cls the class to query for
39972        * @return {Boolean} returns true if the element has the given class
39973        */
39974       Element.prototype.hasClass = function(cls) {
39975         if (!cls) {
39976           throw new Error('[snapsvg] syntax: hasClass(clsStr)');
39977         }
39978
39979         return getClasses(this).indexOf(cls) !== -1;
39980       };
39981
39982       /**
39983        * @method snapsvg.Element#removeClass
39984        *
39985        * @example
39986        *
39987        * e.attr('class', 'foo bar');
39988        *
39989        * e.removeClass('foo'); e.attr('class'); // -> 'bar'
39990        *
39991        * e.removeClass('foo bar'); // removes classes foo and bar e.attr('class'); // -> ''
39992        *
39993        * @param {String}
39994        *            cls classes to be removed from element
39995        *
39996        * @return {snapsvg.Element} the element (this)
39997        */
39998       Element.prototype.removeClass = function(cls) {
39999         var current = getClasses(this),
40000           remove = split(cls),
40001           i, e, idx;
40002
40003         for (i = 0, e; !!(e = remove[i]); i++) {
40004           idx = current.indexOf(e);
40005
40006           if (idx !== -1) {
40007             // remove element from array
40008             current.splice(idx, 1);
40009           }
40010         }
40011
40012         setClasses(this, current);
40013
40014         return this;
40015       };
40016
40017     });
40018
40019     /**
40020      * @class TranslatePlugin
40021      *
40022      * Extends snapsvg with methods to translate elements
40023      */
40024     snapsvg.plugin(function(Snap, Element, Paper, global) {
40025
40026       /*
40027        * @method snapsvg.Element#translate
40028        *
40029        * @example
40030        *
40031        * e.translate(10, 20);
40032        *  // sets transform matrix to translate(10, 20)
40033        *
40034        * @param {Number} x translation @param {Number} y translation
40035        *
40036        * @return {snapsvg.Element} the element (this)
40037        */
40038       Element.prototype.translate = function(x, y) {
40039         var matrix = new Snap.Matrix();
40040         matrix.translate(x, y);
40041         return this.transform(matrix);
40042       };
40043     });
40044
40045
40046     /**
40047      * @class CreatePlugin
40048      *
40049      * Create an svg element without attaching it to the dom
40050      */
40051     snapsvg.plugin(function(Snap) {
40052
40053       Snap.create = function(name, attrs) {
40054         return Snap._.wrap(Snap._.$(name, attrs));
40055       };
40056     });
40057
40058
40059     /**
40060      * @class CreatSnapAtPlugin
40061      *
40062      * Extends snap.svg with a method to create a SVG element at a specific position
40063      * in the DOM.
40064      */
40065     snapsvg.plugin(function(Snap, Element, Paper, global) {
40066
40067       /*
40068        * @method snapsvg.createSnapAt
40069        *
40070        * @example
40071        *
40072        * snapsvg.createSnapAt(parentNode, 200, 200);
40073        *
40074        * @param {Number} width of svg @param {Number} height of svg @param
40075        * {Object} parentNode svg Element will be child of this
40076        *
40077        * @return {snapsvg.Element} the newly created wrapped SVG element instance
40078        */
40079       Snap.createSnapAt = function(width, height, parentNode) {
40080
40081         var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
40082         svg.setAttribute('width', width);
40083         svg.setAttribute('height', height);
40084         if (!parentNode) {
40085           parentNode = document.body;
40086         }
40087         parentNode.appendChild(svg);
40088
40089         return new Snap(svg);
40090       };
40091     });
40092   }, {
40093     "snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js"
40094   }],
40095   "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js": [function(require, module, exports) {
40096     /*
40097      * ! jQuery JavaScript Library v2.1.4 http://jquery.com/
40098      *
40099      * Includes Sizzle.js http://sizzlejs.com/
40100      *
40101      * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors Released
40102      * under the MIT license http://jquery.org/license
40103      *
40104      * Date: 2015-04-28T16:01Z
40105      */
40106
40107     (function(global, factory) {
40108
40109       if (typeof module === "object" && typeof module.exports === "object") {
40110         // For CommonJS and CommonJS-like environments where a proper `window`
40111         // is present, execute the factory and get jQuery.
40112         // For environments that do not have a `window` with a `document`
40113         // (such as Node.js), expose a factory as module.exports.
40114         // This accentuates the need for the creation of a real `window`.
40115         // e.g. var jQuery = require("jquery")(window);
40116         // See ticket #14549 for more info.
40117         module.exports = global.document ?
40118           factory(global, true) :
40119           function(w) {
40120             if (!w.document) {
40121               throw new Error("jQuery requires a window with a document");
40122             }
40123             return factory(w);
40124           };
40125       } else {
40126         factory(global);
40127       }
40128
40129       // Pass this if window is not defined yet
40130     }(typeof window !== "undefined" ? window : this, function(window, noGlobal) {
40131
40132       // Support: Firefox 18+
40133       // Can't be in strict mode, several libs including ASP.NET trace
40134       // the stack via arguments.caller.callee and Firefox dies if
40135       // you try to trace through "use strict" call chains. (#13335)
40136       //
40137
40138       var arr = [];
40139
40140       var slice = arr.slice;
40141
40142       var concat = arr.concat;
40143
40144       var push = arr.push;
40145
40146       var indexOf = arr.indexOf;
40147
40148       var class2type = {};
40149
40150       var toString = class2type.toString;
40151
40152       var hasOwn = class2type.hasOwnProperty;
40153
40154       var support = {};
40155
40156
40157
40158       var
40159         // Use the correct document accordingly with window argument (sandbox)
40160         document = window.document,
40161
40162         version = "2.1.4",
40163
40164         // Define a local copy of jQuery
40165         jQuery = function(selector, context) {
40166           // The jQuery object is actually just the init constructor 'enhanced'
40167           // Need init if jQuery is called (just allow error to be thrown if not
40168           // included)
40169           return new jQuery.fn.init(selector, context);
40170         },
40171
40172         // Support: Android<4.1
40173         // Make sure we trim BOM and NBSP
40174         rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
40175
40176         // Matches dashed string for camelizing
40177         rmsPrefix = /^-ms-/,
40178         rdashAlpha = /-([\da-z])/gi,
40179
40180         // Used by jQuery.camelCase as callback to replace()
40181         fcamelCase = function(all, letter) {
40182           return letter.toUpperCase();
40183         };
40184
40185       jQuery.fn = jQuery.prototype = {
40186         // The current version of jQuery being used
40187         jquery: version,
40188
40189         constructor: jQuery,
40190
40191         // Start with an empty selector
40192         selector: "",
40193
40194         // The default length of a jQuery object is 0
40195         length: 0,
40196
40197         toArray: function() {
40198           return slice.call(this);
40199         },
40200
40201         // Get the Nth element in the matched element set OR
40202         // Get the whole matched element set as a clean array
40203         get: function(num) {
40204           return num != null ?
40205
40206             // Return just the one element from the set
40207             (num < 0 ? this[num + this.length] : this[num]) :
40208
40209             // Return all the elements in a clean array
40210             slice.call(this);
40211         },
40212
40213         // Take an array of elements and push it onto the stack
40214         // (returning the new matched element set)
40215         pushStack: function(elems) {
40216
40217           // Build a new jQuery matched element set
40218           var ret = jQuery.merge(this.constructor(), elems);
40219
40220           // Add the old object onto the stack (as a reference)
40221           ret.prevObject = this;
40222           ret.context = this.context;
40223
40224           // Return the newly-formed element set
40225           return ret;
40226         },
40227
40228         // Execute a callback for every element in the matched set.
40229         // (You can seed the arguments with an array of args, but this is
40230         // only used internally.)
40231         each: function(callback, args) {
40232           return jQuery.each(this, callback, args);
40233         },
40234
40235         map: function(callback) {
40236           return this.pushStack(jQuery.map(this, function(elem, i) {
40237             return callback.call(elem, i, elem);
40238           }));
40239         },
40240
40241         slice: function() {
40242           return this.pushStack(slice.apply(this, arguments));
40243         },
40244
40245         first: function() {
40246           return this.eq(0);
40247         },
40248
40249         last: function() {
40250           return this.eq(-1);
40251         },
40252
40253         eq: function(i) {
40254           var len = this.length,
40255             j = +i + (i < 0 ? len : 0);
40256           return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
40257         },
40258
40259         end: function() {
40260           return this.prevObject || this.constructor(null);
40261         },
40262
40263         // For internal use only.
40264         // Behaves like an Array's method, not like a jQuery method.
40265         push: push,
40266         sort: arr.sort,
40267         splice: arr.splice
40268       };
40269
40270       jQuery.extend = jQuery.fn.extend = function() {
40271         var options, name, src, copy, copyIsArray, clone,
40272           target = arguments[0] || {},
40273           i = 1,
40274           length = arguments.length,
40275           deep = false;
40276
40277         // Handle a deep copy situation
40278         if (typeof target === "boolean") {
40279           deep = target;
40280
40281           // Skip the boolean and the target
40282           target = arguments[i] || {};
40283           i++;
40284         }
40285
40286         // Handle case when target is a string or something (possible in deep copy)
40287         if (typeof target !== "object" && !jQuery.isFunction(target)) {
40288           target = {};
40289         }
40290
40291         // Extend jQuery itself if only one argument is passed
40292         if (i === length) {
40293           target = this;
40294           i--;
40295         }
40296
40297         for (; i < length; i++) {
40298           // Only deal with non-null/undefined values
40299           if ((options = arguments[i]) != null) {
40300             // Extend the base object
40301             for (name in options) {
40302               src = target[name];
40303               copy = options[name];
40304
40305               // Prevent never-ending loop
40306               if (target === copy) {
40307                 continue;
40308               }
40309
40310               // Recurse if we're merging plain objects or arrays
40311               if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
40312                 if (copyIsArray) {
40313                   copyIsArray = false;
40314                   clone = src && jQuery.isArray(src) ? src : [];
40315
40316                 } else {
40317                   clone = src && jQuery.isPlainObject(src) ? src : {};
40318                 }
40319
40320                 // Never move original objects, clone them
40321                 target[name] = jQuery.extend(deep, clone, copy);
40322
40323                 // Don't bring in undefined values
40324               } else if (copy !== undefined) {
40325                 target[name] = copy;
40326               }
40327             }
40328           }
40329         }
40330
40331         // Return the modified object
40332         return target;
40333       };
40334
40335       jQuery.extend({
40336         // Unique for each copy of jQuery on the page
40337         expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
40338
40339         // Assume jQuery is ready without the ready module
40340         isReady: true,
40341
40342         error: function(msg) {
40343           throw new Error(msg);
40344         },
40345
40346         noop: function() {},
40347
40348         isFunction: function(obj) {
40349           return jQuery.type(obj) === "function";
40350         },
40351
40352         isArray: Array.isArray,
40353
40354         isWindow: function(obj) {
40355           return obj != null && obj === obj.window;
40356         },
40357
40358         isNumeric: function(obj) {
40359           // parseFloat NaNs numeric-cast false positives (null|true|false|"")
40360           // ...but misinterprets leading-number strings, particularly hex
40361           // literals ("0x...")
40362           // subtraction forces infinities to NaN
40363           // adding 1 corrects loss of precision from parseFloat (#15100)
40364           return !jQuery.isArray(obj) && (obj - parseFloat(obj) + 1) >= 0;
40365         },
40366
40367         isPlainObject: function(obj) {
40368           // Not plain objects:
40369           // - Any object or value whose internal [[Class]] property is not
40370           // "[object Object]"
40371           // - DOM nodes
40372           // - window
40373           if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
40374             return false;
40375           }
40376
40377           if (obj.constructor &&
40378             !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
40379             return false;
40380           }
40381
40382           // If the function hasn't returned already, we're confident that
40383           // |obj| is a plain object, created by {} or constructed with new Object
40384           return true;
40385         },
40386
40387         isEmptyObject: function(obj) {
40388           var name;
40389           for (name in obj) {
40390             return false;
40391           }
40392           return true;
40393         },
40394
40395         type: function(obj) {
40396           if (obj == null) {
40397             return obj + "";
40398           }
40399           // Support: Android<4.0, iOS<6 (functionish RegExp)
40400           return typeof obj === "object" || typeof obj === "function" ?
40401             class2type[toString.call(obj)] || "object" :
40402             typeof obj;
40403         },
40404
40405         // Evaluates a script in a global context
40406         globalEval: function(code) {
40407           var script,
40408             indirect = eval;
40409
40410           code = jQuery.trim(code);
40411
40412           if (code) {
40413             // If the code includes a valid, prologue position
40414             // strict mode pragma, execute code by injecting a
40415             // script tag into the document.
40416             if (code.indexOf("use strict") === 1) {
40417               script = document.createElement("script");
40418               script.text = code;
40419               document.head.appendChild(script).parentNode.removeChild(script);
40420             } else {
40421               // Otherwise, avoid the DOM node creation, insertion
40422               // and removal by using an indirect global eval
40423               indirect(code);
40424             }
40425           }
40426         },
40427
40428         // Convert dashed to camelCase; used by the css and data modules
40429         // Support: IE9-11+
40430         // Microsoft forgot to hump their vendor prefix (#9572)
40431         camelCase: function(string) {
40432           return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
40433         },
40434
40435         nodeName: function(elem, name) {
40436           return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
40437         },
40438
40439         // args is for internal usage only
40440         each: function(obj, callback, args) {
40441           var value,
40442             i = 0,
40443             length = obj.length,
40444             isArray = isArraylike(obj);
40445
40446           if (args) {
40447             if (isArray) {
40448               for (; i < length; i++) {
40449                 value = callback.apply(obj[i], args);
40450
40451                 if (value === false) {
40452                   break;
40453                 }
40454               }
40455             } else {
40456               for (i in obj) {
40457                 value = callback.apply(obj[i], args);
40458
40459                 if (value === false) {
40460                   break;
40461                 }
40462               }
40463             }
40464
40465             // A special, fast, case for the most common use of each
40466           } else {
40467             if (isArray) {
40468               for (; i < length; i++) {
40469                 value = callback.call(obj[i], i, obj[i]);
40470
40471                 if (value === false) {
40472                   break;
40473                 }
40474               }
40475             } else {
40476               for (i in obj) {
40477                 value = callback.call(obj[i], i, obj[i]);
40478
40479                 if (value === false) {
40480                   break;
40481                 }
40482               }
40483             }
40484           }
40485
40486           return obj;
40487         },
40488
40489         // Support: Android<4.1
40490         trim: function(text) {
40491           return text == null ?
40492             "" :
40493             (text + "").replace(rtrim, "");
40494         },
40495
40496         // results is for internal usage only
40497         makeArray: function(arr, results) {
40498           var ret = results || [];
40499
40500           if (arr != null) {
40501             if (isArraylike(Object(arr))) {
40502               jQuery.merge(ret,
40503                 typeof arr === "string" ? [arr] : arr
40504               );
40505             } else {
40506               push.call(ret, arr);
40507             }
40508           }
40509
40510           return ret;
40511         },
40512
40513         inArray: function(elem, arr, i) {
40514           return arr == null ? -1 : indexOf.call(arr, elem, i);
40515         },
40516
40517         merge: function(first, second) {
40518           var len = +second.length,
40519             j = 0,
40520             i = first.length;
40521
40522           for (; j < len; j++) {
40523             first[i++] = second[j];
40524           }
40525
40526           first.length = i;
40527
40528           return first;
40529         },
40530
40531         grep: function(elems, callback, invert) {
40532           var callbackInverse,
40533             matches = [],
40534             i = 0,
40535             length = elems.length,
40536             callbackExpect = !invert;
40537
40538           // Go through the array, only saving the items
40539           // that pass the validator function
40540           for (; i < length; i++) {
40541             callbackInverse = !callback(elems[i], i);
40542             if (callbackInverse !== callbackExpect) {
40543               matches.push(elems[i]);
40544             }
40545           }
40546
40547           return matches;
40548         },
40549
40550         // arg is for internal usage only
40551         map: function(elems, callback, arg) {
40552           var value,
40553             i = 0,
40554             length = elems.length,
40555             isArray = isArraylike(elems),
40556             ret = [];
40557
40558           // Go through the array, translating each of the items to their new
40559           // values
40560           if (isArray) {
40561             for (; i < length; i++) {
40562               value = callback(elems[i], i, arg);
40563
40564               if (value != null) {
40565                 ret.push(value);
40566               }
40567             }
40568
40569             // Go through every key on the object,
40570           } else {
40571             for (i in elems) {
40572               value = callback(elems[i], i, arg);
40573
40574               if (value != null) {
40575                 ret.push(value);
40576               }
40577             }
40578           }
40579
40580           // Flatten any nested arrays
40581           return concat.apply([], ret);
40582         },
40583
40584         // A global GUID counter for objects
40585         guid: 1,
40586
40587         // Bind a function to a context, optionally partially applying any
40588         // arguments.
40589         proxy: function(fn, context) {
40590           var tmp, args, proxy;
40591
40592           if (typeof context === "string") {
40593             tmp = fn[context];
40594             context = fn;
40595             fn = tmp;
40596           }
40597
40598           // Quick check to determine if target is callable, in the spec
40599           // this throws a TypeError, but we will just return undefined.
40600           if (!jQuery.isFunction(fn)) {
40601             return undefined;
40602           }
40603
40604           // Simulated bind
40605           args = slice.call(arguments, 2);
40606           proxy = function() {
40607             return fn.apply(context || this, args.concat(slice.call(arguments)));
40608           };
40609
40610           // Set the guid of unique handler to the same of original handler, so it
40611           // can be removed
40612           proxy.guid = fn.guid = fn.guid || jQuery.guid++;
40613
40614           return proxy;
40615         },
40616
40617         now: Date.now,
40618
40619         // jQuery.support is not used in Core but other projects attach their
40620         // properties to it so it needs to exist.
40621         support: support
40622       });
40623
40624       // Populate the class2type map
40625       jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
40626         class2type["[object " + name + "]"] = name.toLowerCase();
40627       });
40628
40629       function isArraylike(obj) {
40630
40631         // Support: iOS 8.2 (not reproducible in simulator)
40632         // `in` check used to prevent JIT error (gh-2145)
40633         // hasOwn isn't used here due to false negatives
40634         // regarding Nodelist length in IE
40635         var length = "length" in obj && obj.length,
40636           type = jQuery.type(obj);
40637
40638         if (type === "function" || jQuery.isWindow(obj)) {
40639           return false;
40640         }
40641
40642         if (obj.nodeType === 1 && length) {
40643           return true;
40644         }
40645
40646         return type === "array" || length === 0 ||
40647           typeof length === "number" && length > 0 && (length - 1) in obj;
40648       }
40649       var Sizzle =
40650         /*
40651          * ! Sizzle CSS Selector Engine v2.2.0-pre http://sizzlejs.com/
40652          *
40653          * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors Released
40654          * under the MIT license http://jquery.org/license
40655          *
40656          * Date: 2014-12-16
40657          */
40658         (function(window) {
40659
40660           var i,
40661             support,
40662             Expr,
40663             getText,
40664             isXML,
40665             tokenize,
40666             compile,
40667             select,
40668             outermostContext,
40669             sortInput,
40670             hasDuplicate,
40671
40672             // Local document vars
40673             setDocument,
40674             document,
40675             docElem,
40676             documentIsHTML,
40677             rbuggyQSA,
40678             rbuggyMatches,
40679             matches,
40680             contains,
40681
40682             // Instance-specific data
40683             expando = "sizzle" + 1 * new Date(),
40684             preferredDoc = window.document,
40685             dirruns = 0,
40686             done = 0,
40687             classCache = createCache(),
40688             tokenCache = createCache(),
40689             compilerCache = createCache(),
40690             sortOrder = function(a, b) {
40691               if (a === b) {
40692                 hasDuplicate = true;
40693               }
40694               return 0;
40695             },
40696
40697             // General-purpose constants
40698             MAX_NEGATIVE = 1 << 31,
40699
40700             // Instance methods
40701             hasOwn = ({}).hasOwnProperty,
40702             arr = [],
40703             pop = arr.pop,
40704             push_native = arr.push,
40705             push = arr.push,
40706             slice = arr.slice,
40707             // Use a stripped-down indexOf as it's faster than native
40708             // http://jsperf.com/thor-indexof-vs-for/5
40709             indexOf = function(list, elem) {
40710               var i = 0,
40711                 len = list.length;
40712               for (; i < len; i++) {
40713                 if (list[i] === elem) {
40714                   return i;
40715                 }
40716               }
40717               return -1;
40718             },
40719
40720             booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
40721
40722             // Regular expressions
40723
40724             // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
40725             whitespace = "[\\x20\\t\\r\\n\\f]",
40726             // http://www.w3.org/TR/css3-syntax/#characters
40727             characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
40728
40729             // Loosely modeled on CSS identifier characters
40730             // An unquoted value should be a CSS identifier
40731             // http://www.w3.org/TR/css3-selectors/#attribute-selectors
40732             // Proper syntax:
40733             // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
40734             identifier = characterEncoding.replace("w", "w#"),
40735
40736             // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
40737             attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
40738             // Operator (capture 2)
40739             "*([*^$|!~]?=)" + whitespace +
40740             // "Attribute values must be CSS identifiers [capture 5] or strings
40741             // [capture 3 or capture 4]"
40742             "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
40743             "*\\]",
40744
40745             pseudos = ":(" + characterEncoding + ")(?:\\((" +
40746             // To reduce the number of selectors needing tokenize in the preFilter,
40747             // prefer arguments:
40748             // 1. quoted (capture 3; capture 4 or capture 5)
40749             "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
40750             // 2. simple (capture 6)
40751             "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
40752             // 3. anything else (capture 2)
40753             ".*" +
40754             ")\\)|)",
40755
40756             // Leading and non-escaped trailing whitespace, capturing some
40757             // non-whitespace characters preceding the latter
40758             rwhitespace = new RegExp(whitespace + "+", "g"),
40759             rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
40760
40761             rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
40762             rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
40763
40764             rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"),
40765
40766             rpseudo = new RegExp(pseudos),
40767             ridentifier = new RegExp("^" + identifier + "$"),
40768
40769             matchExpr = {
40770               "ID": new RegExp("^#(" + characterEncoding + ")"),
40771               "CLASS": new RegExp("^\\.(" + characterEncoding + ")"),
40772               "TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
40773               "ATTR": new RegExp("^" + attributes),
40774               "PSEUDO": new RegExp("^" + pseudos),
40775               "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
40776                 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
40777                 "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
40778               "bool": new RegExp("^(?:" + booleans + ")$", "i"),
40779               // For use in libraries implementing .is()
40780               // We use this for POS matching in `select`
40781               "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
40782                 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
40783             },
40784
40785             rinputs = /^(?:input|select|textarea|button)$/i,
40786             rheader = /^h\d$/i,
40787
40788             rnative = /^[^{]+\{\s*\[native \w/,
40789
40790             // Easily-parseable/retrievable ID or TAG or CLASS selectors
40791             rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
40792
40793             rsibling = /[+~]/,
40794             rescape = /'|\\/g,
40795
40796             // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
40797             runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"),
40798             funescape = function(_, escaped, escapedWhitespace) {
40799               var high = "0x" + escaped - 0x10000;
40800               // NaN means non-codepoint
40801               // Support: Firefox<24
40802               // Workaround erroneous numeric interpretation of +"0x"
40803               return high !== high || escapedWhitespace ?
40804                 escaped :
40805                 high < 0 ?
40806                 // BMP codepoint
40807                 String.fromCharCode(high + 0x10000) :
40808                 // Supplemental Plane codepoint (surrogate pair)
40809                 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
40810             },
40811
40812             // Used for iframes
40813             // See setDocument()
40814             // Removing the function wrapper causes a "Permission Denied"
40815             // error in IE
40816             unloadHandler = function() {
40817               setDocument();
40818             };
40819
40820           // Optimize for push.apply( _, NodeList )
40821           try {
40822             push.apply(
40823               (arr = slice.call(preferredDoc.childNodes)),
40824               preferredDoc.childNodes
40825             );
40826             // Support: Android<4.0
40827             // Detect silently failing push.apply
40828             arr[preferredDoc.childNodes.length].nodeType;
40829           } catch (e) {
40830             push = {
40831               apply: arr.length ?
40832
40833                 // Leverage slice if possible
40834                 function(target, els) {
40835                   push_native.apply(target, slice.call(els));
40836                 } :
40837
40838                 // Support: IE<9
40839                 // Otherwise append directly
40840                 function(target, els) {
40841                   var j = target.length,
40842                     i = 0;
40843                   // Can't trust NodeList.length
40844                   while ((target[j++] = els[i++])) {}
40845                   target.length = j - 1;
40846                 }
40847             };
40848           }
40849
40850           function Sizzle(selector, context, results, seed) {
40851             var match, elem, m, nodeType,
40852               // QSA vars
40853               i, groups, old, nid, newContext, newSelector;
40854
40855             if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
40856               setDocument(context);
40857             }
40858
40859             context = context || document;
40860             results = results || [];
40861             nodeType = context.nodeType;
40862
40863             if (typeof selector !== "string" || !selector ||
40864               nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
40865
40866               return results;
40867             }
40868
40869             if (!seed && documentIsHTML) {
40870
40871               // Try to shortcut find operations when possible (e.g., not under
40872               // DocumentFragment)
40873               if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
40874                 // Speed-up: Sizzle("#ID")
40875                 if ((m = match[1])) {
40876                   if (nodeType === 9) {
40877                     elem = context.getElementById(m);
40878                     // Check parentNode to catch when Blackberry 4.6 returns
40879                     // nodes that are no longer in the document (jQuery #6963)
40880                     if (elem && elem.parentNode) {
40881                       // Handle the case where IE, Opera, and Webkit return
40882                       // items
40883                       // by name instead of ID
40884                       if (elem.id === m) {
40885                         results.push(elem);
40886                         return results;
40887                       }
40888                     } else {
40889                       return results;
40890                     }
40891                   } else {
40892                     // Context is not a document
40893                     if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
40894                       contains(context, elem) && elem.id === m) {
40895                       results.push(elem);
40896                       return results;
40897                     }
40898                   }
40899
40900                   // Speed-up: Sizzle("TAG")
40901                 } else if (match[2]) {
40902                   push.apply(results, context.getElementsByTagName(selector));
40903                   return results;
40904
40905                   // Speed-up: Sizzle(".CLASS")
40906                 } else if ((m = match[3]) && support.getElementsByClassName) {
40907                   push.apply(results, context.getElementsByClassName(m));
40908                   return results;
40909                 }
40910               }
40911
40912               // QSA path
40913               if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
40914                 nid = old = expando;
40915                 newContext = context;
40916                 newSelector = nodeType !== 1 && selector;
40917
40918                 // qSA works strangely on Element-rooted queries
40919                 // We can work around this by specifying an extra ID on the root
40920                 // and working up from there (Thanks to Andrew Dupont for the
40921                 // technique)
40922                 // IE 8 doesn't work on object elements
40923                 if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
40924                   groups = tokenize(selector);
40925
40926                   if ((old = context.getAttribute("id"))) {
40927                     nid = old.replace(rescape, "\\$&");
40928                   } else {
40929                     context.setAttribute("id", nid);
40930                   }
40931                   nid = "[id='" + nid + "'] ";
40932
40933                   i = groups.length;
40934                   while (i--) {
40935                     groups[i] = nid + toSelector(groups[i]);
40936                   }
40937                   newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
40938                   newSelector = groups.join(",");
40939                 }
40940
40941                 if (newSelector) {
40942                   try {
40943                     push.apply(results,
40944                       newContext.querySelectorAll(newSelector)
40945                     );
40946                     return results;
40947                   } catch (qsaError) {} finally {
40948                     if (!old) {
40949                       context.removeAttribute("id");
40950                     }
40951                   }
40952                 }
40953               }
40954             }
40955
40956             // All others
40957             return select(selector.replace(rtrim, "$1"), context, results, seed);
40958           }
40959
40960           /**
40961            * Create key-value caches of limited size
40962            *
40963            * @returns {Function(string, Object)} Returns the Object data after storing it
40964            *          on itself with property name the (space-suffixed) string and (if the
40965            *          cache is larger than Expr.cacheLength) deleting the oldest entry
40966            */
40967           function createCache() {
40968             var keys = [];
40969
40970             function cache(key, value) {
40971               // Use (key + " ") to avoid collision with native prototype properties
40972               // (see Issue #157)
40973               if (keys.push(key + " ") > Expr.cacheLength) {
40974                 // Only keep the most recent entries
40975                 delete cache[keys.shift()];
40976               }
40977               return (cache[key + " "] = value);
40978             }
40979             return cache;
40980           }
40981
40982           /**
40983            * Mark a function for special use by Sizzle
40984            *
40985            * @param {Function}
40986            *            fn The function to mark
40987            */
40988           function markFunction(fn) {
40989             fn[expando] = true;
40990             return fn;
40991           }
40992
40993           /**
40994            * Support testing using an element
40995            *
40996            * @param {Function}
40997            *            fn Passed the created div and expects a boolean result
40998            */
40999           function assert(fn) {
41000             var div = document.createElement("div");
41001
41002             try {
41003               return !!fn(div);
41004             } catch (e) {
41005               return false;
41006             } finally {
41007               // Remove from its parent by default
41008               if (div.parentNode) {
41009                 div.parentNode.removeChild(div);
41010               }
41011               // release memory in IE
41012               div = null;
41013             }
41014           }
41015
41016           /**
41017            * Adds the same handler for all of the specified attrs
41018            *
41019            * @param {String}
41020            *            attrs Pipe-separated list of attributes
41021            * @param {Function}
41022            *            handler The method that will be applied
41023            */
41024           function addHandle(attrs, handler) {
41025             var arr = attrs.split("|"),
41026               i = attrs.length;
41027
41028             while (i--) {
41029               Expr.attrHandle[arr[i]] = handler;
41030             }
41031           }
41032
41033           /**
41034            * Checks document order of two siblings
41035            *
41036            * @param {Element}
41037            *            a
41038            * @param {Element}
41039            *            b
41040            * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a
41041            *          follows b
41042            */
41043           function siblingCheck(a, b) {
41044             var cur = b && a,
41045               diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
41046               (~b.sourceIndex || MAX_NEGATIVE) -
41047               (~a.sourceIndex || MAX_NEGATIVE);
41048
41049             // Use IE sourceIndex if available on both nodes
41050             if (diff) {
41051               return diff;
41052             }
41053
41054             // Check if b follows a
41055             if (cur) {
41056               while ((cur = cur.nextSibling)) {
41057                 if (cur === b) {
41058                   return -1;
41059                 }
41060               }
41061             }
41062
41063             return a ? 1 : -1;
41064           }
41065
41066           /**
41067            * Returns a function to use in pseudos for input types
41068            *
41069            * @param {String}
41070            *            type
41071            */
41072           function createInputPseudo(type) {
41073             return function(elem) {
41074               var name = elem.nodeName.toLowerCase();
41075               return name === "input" && elem.type === type;
41076             };
41077           }
41078
41079           /**
41080            * Returns a function to use in pseudos for buttons
41081            *
41082            * @param {String}
41083            *            type
41084            */
41085           function createButtonPseudo(type) {
41086             return function(elem) {
41087               var name = elem.nodeName.toLowerCase();
41088               return (name === "input" || name === "button") && elem.type === type;
41089             };
41090           }
41091
41092           /**
41093            * Returns a function to use in pseudos for positionals
41094            *
41095            * @param {Function}
41096            *            fn
41097            */
41098           function createPositionalPseudo(fn) {
41099             return markFunction(function(argument) {
41100               argument = +argument;
41101               return markFunction(function(seed, matches) {
41102                 var j,
41103                   matchIndexes = fn([], seed.length, argument),
41104                   i = matchIndexes.length;
41105
41106                 // Match elements found at the specified indexes
41107                 while (i--) {
41108                   if (seed[(j = matchIndexes[i])]) {
41109                     seed[j] = !(matches[j] = seed[j]);
41110                   }
41111                 }
41112               });
41113             });
41114           }
41115
41116           /**
41117            * Checks a node for validity as a Sizzle context
41118            *
41119            * @param {Element|Object=}
41120            *            context
41121            * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a
41122            *          falsy value
41123            */
41124           function testContext(context) {
41125             return context && typeof context.getElementsByTagName !== "undefined" && context;
41126           }
41127
41128           // Expose support vars for convenience
41129           support = Sizzle.support = {};
41130
41131           /**
41132            * Detects XML nodes
41133            *
41134            * @param {Element|Object}
41135            *            elem An element or a document
41136            * @returns {Boolean} True iff elem is a non-HTML XML node
41137            */
41138           isXML = Sizzle.isXML = function(elem) {
41139             // documentElement is verified for cases where it doesn't yet exist
41140             // (such as loading iframes in IE - #4833)
41141             var documentElement = elem && (elem.ownerDocument || elem).documentElement;
41142             return documentElement ? documentElement.nodeName !== "HTML" : false;
41143           };
41144
41145           /**
41146            * Sets document-related variables once based on the current document
41147            *
41148            * @param {Element|Object}
41149            *            [doc] An element or document object to use to set the document
41150            * @returns {Object} Returns the current document
41151            */
41152           setDocument = Sizzle.setDocument = function(node) {
41153             var hasCompare, parent,
41154               doc = node ? node.ownerDocument || node : preferredDoc;
41155
41156             // If no document and documentElement is available, return
41157             if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
41158               return document;
41159             }
41160
41161             // Set our document
41162             document = doc;
41163             docElem = doc.documentElement;
41164             parent = doc.defaultView;
41165
41166             // Support: IE>8
41167             // If iframe document is assigned to "document" variable and if iframe has
41168             // been reloaded,
41169             // IE will throw "permission denied" error when accessing "document"
41170             // variable, see jQuery #13936
41171             // IE6-8 do not support the defaultView property so parent will be undefined
41172             if (parent && parent !== parent.top) {
41173               // IE11 does not have attachEvent, so all must suffer
41174               if (parent.addEventListener) {
41175                 parent.addEventListener("unload", unloadHandler, false);
41176               } else if (parent.attachEvent) {
41177                 parent.attachEvent("onunload", unloadHandler);
41178               }
41179             }
41180
41181             /*
41182              * Support tests
41183              * ----------------------------------------------------------------------
41184              */
41185             documentIsHTML = !isXML(doc);
41186
41187             /*
41188              * Attributes
41189              * ----------------------------------------------------------------------
41190              */
41191
41192             // Support: IE<8
41193             // Verify that getAttribute really returns attributes and not properties
41194             // (excepting IE8 booleans)
41195             support.attributes = assert(function(div) {
41196               div.className = "i";
41197               return !div.getAttribute("className");
41198             });
41199
41200             /***************************************************************************
41201              * getElement(s)By
41202              * ----------------------------------------------------------------------
41203              */
41204
41205             // Check if getElementsByTagName("*") returns only elements
41206             support.getElementsByTagName = assert(function(div) {
41207               div.appendChild(doc.createComment(""));
41208               return !div.getElementsByTagName("*").length;
41209             });
41210
41211             // Support: IE<9
41212             support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
41213
41214             // Support: IE<10
41215             // Check if getElementById returns elements by name
41216             // The broken getElementById methods don't pick up programatically-set
41217             // names,
41218             // so use a roundabout getElementsByName test
41219             support.getById = assert(function(div) {
41220               docElem.appendChild(div).id = expando;
41221               return !doc.getElementsByName || !doc.getElementsByName(expando).length;
41222             });
41223
41224             // ID find and filter
41225             if (support.getById) {
41226               Expr.find["ID"] = function(id, context) {
41227                 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
41228                   var m = context.getElementById(id);
41229                   // Check parentNode to catch when Blackberry 4.6 returns
41230                   // nodes that are no longer in the document #6963
41231                   return m && m.parentNode ? [m] : [];
41232                 }
41233               };
41234               Expr.filter["ID"] = function(id) {
41235                 var attrId = id.replace(runescape, funescape);
41236                 return function(elem) {
41237                   return elem.getAttribute("id") === attrId;
41238                 };
41239               };
41240             } else {
41241               // Support: IE6/7
41242               // getElementById is not reliable as a find shortcut
41243               delete Expr.find["ID"];
41244
41245               Expr.filter["ID"] = function(id) {
41246                 var attrId = id.replace(runescape, funescape);
41247                 return function(elem) {
41248                   var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
41249                   return node && node.value === attrId;
41250                 };
41251               };
41252             }
41253
41254             // Tag
41255             Expr.find["TAG"] = support.getElementsByTagName ?
41256               function(tag, context) {
41257                 if (typeof context.getElementsByTagName !== "undefined") {
41258                   return context.getElementsByTagName(tag);
41259
41260                   // DocumentFragment nodes don't have gEBTN
41261                 } else if (support.qsa) {
41262                   return context.querySelectorAll(tag);
41263                 }
41264               } :
41265
41266               function(tag, context) {
41267                 var elem,
41268                   tmp = [],
41269                   i = 0,
41270                   // By happy coincidence, a (broken) gEBTN appears on
41271                   // DocumentFragment nodes too
41272                   results = context.getElementsByTagName(tag);
41273
41274                 // Filter out possible comments
41275                 if (tag === "*") {
41276                   while ((elem = results[i++])) {
41277                     if (elem.nodeType === 1) {
41278                       tmp.push(elem);
41279                     }
41280                   }
41281
41282                   return tmp;
41283                 }
41284                 return results;
41285               };
41286
41287             // Class
41288             Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
41289               if (documentIsHTML) {
41290                 return context.getElementsByClassName(className);
41291               }
41292             };
41293
41294             /*
41295              * QSA/matchesSelector
41296              * ----------------------------------------------------------------------
41297              */
41298
41299             // QSA and matchesSelector support
41300
41301             // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
41302             rbuggyMatches = [];
41303
41304             // qSa(:focus) reports false when true (Chrome 21)
41305             // We allow this because of a bug in IE8/9 that throws an error
41306             // whenever `document.activeElement` is accessed on an iframe
41307             // So, we allow :focus to pass through QSA all the time to avoid the IE
41308             // error
41309             // See http://bugs.jquery.com/ticket/13378
41310             rbuggyQSA = [];
41311
41312             if ((support.qsa = rnative.test(doc.querySelectorAll))) {
41313               // Build QSA regex
41314               // Regex strategy adopted from Diego Perini
41315               assert(function(div) {
41316                 // Select is set to empty string on purpose
41317                 // This is to test IE's treatment of not explicitly
41318                 // setting a boolean content attribute,
41319                 // since its presence should be enough
41320                 // http://bugs.jquery.com/ticket/12359
41321                 docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a>" +
41322                   "<select id='" + expando + "-\f]' msallowcapture=''>" +
41323                   "<option selected=''></option></select>";
41324
41325                 // Support: IE8, Opera 11-12.16
41326                 // Nothing should be selected when empty strings follow ^= or $= or
41327                 // *=
41328                 // The test attribute must be unknown in Opera but "safe" for WinRT
41329                 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
41330                 if (div.querySelectorAll("[msallowcapture^='']").length) {
41331                   rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
41332                 }
41333
41334                 // Support: IE8
41335                 // Boolean attributes and "value" are not treated correctly
41336                 if (!div.querySelectorAll("[selected]").length) {
41337                   rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
41338                 }
41339
41340                 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+,
41341                 // PhantomJS<1.9.7+
41342                 if (!div.querySelectorAll("[id~=" + expando + "-]").length) {
41343                   rbuggyQSA.push("~=");
41344                 }
41345
41346                 // Webkit/Opera - :checked should return selected option elements
41347                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41348                 // IE8 throws error here and will not see later tests
41349                 if (!div.querySelectorAll(":checked").length) {
41350                   rbuggyQSA.push(":checked");
41351                 }
41352
41353                 // Support: Safari 8+, iOS 8+
41354                 // https://bugs.webkit.org/show_bug.cgi?id=136851
41355                 // In-page `selector#id sibing-combinator selector` fails
41356                 if (!div.querySelectorAll("a#" + expando + "+*").length) {
41357                   rbuggyQSA.push(".#.+[+~]");
41358                 }
41359               });
41360
41361               assert(function(div) {
41362                 // Support: Windows 8 Native Apps
41363                 // The type and name attributes are restricted during .innerHTML
41364                 // assignment
41365                 var input = doc.createElement("input");
41366                 input.setAttribute("type", "hidden");
41367                 div.appendChild(input).setAttribute("name", "D");
41368
41369                 // Support: IE8
41370                 // Enforce case-sensitivity of name attribute
41371                 if (div.querySelectorAll("[name=d]").length) {
41372                   rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
41373                 }
41374
41375                 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements
41376                 // are still enabled)
41377                 // IE8 throws error here and will not see later tests
41378                 if (!div.querySelectorAll(":enabled").length) {
41379                   rbuggyQSA.push(":enabled", ":disabled");
41380                 }
41381
41382                 // Opera 10-11 does not throw on post-comma invalid pseudos
41383                 div.querySelectorAll("*,:x");
41384                 rbuggyQSA.push(",.*:");
41385               });
41386             }
41387
41388             if ((support.matchesSelector = rnative.test((matches = docElem.matches ||
41389                 docElem.webkitMatchesSelector ||
41390                 docElem.mozMatchesSelector ||
41391                 docElem.oMatchesSelector ||
41392                 docElem.msMatchesSelector)))) {
41393
41394               assert(function(div) {
41395                 // Check to see if it's possible to do matchesSelector
41396                 // on a disconnected node (IE 9)
41397                 support.disconnectedMatch = matches.call(div, "div");
41398
41399                 // This should fail with an exception
41400                 // Gecko does not error, returns false instead
41401                 matches.call(div, "[s!='']:x");
41402                 rbuggyMatches.push("!=", pseudos);
41403               });
41404             }
41405
41406             rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
41407             rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
41408
41409             /*
41410              * Contains
41411              * ----------------------------------------------------------------------
41412              */
41413             hasCompare = rnative.test(docElem.compareDocumentPosition);
41414
41415             // Element contains another
41416             // Purposefully does not implement inclusive descendent
41417             // As in, an element does not contain itself
41418             contains = hasCompare || rnative.test(docElem.contains) ?
41419               function(a, b) {
41420                 var adown = a.nodeType === 9 ? a.documentElement : a,
41421                   bup = b && b.parentNode;
41422                 return a === bup || !!(bup && bup.nodeType === 1 && (
41423                   adown.contains ?
41424                   adown.contains(bup) :
41425                   a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
41426                 ));
41427               } :
41428               function(a, b) {
41429                 if (b) {
41430                   while ((b = b.parentNode)) {
41431                     if (b === a) {
41432                       return true;
41433                     }
41434                   }
41435                 }
41436                 return false;
41437               };
41438
41439             /*
41440              * Sorting
41441              * ----------------------------------------------------------------------
41442              */
41443
41444             // Document order sorting
41445             sortOrder = hasCompare ?
41446               function(a, b) {
41447
41448                 // Flag for duplicate removal
41449                 if (a === b) {
41450                   hasDuplicate = true;
41451                   return 0;
41452                 }
41453
41454                 // Sort on method existence if only one input has
41455                 // compareDocumentPosition
41456                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
41457                 if (compare) {
41458                   return compare;
41459                 }
41460
41461                 // Calculate position if both inputs belong to the same document
41462                 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ?
41463                   a.compareDocumentPosition(b) :
41464
41465                   // Otherwise we know they are disconnected
41466                   1;
41467
41468                 // Disconnected nodes
41469                 if (compare & 1 ||
41470                   (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
41471
41472                   // Choose the first element that is related to our preferred
41473                   // document
41474                   if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
41475                     return -1;
41476                   }
41477                   if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
41478                     return 1;
41479                   }
41480
41481                   // Maintain original order
41482                   return sortInput ?
41483                     (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41484                     0;
41485                 }
41486
41487                 return compare & 4 ? -1 : 1;
41488               } :
41489               function(a, b) {
41490                 // Exit early if the nodes are identical
41491                 if (a === b) {
41492                   hasDuplicate = true;
41493                   return 0;
41494                 }
41495
41496                 var cur,
41497                   i = 0,
41498                   aup = a.parentNode,
41499                   bup = b.parentNode,
41500                   ap = [a],
41501                   bp = [b];
41502
41503                 // Parentless nodes are either documents or disconnected
41504                 if (!aup || !bup) {
41505                   return a === doc ? -1 :
41506                     b === doc ? 1 :
41507                     aup ? -1 :
41508                     bup ? 1 :
41509                     sortInput ?
41510                     (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41511                     0;
41512
41513                   // If the nodes are siblings, we can do a quick check
41514                 } else if (aup === bup) {
41515                   return siblingCheck(a, b);
41516                 }
41517
41518                 // Otherwise we need full lists of their ancestors for comparison
41519                 cur = a;
41520                 while ((cur = cur.parentNode)) {
41521                   ap.unshift(cur);
41522                 }
41523                 cur = b;
41524                 while ((cur = cur.parentNode)) {
41525                   bp.unshift(cur);
41526                 }
41527
41528                 // Walk down the tree looking for a discrepancy
41529                 while (ap[i] === bp[i]) {
41530                   i++;
41531                 }
41532
41533                 return i ?
41534                   // Do a sibling check if the nodes have a common ancestor
41535                   siblingCheck(ap[i], bp[i]) :
41536
41537                   // Otherwise nodes in our document sort first
41538                   ap[i] === preferredDoc ? -1 :
41539                   bp[i] === preferredDoc ? 1 :
41540                   0;
41541               };
41542
41543             return doc;
41544           };
41545
41546           Sizzle.matches = function(expr, elements) {
41547             return Sizzle(expr, null, null, elements);
41548           };
41549
41550           Sizzle.matchesSelector = function(elem, expr) {
41551             // Set document vars if needed
41552             if ((elem.ownerDocument || elem) !== document) {
41553               setDocument(elem);
41554             }
41555
41556             // Make sure that attribute selectors are quoted
41557             expr = expr.replace(rattributeQuotes, "='$1']");
41558
41559             if (support.matchesSelector && documentIsHTML &&
41560               (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
41561               (!rbuggyQSA || !rbuggyQSA.test(expr))) {
41562
41563               try {
41564                 var ret = matches.call(elem, expr);
41565
41566                 // IE 9's matchesSelector returns false on disconnected nodes
41567                 if (ret || support.disconnectedMatch ||
41568                   // As well, disconnected nodes are said to be in a document
41569                   // fragment in IE 9
41570                   elem.document && elem.document.nodeType !== 11) {
41571                   return ret;
41572                 }
41573               } catch (e) {}
41574             }
41575
41576             return Sizzle(expr, document, null, [elem]).length > 0;
41577           };
41578
41579           Sizzle.contains = function(context, elem) {
41580             // Set document vars if needed
41581             if ((context.ownerDocument || context) !== document) {
41582               setDocument(context);
41583             }
41584             return contains(context, elem);
41585           };
41586
41587           Sizzle.attr = function(elem, name) {
41588             // Set document vars if needed
41589             if ((elem.ownerDocument || elem) !== document) {
41590               setDocument(elem);
41591             }
41592
41593             var fn = Expr.attrHandle[name.toLowerCase()],
41594               // Don't get fooled by Object.prototype properties (jQuery #13807)
41595               val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ?
41596               fn(elem, name, !documentIsHTML) :
41597               undefined;
41598
41599             return val !== undefined ?
41600               val :
41601               support.attributes || !documentIsHTML ?
41602               elem.getAttribute(name) :
41603               (val = elem.getAttributeNode(name)) && val.specified ?
41604               val.value :
41605               null;
41606           };
41607
41608           Sizzle.error = function(msg) {
41609             throw new Error("Syntax error, unrecognized expression: " + msg);
41610           };
41611
41612           /**
41613            * Document sorting and removing duplicates
41614            *
41615            * @param {ArrayLike}
41616            *            results
41617            */
41618           Sizzle.uniqueSort = function(results) {
41619             var elem,
41620               duplicates = [],
41621               j = 0,
41622               i = 0;
41623
41624             // Unless we *know* we can detect duplicates, assume their presence
41625             hasDuplicate = !support.detectDuplicates;
41626             sortInput = !support.sortStable && results.slice(0);
41627             results.sort(sortOrder);
41628
41629             if (hasDuplicate) {
41630               while ((elem = results[i++])) {
41631                 if (elem === results[i]) {
41632                   j = duplicates.push(i);
41633                 }
41634               }
41635               while (j--) {
41636                 results.splice(duplicates[j], 1);
41637               }
41638             }
41639
41640             // Clear input after sorting to release objects
41641             // See https://github.com/jquery/sizzle/pull/225
41642             sortInput = null;
41643
41644             return results;
41645           };
41646
41647           /**
41648            * Utility function for retrieving the text value of an array of DOM nodes
41649            *
41650            * @param {Array|Element}
41651            *            elem
41652            */
41653           getText = Sizzle.getText = function(elem) {
41654             var node,
41655               ret = "",
41656               i = 0,
41657               nodeType = elem.nodeType;
41658
41659             if (!nodeType) {
41660               // If no nodeType, this is expected to be an array
41661               while ((node = elem[i++])) {
41662                 // Do not traverse comment nodes
41663                 ret += getText(node);
41664               }
41665             } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
41666               // Use textContent for elements
41667               // innerText usage removed for consistency of new lines (jQuery #11153)
41668               if (typeof elem.textContent === "string") {
41669                 return elem.textContent;
41670               } else {
41671                 // Traverse its children
41672                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41673                   ret += getText(elem);
41674                 }
41675               }
41676             } else if (nodeType === 3 || nodeType === 4) {
41677               return elem.nodeValue;
41678             }
41679             // Do not include comment or processing instruction nodes
41680
41681             return ret;
41682           };
41683
41684           Expr = Sizzle.selectors = {
41685
41686             // Can be adjusted by the user
41687             cacheLength: 50,
41688
41689             createPseudo: markFunction,
41690
41691             match: matchExpr,
41692
41693             attrHandle: {},
41694
41695             find: {},
41696
41697             relative: {
41698               ">": {
41699                 dir: "parentNode",
41700                 first: true
41701               },
41702               " ": {
41703                 dir: "parentNode"
41704               },
41705               "+": {
41706                 dir: "previousSibling",
41707                 first: true
41708               },
41709               "~": {
41710                 dir: "previousSibling"
41711               }
41712             },
41713
41714             preFilter: {
41715               "ATTR": function(match) {
41716                 match[1] = match[1].replace(runescape, funescape);
41717
41718                 // Move the given value to match[3] whether quoted or unquoted
41719                 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
41720
41721                 if (match[2] === "~=") {
41722                   match[3] = " " + match[3] + " ";
41723                 }
41724
41725                 return match.slice(0, 4);
41726               },
41727
41728               "CHILD": function(match) {
41729                 /*
41730                  * matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what
41731                  * (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4
41732                  * xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component
41733                  * 6 x of xn-component 7 sign of y-component 8 y of y-component
41734                  */
41735                 match[1] = match[1].toLowerCase();
41736
41737                 if (match[1].slice(0, 3) === "nth") {
41738                   // nth-* requires argument
41739                   if (!match[3]) {
41740                     Sizzle.error(match[0]);
41741                   }
41742
41743                   // numeric x and y parameters for Expr.filter.CHILD
41744                   // remember that false/true cast respectively to 0/1
41745                   match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
41746                   match[5] = +((match[7] + match[8]) || match[3] === "odd");
41747
41748                   // other types prohibit arguments
41749                 } else if (match[3]) {
41750                   Sizzle.error(match[0]);
41751                 }
41752
41753                 return match;
41754               },
41755
41756               "PSEUDO": function(match) {
41757                 var excess,
41758                   unquoted = !match[6] && match[2];
41759
41760                 if (matchExpr["CHILD"].test(match[0])) {
41761                   return null;
41762                 }
41763
41764                 // Accept quoted arguments as-is
41765                 if (match[3]) {
41766                   match[2] = match[4] || match[5] || "";
41767
41768                   // Strip excess characters from unquoted arguments
41769                 } else if (unquoted && rpseudo.test(unquoted) &&
41770                   // Get excess from tokenize (recursively)
41771                   (excess = tokenize(unquoted, true)) &&
41772                   // advance to the next closing parenthesis
41773                   (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
41774
41775                   // excess is a negative index
41776                   match[0] = match[0].slice(0, excess);
41777                   match[2] = unquoted.slice(0, excess);
41778                 }
41779
41780                 // Return only captures needed by the pseudo filter method (type and
41781                 // argument)
41782                 return match.slice(0, 3);
41783               }
41784             },
41785
41786             filter: {
41787
41788               "TAG": function(nodeNameSelector) {
41789                 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
41790                 return nodeNameSelector === "*" ?
41791                   function() {
41792                     return true;
41793                   } :
41794                   function(elem) {
41795                     return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
41796                   };
41797               },
41798
41799               "CLASS": function(className) {
41800                 var pattern = classCache[className + " "];
41801
41802                 return pattern ||
41803                   (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&
41804                   classCache(className, function(elem) {
41805                     return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
41806                   });
41807               },
41808
41809               "ATTR": function(name, operator, check) {
41810                 return function(elem) {
41811                   var result = Sizzle.attr(elem, name);
41812
41813                   if (result == null) {
41814                     return operator === "!=";
41815                   }
41816                   if (!operator) {
41817                     return true;
41818                   }
41819
41820                   result += "";
41821
41822                   return operator === "=" ? result === check :
41823                     operator === "!=" ? result !== check :
41824                     operator === "^=" ? check && result.indexOf(check) === 0 :
41825                     operator === "*=" ? check && result.indexOf(check) > -1 :
41826                     operator === "$=" ? check && result.slice(-check.length) === check :
41827                     operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 :
41828                     operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :
41829                     false;
41830                 };
41831               },
41832
41833               "CHILD": function(type, what, argument, first, last) {
41834                 var simple = type.slice(0, 3) !== "nth",
41835                   forward = type.slice(-4) !== "last",
41836                   ofType = what === "of-type";
41837
41838                 return first === 1 && last === 0 ?
41839
41840                   // Shortcut for :nth-*(n)
41841                   function(elem) {
41842                     return !!elem.parentNode;
41843                   } :
41844
41845                   function(elem, context, xml) {
41846                     var cache, outerCache, node, diff, nodeIndex, start,
41847                       dir = simple !== forward ? "nextSibling" : "previousSibling",
41848                       parent = elem.parentNode,
41849                       name = ofType && elem.nodeName.toLowerCase(),
41850                       useCache = !xml && !ofType;
41851
41852                     if (parent) {
41853
41854                       // :(first|last|only)-(child|of-type)
41855                       if (simple) {
41856                         while (dir) {
41857                           node = elem;
41858                           while ((node = node[dir])) {
41859                             if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
41860                               return false;
41861                             }
41862                           }
41863                           // Reverse direction for :only-* (if we haven't
41864                           // yet done so)
41865                           start = dir = type === "only" && !start && "nextSibling";
41866                         }
41867                         return true;
41868                       }
41869
41870                       start = [forward ? parent.firstChild : parent.lastChild];
41871
41872                       // non-xml :nth-child(...) stores cache data on `parent`
41873                       if (forward && useCache) {
41874                         // Seek `elem` from a previously-cached index
41875                         outerCache = parent[expando] || (parent[expando] = {});
41876                         cache = outerCache[type] || [];
41877                         nodeIndex = cache[0] === dirruns && cache[1];
41878                         diff = cache[0] === dirruns && cache[2];
41879                         node = nodeIndex && parent.childNodes[nodeIndex];
41880
41881                         while ((node = ++nodeIndex && node && node[dir] ||
41882
41883                             // Fallback to seeking `elem` from the start
41884                             (diff = nodeIndex = 0) || start.pop())) {
41885
41886                           // When found, cache indexes on `parent` and
41887                           // break
41888                           if (node.nodeType === 1 && ++diff && node === elem) {
41889                             outerCache[type] = [dirruns, nodeIndex, diff];
41890                             break;
41891                           }
41892                         }
41893
41894                         // Use previously-cached element index if available
41895                       } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
41896                         diff = cache[1];
41897
41898                         // xml :nth-child(...) or :nth-last-child(...) or
41899                         // :nth(-last)?-of-type(...)
41900                       } else {
41901                         // Use the same loop as above to seek `elem` from
41902                         // the start
41903                         while ((node = ++nodeIndex && node && node[dir] ||
41904                             (diff = nodeIndex = 0) || start.pop())) {
41905
41906                           if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
41907                             // Cache the index of each encountered
41908                             // element
41909                             if (useCache) {
41910                               (node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
41911                             }
41912
41913                             if (node === elem) {
41914                               break;
41915                             }
41916                           }
41917                         }
41918                       }
41919
41920                       // Incorporate the offset, then check against cycle size
41921                       diff -= last;
41922                       return diff === first || (diff % first === 0 && diff / first >= 0);
41923                     }
41924                   };
41925               },
41926
41927               "PSEUDO": function(pseudo, argument) {
41928                 // pseudo-class names are case-insensitive
41929                 // http://www.w3.org/TR/selectors/#pseudo-classes
41930                 // Prioritize by case sensitivity in case custom pseudos are added
41931                 // with uppercase letters
41932                 // Remember that setFilters inherits from pseudos
41933                 var args,
41934                   fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] ||
41935                   Sizzle.error("unsupported pseudo: " + pseudo);
41936
41937                 // The user may use createPseudo to indicate that
41938                 // arguments are needed to create the filter function
41939                 // just as Sizzle does
41940                 if (fn[expando]) {
41941                   return fn(argument);
41942                 }
41943
41944                 // But maintain support for old signatures
41945                 if (fn.length > 1) {
41946                   args = [pseudo, pseudo, "", argument];
41947                   return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ?
41948                     markFunction(function(seed, matches) {
41949                       var idx,
41950                         matched = fn(seed, argument),
41951                         i = matched.length;
41952                       while (i--) {
41953                         idx = indexOf(seed, matched[i]);
41954                         seed[idx] = !(matches[idx] = matched[i]);
41955                       }
41956                     }) :
41957                     function(elem) {
41958                       return fn(elem, 0, args);
41959                     };
41960                 }
41961
41962                 return fn;
41963               }
41964             },
41965
41966             pseudos: {
41967               // Potentially complex pseudos
41968               "not": markFunction(function(selector) {
41969                 // Trim the selector passed to compile
41970                 // to avoid treating leading and trailing
41971                 // spaces as combinators
41972                 var input = [],
41973                   results = [],
41974                   matcher = compile(selector.replace(rtrim, "$1"));
41975
41976                 return matcher[expando] ?
41977                   markFunction(function(seed, matches, context, xml) {
41978                     var elem,
41979                       unmatched = matcher(seed, null, xml, []),
41980                       i = seed.length;
41981
41982                     // Match elements unmatched by `matcher`
41983                     while (i--) {
41984                       if ((elem = unmatched[i])) {
41985                         seed[i] = !(matches[i] = elem);
41986                       }
41987                     }
41988                   }) :
41989                   function(elem, context, xml) {
41990                     input[0] = elem;
41991                     matcher(input, null, xml, results);
41992                     // Don't keep the element (issue #299)
41993                     input[0] = null;
41994                     return !results.pop();
41995                   };
41996               }),
41997
41998               "has": markFunction(function(selector) {
41999                 return function(elem) {
42000                   return Sizzle(selector, elem).length > 0;
42001                 };
42002               }),
42003
42004               "contains": markFunction(function(text) {
42005                 text = text.replace(runescape, funescape);
42006                 return function(elem) {
42007                   return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
42008                 };
42009               }),
42010
42011               // "Whether an element is represented by a :lang() selector
42012               // is based solely on the element's language value
42013               // being equal to the identifier C,
42014               // or beginning with the identifier C immediately followed by "-".
42015               // The matching of C against the element's language value is performed
42016               // case-insensitively.
42017               // The identifier C does not have to be a valid language name."
42018               // http://www.w3.org/TR/selectors/#lang-pseudo
42019               "lang": markFunction(function(lang) {
42020                 // lang value must be a valid identifier
42021                 if (!ridentifier.test(lang || "")) {
42022                   Sizzle.error("unsupported lang: " + lang);
42023                 }
42024                 lang = lang.replace(runescape, funescape).toLowerCase();
42025                 return function(elem) {
42026                   var elemLang;
42027                   do {
42028                     if ((elemLang = documentIsHTML ?
42029                         elem.lang :
42030                         elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
42031
42032                       elemLang = elemLang.toLowerCase();
42033                       return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
42034                     }
42035                   } while ((elem = elem.parentNode) && elem.nodeType === 1);
42036                   return false;
42037                 };
42038               }),
42039
42040               // Miscellaneous
42041               "target": function(elem) {
42042                 var hash = window.location && window.location.hash;
42043                 return hash && hash.slice(1) === elem.id;
42044               },
42045
42046               "root": function(elem) {
42047                 return elem === docElem;
42048               },
42049
42050               "focus": function(elem) {
42051                 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
42052               },
42053
42054               // Boolean properties
42055               "enabled": function(elem) {
42056                 return elem.disabled === false;
42057               },
42058
42059               "disabled": function(elem) {
42060                 return elem.disabled === true;
42061               },
42062
42063               "checked": function(elem) {
42064                 // In CSS3, :checked should return both checked and selected
42065                 // elements
42066                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
42067                 var nodeName = elem.nodeName.toLowerCase();
42068                 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
42069               },
42070
42071               "selected": function(elem) {
42072                 // Accessing this property makes selected-by-default
42073                 // options in Safari work properly
42074                 if (elem.parentNode) {
42075                   elem.parentNode.selectedIndex;
42076                 }
42077
42078                 return elem.selected === true;
42079               },
42080
42081               // Contents
42082               "empty": function(elem) {
42083                 // http://www.w3.org/TR/selectors/#empty-pseudo
42084                 // :empty is negated by element (1) or content nodes (text: 3;
42085                 // cdata: 4; entity ref: 5),
42086                 // but not by others (comment: 8; processing instruction: 7; etc.)
42087                 // nodeType < 6 works because attributes (2) do not appear as
42088                 // children
42089                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
42090                   if (elem.nodeType < 6) {
42091                     return false;
42092                   }
42093                 }
42094                 return true;
42095               },
42096
42097               "parent": function(elem) {
42098                 return !Expr.pseudos["empty"](elem);
42099               },
42100
42101               // Element/input types
42102               "header": function(elem) {
42103                 return rheader.test(elem.nodeName);
42104               },
42105
42106               "input": function(elem) {
42107                 return rinputs.test(elem.nodeName);
42108               },
42109
42110               "button": function(elem) {
42111                 var name = elem.nodeName.toLowerCase();
42112                 return name === "input" && elem.type === "button" || name === "button";
42113               },
42114
42115               "text": function(elem) {
42116                 var attr;
42117                 return elem.nodeName.toLowerCase() === "input" &&
42118                   elem.type === "text" &&
42119
42120                   // Support: IE<8
42121                   // New HTML5 attribute values (e.g., "search") appear with
42122                   // elem.type === "text"
42123                   ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
42124               },
42125
42126               // Position-in-collection
42127               "first": createPositionalPseudo(function() {
42128                 return [0];
42129               }),
42130
42131               "last": createPositionalPseudo(function(matchIndexes, length) {
42132                 return [length - 1];
42133               }),
42134
42135               "eq": createPositionalPseudo(function(matchIndexes, length, argument) {
42136                 return [argument < 0 ? argument + length : argument];
42137               }),
42138
42139               "even": createPositionalPseudo(function(matchIndexes, length) {
42140                 var i = 0;
42141                 for (; i < length; i += 2) {
42142                   matchIndexes.push(i);
42143                 }
42144                 return matchIndexes;
42145               }),
42146
42147               "odd": createPositionalPseudo(function(matchIndexes, length) {
42148                 var i = 1;
42149                 for (; i < length; i += 2) {
42150                   matchIndexes.push(i);
42151                 }
42152                 return matchIndexes;
42153               }),
42154
42155               "lt": createPositionalPseudo(function(matchIndexes, length, argument) {
42156                 var i = argument < 0 ? argument + length : argument;
42157                 for (; --i >= 0;) {
42158                   matchIndexes.push(i);
42159                 }
42160                 return matchIndexes;
42161               }),
42162
42163               "gt": createPositionalPseudo(function(matchIndexes, length, argument) {
42164                 var i = argument < 0 ? argument + length : argument;
42165                 for (; ++i < length;) {
42166                   matchIndexes.push(i);
42167                 }
42168                 return matchIndexes;
42169               })
42170             }
42171           };
42172
42173           Expr.pseudos["nth"] = Expr.pseudos["eq"];
42174
42175           // Add button/input type pseudos
42176           for (i in {
42177               radio: true,
42178               checkbox: true,
42179               file: true,
42180               password: true,
42181               image: true
42182             }) {
42183             Expr.pseudos[i] = createInputPseudo(i);
42184           }
42185           for (i in {
42186               submit: true,
42187               reset: true
42188             }) {
42189             Expr.pseudos[i] = createButtonPseudo(i);
42190           }
42191
42192           // Easy API for creating new setFilters
42193           function setFilters() {}
42194           setFilters.prototype = Expr.filters = Expr.pseudos;
42195           Expr.setFilters = new setFilters();
42196
42197           tokenize = Sizzle.tokenize = function(selector, parseOnly) {
42198             var matched, match, tokens, type,
42199               soFar, groups, preFilters,
42200               cached = tokenCache[selector + " "];
42201
42202             if (cached) {
42203               return parseOnly ? 0 : cached.slice(0);
42204             }
42205
42206             soFar = selector;
42207             groups = [];
42208             preFilters = Expr.preFilter;
42209
42210             while (soFar) {
42211
42212               // Comma and first run
42213               if (!matched || (match = rcomma.exec(soFar))) {
42214                 if (match) {
42215                   // Don't consume trailing commas as valid
42216                   soFar = soFar.slice(match[0].length) || soFar;
42217                 }
42218                 groups.push((tokens = []));
42219               }
42220
42221               matched = false;
42222
42223               // Combinators
42224               if ((match = rcombinators.exec(soFar))) {
42225                 matched = match.shift();
42226                 tokens.push({
42227                   value: matched,
42228                   // Cast descendant combinators to space
42229                   type: match[0].replace(rtrim, " ")
42230                 });
42231                 soFar = soFar.slice(matched.length);
42232               }
42233
42234               // Filters
42235               for (type in Expr.filter) {
42236                 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] ||
42237                     (match = preFilters[type](match)))) {
42238                   matched = match.shift();
42239                   tokens.push({
42240                     value: matched,
42241                     type: type,
42242                     matches: match
42243                   });
42244                   soFar = soFar.slice(matched.length);
42245                 }
42246               }
42247
42248               if (!matched) {
42249                 break;
42250               }
42251             }
42252
42253             // Return the length of the invalid excess
42254             // if we're just parsing
42255             // Otherwise, throw an error or return tokens
42256             return parseOnly ?
42257               soFar.length :
42258               soFar ?
42259               Sizzle.error(selector) :
42260               // Cache the tokens
42261               tokenCache(selector, groups).slice(0);
42262           };
42263
42264           function toSelector(tokens) {
42265             var i = 0,
42266               len = tokens.length,
42267               selector = "";
42268             for (; i < len; i++) {
42269               selector += tokens[i].value;
42270             }
42271             return selector;
42272           }
42273
42274           function addCombinator(matcher, combinator, base) {
42275             var dir = combinator.dir,
42276               checkNonElements = base && dir === "parentNode",
42277               doneName = done++;
42278
42279             return combinator.first ?
42280               // Check against closest ancestor/preceding element
42281               function(elem, context, xml) {
42282                 while ((elem = elem[dir])) {
42283                   if (elem.nodeType === 1 || checkNonElements) {
42284                     return matcher(elem, context, xml);
42285                   }
42286                 }
42287               } :
42288
42289               // Check against all ancestor/preceding elements
42290               function(elem, context, xml) {
42291                 var oldCache, outerCache,
42292                   newCache = [dirruns, doneName];
42293
42294                 // We can't set arbitrary data on XML nodes, so they don't benefit
42295                 // from dir caching
42296                 if (xml) {
42297                   while ((elem = elem[dir])) {
42298                     if (elem.nodeType === 1 || checkNonElements) {
42299                       if (matcher(elem, context, xml)) {
42300                         return true;
42301                       }
42302                     }
42303                   }
42304                 } else {
42305                   while ((elem = elem[dir])) {
42306                     if (elem.nodeType === 1 || checkNonElements) {
42307                       outerCache = elem[expando] || (elem[expando] = {});
42308                       if ((oldCache = outerCache[dir]) &&
42309                         oldCache[0] === dirruns && oldCache[1] === doneName) {
42310
42311                         // Assign to newCache so results back-propagate to
42312                         // previous elements
42313                         return (newCache[2] = oldCache[2]);
42314                       } else {
42315                         // Reuse newcache so results back-propagate to
42316                         // previous elements
42317                         outerCache[dir] = newCache;
42318
42319                         // A match means we're done; a fail means we have to
42320                         // keep checking
42321                         if ((newCache[2] = matcher(elem, context, xml))) {
42322                           return true;
42323                         }
42324                       }
42325                     }
42326                   }
42327                 }
42328               };
42329           }
42330
42331           function elementMatcher(matchers) {
42332             return matchers.length > 1 ?
42333               function(elem, context, xml) {
42334                 var i = matchers.length;
42335                 while (i--) {
42336                   if (!matchers[i](elem, context, xml)) {
42337                     return false;
42338                   }
42339                 }
42340                 return true;
42341               } :
42342               matchers[0];
42343           }
42344
42345           function multipleContexts(selector, contexts, results) {
42346             var i = 0,
42347               len = contexts.length;
42348             for (; i < len; i++) {
42349               Sizzle(selector, contexts[i], results);
42350             }
42351             return results;
42352           }
42353
42354           function condense(unmatched, map, filter, context, xml) {
42355             var elem,
42356               newUnmatched = [],
42357               i = 0,
42358               len = unmatched.length,
42359               mapped = map != null;
42360
42361             for (; i < len; i++) {
42362               if ((elem = unmatched[i])) {
42363                 if (!filter || filter(elem, context, xml)) {
42364                   newUnmatched.push(elem);
42365                   if (mapped) {
42366                     map.push(i);
42367                   }
42368                 }
42369               }
42370             }
42371
42372             return newUnmatched;
42373           }
42374
42375           function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
42376             if (postFilter && !postFilter[expando]) {
42377               postFilter = setMatcher(postFilter);
42378             }
42379             if (postFinder && !postFinder[expando]) {
42380               postFinder = setMatcher(postFinder, postSelector);
42381             }
42382             return markFunction(function(seed, results, context, xml) {
42383               var temp, i, elem,
42384                 preMap = [],
42385                 postMap = [],
42386                 preexisting = results.length,
42387
42388                 // Get initial elements from seed or context
42389                 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
42390
42391                 // Prefilter to get matcher input, preserving a map for seed-results
42392                 // synchronization
42393                 matcherIn = preFilter && (seed || !selector) ?
42394                 condense(elems, preMap, preFilter, context, xml) :
42395                 elems,
42396
42397                 matcherOut = matcher ?
42398                 // If we have a postFinder, or filtered seed, or non-seed
42399                 // postFilter or preexisting results,
42400                 postFinder || (seed ? preFilter : preexisting || postFilter) ?
42401
42402                 // ...intermediate processing is necessary
42403                 [] :
42404
42405                 // ...otherwise use results directly
42406                 results :
42407                 matcherIn;
42408
42409               // Find primary matches
42410               if (matcher) {
42411                 matcher(matcherIn, matcherOut, context, xml);
42412               }
42413
42414               // Apply postFilter
42415               if (postFilter) {
42416                 temp = condense(matcherOut, postMap);
42417                 postFilter(temp, [], context, xml);
42418
42419                 // Un-match failing elements by moving them back to matcherIn
42420                 i = temp.length;
42421                 while (i--) {
42422                   if ((elem = temp[i])) {
42423                     matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
42424                   }
42425                 }
42426               }
42427
42428               if (seed) {
42429                 if (postFinder || preFilter) {
42430                   if (postFinder) {
42431                     // Get the final matcherOut by condensing this intermediate
42432                     // into postFinder contexts
42433                     temp = [];
42434                     i = matcherOut.length;
42435                     while (i--) {
42436                       if ((elem = matcherOut[i])) {
42437                         // Restore matcherIn since elem is not yet a final
42438                         // match
42439                         temp.push((matcherIn[i] = elem));
42440                       }
42441                     }
42442                     postFinder(null, (matcherOut = []), temp, xml);
42443                   }
42444
42445                   // Move matched elements from seed to results to keep them
42446                   // synchronized
42447                   i = matcherOut.length;
42448                   while (i--) {
42449                     if ((elem = matcherOut[i]) &&
42450                       (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
42451
42452                       seed[temp] = !(results[temp] = elem);
42453                     }
42454                   }
42455                 }
42456
42457                 // Add elements to results, through postFinder if defined
42458               } else {
42459                 matcherOut = condense(
42460                   matcherOut === results ?
42461                   matcherOut.splice(preexisting, matcherOut.length) :
42462                   matcherOut
42463                 );
42464                 if (postFinder) {
42465                   postFinder(null, results, matcherOut, xml);
42466                 } else {
42467                   push.apply(results, matcherOut);
42468                 }
42469               }
42470             });
42471           }
42472
42473           function matcherFromTokens(tokens) {
42474             var checkContext, matcher, j,
42475               len = tokens.length,
42476               leadingRelative = Expr.relative[tokens[0].type],
42477               implicitRelative = leadingRelative || Expr.relative[" "],
42478               i = leadingRelative ? 1 : 0,
42479
42480               // The foundational matcher ensures that elements are reachable from
42481               // top-level context(s)
42482               matchContext = addCombinator(function(elem) {
42483                 return elem === checkContext;
42484               }, implicitRelative, true),
42485               matchAnyContext = addCombinator(function(elem) {
42486                 return indexOf(checkContext, elem) > -1;
42487               }, implicitRelative, true),
42488               matchers = [function(elem, context, xml) {
42489                 var ret = (!leadingRelative && (xml || context !== outermostContext)) || (
42490                   (checkContext = context).nodeType ?
42491                   matchContext(elem, context, xml) :
42492                   matchAnyContext(elem, context, xml));
42493                 // Avoid hanging onto element (issue #299)
42494                 checkContext = null;
42495                 return ret;
42496               }];
42497
42498             for (; i < len; i++) {
42499               if ((matcher = Expr.relative[tokens[i].type])) {
42500                 matchers = [addCombinator(elementMatcher(matchers), matcher)];
42501               } else {
42502                 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
42503
42504                 // Return special upon seeing a positional matcher
42505                 if (matcher[expando]) {
42506                   // Find the next relative operator (if any) for proper handling
42507                   j = ++i;
42508                   for (; j < len; j++) {
42509                     if (Expr.relative[tokens[j].type]) {
42510                       break;
42511                     }
42512                   }
42513                   return setMatcher(
42514                     i > 1 && elementMatcher(matchers),
42515                     i > 1 && toSelector(
42516                       // If the preceding token was a descendant combinator,
42517                       // insert an implicit any-element `*`
42518                       tokens.slice(0, i - 1).concat({
42519                         value: tokens[i - 2].type === " " ? "*" : ""
42520                       })
42521                     ).replace(rtrim, "$1"),
42522                     matcher,
42523                     i < j && matcherFromTokens(tokens.slice(i, j)),
42524                     j < len && matcherFromTokens((tokens = tokens.slice(j))),
42525                     j < len && toSelector(tokens)
42526                   );
42527                 }
42528                 matchers.push(matcher);
42529               }
42530             }
42531
42532             return elementMatcher(matchers);
42533           }
42534
42535           function matcherFromGroupMatchers(elementMatchers, setMatchers) {
42536             var bySet = setMatchers.length > 0,
42537               byElement = elementMatchers.length > 0,
42538               superMatcher = function(seed, context, xml, results, outermost) {
42539                 var elem, j, matcher,
42540                   matchedCount = 0,
42541                   i = "0",
42542                   unmatched = seed && [],
42543                   setMatched = [],
42544                   contextBackup = outermostContext,
42545                   // We must always have either seed elements or outermost context
42546                   elems = seed || byElement && Expr.find["TAG"]("*", outermost),
42547                   // Use integer dirruns iff this is the outermost matcher
42548                   dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
42549                   len = elems.length;
42550
42551                 if (outermost) {
42552                   outermostContext = context !== document && context;
42553                 }
42554
42555                 // Add elements passing elementMatchers directly to results
42556                 // Keep `i` a string if there are no elements so `matchedCount` will
42557                 // be "00" below
42558                 // Support: IE<9, Safari
42559                 // Tolerate NodeList properties (IE: "length"; Safari: <number>)
42560                 // matching elements by id
42561                 for (; i !== len && (elem = elems[i]) != null; i++) {
42562                   if (byElement && elem) {
42563                     j = 0;
42564                     while ((matcher = elementMatchers[j++])) {
42565                       if (matcher(elem, context, xml)) {
42566                         results.push(elem);
42567                         break;
42568                       }
42569                     }
42570                     if (outermost) {
42571                       dirruns = dirrunsUnique;
42572                     }
42573                   }
42574
42575                   // Track unmatched elements for set filters
42576                   if (bySet) {
42577                     // They will have gone through all possible matchers
42578                     if ((elem = !matcher && elem)) {
42579                       matchedCount--;
42580                     }
42581
42582                     // Lengthen the array for every element, matched or not
42583                     if (seed) {
42584                       unmatched.push(elem);
42585                     }
42586                   }
42587                 }
42588
42589                 // Apply set filters to unmatched elements
42590                 matchedCount += i;
42591                 if (bySet && i !== matchedCount) {
42592                   j = 0;
42593                   while ((matcher = setMatchers[j++])) {
42594                     matcher(unmatched, setMatched, context, xml);
42595                   }
42596
42597                   if (seed) {
42598                     // Reintegrate element matches to eliminate the need for
42599                     // sorting
42600                     if (matchedCount > 0) {
42601                       while (i--) {
42602                         if (!(unmatched[i] || setMatched[i])) {
42603                           setMatched[i] = pop.call(results);
42604                         }
42605                       }
42606                     }
42607
42608                     // Discard index placeholder values to get only actual
42609                     // matches
42610                     setMatched = condense(setMatched);
42611                   }
42612
42613                   // Add matches to results
42614                   push.apply(results, setMatched);
42615
42616                   // Seedless set matches succeeding multiple successful matchers
42617                   // stipulate sorting
42618                   if (outermost && !seed && setMatched.length > 0 &&
42619                     (matchedCount + setMatchers.length) > 1) {
42620
42621                     Sizzle.uniqueSort(results);
42622                   }
42623                 }
42624
42625                 // Override manipulation of globals by nested matchers
42626                 if (outermost) {
42627                   dirruns = dirrunsUnique;
42628                   outermostContext = contextBackup;
42629                 }
42630
42631                 return unmatched;
42632               };
42633
42634             return bySet ?
42635               markFunction(superMatcher) :
42636               superMatcher;
42637           }
42638
42639           compile = Sizzle.compile = function(selector, match /* Internal Use Only */ ) {
42640             var i,
42641               setMatchers = [],
42642               elementMatchers = [],
42643               cached = compilerCache[selector + " "];
42644
42645             if (!cached) {
42646               // Generate a function of recursive functions that can be used to check
42647               // each element
42648               if (!match) {
42649                 match = tokenize(selector);
42650               }
42651               i = match.length;
42652               while (i--) {
42653                 cached = matcherFromTokens(match[i]);
42654                 if (cached[expando]) {
42655                   setMatchers.push(cached);
42656                 } else {
42657                   elementMatchers.push(cached);
42658                 }
42659               }
42660
42661               // Cache the compiled function
42662               cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
42663
42664               // Save selector and tokenization
42665               cached.selector = selector;
42666             }
42667             return cached;
42668           };
42669
42670           /**
42671            * A low-level selection function that works with Sizzle's compiled selector
42672            * functions
42673            *
42674            * @param {String|Function}
42675            *            selector A selector or a pre-compiled selector function built with
42676            *            Sizzle.compile
42677            * @param {Element}
42678            *            context
42679            * @param {Array}
42680            *            [results]
42681            * @param {Array}
42682            *            [seed] A set of elements to match against
42683            */
42684           select = Sizzle.select = function(selector, context, results, seed) {
42685             var i, tokens, token, type, find,
42686               compiled = typeof selector === "function" && selector,
42687               match = !seed && tokenize((selector = compiled.selector || selector));
42688
42689             results = results || [];
42690
42691             // Try to minimize operations if there is no seed and only one group
42692             if (match.length === 1) {
42693
42694               // Take a shortcut and set the context if the root selector is an ID
42695               tokens = match[0] = match[0].slice(0);
42696               if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&
42697                 support.getById && context.nodeType === 9 && documentIsHTML &&
42698                 Expr.relative[tokens[1].type]) {
42699
42700                 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
42701                 if (!context) {
42702                   return results;
42703
42704                   // Precompiled matchers will still verify ancestry, so step up a
42705                   // level
42706                 } else if (compiled) {
42707                   context = context.parentNode;
42708                 }
42709
42710                 selector = selector.slice(tokens.shift().value.length);
42711               }
42712
42713               // Fetch a seed set for right-to-left matching
42714               i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
42715               while (i--) {
42716                 token = tokens[i];
42717
42718                 // Abort if we hit a combinator
42719                 if (Expr.relative[(type = token.type)]) {
42720                   break;
42721                 }
42722                 if ((find = Expr.find[type])) {
42723                   // Search, expanding context for leading sibling combinators
42724                   if ((seed = find(
42725                       token.matches[0].replace(runescape, funescape),
42726                       rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
42727                     ))) {
42728
42729                     // If seed is empty or no tokens remain, we can return early
42730                     tokens.splice(i, 1);
42731                     selector = seed.length && toSelector(tokens);
42732                     if (!selector) {
42733                       push.apply(results, seed);
42734                       return results;
42735                     }
42736
42737                     break;
42738                   }
42739                 }
42740               }
42741             }
42742
42743             // Compile and execute a filtering function if one is not provided
42744             // Provide `match` to avoid retokenization if we modified the selector above
42745             (compiled || compile(selector, match))(
42746               seed,
42747               context, !documentIsHTML,
42748               results,
42749               rsibling.test(selector) && testContext(context.parentNode) || context
42750             );
42751             return results;
42752           };
42753
42754           // One-time assignments
42755
42756           // Sort stability
42757           support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
42758
42759           // Support: Chrome 14-35+
42760           // Always assume duplicates if they aren't passed to the comparison function
42761           support.detectDuplicates = !!hasDuplicate;
42762
42763           // Initialize against the default document
42764           setDocument();
42765
42766           // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
42767           // Detached nodes confoundingly follow *each other*
42768           support.sortDetached = assert(function(div1) {
42769             // Should return 1, but returns 4 (following)
42770             return div1.compareDocumentPosition(document.createElement("div")) & 1;
42771           });
42772
42773           // Support: IE<8
42774           // Prevent attribute/property "interpolation"
42775           // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
42776           if (!assert(function(div) {
42777               div.innerHTML = "<a href='#'></a>";
42778               return div.firstChild.getAttribute("href") === "#";
42779             })) {
42780             addHandle("type|href|height|width", function(elem, name, isXML) {
42781               if (!isXML) {
42782                 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
42783               }
42784             });
42785           }
42786
42787           // Support: IE<9
42788           // Use defaultValue in place of getAttribute("value")
42789           if (!support.attributes || !assert(function(div) {
42790               div.innerHTML = "<input/>";
42791               div.firstChild.setAttribute("value", "");
42792               return div.firstChild.getAttribute("value") === "";
42793             })) {
42794             addHandle("value", function(elem, name, isXML) {
42795               if (!isXML && elem.nodeName.toLowerCase() === "input") {
42796                 return elem.defaultValue;
42797               }
42798             });
42799           }
42800
42801           // Support: IE<9
42802           // Use getAttributeNode to fetch booleans when getAttribute lies
42803           if (!assert(function(div) {
42804               return div.getAttribute("disabled") == null;
42805             })) {
42806             addHandle(booleans, function(elem, name, isXML) {
42807               var val;
42808               if (!isXML) {
42809                 return elem[name] === true ? name.toLowerCase() :
42810                   (val = elem.getAttributeNode(name)) && val.specified ?
42811                   val.value :
42812                   null;
42813               }
42814             });
42815           }
42816
42817           return Sizzle;
42818
42819         })(window);
42820
42821
42822
42823       jQuery.find = Sizzle;
42824       jQuery.expr = Sizzle.selectors;
42825       jQuery.expr[":"] = jQuery.expr.pseudos;
42826       jQuery.unique = Sizzle.uniqueSort;
42827       jQuery.text = Sizzle.getText;
42828       jQuery.isXMLDoc = Sizzle.isXML;
42829       jQuery.contains = Sizzle.contains;
42830
42831
42832
42833       var rneedsContext = jQuery.expr.match.needsContext;
42834
42835       var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
42836
42837
42838
42839       var risSimple = /^.[^:#\[\.,]*$/;
42840
42841       // Implement the identical functionality for filter and not
42842       function winnow(elements, qualifier, not) {
42843         if (jQuery.isFunction(qualifier)) {
42844           return jQuery.grep(elements, function(elem, i) {
42845             /* jshint -W018 */
42846             return !!qualifier.call(elem, i, elem) !== not;
42847           });
42848
42849         }
42850
42851         if (qualifier.nodeType) {
42852           return jQuery.grep(elements, function(elem) {
42853             return (elem === qualifier) !== not;
42854           });
42855
42856         }
42857
42858         if (typeof qualifier === "string") {
42859           if (risSimple.test(qualifier)) {
42860             return jQuery.filter(qualifier, elements, not);
42861           }
42862
42863           qualifier = jQuery.filter(qualifier, elements);
42864         }
42865
42866         return jQuery.grep(elements, function(elem) {
42867           return (indexOf.call(qualifier, elem) >= 0) !== not;
42868         });
42869       }
42870
42871       jQuery.filter = function(expr, elems, not) {
42872         var elem = elems[0];
42873
42874         if (not) {
42875           expr = ":not(" + expr + ")";
42876         }
42877
42878         return elems.length === 1 && elem.nodeType === 1 ?
42879           jQuery.find.matchesSelector(elem, expr) ? [elem] : [] :
42880           jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
42881             return elem.nodeType === 1;
42882           }));
42883       };
42884
42885       jQuery.fn.extend({
42886         find: function(selector) {
42887           var i,
42888             len = this.length,
42889             ret = [],
42890             self = this;
42891
42892           if (typeof selector !== "string") {
42893             return this.pushStack(jQuery(selector).filter(function() {
42894               for (i = 0; i < len; i++) {
42895                 if (jQuery.contains(self[i], this)) {
42896                   return true;
42897                 }
42898               }
42899             }));
42900           }
42901
42902           for (i = 0; i < len; i++) {
42903             jQuery.find(selector, self[i], ret);
42904           }
42905
42906           // Needed because $( selector, context ) becomes $( context ).find(
42907           // selector )
42908           ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
42909           ret.selector = this.selector ? this.selector + " " + selector : selector;
42910           return ret;
42911         },
42912         filter: function(selector) {
42913           return this.pushStack(winnow(this, selector || [], false));
42914         },
42915         not: function(selector) {
42916           return this.pushStack(winnow(this, selector || [], true));
42917         },
42918         is: function(selector) {
42919           return !!winnow(
42920             this,
42921
42922             // If this is a positional/relative selector, check membership in
42923             // the returned set
42924             // so $("p:first").is("p:last") won't return true for a doc with two
42925             // "p".
42926             typeof selector === "string" && rneedsContext.test(selector) ?
42927             jQuery(selector) :
42928             selector || [],
42929             false
42930           ).length;
42931         }
42932       });
42933
42934
42935       // Initialize a jQuery object
42936
42937
42938       // A central reference to the root jQuery(document)
42939       var rootjQuery,
42940
42941         // A simple way to check for HTML strings
42942         // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
42943         // Strict HTML recognition (#11290: must start with <)
42944         rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
42945
42946         init = jQuery.fn.init = function(selector, context) {
42947           var match, elem;
42948
42949           // HANDLE: $(""), $(null), $(undefined), $(false)
42950           if (!selector) {
42951             return this;
42952           }
42953
42954           // Handle HTML strings
42955           if (typeof selector === "string") {
42956             if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
42957               // Assume that strings that start and end with <> are HTML and
42958               // skip the regex check
42959               match = [null, selector, null];
42960
42961             } else {
42962               match = rquickExpr.exec(selector);
42963             }
42964
42965             // Match html or make sure no context is specified for #id
42966             if (match && (match[1] || !context)) {
42967
42968               // HANDLE: $(html) -> $(array)
42969               if (match[1]) {
42970                 context = context instanceof jQuery ? context[0] : context;
42971
42972                 // Option to run scripts is true for back-compat
42973                 // Intentionally let the error be thrown if parseHTML is not
42974                 // present
42975                 jQuery.merge(this, jQuery.parseHTML(
42976                   match[1],
42977                   context && context.nodeType ? context.ownerDocument || context : document,
42978                   true
42979                 ));
42980
42981                 // HANDLE: $(html, props)
42982                 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
42983                   for (match in context) {
42984                     // Properties of context are called as methods if
42985                     // possible
42986                     if (jQuery.isFunction(this[match])) {
42987                       this[match](context[match]);
42988
42989                       // ...and otherwise set as attributes
42990                     } else {
42991                       this.attr(match, context[match]);
42992                     }
42993                   }
42994                 }
42995
42996                 return this;
42997
42998                 // HANDLE: $(#id)
42999               } else {
43000                 elem = document.getElementById(match[2]);
43001
43002                 // Support: Blackberry 4.6
43003                 // gEBID returns nodes no longer in the document (#6963)
43004                 if (elem && elem.parentNode) {
43005                   // Inject the element directly into the jQuery object
43006                   this.length = 1;
43007                   this[0] = elem;
43008                 }
43009
43010                 this.context = document;
43011                 this.selector = selector;
43012                 return this;
43013               }
43014
43015               // HANDLE: $(expr, $(...))
43016             } else if (!context || context.jquery) {
43017               return (context || rootjQuery).find(selector);
43018
43019               // HANDLE: $(expr, context)
43020               // (which is just equivalent to: $(context).find(expr)
43021             } else {
43022               return this.constructor(context).find(selector);
43023             }
43024
43025             // HANDLE: $(DOMElement)
43026           } else if (selector.nodeType) {
43027             this.context = this[0] = selector;
43028             this.length = 1;
43029             return this;
43030
43031             // HANDLE: $(function)
43032             // Shortcut for document ready
43033           } else if (jQuery.isFunction(selector)) {
43034             return typeof rootjQuery.ready !== "undefined" ?
43035               rootjQuery.ready(selector) :
43036               // Execute immediately if ready is not present
43037               selector(jQuery);
43038           }
43039
43040           if (selector.selector !== undefined) {
43041             this.selector = selector.selector;
43042             this.context = selector.context;
43043           }
43044
43045           return jQuery.makeArray(selector, this);
43046         };
43047
43048       // Give the init function the jQuery prototype for later instantiation
43049       init.prototype = jQuery.fn;
43050
43051       // Initialize central reference
43052       rootjQuery = jQuery(document);
43053
43054
43055       var rparentsprev = /^(?:parents|prev(?:Until|All))/,
43056         // Methods guaranteed to produce a unique set when starting from a unique
43057         // set
43058         guaranteedUnique = {
43059           children: true,
43060           contents: true,
43061           next: true,
43062           prev: true
43063         };
43064
43065       jQuery.extend({
43066         dir: function(elem, dir, until) {
43067           var matched = [],
43068             truncate = until !== undefined;
43069
43070           while ((elem = elem[dir]) && elem.nodeType !== 9) {
43071             if (elem.nodeType === 1) {
43072               if (truncate && jQuery(elem).is(until)) {
43073                 break;
43074               }
43075               matched.push(elem);
43076             }
43077           }
43078           return matched;
43079         },
43080
43081         sibling: function(n, elem) {
43082           var matched = [];
43083
43084           for (; n; n = n.nextSibling) {
43085             if (n.nodeType === 1 && n !== elem) {
43086               matched.push(n);
43087             }
43088           }
43089
43090           return matched;
43091         }
43092       });
43093
43094       jQuery.fn.extend({
43095         has: function(target) {
43096           var targets = jQuery(target, this),
43097             l = targets.length;
43098
43099           return this.filter(function() {
43100             var i = 0;
43101             for (; i < l; i++) {
43102               if (jQuery.contains(this, targets[i])) {
43103                 return true;
43104               }
43105             }
43106           });
43107         },
43108
43109         closest: function(selectors, context) {
43110           var cur,
43111             i = 0,
43112             l = this.length,
43113             matched = [],
43114             pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?
43115             jQuery(selectors, context || this.context) :
43116             0;
43117
43118           for (; i < l; i++) {
43119             for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
43120               // Always skip document fragments
43121               if (cur.nodeType < 11 && (pos ?
43122                   pos.index(cur) > -1 :
43123
43124                   // Don't pass non-elements to Sizzle
43125                   cur.nodeType === 1 &&
43126                   jQuery.find.matchesSelector(cur, selectors))) {
43127
43128                 matched.push(cur);
43129                 break;
43130               }
43131             }
43132           }
43133
43134           return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
43135         },
43136
43137         // Determine the position of an element within the set
43138         index: function(elem) {
43139
43140           // No argument, return index in parent
43141           if (!elem) {
43142             return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
43143           }
43144
43145           // Index in selector
43146           if (typeof elem === "string") {
43147             return indexOf.call(jQuery(elem), this[0]);
43148           }
43149
43150           // Locate the position of the desired element
43151           return indexOf.call(this,
43152
43153             // If it receives a jQuery object, the first element is used
43154             elem.jquery ? elem[0] : elem
43155           );
43156         },
43157
43158         add: function(selector, context) {
43159           return this.pushStack(
43160             jQuery.unique(
43161               jQuery.merge(this.get(), jQuery(selector, context))
43162             )
43163           );
43164         },
43165
43166         addBack: function(selector) {
43167           return this.add(selector == null ?
43168             this.prevObject : this.prevObject.filter(selector)
43169           );
43170         }
43171       });
43172
43173       function sibling(cur, dir) {
43174         while ((cur = cur[dir]) && cur.nodeType !== 1) {}
43175         return cur;
43176       }
43177
43178       jQuery.each({
43179         parent: function(elem) {
43180           var parent = elem.parentNode;
43181           return parent && parent.nodeType !== 11 ? parent : null;
43182         },
43183         parents: function(elem) {
43184           return jQuery.dir(elem, "parentNode");
43185         },
43186         parentsUntil: function(elem, i, until) {
43187           return jQuery.dir(elem, "parentNode", until);
43188         },
43189         next: function(elem) {
43190           return sibling(elem, "nextSibling");
43191         },
43192         prev: function(elem) {
43193           return sibling(elem, "previousSibling");
43194         },
43195         nextAll: function(elem) {
43196           return jQuery.dir(elem, "nextSibling");
43197         },
43198         prevAll: function(elem) {
43199           return jQuery.dir(elem, "previousSibling");
43200         },
43201         nextUntil: function(elem, i, until) {
43202           return jQuery.dir(elem, "nextSibling", until);
43203         },
43204         prevUntil: function(elem, i, until) {
43205           return jQuery.dir(elem, "previousSibling", until);
43206         },
43207         siblings: function(elem) {
43208           return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
43209         },
43210         children: function(elem) {
43211           return jQuery.sibling(elem.firstChild);
43212         },
43213         contents: function(elem) {
43214           return elem.contentDocument || jQuery.merge([], elem.childNodes);
43215         }
43216       }, function(name, fn) {
43217         jQuery.fn[name] = function(until, selector) {
43218           var matched = jQuery.map(this, fn, until);
43219
43220           if (name.slice(-5) !== "Until") {
43221             selector = until;
43222           }
43223
43224           if (selector && typeof selector === "string") {
43225             matched = jQuery.filter(selector, matched);
43226           }
43227
43228           if (this.length > 1) {
43229             // Remove duplicates
43230             if (!guaranteedUnique[name]) {
43231               jQuery.unique(matched);
43232             }
43233
43234             // Reverse order for parents* and prev-derivatives
43235             if (rparentsprev.test(name)) {
43236               matched.reverse();
43237             }
43238           }
43239
43240           return this.pushStack(matched);
43241         };
43242       });
43243       var rnotwhite = (/\S+/g);
43244
43245
43246
43247       // String to Object options format cache
43248       var optionsCache = {};
43249
43250       // Convert String-formatted options into Object-formatted ones and store in
43251       // cache
43252       function createOptions(options) {
43253         var object = optionsCache[options] = {};
43254         jQuery.each(options.match(rnotwhite) || [], function(_, flag) {
43255           object[flag] = true;
43256         });
43257         return object;
43258       }
43259
43260       /*
43261        * Create a callback list using the following parameters:
43262        *
43263        * options: an optional list of space-separated options that will change how the
43264        * callback list behaves or a more traditional option object
43265        *
43266        * By default a callback list will act like an event callback list and can be
43267        * "fired" multiple times.
43268        *
43269        * Possible options:
43270        *
43271        * once: will ensure the callback list can only be fired once (like a Deferred)
43272        *
43273        * memory: will keep track of previous values and will call any callback added
43274        * after the list has been fired right away with the latest "memorized" values
43275        * (like a Deferred)
43276        *
43277        * unique: will ensure a callback can only be added once (no duplicate in the
43278        * list)
43279        *
43280        * stopOnFalse: interrupt callings when a callback returns false
43281        *
43282        */
43283       jQuery.Callbacks = function(options) {
43284
43285         // Convert options from String-formatted to Object-formatted if needed
43286         // (we check in cache first)
43287         options = typeof options === "string" ?
43288           (optionsCache[options] || createOptions(options)) :
43289           jQuery.extend({}, options);
43290
43291         var // Last fire value (for non-forgettable lists)
43292           memory,
43293           // Flag to know if list was already fired
43294           fired,
43295           // Flag to know if list is currently firing
43296           firing,
43297           // First callback to fire (used internally by add and fireWith)
43298           firingStart,
43299           // End of the loop when firing
43300           firingLength,
43301           // Index of currently firing callback (modified by remove if needed)
43302           firingIndex,
43303           // Actual callback list
43304           list = [],
43305           // Stack of fire calls for repeatable lists
43306           stack = !options.once && [],
43307           // Fire callbacks
43308           fire = function(data) {
43309             memory = options.memory && data;
43310             fired = true;
43311             firingIndex = firingStart || 0;
43312             firingStart = 0;
43313             firingLength = list.length;
43314             firing = true;
43315             for (; list && firingIndex < firingLength; firingIndex++) {
43316               if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
43317                 memory = false; // To prevent further calls using add
43318                 break;
43319               }
43320             }
43321             firing = false;
43322             if (list) {
43323               if (stack) {
43324                 if (stack.length) {
43325                   fire(stack.shift());
43326                 }
43327               } else if (memory) {
43328                 list = [];
43329               } else {
43330                 self.disable();
43331               }
43332             }
43333           },
43334           // Actual Callbacks object
43335           self = {
43336             // Add a callback or a collection of callbacks to the list
43337             add: function() {
43338               if (list) {
43339                 // First, we save the current length
43340                 var start = list.length;
43341                 (function add(args) {
43342                   jQuery.each(args, function(_, arg) {
43343                     var type = jQuery.type(arg);
43344                     if (type === "function") {
43345                       if (!options.unique || !self.has(arg)) {
43346                         list.push(arg);
43347                       }
43348                     } else if (arg && arg.length && type !== "string") {
43349                       // Inspect recursively
43350                       add(arg);
43351                     }
43352                   });
43353                 })(arguments);
43354                 // Do we need to add the callbacks to the
43355                 // current firing batch?
43356                 if (firing) {
43357                   firingLength = list.length;
43358                   // With memory, if we're not firing then
43359                   // we should call right away
43360                 } else if (memory) {
43361                   firingStart = start;
43362                   fire(memory);
43363                 }
43364               }
43365               return this;
43366             },
43367             // Remove a callback from the list
43368             remove: function() {
43369               if (list) {
43370                 jQuery.each(arguments, function(_, arg) {
43371                   var index;
43372                   while ((index = jQuery.inArray(arg, list, index)) > -1) {
43373                     list.splice(index, 1);
43374                     // Handle firing indexes
43375                     if (firing) {
43376                       if (index <= firingLength) {
43377                         firingLength--;
43378                       }
43379                       if (index <= firingIndex) {
43380                         firingIndex--;
43381                       }
43382                     }
43383                   }
43384                 });
43385               }
43386               return this;
43387             },
43388             // Check if a given callback is in the list.
43389             // If no argument is given, return whether or not list has callbacks
43390             // attached.
43391             has: function(fn) {
43392               return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
43393             },
43394             // Remove all callbacks from the list
43395             empty: function() {
43396               list = [];
43397               firingLength = 0;
43398               return this;
43399             },
43400             // Have the list do nothing anymore
43401             disable: function() {
43402               list = stack = memory = undefined;
43403               return this;
43404             },
43405             // Is it disabled?
43406             disabled: function() {
43407               return !list;
43408             },
43409             // Lock the list in its current state
43410             lock: function() {
43411               stack = undefined;
43412               if (!memory) {
43413                 self.disable();
43414               }
43415               return this;
43416             },
43417             // Is it locked?
43418             locked: function() {
43419               return !stack;
43420             },
43421             // Call all callbacks with the given context and arguments
43422             fireWith: function(context, args) {
43423               if (list && (!fired || stack)) {
43424                 args = args || [];
43425                 args = [context, args.slice ? args.slice() : args];
43426                 if (firing) {
43427                   stack.push(args);
43428                 } else {
43429                   fire(args);
43430                 }
43431               }
43432               return this;
43433             },
43434             // Call all the callbacks with the given arguments
43435             fire: function() {
43436               self.fireWith(this, arguments);
43437               return this;
43438             },
43439             // To know if the callbacks have already been called at least once
43440             fired: function() {
43441               return !!fired;
43442             }
43443           };
43444
43445         return self;
43446       };
43447
43448
43449       jQuery.extend({
43450
43451         Deferred: function(func) {
43452           var tuples = [
43453               // action, add listener, listener list, final state
43454               ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
43455               ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
43456               ["notify", "progress", jQuery.Callbacks("memory")]
43457             ],
43458             state = "pending",
43459             promise = {
43460               state: function() {
43461                 return state;
43462               },
43463               always: function() {
43464                 deferred.done(arguments).fail(arguments);
43465                 return this;
43466               },
43467               then: function( /* fnDone, fnFail, fnProgress */ ) {
43468                 var fns = arguments;
43469                 return jQuery.Deferred(function(newDefer) {
43470                   jQuery.each(tuples, function(i, tuple) {
43471                     var fn = jQuery.isFunction(fns[i]) && fns[i];
43472                     // deferred[ done | fail | progress ] for forwarding
43473                     // actions to newDefer
43474                     deferred[tuple[1]](function() {
43475                       var returned = fn && fn.apply(this, arguments);
43476                       if (returned && jQuery.isFunction(returned.promise)) {
43477                         returned.promise()
43478                           .done(newDefer.resolve)
43479                           .fail(newDefer.reject)
43480                           .progress(newDefer.notify);
43481                       } else {
43482                         newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
43483                       }
43484                     });
43485                   });
43486                   fns = null;
43487                 }).promise();
43488               },
43489               // Get a promise for this deferred
43490               // If obj is provided, the promise aspect is added to the object
43491               promise: function(obj) {
43492                 return obj != null ? jQuery.extend(obj, promise) : promise;
43493               }
43494             },
43495             deferred = {};
43496
43497           // Keep pipe for back-compat
43498           promise.pipe = promise.then;
43499
43500           // Add list-specific methods
43501           jQuery.each(tuples, function(i, tuple) {
43502             var list = tuple[2],
43503               stateString = tuple[3];
43504
43505             // promise[ done | fail | progress ] = list.add
43506             promise[tuple[1]] = list.add;
43507
43508             // Handle state
43509             if (stateString) {
43510               list.add(function() {
43511                 // state = [ resolved | rejected ]
43512                 state = stateString;
43513
43514                 // [ reject_list | resolve_list ].disable; progress_list.lock
43515               }, tuples[i ^ 1][2].disable, tuples[2][2].lock);
43516             }
43517
43518             // deferred[ resolve | reject | notify ]
43519             deferred[tuple[0]] = function() {
43520               deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
43521               return this;
43522             };
43523             deferred[tuple[0] + "With"] = list.fireWith;
43524           });
43525
43526           // Make the deferred a promise
43527           promise.promise(deferred);
43528
43529           // Call given func if any
43530           if (func) {
43531             func.call(deferred, deferred);
43532           }
43533
43534           // All done!
43535           return deferred;
43536         },
43537
43538         // Deferred helper
43539         when: function(subordinate /* , ..., subordinateN */ ) {
43540           var i = 0,
43541             resolveValues = slice.call(arguments),
43542             length = resolveValues.length,
43543
43544             // the count of uncompleted subordinates
43545             remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0,
43546
43547             // the master Deferred. If resolveValues consist of only a single
43548             // Deferred, just use that.
43549             deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
43550
43551             // Update function for both resolve and progress values
43552             updateFunc = function(i, contexts, values) {
43553               return function(value) {
43554                 contexts[i] = this;
43555                 values[i] = arguments.length > 1 ? slice.call(arguments) : value;
43556                 if (values === progressValues) {
43557                   deferred.notifyWith(contexts, values);
43558                 } else if (!(--remaining)) {
43559                   deferred.resolveWith(contexts, values);
43560                 }
43561               };
43562             },
43563
43564             progressValues, progressContexts, resolveContexts;
43565
43566           // Add listeners to Deferred subordinates; treat others as resolved
43567           if (length > 1) {
43568             progressValues = new Array(length);
43569             progressContexts = new Array(length);
43570             resolveContexts = new Array(length);
43571             for (; i < length; i++) {
43572               if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
43573                 resolveValues[i].promise()
43574                   .done(updateFunc(i, resolveContexts, resolveValues))
43575                   .fail(deferred.reject)
43576                   .progress(updateFunc(i, progressContexts, progressValues));
43577               } else {
43578                 --remaining;
43579               }
43580             }
43581           }
43582
43583           // If we're not waiting on anything, resolve the master
43584           if (!remaining) {
43585             deferred.resolveWith(resolveContexts, resolveValues);
43586           }
43587
43588           return deferred.promise();
43589         }
43590       });
43591
43592
43593       // The deferred used on DOM ready
43594       var readyList;
43595
43596       jQuery.fn.ready = function(fn) {
43597         // Add the callback
43598         jQuery.ready.promise().done(fn);
43599
43600         return this;
43601       };
43602
43603       jQuery.extend({
43604         // Is the DOM ready to be used? Set to true once it occurs.
43605         isReady: false,
43606
43607         // A counter to track how many items to wait for before
43608         // the ready event fires. See #6781
43609         readyWait: 1,
43610
43611         // Hold (or release) the ready event
43612         holdReady: function(hold) {
43613           if (hold) {
43614             jQuery.readyWait++;
43615           } else {
43616             jQuery.ready(true);
43617           }
43618         },
43619
43620         // Handle when the DOM is ready
43621         ready: function(wait) {
43622
43623           // Abort if there are pending holds or we're already ready
43624           if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
43625             return;
43626           }
43627
43628           // Remember that the DOM is ready
43629           jQuery.isReady = true;
43630
43631           // If a normal DOM Ready event fired, decrement, and wait if need be
43632           if (wait !== true && --jQuery.readyWait > 0) {
43633             return;
43634           }
43635
43636           // If there are functions bound, to execute
43637           readyList.resolveWith(document, [jQuery]);
43638
43639           // Trigger any bound ready events
43640           if (jQuery.fn.triggerHandler) {
43641             jQuery(document).triggerHandler("ready");
43642             jQuery(document).off("ready");
43643           }
43644         }
43645       });
43646
43647       /**
43648        * The ready event handler and self cleanup method
43649        */
43650       function completed() {
43651         document.removeEventListener("DOMContentLoaded", completed, false);
43652         window.removeEventListener("load", completed, false);
43653         jQuery.ready();
43654       }
43655
43656       jQuery.ready.promise = function(obj) {
43657         if (!readyList) {
43658
43659           readyList = jQuery.Deferred();
43660
43661           // Catch cases where $(document).ready() is called after the browser
43662           // event has already occurred.
43663           // We once tried to use readyState "interactive" here, but it caused
43664           // issues like the one
43665           // discovered by ChrisS here:
43666           // http://bugs.jquery.com/ticket/12282#comment:15
43667           if (document.readyState === "complete") {
43668             // Handle it asynchronously to allow scripts the opportunity to
43669             // delay ready
43670             setTimeout(jQuery.ready);
43671
43672           } else {
43673
43674             // Use the handy event callback
43675             document.addEventListener("DOMContentLoaded", completed, false);
43676
43677             // A fallback to window.onload, that will always work
43678             window.addEventListener("load", completed, false);
43679           }
43680         }
43681         return readyList.promise(obj);
43682       };
43683
43684       // Kick off the DOM ready check even if the user does not
43685       jQuery.ready.promise();
43686
43687
43688
43689
43690       // Multifunctional method to get and set values of a collection
43691       // The value/s can optionally be executed if it's a function
43692       var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
43693         var i = 0,
43694           len = elems.length,
43695           bulk = key == null;
43696
43697         // Sets many values
43698         if (jQuery.type(key) === "object") {
43699           chainable = true;
43700           for (i in key) {
43701             jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
43702           }
43703
43704           // Sets one value
43705         } else if (value !== undefined) {
43706           chainable = true;
43707
43708           if (!jQuery.isFunction(value)) {
43709             raw = true;
43710           }
43711
43712           if (bulk) {
43713             // Bulk operations run against the entire set
43714             if (raw) {
43715               fn.call(elems, value);
43716               fn = null;
43717
43718               // ...except when executing function values
43719             } else {
43720               bulk = fn;
43721               fn = function(elem, key, value) {
43722                 return bulk.call(jQuery(elem), value);
43723               };
43724             }
43725           }
43726
43727           if (fn) {
43728             for (; i < len; i++) {
43729               fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
43730             }
43731           }
43732         }
43733
43734         return chainable ?
43735           elems :
43736
43737           // Gets
43738           bulk ?
43739           fn.call(elems) :
43740           len ? fn(elems[0], key) : emptyGet;
43741       };
43742
43743
43744       /**
43745        * Determines whether an object can have data
43746        */
43747       jQuery.acceptData = function(owner) {
43748         // Accepts only:
43749         // - Node
43750         // - Node.ELEMENT_NODE
43751         // - Node.DOCUMENT_NODE
43752         // - Object
43753         // - Any
43754         /* jshint -W018 */
43755         return owner.nodeType === 1 || owner.nodeType === 9 || !(+owner.nodeType);
43756       };
43757
43758
43759       function Data() {
43760         // Support: Android<4,
43761         // Old WebKit does not have Object.preventExtensions/freeze method,
43762         // return new empty object instead with no [[set]] accessor
43763         Object.defineProperty(this.cache = {}, 0, {
43764           get: function() {
43765             return {};
43766           }
43767         });
43768
43769         this.expando = jQuery.expando + Data.uid++;
43770       }
43771
43772       Data.uid = 1;
43773       Data.accepts = jQuery.acceptData;
43774
43775       Data.prototype = {
43776         key: function(owner) {
43777           // We can accept data for non-element nodes in modern browsers,
43778           // but we should not, see #8335.
43779           // Always return the key for a frozen object.
43780           if (!Data.accepts(owner)) {
43781             return 0;
43782           }
43783
43784           var descriptor = {},
43785             // Check if the owner object already has a cache key
43786             unlock = owner[this.expando];
43787
43788           // If not, create one
43789           if (!unlock) {
43790             unlock = Data.uid++;
43791
43792             // Secure it in a non-enumerable, non-writable property
43793             try {
43794               descriptor[this.expando] = {
43795                 value: unlock
43796               };
43797               Object.defineProperties(owner, descriptor);
43798
43799               // Support: Android<4
43800               // Fallback to a less secure definition
43801             } catch (e) {
43802               descriptor[this.expando] = unlock;
43803               jQuery.extend(owner, descriptor);
43804             }
43805           }
43806
43807           // Ensure the cache object
43808           if (!this.cache[unlock]) {
43809             this.cache[unlock] = {};
43810           }
43811
43812           return unlock;
43813         },
43814         set: function(owner, data, value) {
43815           var prop,
43816             // There may be an unlock assigned to this node,
43817             // if there is no entry for this "owner", create one inline
43818             // and set the unlock as though an owner entry had always existed
43819             unlock = this.key(owner),
43820             cache = this.cache[unlock];
43821
43822           // Handle: [ owner, key, value ] args
43823           if (typeof data === "string") {
43824             cache[data] = value;
43825
43826             // Handle: [ owner, { properties } ] args
43827           } else {
43828             // Fresh assignments by object are shallow copied
43829             if (jQuery.isEmptyObject(cache)) {
43830               jQuery.extend(this.cache[unlock], data);
43831               // Otherwise, copy the properties one-by-one to the cache object
43832             } else {
43833               for (prop in data) {
43834                 cache[prop] = data[prop];
43835               }
43836             }
43837           }
43838           return cache;
43839         },
43840         get: function(owner, key) {
43841           // Either a valid cache is found, or will be created.
43842           // New caches will be created and the unlock returned,
43843           // allowing direct access to the newly created
43844           // empty data object. A valid owner object must be provided.
43845           var cache = this.cache[this.key(owner)];
43846
43847           return key === undefined ?
43848             cache : cache[key];
43849         },
43850         access: function(owner, key, value) {
43851           var stored;
43852           // In cases where either:
43853           //
43854           // 1. No key was specified
43855           // 2. A string key was specified, but no value provided
43856           //
43857           // Take the "read" path and allow the get method to determine
43858           // which value to return, respectively either:
43859           //
43860           // 1. The entire cache object
43861           // 2. The data stored at the key
43862           //
43863           if (key === undefined ||
43864             ((key && typeof key === "string") && value === undefined)) {
43865
43866             stored = this.get(owner, key);
43867
43868             return stored !== undefined ?
43869               stored : this.get(owner, jQuery.camelCase(key));
43870           }
43871
43872           // [*]When the key is not a string, or both a key and value
43873           // are specified, set or extend (existing objects) with either:
43874           //
43875           // 1. An object of properties
43876           // 2. A key and value
43877           //
43878           this.set(owner, key, value);
43879
43880           // Since the "set" path can have two possible entry points
43881           // return the expected data based on which path was taken[*]
43882           return value !== undefined ? value : key;
43883         },
43884         remove: function(owner, key) {
43885           var i, name, camel,
43886             unlock = this.key(owner),
43887             cache = this.cache[unlock];
43888
43889           if (key === undefined) {
43890             this.cache[unlock] = {};
43891
43892           } else {
43893             // Support array or space separated string of keys
43894             if (jQuery.isArray(key)) {
43895               // If "name" is an array of keys...
43896               // When data is initially created, via ("key", "val") signature,
43897               // keys will be converted to camelCase.
43898               // Since there is no way to tell _how_ a key was added, remove
43899               // both plain key and camelCase key. #12786
43900               // This will only penalize the array argument path.
43901               name = key.concat(key.map(jQuery.camelCase));
43902             } else {
43903               camel = jQuery.camelCase(key);
43904               // Try the string as a key before any manipulation
43905               if (key in cache) {
43906                 name = [key, camel];
43907               } else {
43908                 // If a key with the spaces exists, use it.
43909                 // Otherwise, create an array by matching non-whitespace
43910                 name = camel;
43911                 name = name in cache ? [name] : (name.match(rnotwhite) || []);
43912               }
43913             }
43914
43915             i = name.length;
43916             while (i--) {
43917               delete cache[name[i]];
43918             }
43919           }
43920         },
43921         hasData: function(owner) {
43922           return !jQuery.isEmptyObject(
43923             this.cache[owner[this.expando]] || {}
43924           );
43925         },
43926         discard: function(owner) {
43927           if (owner[this.expando]) {
43928             delete this.cache[owner[this.expando]];
43929           }
43930         }
43931       };
43932       var data_priv = new Data();
43933
43934       var data_user = new Data();
43935
43936
43937
43938       // Implementation Summary
43939       //
43940       // 1. Enforce API surface and semantic compatibility with 1.9.x branch
43941       // 2. Improve the module's maintainability by reducing the storage
43942       // paths to a single mechanism.
43943       // 3. Use the same single mechanism to support "private" and "user" data.
43944       // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
43945       // 5. Avoid exposing implementation details on user objects (eg. expando
43946       // properties)
43947       // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
43948
43949       var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
43950         rmultiDash = /([A-Z])/g;
43951
43952       function dataAttr(elem, key, data) {
43953         var name;
43954
43955         // If nothing was found internally, try to fetch any
43956         // data from the HTML5 data-* attribute
43957         if (data === undefined && elem.nodeType === 1) {
43958           name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
43959           data = elem.getAttribute(name);
43960
43961           if (typeof data === "string") {
43962             try {
43963               data = data === "true" ? true :
43964                 data === "false" ? false :
43965                 data === "null" ? null :
43966                 // Only convert to a number if it doesn't change the string
43967                 +data + "" === data ? +data :
43968                 rbrace.test(data) ? jQuery.parseJSON(data) :
43969                 data;
43970             } catch (e) {}
43971
43972             // Make sure we set the data so it isn't changed later
43973             data_user.set(elem, key, data);
43974           } else {
43975             data = undefined;
43976           }
43977         }
43978         return data;
43979       }
43980
43981       jQuery.extend({
43982         hasData: function(elem) {
43983           return data_user.hasData(elem) || data_priv.hasData(elem);
43984         },
43985
43986         data: function(elem, name, data) {
43987           return data_user.access(elem, name, data);
43988         },
43989
43990         removeData: function(elem, name) {
43991           data_user.remove(elem, name);
43992         },
43993
43994         // TODO: Now that all calls to _data and _removeData have been replaced
43995         // with direct calls to data_priv methods, these can be deprecated.
43996         _data: function(elem, name, data) {
43997           return data_priv.access(elem, name, data);
43998         },
43999
44000         _removeData: function(elem, name) {
44001           data_priv.remove(elem, name);
44002         }
44003       });
44004
44005       jQuery.fn.extend({
44006         data: function(key, value) {
44007           var i, name, data,
44008             elem = this[0],
44009             attrs = elem && elem.attributes;
44010
44011           // Gets all values
44012           if (key === undefined) {
44013             if (this.length) {
44014               data = data_user.get(elem);
44015
44016               if (elem.nodeType === 1 && !data_priv.get(elem, "hasDataAttrs")) {
44017                 i = attrs.length;
44018                 while (i--) {
44019
44020                   // Support: IE11+
44021                   // The attrs elements can be null (#14894)
44022                   if (attrs[i]) {
44023                     name = attrs[i].name;
44024                     if (name.indexOf("data-") === 0) {
44025                       name = jQuery.camelCase(name.slice(5));
44026                       dataAttr(elem, name, data[name]);
44027                     }
44028                   }
44029                 }
44030                 data_priv.set(elem, "hasDataAttrs", true);
44031               }
44032             }
44033
44034             return data;
44035           }
44036
44037           // Sets multiple values
44038           if (typeof key === "object") {
44039             return this.each(function() {
44040               data_user.set(this, key);
44041             });
44042           }
44043
44044           return access(this, function(value) {
44045             var data,
44046               camelKey = jQuery.camelCase(key);
44047
44048             // The calling jQuery object (element matches) is not empty
44049             // (and therefore has an element appears at this[ 0 ]) and the
44050             // `value` parameter was not undefined. An empty jQuery object
44051             // will result in `undefined` for elem = this[ 0 ] which will
44052             // throw an exception if an attempt to read a data cache is made.
44053             if (elem && value === undefined) {
44054               // Attempt to get data from the cache
44055               // with the key as-is
44056               data = data_user.get(elem, key);
44057               if (data !== undefined) {
44058                 return data;
44059               }
44060
44061               // Attempt to get data from the cache
44062               // with the key camelized
44063               data = data_user.get(elem, camelKey);
44064               if (data !== undefined) {
44065                 return data;
44066               }
44067
44068               // Attempt to "discover" the data in
44069               // HTML5 custom data-* attrs
44070               data = dataAttr(elem, camelKey, undefined);
44071               if (data !== undefined) {
44072                 return data;
44073               }
44074
44075               // We tried really hard, but the data doesn't exist.
44076               return;
44077             }
44078
44079             // Set the data...
44080             this.each(function() {
44081               // First, attempt to store a copy or reference of any
44082               // data that might've been store with a camelCased key.
44083               var data = data_user.get(this, camelKey);
44084
44085               // For HTML5 data-* attribute interop, we have to
44086               // store property names with dashes in a camelCase form.
44087               // This might not apply to all properties...*
44088               data_user.set(this, camelKey, value);
44089
44090               // *... In the case of properties that might _actually_
44091               // have dashes, we need to also store a copy of that
44092               // unchanged property.
44093               if (key.indexOf("-") !== -1 && data !== undefined) {
44094                 data_user.set(this, key, value);
44095               }
44096             });
44097           }, null, value, arguments.length > 1, null, true);
44098         },
44099
44100         removeData: function(key) {
44101           return this.each(function() {
44102             data_user.remove(this, key);
44103           });
44104         }
44105       });
44106
44107
44108       jQuery.extend({
44109         queue: function(elem, type, data) {
44110           var queue;
44111
44112           if (elem) {
44113             type = (type || "fx") + "queue";
44114             queue = data_priv.get(elem, type);
44115
44116             // Speed up dequeue by getting out quickly if this is just a lookup
44117             if (data) {
44118               if (!queue || jQuery.isArray(data)) {
44119                 queue = data_priv.access(elem, type, jQuery.makeArray(data));
44120               } else {
44121                 queue.push(data);
44122               }
44123             }
44124             return queue || [];
44125           }
44126         },
44127
44128         dequeue: function(elem, type) {
44129           type = type || "fx";
44130
44131           var queue = jQuery.queue(elem, type),
44132             startLength = queue.length,
44133             fn = queue.shift(),
44134             hooks = jQuery._queueHooks(elem, type),
44135             next = function() {
44136               jQuery.dequeue(elem, type);
44137             };
44138
44139           // If the fx queue is dequeued, always remove the progress sentinel
44140           if (fn === "inprogress") {
44141             fn = queue.shift();
44142             startLength--;
44143           }
44144
44145           if (fn) {
44146
44147             // Add a progress sentinel to prevent the fx queue from being
44148             // automatically dequeued
44149             if (type === "fx") {
44150               queue.unshift("inprogress");
44151             }
44152
44153             // Clear up the last queue stop function
44154             delete hooks.stop;
44155             fn.call(elem, next, hooks);
44156           }
44157
44158           if (!startLength && hooks) {
44159             hooks.empty.fire();
44160           }
44161         },
44162
44163         // Not public - generate a queueHooks object, or return the current one
44164         _queueHooks: function(elem, type) {
44165           var key = type + "queueHooks";
44166           return data_priv.get(elem, key) || data_priv.access(elem, key, {
44167             empty: jQuery.Callbacks("once memory").add(function() {
44168               data_priv.remove(elem, [type + "queue", key]);
44169             })
44170           });
44171         }
44172       });
44173
44174       jQuery.fn.extend({
44175         queue: function(type, data) {
44176           var setter = 2;
44177
44178           if (typeof type !== "string") {
44179             data = type;
44180             type = "fx";
44181             setter--;
44182           }
44183
44184           if (arguments.length < setter) {
44185             return jQuery.queue(this[0], type);
44186           }
44187
44188           return data === undefined ?
44189             this :
44190             this.each(function() {
44191               var queue = jQuery.queue(this, type, data);
44192
44193               // Ensure a hooks for this queue
44194               jQuery._queueHooks(this, type);
44195
44196               if (type === "fx" && queue[0] !== "inprogress") {
44197                 jQuery.dequeue(this, type);
44198               }
44199             });
44200         },
44201         dequeue: function(type) {
44202           return this.each(function() {
44203             jQuery.dequeue(this, type);
44204           });
44205         },
44206         clearQueue: function(type) {
44207           return this.queue(type || "fx", []);
44208         },
44209         // Get a promise resolved when queues of a certain type
44210         // are emptied (fx is the type by default)
44211         promise: function(type, obj) {
44212           var tmp,
44213             count = 1,
44214             defer = jQuery.Deferred(),
44215             elements = this,
44216             i = this.length,
44217             resolve = function() {
44218               if (!(--count)) {
44219                 defer.resolveWith(elements, [elements]);
44220               }
44221             };
44222
44223           if (typeof type !== "string") {
44224             obj = type;
44225             type = undefined;
44226           }
44227           type = type || "fx";
44228
44229           while (i--) {
44230             tmp = data_priv.get(elements[i], type + "queueHooks");
44231             if (tmp && tmp.empty) {
44232               count++;
44233               tmp.empty.add(resolve);
44234             }
44235           }
44236           resolve();
44237           return defer.promise(obj);
44238         }
44239       });
44240       var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
44241
44242       var cssExpand = ["Top", "Right", "Bottom", "Left"];
44243
44244       var isHidden = function(elem, el) {
44245         // isHidden might be called from jQuery#filter function;
44246         // in that case, element will be second argument
44247         elem = el || elem;
44248         return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
44249       };
44250
44251       var rcheckableType = (/^(?:checkbox|radio)$/i);
44252
44253
44254
44255       (function() {
44256         var fragment = document.createDocumentFragment(),
44257           div = fragment.appendChild(document.createElement("div")),
44258           input = document.createElement("input");
44259
44260         // Support: Safari<=5.1
44261         // Check state lost if the name is set (#11217)
44262         // Support: Windows Web Apps (WWA)
44263         // `name` and `type` must use .setAttribute for WWA (#14901)
44264         input.setAttribute("type", "radio");
44265         input.setAttribute("checked", "checked");
44266         input.setAttribute("name", "t");
44267
44268         div.appendChild(input);
44269
44270         // Support: Safari<=5.1, Android<4.2
44271         // Older WebKit doesn't clone checked state correctly in fragments
44272         support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
44273
44274         // Support: IE<=11+
44275         // Make sure textarea (and checkbox) defaultValue is properly cloned
44276         div.innerHTML = "<textarea>x</textarea>";
44277         support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
44278       })();
44279       var strundefined = typeof undefined;
44280
44281
44282
44283       support.focusinBubbles = "onfocusin" in window;
44284
44285
44286       var
44287         rkeyEvent = /^key/,
44288         rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
44289         rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
44290         rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
44291
44292       function returnTrue() {
44293         return true;
44294       }
44295
44296       function returnFalse() {
44297         return false;
44298       }
44299
44300       function safeActiveElement() {
44301         try {
44302           return document.activeElement;
44303         } catch (err) {}
44304       }
44305
44306       /*
44307        * Helper functions for managing events -- not part of the public interface.
44308        * Props to Dean Edwards' addEvent library for many of the ideas.
44309        */
44310       jQuery.event = {
44311
44312         global: {},
44313
44314         add: function(elem, types, handler, data, selector) {
44315
44316           var handleObjIn, eventHandle, tmp,
44317             events, t, handleObj,
44318             special, handlers, type, namespaces, origType,
44319             elemData = data_priv.get(elem);
44320
44321           // Don't attach events to noData or text/comment nodes (but allow plain
44322           // objects)
44323           if (!elemData) {
44324             return;
44325           }
44326
44327           // Caller can pass in an object of custom data in lieu of the handler
44328           if (handler.handler) {
44329             handleObjIn = handler;
44330             handler = handleObjIn.handler;
44331             selector = handleObjIn.selector;
44332           }
44333
44334           // Make sure that the handler has a unique ID, used to find/remove it
44335           // later
44336           if (!handler.guid) {
44337             handler.guid = jQuery.guid++;
44338           }
44339
44340           // Init the element's event structure and main handler, if this is the
44341           // first
44342           if (!(events = elemData.events)) {
44343             events = elemData.events = {};
44344           }
44345           if (!(eventHandle = elemData.handle)) {
44346             eventHandle = elemData.handle = function(e) {
44347               // Discard the second event of a jQuery.event.trigger() and
44348               // when an event is called after a page has unloaded
44349               return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
44350                 jQuery.event.dispatch.apply(elem, arguments) : undefined;
44351             };
44352           }
44353
44354           // Handle multiple events separated by a space
44355           types = (types || "").match(rnotwhite) || [""];
44356           t = types.length;
44357           while (t--) {
44358             tmp = rtypenamespace.exec(types[t]) || [];
44359             type = origType = tmp[1];
44360             namespaces = (tmp[2] || "").split(".").sort();
44361
44362             // There *must* be a type, no attaching namespace-only handlers
44363             if (!type) {
44364               continue;
44365             }
44366
44367             // If event changes its type, use the special event handlers for the
44368             // changed type
44369             special = jQuery.event.special[type] || {};
44370
44371             // If selector defined, determine special event api type, otherwise
44372             // given type
44373             type = (selector ? special.delegateType : special.bindType) || type;
44374
44375             // Update special based on newly reset type
44376             special = jQuery.event.special[type] || {};
44377
44378             // handleObj is passed to all event handlers
44379             handleObj = jQuery.extend({
44380               type: type,
44381               origType: origType,
44382               data: data,
44383               handler: handler,
44384               guid: handler.guid,
44385               selector: selector,
44386               needsContext: selector && jQuery.expr.match.needsContext.test(selector),
44387               namespace: namespaces.join(".")
44388             }, handleObjIn);
44389
44390             // Init the event handler queue if we're the first
44391             if (!(handlers = events[type])) {
44392               handlers = events[type] = [];
44393               handlers.delegateCount = 0;
44394
44395               // Only use addEventListener if the special events handler
44396               // returns false
44397               if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
44398                 if (elem.addEventListener) {
44399                   elem.addEventListener(type, eventHandle, false);
44400                 }
44401               }
44402             }
44403
44404             if (special.add) {
44405               special.add.call(elem, handleObj);
44406
44407               if (!handleObj.handler.guid) {
44408                 handleObj.handler.guid = handler.guid;
44409               }
44410             }
44411
44412             // Add to the element's handler list, delegates in front
44413             if (selector) {
44414               handlers.splice(handlers.delegateCount++, 0, handleObj);
44415             } else {
44416               handlers.push(handleObj);
44417             }
44418
44419             // Keep track of which events have ever been used, for event
44420             // optimization
44421             jQuery.event.global[type] = true;
44422           }
44423
44424         },
44425
44426         // Detach an event or set of events from an element
44427         remove: function(elem, types, handler, selector, mappedTypes) {
44428
44429           var j, origCount, tmp,
44430             events, t, handleObj,
44431             special, handlers, type, namespaces, origType,
44432             elemData = data_priv.hasData(elem) && data_priv.get(elem);
44433
44434           if (!elemData || !(events = elemData.events)) {
44435             return;
44436           }
44437
44438           // Once for each type.namespace in types; type may be omitted
44439           types = (types || "").match(rnotwhite) || [""];
44440           t = types.length;
44441           while (t--) {
44442             tmp = rtypenamespace.exec(types[t]) || [];
44443             type = origType = tmp[1];
44444             namespaces = (tmp[2] || "").split(".").sort();
44445
44446             // Unbind all events (on this namespace, if provided) for the
44447             // element
44448             if (!type) {
44449               for (type in events) {
44450                 jQuery.event.remove(elem, type + types[t], handler, selector, true);
44451               }
44452               continue;
44453             }
44454
44455             special = jQuery.event.special[type] || {};
44456             type = (selector ? special.delegateType : special.bindType) || type;
44457             handlers = events[type] || [];
44458             tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
44459
44460             // Remove matching events
44461             origCount = j = handlers.length;
44462             while (j--) {
44463               handleObj = handlers[j];
44464
44465               if ((mappedTypes || origType === handleObj.origType) &&
44466                 (!handler || handler.guid === handleObj.guid) &&
44467                 (!tmp || tmp.test(handleObj.namespace)) &&
44468                 (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
44469                 handlers.splice(j, 1);
44470
44471                 if (handleObj.selector) {
44472                   handlers.delegateCount--;
44473                 }
44474                 if (special.remove) {
44475                   special.remove.call(elem, handleObj);
44476                 }
44477               }
44478             }
44479
44480             // Remove generic event handler if we removed something and no more
44481             // handlers exist
44482             // (avoids potential for endless recursion during removal of special
44483             // event handlers)
44484             if (origCount && !handlers.length) {
44485               if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
44486                 jQuery.removeEvent(elem, type, elemData.handle);
44487               }
44488
44489               delete events[type];
44490             }
44491           }
44492
44493           // Remove the expando if it's no longer used
44494           if (jQuery.isEmptyObject(events)) {
44495             delete elemData.handle;
44496             data_priv.remove(elem, "events");
44497           }
44498         },
44499
44500         trigger: function(event, data, elem, onlyHandlers) {
44501
44502           var i, cur, tmp, bubbleType, ontype, handle, special,
44503             eventPath = [elem || document],
44504             type = hasOwn.call(event, "type") ? event.type : event,
44505             namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
44506
44507           cur = tmp = elem = elem || document;
44508
44509           // Don't do events on text and comment nodes
44510           if (elem.nodeType === 3 || elem.nodeType === 8) {
44511             return;
44512           }
44513
44514           // focus/blur morphs to focusin/out; ensure we're not firing them right
44515           // now
44516           if (rfocusMorph.test(type + jQuery.event.triggered)) {
44517             return;
44518           }
44519
44520           if (type.indexOf(".") >= 0) {
44521             // Namespaced trigger; create a regexp to match event type in
44522             // handle()
44523             namespaces = type.split(".");
44524             type = namespaces.shift();
44525             namespaces.sort();
44526           }
44527           ontype = type.indexOf(":") < 0 && "on" + type;
44528
44529           // Caller can pass in a jQuery.Event object, Object, or just an event
44530           // type string
44531           event = event[jQuery.expando] ?
44532             event :
44533             new jQuery.Event(type, typeof event === "object" && event);
44534
44535           // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always
44536           // true)
44537           event.isTrigger = onlyHandlers ? 2 : 3;
44538           event.namespace = namespaces.join(".");
44539           event.namespace_re = event.namespace ?
44540             new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") :
44541             null;
44542
44543           // Clean up the event in case it is being reused
44544           event.result = undefined;
44545           if (!event.target) {
44546             event.target = elem;
44547           }
44548
44549           // Clone any incoming data and prepend the event, creating the handler
44550           // arg list
44551           data = data == null ? [event] :
44552             jQuery.makeArray(data, [event]);
44553
44554           // Allow special events to draw outside the lines
44555           special = jQuery.event.special[type] || {};
44556           if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
44557             return;
44558           }
44559
44560           // Determine event propagation path in advance, per W3C events spec
44561           // (#9951)
44562           // Bubble up to document, then to window; watch for a global
44563           // ownerDocument var (#9724)
44564           if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
44565
44566             bubbleType = special.delegateType || type;
44567             if (!rfocusMorph.test(bubbleType + type)) {
44568               cur = cur.parentNode;
44569             }
44570             for (; cur; cur = cur.parentNode) {
44571               eventPath.push(cur);
44572               tmp = cur;
44573             }
44574
44575             // Only add window if we got to document (e.g., not plain obj or
44576             // detached DOM)
44577             if (tmp === (elem.ownerDocument || document)) {
44578               eventPath.push(tmp.defaultView || tmp.parentWindow || window);
44579             }
44580           }
44581
44582           // Fire handlers on the event path
44583           i = 0;
44584           while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
44585
44586             event.type = i > 1 ?
44587               bubbleType :
44588               special.bindType || type;
44589
44590             // jQuery handler
44591             handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
44592             if (handle) {
44593               handle.apply(cur, data);
44594             }
44595
44596             // Native handler
44597             handle = ontype && cur[ontype];
44598             if (handle && handle.apply && jQuery.acceptData(cur)) {
44599               event.result = handle.apply(cur, data);
44600               if (event.result === false) {
44601                 event.preventDefault();
44602               }
44603             }
44604           }
44605           event.type = type;
44606
44607           // If nobody prevented the default action, do it now
44608           if (!onlyHandlers && !event.isDefaultPrevented()) {
44609
44610             if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&
44611               jQuery.acceptData(elem)) {
44612
44613               // Call a native DOM method on the target with the same name
44614               // name as the event.
44615               // Don't do default actions on window, that's where global
44616               // variables be (#6170)
44617               if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
44618
44619                 // Don't re-trigger an onFOO event when we call its FOO()
44620                 // method
44621                 tmp = elem[ontype];
44622
44623                 if (tmp) {
44624                   elem[ontype] = null;
44625                 }
44626
44627                 // Prevent re-triggering of the same event, since we already
44628                 // bubbled it above
44629                 jQuery.event.triggered = type;
44630                 elem[type]();
44631                 jQuery.event.triggered = undefined;
44632
44633                 if (tmp) {
44634                   elem[ontype] = tmp;
44635                 }
44636               }
44637             }
44638           }
44639
44640           return event.result;
44641         },
44642
44643         dispatch: function(event) {
44644
44645           // Make a writable jQuery.Event from the native event object
44646           event = jQuery.event.fix(event);
44647
44648           var i, j, ret, matched, handleObj,
44649             handlerQueue = [],
44650             args = slice.call(arguments),
44651             handlers = (data_priv.get(this, "events") || {})[event.type] || [],
44652             special = jQuery.event.special[event.type] || {};
44653
44654           // Use the fix-ed jQuery.Event rather than the (read-only) native event
44655           args[0] = event;
44656           event.delegateTarget = this;
44657
44658           // Call the preDispatch hook for the mapped type, and let it bail if
44659           // desired
44660           if (special.preDispatch && special.preDispatch.call(this, event) === false) {
44661             return;
44662           }
44663
44664           // Determine handlers
44665           handlerQueue = jQuery.event.handlers.call(this, event, handlers);
44666
44667           // Run delegates first; they may want to stop propagation beneath us
44668           i = 0;
44669           while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
44670             event.currentTarget = matched.elem;
44671
44672             j = 0;
44673             while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
44674
44675               // Triggered event must either 1) have no namespace, or 2) have
44676               // namespace(s)
44677               // a subset or equal to those in the bound event (both can have
44678               // no namespace).
44679               if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
44680
44681                 event.handleObj = handleObj;
44682                 event.data = handleObj.data;
44683
44684                 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler)
44685                   .apply(matched.elem, args);
44686
44687                 if (ret !== undefined) {
44688                   if ((event.result = ret) === false) {
44689                     event.preventDefault();
44690                     event.stopPropagation();
44691                   }
44692                 }
44693               }
44694             }
44695           }
44696
44697           // Call the postDispatch hook for the mapped type
44698           if (special.postDispatch) {
44699             special.postDispatch.call(this, event);
44700           }
44701
44702           return event.result;
44703         },
44704
44705         handlers: function(event, handlers) {
44706           var i, matches, sel, handleObj,
44707             handlerQueue = [],
44708             delegateCount = handlers.delegateCount,
44709             cur = event.target;
44710
44711           // Find delegate handlers
44712           // Black-hole SVG <use> instance trees (#13180)
44713           // Avoid non-left-click bubbling in Firefox (#3861)
44714           if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
44715
44716             for (; cur !== this; cur = cur.parentNode || this) {
44717
44718               // Don't process clicks on disabled elements (#6911, #8165,
44719               // #11382, #11764)
44720               if (cur.disabled !== true || event.type !== "click") {
44721                 matches = [];
44722                 for (i = 0; i < delegateCount; i++) {
44723                   handleObj = handlers[i];
44724
44725                   // Don't conflict with Object.prototype properties
44726                   // (#13203)
44727                   sel = handleObj.selector + " ";
44728
44729                   if (matches[sel] === undefined) {
44730                     matches[sel] = handleObj.needsContext ?
44731                       jQuery(sel, this).index(cur) >= 0 :
44732                       jQuery.find(sel, this, null, [cur]).length;
44733                   }
44734                   if (matches[sel]) {
44735                     matches.push(handleObj);
44736                   }
44737                 }
44738                 if (matches.length) {
44739                   handlerQueue.push({
44740                     elem: cur,
44741                     handlers: matches
44742                   });
44743                 }
44744               }
44745             }
44746           }
44747
44748           // Add the remaining (directly-bound) handlers
44749           if (delegateCount < handlers.length) {
44750             handlerQueue.push({
44751               elem: this,
44752               handlers: handlers.slice(delegateCount)
44753             });
44754           }
44755
44756           return handlerQueue;
44757         },
44758
44759         // Includes some event props shared by KeyEvent and MouseEvent
44760         props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
44761
44762         fixHooks: {},
44763
44764         keyHooks: {
44765           props: "char charCode key keyCode".split(" "),
44766           filter: function(event, original) {
44767
44768             // Add which for key events
44769             if (event.which == null) {
44770               event.which = original.charCode != null ? original.charCode : original.keyCode;
44771             }
44772
44773             return event;
44774           }
44775         },
44776
44777         mouseHooks: {
44778           props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
44779           filter: function(event, original) {
44780             var eventDoc, doc, body,
44781               button = original.button;
44782
44783             // Calculate pageX/Y if missing and clientX/Y available
44784             if (event.pageX == null && original.clientX != null) {
44785               eventDoc = event.target.ownerDocument || document;
44786               doc = eventDoc.documentElement;
44787               body = eventDoc.body;
44788
44789               event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
44790               event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
44791             }
44792
44793             // Add which for click: 1 === left; 2 === middle; 3 === right
44794             // Note: button is not normalized, so don't use it
44795             if (!event.which && button !== undefined) {
44796               event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
44797             }
44798
44799             return event;
44800           }
44801         },
44802
44803         fix: function(event) {
44804           if (event[jQuery.expando]) {
44805             return event;
44806           }
44807
44808           // Create a writable copy of the event object and normalize some
44809           // properties
44810           var i, prop, copy,
44811             type = event.type,
44812             originalEvent = event,
44813             fixHook = this.fixHooks[type];
44814
44815           if (!fixHook) {
44816             this.fixHooks[type] = fixHook =
44817               rmouseEvent.test(type) ? this.mouseHooks :
44818               rkeyEvent.test(type) ? this.keyHooks : {};
44819           }
44820           copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
44821
44822           event = new jQuery.Event(originalEvent);
44823
44824           i = copy.length;
44825           while (i--) {
44826             prop = copy[i];
44827             event[prop] = originalEvent[prop];
44828           }
44829
44830           // Support: Cordova 2.5 (WebKit) (#13255)
44831           // All events should have a target; Cordova deviceready doesn't
44832           if (!event.target) {
44833             event.target = document;
44834           }
44835
44836           // Support: Safari 6.0+, Chrome<28
44837           // Target should not be a text node (#504, #13143)
44838           if (event.target.nodeType === 3) {
44839             event.target = event.target.parentNode;
44840           }
44841
44842           return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
44843         },
44844
44845         special: {
44846           load: {
44847             // Prevent triggered image.load events from bubbling to window.load
44848             noBubble: true
44849           },
44850           focus: {
44851             // Fire native event if possible so blur/focus sequence is correct
44852             trigger: function() {
44853               if (this !== safeActiveElement() && this.focus) {
44854                 this.focus();
44855                 return false;
44856               }
44857             },
44858             delegateType: "focusin"
44859           },
44860           blur: {
44861             trigger: function() {
44862               if (this === safeActiveElement() && this.blur) {
44863                 this.blur();
44864                 return false;
44865               }
44866             },
44867             delegateType: "focusout"
44868           },
44869           click: {
44870             // For checkbox, fire native event so checked state will be right
44871             trigger: function() {
44872               if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) {
44873                 this.click();
44874                 return false;
44875               }
44876             },
44877
44878             // For cross-browser consistency, don't fire native .click() on
44879             // links
44880             _default: function(event) {
44881               return jQuery.nodeName(event.target, "a");
44882             }
44883           },
44884
44885           beforeunload: {
44886             postDispatch: function(event) {
44887
44888               // Support: Firefox 20+
44889               // Firefox doesn't alert if the returnValue field is not set.
44890               if (event.result !== undefined && event.originalEvent) {
44891                 event.originalEvent.returnValue = event.result;
44892               }
44893             }
44894           }
44895         },
44896
44897         simulate: function(type, elem, event, bubble) {
44898           // Piggyback on a donor event to simulate a different one.
44899           // Fake originalEvent to avoid donor's stopPropagation, but if the
44900           // simulated event prevents default then we do the same on the donor.
44901           var e = jQuery.extend(
44902             new jQuery.Event(),
44903             event, {
44904               type: type,
44905               isSimulated: true,
44906               originalEvent: {}
44907             }
44908           );
44909           if (bubble) {
44910             jQuery.event.trigger(e, null, elem);
44911           } else {
44912             jQuery.event.dispatch.call(elem, e);
44913           }
44914           if (e.isDefaultPrevented()) {
44915             event.preventDefault();
44916           }
44917         }
44918       };
44919
44920       jQuery.removeEvent = function(elem, type, handle) {
44921         if (elem.removeEventListener) {
44922           elem.removeEventListener(type, handle, false);
44923         }
44924       };
44925
44926       jQuery.Event = function(src, props) {
44927         // Allow instantiation without the 'new' keyword
44928         if (!(this instanceof jQuery.Event)) {
44929           return new jQuery.Event(src, props);
44930         }
44931
44932         // Event object
44933         if (src && src.type) {
44934           this.originalEvent = src;
44935           this.type = src.type;
44936
44937           // Events bubbling up the document may have been marked as prevented
44938           // by a handler lower down the tree; reflect the correct value.
44939           this.isDefaultPrevented = src.defaultPrevented ||
44940             src.defaultPrevented === undefined &&
44941             // Support: Android<4.0
44942             src.returnValue === false ?
44943             returnTrue :
44944             returnFalse;
44945
44946           // Event type
44947         } else {
44948           this.type = src;
44949         }
44950
44951         // Put explicitly provided properties onto the event object
44952         if (props) {
44953           jQuery.extend(this, props);
44954         }
44955
44956         // Create a timestamp if incoming event doesn't have one
44957         this.timeStamp = src && src.timeStamp || jQuery.now();
44958
44959         // Mark it as fixed
44960         this[jQuery.expando] = true;
44961       };
44962
44963       // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language
44964       // Binding
44965       // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
44966       jQuery.Event.prototype = {
44967         isDefaultPrevented: returnFalse,
44968         isPropagationStopped: returnFalse,
44969         isImmediatePropagationStopped: returnFalse,
44970
44971         preventDefault: function() {
44972           var e = this.originalEvent;
44973
44974           this.isDefaultPrevented = returnTrue;
44975
44976           if (e && e.preventDefault) {
44977             e.preventDefault();
44978           }
44979         },
44980         stopPropagation: function() {
44981           var e = this.originalEvent;
44982
44983           this.isPropagationStopped = returnTrue;
44984
44985           if (e && e.stopPropagation) {
44986             e.stopPropagation();
44987           }
44988         },
44989         stopImmediatePropagation: function() {
44990           var e = this.originalEvent;
44991
44992           this.isImmediatePropagationStopped = returnTrue;
44993
44994           if (e && e.stopImmediatePropagation) {
44995             e.stopImmediatePropagation();
44996           }
44997
44998           this.stopPropagation();
44999         }
45000       };
45001
45002       // Create mouseenter/leave events using mouseover/out and event-time checks
45003       // Support: Chrome 15+
45004       jQuery.each({
45005         mouseenter: "mouseover",
45006         mouseleave: "mouseout",
45007         pointerenter: "pointerover",
45008         pointerleave: "pointerout"
45009       }, function(orig, fix) {
45010         jQuery.event.special[orig] = {
45011           delegateType: fix,
45012           bindType: fix,
45013
45014           handle: function(event) {
45015             var ret,
45016               target = this,
45017               related = event.relatedTarget,
45018               handleObj = event.handleObj;
45019
45020             // For mousenter/leave call the handler if related is outside the
45021             // target.
45022             // NB: No relatedTarget if the mouse left/entered the browser window
45023             if (!related || (related !== target && !jQuery.contains(target, related))) {
45024               event.type = handleObj.origType;
45025               ret = handleObj.handler.apply(this, arguments);
45026               event.type = fix;
45027             }
45028             return ret;
45029           }
45030         };
45031       });
45032
45033       // Support: Firefox, Chrome, Safari
45034       // Create "bubbling" focus and blur events
45035       if (!support.focusinBubbles) {
45036         jQuery.each({
45037           focus: "focusin",
45038           blur: "focusout"
45039         }, function(orig, fix) {
45040
45041           // Attach a single capturing handler on the document while someone wants
45042           // focusin/focusout
45043           var handler = function(event) {
45044             jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
45045           };
45046
45047           jQuery.event.special[fix] = {
45048             setup: function() {
45049               var doc = this.ownerDocument || this,
45050                 attaches = data_priv.access(doc, fix);
45051
45052               if (!attaches) {
45053                 doc.addEventListener(orig, handler, true);
45054               }
45055               data_priv.access(doc, fix, (attaches || 0) + 1);
45056             },
45057             teardown: function() {
45058               var doc = this.ownerDocument || this,
45059                 attaches = data_priv.access(doc, fix) - 1;
45060
45061               if (!attaches) {
45062                 doc.removeEventListener(orig, handler, true);
45063                 data_priv.remove(doc, fix);
45064
45065               } else {
45066                 data_priv.access(doc, fix, attaches);
45067               }
45068             }
45069           };
45070         });
45071       }
45072
45073       jQuery.fn.extend({
45074
45075         on: function(types, selector, data, fn, /* INTERNAL */ one) {
45076           var origFn, type;
45077
45078           // Types can be a map of types/handlers
45079           if (typeof types === "object") {
45080             // ( types-Object, selector, data )
45081             if (typeof selector !== "string") {
45082               // ( types-Object, data )
45083               data = data || selector;
45084               selector = undefined;
45085             }
45086             for (type in types) {
45087               this.on(type, selector, data, types[type], one);
45088             }
45089             return this;
45090           }
45091
45092           if (data == null && fn == null) {
45093             // ( types, fn )
45094             fn = selector;
45095             data = selector = undefined;
45096           } else if (fn == null) {
45097             if (typeof selector === "string") {
45098               // ( types, selector, fn )
45099               fn = data;
45100               data = undefined;
45101             } else {
45102               // ( types, data, fn )
45103               fn = data;
45104               data = selector;
45105               selector = undefined;
45106             }
45107           }
45108           if (fn === false) {
45109             fn = returnFalse;
45110           } else if (!fn) {
45111             return this;
45112           }
45113
45114           if (one === 1) {
45115             origFn = fn;
45116             fn = function(event) {
45117               // Can use an empty set, since event contains the info
45118               jQuery().off(event);
45119               return origFn.apply(this, arguments);
45120             };
45121             // Use same guid so caller can remove using origFn
45122             fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
45123           }
45124           return this.each(function() {
45125             jQuery.event.add(this, types, fn, data, selector);
45126           });
45127         },
45128         one: function(types, selector, data, fn) {
45129           return this.on(types, selector, data, fn, 1);
45130         },
45131         off: function(types, selector, fn) {
45132           var handleObj, type;
45133           if (types && types.preventDefault && types.handleObj) {
45134             // ( event ) dispatched jQuery.Event
45135             handleObj = types.handleObj;
45136             jQuery(types.delegateTarget).off(
45137               handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
45138               handleObj.selector,
45139               handleObj.handler
45140             );
45141             return this;
45142           }
45143           if (typeof types === "object") {
45144             // ( types-object [, selector] )
45145             for (type in types) {
45146               this.off(type, selector, types[type]);
45147             }
45148             return this;
45149           }
45150           if (selector === false || typeof selector === "function") {
45151             // ( types [, fn] )
45152             fn = selector;
45153             selector = undefined;
45154           }
45155           if (fn === false) {
45156             fn = returnFalse;
45157           }
45158           return this.each(function() {
45159             jQuery.event.remove(this, types, fn, selector);
45160           });
45161         },
45162
45163         trigger: function(type, data) {
45164           return this.each(function() {
45165             jQuery.event.trigger(type, data, this);
45166           });
45167         },
45168         triggerHandler: function(type, data) {
45169           var elem = this[0];
45170           if (elem) {
45171             return jQuery.event.trigger(type, data, elem, true);
45172           }
45173         }
45174       });
45175
45176
45177       var
45178         rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
45179         rtagName = /<([\w:]+)/,
45180         rhtml = /<|&#?\w+;/,
45181         rnoInnerhtml = /<(?:script|style|link)/i,
45182         // checked="checked" or checked
45183         rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
45184         rscriptType = /^$|\/(?:java|ecma)script/i,
45185         rscriptTypeMasked = /^true\/(.*)/,
45186         rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
45187
45188         // We have to close these tags to support XHTML (#13200)
45189         wrapMap = {
45190
45191           // Support: IE9
45192           option: [1, "<select multiple='multiple'>", "</select>"],
45193
45194           thead: [1, "<table>", "</table>"],
45195           col: [2, "<table><colgroup>", "</colgroup></table>"],
45196           tr: [2, "<table><tbody>", "</tbody></table>"],
45197           td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
45198
45199           _default: [0, "", ""]
45200         };
45201
45202       // Support: IE9
45203       wrapMap.optgroup = wrapMap.option;
45204
45205       wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
45206       wrapMap.th = wrapMap.td;
45207
45208       // Support: 1.x compatibility
45209       // Manipulating tables requires a tbody
45210       function manipulationTarget(elem, content) {
45211         return jQuery.nodeName(elem, "table") &&
45212           jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ?
45213
45214           elem.getElementsByTagName("tbody")[0] ||
45215           elem.appendChild(elem.ownerDocument.createElement("tbody")) :
45216           elem;
45217       }
45218
45219       // Replace/restore the type attribute of script elements for safe DOM
45220       // manipulation
45221       function disableScript(elem) {
45222         elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
45223         return elem;
45224       }
45225
45226       function restoreScript(elem) {
45227         var match = rscriptTypeMasked.exec(elem.type);
45228
45229         if (match) {
45230           elem.type = match[1];
45231         } else {
45232           elem.removeAttribute("type");
45233         }
45234
45235         return elem;
45236       }
45237
45238       // Mark scripts as having already been evaluated
45239       function setGlobalEval(elems, refElements) {
45240         var i = 0,
45241           l = elems.length;
45242
45243         for (; i < l; i++) {
45244           data_priv.set(
45245             elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval")
45246           );
45247         }
45248       }
45249
45250       function cloneCopyEvent(src, dest) {
45251         var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
45252
45253         if (dest.nodeType !== 1) {
45254           return;
45255         }
45256
45257         // 1. Copy private data: events, handlers, etc.
45258         if (data_priv.hasData(src)) {
45259           pdataOld = data_priv.access(src);
45260           pdataCur = data_priv.set(dest, pdataOld);
45261           events = pdataOld.events;
45262
45263           if (events) {
45264             delete pdataCur.handle;
45265             pdataCur.events = {};
45266
45267             for (type in events) {
45268               for (i = 0, l = events[type].length; i < l; i++) {
45269                 jQuery.event.add(dest, type, events[type][i]);
45270               }
45271             }
45272           }
45273         }
45274
45275         // 2. Copy user data
45276         if (data_user.hasData(src)) {
45277           udataOld = data_user.access(src);
45278           udataCur = jQuery.extend({}, udataOld);
45279
45280           data_user.set(dest, udataCur);
45281         }
45282       }
45283
45284       function getAll(context, tag) {
45285         var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") :
45286           context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
45287
45288         return tag === undefined || tag && jQuery.nodeName(context, tag) ?
45289           jQuery.merge([context], ret) :
45290           ret;
45291       }
45292
45293       // Fix IE bugs, see support tests
45294       function fixInput(src, dest) {
45295         var nodeName = dest.nodeName.toLowerCase();
45296
45297         // Fails to persist the checked state of a cloned checkbox or radio button.
45298         if (nodeName === "input" && rcheckableType.test(src.type)) {
45299           dest.checked = src.checked;
45300
45301           // Fails to return the selected option to the default selected state when
45302           // cloning options
45303         } else if (nodeName === "input" || nodeName === "textarea") {
45304           dest.defaultValue = src.defaultValue;
45305         }
45306       }
45307
45308       jQuery.extend({
45309         clone: function(elem, dataAndEvents, deepDataAndEvents) {
45310           var i, l, srcElements, destElements,
45311             clone = elem.cloneNode(true),
45312             inPage = jQuery.contains(elem.ownerDocument, elem);
45313
45314           // Fix IE cloning issues
45315           if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) &&
45316             !jQuery.isXMLDoc(elem)) {
45317
45318             // We eschew Sizzle here for performance reasons:
45319             // http://jsperf.com/getall-vs-sizzle/2
45320             destElements = getAll(clone);
45321             srcElements = getAll(elem);
45322
45323             for (i = 0, l = srcElements.length; i < l; i++) {
45324               fixInput(srcElements[i], destElements[i]);
45325             }
45326           }
45327
45328           // Copy the events from the original to the clone
45329           if (dataAndEvents) {
45330             if (deepDataAndEvents) {
45331               srcElements = srcElements || getAll(elem);
45332               destElements = destElements || getAll(clone);
45333
45334               for (i = 0, l = srcElements.length; i < l; i++) {
45335                 cloneCopyEvent(srcElements[i], destElements[i]);
45336               }
45337             } else {
45338               cloneCopyEvent(elem, clone);
45339             }
45340           }
45341
45342           // Preserve script evaluation history
45343           destElements = getAll(clone, "script");
45344           if (destElements.length > 0) {
45345             setGlobalEval(destElements, !inPage && getAll(elem, "script"));
45346           }
45347
45348           // Return the cloned set
45349           return clone;
45350         },
45351
45352         buildFragment: function(elems, context, scripts, selection) {
45353           var elem, tmp, tag, wrap, contains, j,
45354             fragment = context.createDocumentFragment(),
45355             nodes = [],
45356             i = 0,
45357             l = elems.length;
45358
45359           for (; i < l; i++) {
45360             elem = elems[i];
45361
45362             if (elem || elem === 0) {
45363
45364               // Add nodes directly
45365               if (jQuery.type(elem) === "object") {
45366                 // Support: QtWebKit, PhantomJS
45367                 // push.apply(_, arraylike) throws on ancient WebKit
45368                 jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
45369
45370                 // Convert non-html into a text node
45371               } else if (!rhtml.test(elem)) {
45372                 nodes.push(context.createTextNode(elem));
45373
45374                 // Convert html into DOM nodes
45375               } else {
45376                 tmp = tmp || fragment.appendChild(context.createElement("div"));
45377
45378                 // Deserialize a standard representation
45379                 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
45380                 wrap = wrapMap[tag] || wrapMap._default;
45381                 tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
45382
45383                 // Descend through wrappers to the right content
45384                 j = wrap[0];
45385                 while (j--) {
45386                   tmp = tmp.lastChild;
45387                 }
45388
45389                 // Support: QtWebKit, PhantomJS
45390                 // push.apply(_, arraylike) throws on ancient WebKit
45391                 jQuery.merge(nodes, tmp.childNodes);
45392
45393                 // Remember the top-level container
45394                 tmp = fragment.firstChild;
45395
45396                 // Ensure the created nodes are orphaned (#12392)
45397                 tmp.textContent = "";
45398               }
45399             }
45400           }
45401
45402           // Remove wrapper from fragment
45403           fragment.textContent = "";
45404
45405           i = 0;
45406           while ((elem = nodes[i++])) {
45407
45408             // #4087 - If origin and destination elements are the same, and this
45409             // is
45410             // that element, do not do anything
45411             if (selection && jQuery.inArray(elem, selection) !== -1) {
45412               continue;
45413             }
45414
45415             contains = jQuery.contains(elem.ownerDocument, elem);
45416
45417             // Append to fragment
45418             tmp = getAll(fragment.appendChild(elem), "script");
45419
45420             // Preserve script evaluation history
45421             if (contains) {
45422               setGlobalEval(tmp);
45423             }
45424
45425             // Capture executables
45426             if (scripts) {
45427               j = 0;
45428               while ((elem = tmp[j++])) {
45429                 if (rscriptType.test(elem.type || "")) {
45430                   scripts.push(elem);
45431                 }
45432               }
45433             }
45434           }
45435
45436           return fragment;
45437         },
45438
45439         cleanData: function(elems) {
45440           var data, elem, type, key,
45441             special = jQuery.event.special,
45442             i = 0;
45443
45444           for (;
45445             (elem = elems[i]) !== undefined; i++) {
45446             if (jQuery.acceptData(elem)) {
45447               key = elem[data_priv.expando];
45448
45449               if (key && (data = data_priv.cache[key])) {
45450                 if (data.events) {
45451                   for (type in data.events) {
45452                     if (special[type]) {
45453                       jQuery.event.remove(elem, type);
45454
45455                       // This is a shortcut to avoid jQuery.event.remove's
45456                       // overhead
45457                     } else {
45458                       jQuery.removeEvent(elem, type, data.handle);
45459                     }
45460                   }
45461                 }
45462                 if (data_priv.cache[key]) {
45463                   // Discard any remaining `private` data
45464                   delete data_priv.cache[key];
45465                 }
45466               }
45467             }
45468             // Discard any remaining `user` data
45469             delete data_user.cache[elem[data_user.expando]];
45470           }
45471         }
45472       });
45473
45474       jQuery.fn.extend({
45475         text: function(value) {
45476           return access(this, function(value) {
45477             return value === undefined ?
45478               jQuery.text(this) :
45479               this.empty().each(function() {
45480                 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45481                   this.textContent = value;
45482                 }
45483               });
45484           }, null, value, arguments.length);
45485         },
45486
45487         append: function() {
45488           return this.domManip(arguments, function(elem) {
45489             if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45490               var target = manipulationTarget(this, elem);
45491               target.appendChild(elem);
45492             }
45493           });
45494         },
45495
45496         prepend: function() {
45497           return this.domManip(arguments, function(elem) {
45498             if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45499               var target = manipulationTarget(this, elem);
45500               target.insertBefore(elem, target.firstChild);
45501             }
45502           });
45503         },
45504
45505         before: function() {
45506           return this.domManip(arguments, function(elem) {
45507             if (this.parentNode) {
45508               this.parentNode.insertBefore(elem, this);
45509             }
45510           });
45511         },
45512
45513         after: function() {
45514           return this.domManip(arguments, function(elem) {
45515             if (this.parentNode) {
45516               this.parentNode.insertBefore(elem, this.nextSibling);
45517             }
45518           });
45519         },
45520
45521         remove: function(selector, keepData /* Internal Use Only */ ) {
45522           var elem,
45523             elems = selector ? jQuery.filter(selector, this) : this,
45524             i = 0;
45525
45526           for (;
45527             (elem = elems[i]) != null; i++) {
45528             if (!keepData && elem.nodeType === 1) {
45529               jQuery.cleanData(getAll(elem));
45530             }
45531
45532             if (elem.parentNode) {
45533               if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
45534                 setGlobalEval(getAll(elem, "script"));
45535               }
45536               elem.parentNode.removeChild(elem);
45537             }
45538           }
45539
45540           return this;
45541         },
45542
45543         empty: function() {
45544           var elem,
45545             i = 0;
45546
45547           for (;
45548             (elem = this[i]) != null; i++) {
45549             if (elem.nodeType === 1) {
45550
45551               // Prevent memory leaks
45552               jQuery.cleanData(getAll(elem, false));
45553
45554               // Remove any remaining nodes
45555               elem.textContent = "";
45556             }
45557           }
45558
45559           return this;
45560         },
45561
45562         clone: function(dataAndEvents, deepDataAndEvents) {
45563           dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
45564           deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
45565
45566           return this.map(function() {
45567             return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
45568           });
45569         },
45570
45571         html: function(value) {
45572           return access(this, function(value) {
45573             var elem = this[0] || {},
45574               i = 0,
45575               l = this.length;
45576
45577             if (value === undefined && elem.nodeType === 1) {
45578               return elem.innerHTML;
45579             }
45580
45581             // See if we can take a shortcut and just use innerHTML
45582             if (typeof value === "string" && !rnoInnerhtml.test(value) &&
45583               !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
45584
45585               value = value.replace(rxhtmlTag, "<$1></$2>");
45586
45587               try {
45588                 for (; i < l; i++) {
45589                   elem = this[i] || {};
45590
45591                   // Remove element nodes and prevent memory leaks
45592                   if (elem.nodeType === 1) {
45593                     jQuery.cleanData(getAll(elem, false));
45594                     elem.innerHTML = value;
45595                   }
45596                 }
45597
45598                 elem = 0;
45599
45600                 // If using innerHTML throws an exception, use the fallback
45601                 // method
45602               } catch (e) {}
45603             }
45604
45605             if (elem) {
45606               this.empty().append(value);
45607             }
45608           }, null, value, arguments.length);
45609         },
45610
45611         replaceWith: function() {
45612           var arg = arguments[0];
45613
45614           // Make the changes, replacing each context element with the new content
45615           this.domManip(arguments, function(elem) {
45616             arg = this.parentNode;
45617
45618             jQuery.cleanData(getAll(this));
45619
45620             if (arg) {
45621               arg.replaceChild(elem, this);
45622             }
45623           });
45624
45625           // Force removal if there was no new content (e.g., from empty
45626           // arguments)
45627           return arg && (arg.length || arg.nodeType) ? this : this.remove();
45628         },
45629
45630         detach: function(selector) {
45631           return this.remove(selector, true);
45632         },
45633
45634         domManip: function(args, callback) {
45635
45636           // Flatten any nested arrays
45637           args = concat.apply([], args);
45638
45639           var fragment, first, scripts, hasScripts, node, doc,
45640             i = 0,
45641             l = this.length,
45642             set = this,
45643             iNoClone = l - 1,
45644             value = args[0],
45645             isFunction = jQuery.isFunction(value);
45646
45647           // We can't cloneNode fragments that contain checked, in WebKit
45648           if (isFunction ||
45649             (l > 1 && typeof value === "string" &&
45650               !support.checkClone && rchecked.test(value))) {
45651             return this.each(function(index) {
45652               var self = set.eq(index);
45653               if (isFunction) {
45654                 args[0] = value.call(this, index, self.html());
45655               }
45656               self.domManip(args, callback);
45657             });
45658           }
45659
45660           if (l) {
45661             fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
45662             first = fragment.firstChild;
45663
45664             if (fragment.childNodes.length === 1) {
45665               fragment = first;
45666             }
45667
45668             if (first) {
45669               scripts = jQuery.map(getAll(fragment, "script"), disableScript);
45670               hasScripts = scripts.length;
45671
45672               // Use the original fragment for the last item instead of the
45673               // first because it can end up
45674               // being emptied incorrectly in certain situations (#8070).
45675               for (; i < l; i++) {
45676                 node = fragment;
45677
45678                 if (i !== iNoClone) {
45679                   node = jQuery.clone(node, true, true);
45680
45681                   // Keep references to cloned scripts for later
45682                   // restoration
45683                   if (hasScripts) {
45684                     // Support: QtWebKit
45685                     // jQuery.merge because push.apply(_, arraylike)
45686                     // throws
45687                     jQuery.merge(scripts, getAll(node, "script"));
45688                   }
45689                 }
45690
45691                 callback.call(this[i], node, i);
45692               }
45693
45694               if (hasScripts) {
45695                 doc = scripts[scripts.length - 1].ownerDocument;
45696
45697                 // Reenable scripts
45698                 jQuery.map(scripts, restoreScript);
45699
45700                 // Evaluate executable scripts on first document insertion
45701                 for (i = 0; i < hasScripts; i++) {
45702                   node = scripts[i];
45703                   if (rscriptType.test(node.type || "") &&
45704                     !data_priv.access(node, "globalEval") && jQuery.contains(doc, node)) {
45705
45706                     if (node.src) {
45707                       // Optional AJAX dependency, but won't run
45708                       // scripts if not present
45709                       if (jQuery._evalUrl) {
45710                         jQuery._evalUrl(node.src);
45711                       }
45712                     } else {
45713                       jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
45714                     }
45715                   }
45716                 }
45717               }
45718             }
45719           }
45720
45721           return this;
45722         }
45723       });
45724
45725       jQuery.each({
45726         appendTo: "append",
45727         prependTo: "prepend",
45728         insertBefore: "before",
45729         insertAfter: "after",
45730         replaceAll: "replaceWith"
45731       }, function(name, original) {
45732         jQuery.fn[name] = function(selector) {
45733           var elems,
45734             ret = [],
45735             insert = jQuery(selector),
45736             last = insert.length - 1,
45737             i = 0;
45738
45739           for (; i <= last; i++) {
45740             elems = i === last ? this : this.clone(true);
45741             jQuery(insert[i])[original](elems);
45742
45743             // Support: QtWebKit
45744             // .get() because push.apply(_, arraylike) throws
45745             push.apply(ret, elems.get());
45746           }
45747
45748           return this.pushStack(ret);
45749         };
45750       });
45751
45752
45753       var iframe,
45754         elemdisplay = {};
45755
45756       /**
45757        * Retrieve the actual display of a element
45758        *
45759        * @param {String}
45760        *            name nodeName of the element
45761        * @param {Object}
45762        *            doc Document object
45763        */
45764       // Called only from within defaultDisplay
45765       function actualDisplay(name, doc) {
45766         var style,
45767           elem = jQuery(doc.createElement(name)).appendTo(doc.body),
45768
45769           // getDefaultComputedStyle might be reliably used only on attached
45770           // element
45771           display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ?
45772
45773           // Use of this method is a temporary fix (more like optimization)
45774           // until something better comes along,
45775           // since it was removed from specification and supported only in FF
45776           style.display : jQuery.css(elem[0], "display");
45777
45778         // We don't have any data stored on the element,
45779         // so use "detach" method as fast way to get rid of the element
45780         elem.detach();
45781
45782         return display;
45783       }
45784
45785       /**
45786        * Try to determine the default display value of an element
45787        *
45788        * @param {String}
45789        *            nodeName
45790        */
45791       function defaultDisplay(nodeName) {
45792         var doc = document,
45793           display = elemdisplay[nodeName];
45794
45795         if (!display) {
45796           display = actualDisplay(nodeName, doc);
45797
45798           // If the simple way fails, read from inside an iframe
45799           if (display === "none" || !display) {
45800
45801             // Use the already-created iframe if possible
45802             iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);
45803
45804             // Always write a new HTML skeleton so Webkit and Firefox don't
45805             // choke on reuse
45806             doc = iframe[0].contentDocument;
45807
45808             // Support: IE
45809             doc.write();
45810             doc.close();
45811
45812             display = actualDisplay(nodeName, doc);
45813             iframe.detach();
45814           }
45815
45816           // Store the correct default display
45817           elemdisplay[nodeName] = display;
45818         }
45819
45820         return display;
45821       }
45822       var rmargin = (/^margin/);
45823
45824       var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
45825
45826       var getStyles = function(elem) {
45827         // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
45828         // IE throws on elements created in popups
45829         // FF meanwhile throws on frame elements through
45830         // "defaultView.getComputedStyle"
45831         if (elem.ownerDocument.defaultView.opener) {
45832           return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
45833         }
45834
45835         return window.getComputedStyle(elem, null);
45836       };
45837
45838
45839
45840       function curCSS(elem, name, computed) {
45841         var width, minWidth, maxWidth, ret,
45842           style = elem.style;
45843
45844         computed = computed || getStyles(elem);
45845
45846         // Support: IE9
45847         // getPropertyValue is only needed for .css('filter') (#12537)
45848         if (computed) {
45849           ret = computed.getPropertyValue(name) || computed[name];
45850         }
45851
45852         if (computed) {
45853
45854           if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
45855             ret = jQuery.style(elem, name);
45856           }
45857
45858           // Support: iOS < 6
45859           // A tribute to the "awesome hack by Dean Edwards"
45860           // iOS < 6 (at least) returns percentage for a larger set of values, but
45861           // width seems to be reliably pixels
45862           // this is against the CSSOM draft spec:
45863           // http://dev.w3.org/csswg/cssom/#resolved-values
45864           if (rnumnonpx.test(ret) && rmargin.test(name)) {
45865
45866             // Remember the original values
45867             width = style.width;
45868             minWidth = style.minWidth;
45869             maxWidth = style.maxWidth;
45870
45871             // Put in the new values to get a computed value out
45872             style.minWidth = style.maxWidth = style.width = ret;
45873             ret = computed.width;
45874
45875             // Revert the changed values
45876             style.width = width;
45877             style.minWidth = minWidth;
45878             style.maxWidth = maxWidth;
45879           }
45880         }
45881
45882         return ret !== undefined ?
45883           // Support: IE
45884           // IE returns zIndex value as an integer.
45885           ret + "" :
45886           ret;
45887       }
45888
45889
45890       function addGetHookIf(conditionFn, hookFn) {
45891         // Define the hook, we'll check on the first run if it's really needed.
45892         return {
45893           get: function() {
45894             if (conditionFn()) {
45895               // Hook not needed (or it's not possible to use it due
45896               // to missing dependency), remove it.
45897               delete this.get;
45898               return;
45899             }
45900
45901             // Hook needed; redefine it so that the support test is not executed
45902             // again.
45903             return (this.get = hookFn).apply(this, arguments);
45904           }
45905         };
45906       }
45907
45908
45909       (function() {
45910         var pixelPositionVal, boxSizingReliableVal,
45911           docElem = document.documentElement,
45912           container = document.createElement("div"),
45913           div = document.createElement("div");
45914
45915         if (!div.style) {
45916           return;
45917         }
45918
45919         // Support: IE9-11+
45920         // Style of cloned element affects source element cloned (#8908)
45921         div.style.backgroundClip = "content-box";
45922         div.cloneNode(true).style.backgroundClip = "";
45923         support.clearCloneStyle = div.style.backgroundClip === "content-box";
45924
45925         container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
45926           "position:absolute";
45927         container.appendChild(div);
45928
45929         // Executing both pixelPosition & boxSizingReliable tests require only one
45930         // layout
45931         // so they're executed at the same time to save the second computation.
45932         function computePixelPositionAndBoxSizingReliable() {
45933           div.style.cssText =
45934             // Support: Firefox<29, Android 2.3
45935             // Vendor-prefix box-sizing
45936             "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
45937             "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
45938             "border:1px;padding:1px;width:4px;position:absolute";
45939           div.innerHTML = "";
45940           docElem.appendChild(container);
45941
45942           var divStyle = window.getComputedStyle(div, null);
45943           pixelPositionVal = divStyle.top !== "1%";
45944           boxSizingReliableVal = divStyle.width === "4px";
45945
45946           docElem.removeChild(container);
45947         }
45948
45949         // Support: node.js jsdom
45950         // Don't assume that getComputedStyle is a property of the global object
45951         if (window.getComputedStyle) {
45952           jQuery.extend(support, {
45953             pixelPosition: function() {
45954
45955               // This test is executed only once but we still do memoizing
45956               // since we can use the boxSizingReliable pre-computing.
45957               // No need to check if the test was already performed, though.
45958               computePixelPositionAndBoxSizingReliable();
45959               return pixelPositionVal;
45960             },
45961             boxSizingReliable: function() {
45962               if (boxSizingReliableVal == null) {
45963                 computePixelPositionAndBoxSizingReliable();
45964               }
45965               return boxSizingReliableVal;
45966             },
45967             reliableMarginRight: function() {
45968
45969               // Support: Android 2.3
45970               // Check if div with explicit width and no margin-right
45971               // incorrectly
45972               // gets computed margin-right based on width of container.
45973               // (#3333)
45974               // WebKit Bug 13343 - getComputedStyle returns wrong value for
45975               // margin-right
45976               // This support function is only executed once so no memoizing
45977               // is needed.
45978               var ret,
45979                 marginDiv = div.appendChild(document.createElement("div"));
45980
45981               // Reset CSS: box-sizing; display; margin; border; padding
45982               marginDiv.style.cssText = div.style.cssText =
45983                 // Support: Firefox<29, Android 2.3
45984                 // Vendor-prefix box-sizing
45985                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
45986                 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
45987               marginDiv.style.marginRight = marginDiv.style.width = "0";
45988               div.style.width = "1px";
45989               docElem.appendChild(container);
45990
45991               ret = !parseFloat(window.getComputedStyle(marginDiv, null).marginRight);
45992
45993               docElem.removeChild(container);
45994               div.removeChild(marginDiv);
45995
45996               return ret;
45997             }
45998           });
45999         }
46000       })();
46001
46002
46003       // A method for quickly swapping in/out CSS properties to get correct
46004       // calculations.
46005       jQuery.swap = function(elem, options, callback, args) {
46006         var ret, name,
46007           old = {};
46008
46009         // Remember the old values, and insert the new ones
46010         for (name in options) {
46011           old[name] = elem.style[name];
46012           elem.style[name] = options[name];
46013         }
46014
46015         ret = callback.apply(elem, args || []);
46016
46017         // Revert the old values
46018         for (name in options) {
46019           elem.style[name] = old[name];
46020         }
46021
46022         return ret;
46023       };
46024
46025
46026       var
46027         // Swappable if display is none or starts with table except "table",
46028         // "table-cell", or "table-caption"
46029         // See here for display values:
46030         // https://developer.mozilla.org/en-US/docs/CSS/display
46031         rdisplayswap = /^(none|table(?!-c[ea]).+)/,
46032         rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"),
46033         rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"),
46034
46035         cssShow = {
46036           position: "absolute",
46037           visibility: "hidden",
46038           display: "block"
46039         },
46040         cssNormalTransform = {
46041           letterSpacing: "0",
46042           fontWeight: "400"
46043         },
46044
46045         cssPrefixes = ["Webkit", "O", "Moz", "ms"];
46046
46047       // Return a css property mapped to a potentially vendor prefixed property
46048       function vendorPropName(style, name) {
46049
46050         // Shortcut for names that are not vendor prefixed
46051         if (name in style) {
46052           return name;
46053         }
46054
46055         // Check for vendor prefixed names
46056         var capName = name[0].toUpperCase() + name.slice(1),
46057           origName = name,
46058           i = cssPrefixes.length;
46059
46060         while (i--) {
46061           name = cssPrefixes[i] + capName;
46062           if (name in style) {
46063             return name;
46064           }
46065         }
46066
46067         return origName;
46068       }
46069
46070       function setPositiveNumber(elem, value, subtract) {
46071         var matches = rnumsplit.exec(value);
46072         return matches ?
46073           // Guard against undefined "subtract", e.g., when used as in cssHooks
46074           Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") :
46075           value;
46076       }
46077
46078       function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
46079         var i = extra === (isBorderBox ? "border" : "content") ?
46080           // If we already have the right measurement, avoid augmentation
46081           4 :
46082           // Otherwise initialize for horizontal or vertical properties
46083           name === "width" ? 1 : 0,
46084
46085           val = 0;
46086
46087         for (; i < 4; i += 2) {
46088           // Both box models exclude margin, so add it if we want it
46089           if (extra === "margin") {
46090             val += jQuery.css(elem, extra + cssExpand[i], true, styles);
46091           }
46092
46093           if (isBorderBox) {
46094             // border-box includes padding, so remove it if we want content
46095             if (extra === "content") {
46096               val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
46097             }
46098
46099             // At this point, extra isn't border nor margin, so remove border
46100             if (extra !== "margin") {
46101               val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
46102             }
46103           } else {
46104             // At this point, extra isn't content, so add padding
46105             val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
46106
46107             // At this point, extra isn't content nor padding, so add border
46108             if (extra !== "padding") {
46109               val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
46110             }
46111           }
46112         }
46113
46114         return val;
46115       }
46116
46117       function getWidthOrHeight(elem, name, extra) {
46118
46119         // Start with offset property, which is equivalent to the border-box value
46120         var valueIsBorderBox = true,
46121           val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
46122           styles = getStyles(elem),
46123           isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
46124
46125         // Some non-html elements return undefined for offsetWidth, so check for
46126         // null/undefined
46127         // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
46128         // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
46129         if (val <= 0 || val == null) {
46130           // Fall back to computed then uncomputed css if necessary
46131           val = curCSS(elem, name, styles);
46132           if (val < 0 || val == null) {
46133             val = elem.style[name];
46134           }
46135
46136           // Computed unit is not pixels. Stop here and return.
46137           if (rnumnonpx.test(val)) {
46138             return val;
46139           }
46140
46141           // Check for style in case a browser which returns unreliable values
46142           // for getComputedStyle silently falls back to the reliable elem.style
46143           valueIsBorderBox = isBorderBox &&
46144             (support.boxSizingReliable() || val === elem.style[name]);
46145
46146           // Normalize "", auto, and prepare for extra
46147           val = parseFloat(val) || 0;
46148         }
46149
46150         // Use the active box-sizing model to add/subtract irrelevant styles
46151         return (val +
46152           augmentWidthOrHeight(
46153             elem,
46154             name,
46155             extra || (isBorderBox ? "border" : "content"),
46156             valueIsBorderBox,
46157             styles
46158           )
46159         ) + "px";
46160       }
46161
46162       function showHide(elements, show) {
46163         var display, elem, hidden,
46164           values = [],
46165           index = 0,
46166           length = elements.length;
46167
46168         for (; index < length; index++) {
46169           elem = elements[index];
46170           if (!elem.style) {
46171             continue;
46172           }
46173
46174           values[index] = data_priv.get(elem, "olddisplay");
46175           display = elem.style.display;
46176           if (show) {
46177             // Reset the inline display of this element to learn if it is
46178             // being hidden by cascaded rules or not
46179             if (!values[index] && display === "none") {
46180               elem.style.display = "";
46181             }
46182
46183             // Set elements which have been overridden with display: none
46184             // in a stylesheet to whatever the default browser style is
46185             // for such an element
46186             if (elem.style.display === "" && isHidden(elem)) {
46187               values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
46188             }
46189           } else {
46190             hidden = isHidden(elem);
46191
46192             if (display !== "none" || !hidden) {
46193               data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
46194             }
46195           }
46196         }
46197
46198         // Set the display of most of the elements in a second loop
46199         // to avoid the constant reflow
46200         for (index = 0; index < length; index++) {
46201           elem = elements[index];
46202           if (!elem.style) {
46203             continue;
46204           }
46205           if (!show || elem.style.display === "none" || elem.style.display === "") {
46206             elem.style.display = show ? values[index] || "" : "none";
46207           }
46208         }
46209
46210         return elements;
46211       }
46212
46213       jQuery.extend({
46214
46215         // Add in style property hooks for overriding the default
46216         // behavior of getting and setting a style property
46217         cssHooks: {
46218           opacity: {
46219             get: function(elem, computed) {
46220               if (computed) {
46221
46222                 // We should always get a number back from opacity
46223                 var ret = curCSS(elem, "opacity");
46224                 return ret === "" ? "1" : ret;
46225               }
46226             }
46227           }
46228         },
46229
46230         // Don't automatically add "px" to these possibly-unitless properties
46231         cssNumber: {
46232           "columnCount": true,
46233           "fillOpacity": true,
46234           "flexGrow": true,
46235           "flexShrink": true,
46236           "fontWeight": true,
46237           "lineHeight": true,
46238           "opacity": true,
46239           "order": true,
46240           "orphans": true,
46241           "widows": true,
46242           "zIndex": true,
46243           "zoom": true
46244         },
46245
46246         // Add in properties whose names you wish to fix before
46247         // setting or getting the value
46248         cssProps: {
46249           "float": "cssFloat"
46250         },
46251
46252         // Get and set the style property on a DOM Node
46253         style: function(elem, name, value, extra) {
46254
46255           // Don't set styles on text and comment nodes
46256           if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
46257             return;
46258           }
46259
46260           // Make sure that we're working with the right name
46261           var ret, type, hooks,
46262             origName = jQuery.camelCase(name),
46263             style = elem.style;
46264
46265           name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
46266
46267           // Gets hook for the prefixed version, then unprefixed version
46268           hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46269
46270           // Check if we're setting a value
46271           if (value !== undefined) {
46272             type = typeof value;
46273
46274             // Convert "+=" or "-=" to relative numbers (#7345)
46275             if (type === "string" && (ret = rrelNum.exec(value))) {
46276               value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
46277               // Fixes bug #9237
46278               type = "number";
46279             }
46280
46281             // Make sure that null and NaN values aren't set (#7116)
46282             if (value == null || value !== value) {
46283               return;
46284             }
46285
46286             // If a number, add 'px' to the (except for certain CSS properties)
46287             if (type === "number" && !jQuery.cssNumber[origName]) {
46288               value += "px";
46289             }
46290
46291             // Support: IE9-11+
46292             // background-* props affect original clone's values
46293             if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
46294               style[name] = "inherit";
46295             }
46296
46297             // If a hook was provided, use that value, otherwise just set the
46298             // specified value
46299             if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
46300               style[name] = value;
46301             }
46302
46303           } else {
46304             // If a hook was provided get the non-computed value from there
46305             if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
46306               return ret;
46307             }
46308
46309             // Otherwise just get the value from the style object
46310             return style[name];
46311           }
46312         },
46313
46314         css: function(elem, name, extra, styles) {
46315           var val, num, hooks,
46316             origName = jQuery.camelCase(name);
46317
46318           // Make sure that we're working with the right name
46319           name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
46320
46321           // Try prefixed name followed by the unprefixed name
46322           hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46323
46324           // If a hook was provided get the computed value from there
46325           if (hooks && "get" in hooks) {
46326             val = hooks.get(elem, true, extra);
46327           }
46328
46329           // Otherwise, if a way to get the computed value exists, use that
46330           if (val === undefined) {
46331             val = curCSS(elem, name, styles);
46332           }
46333
46334           // Convert "normal" to computed value
46335           if (val === "normal" && name in cssNormalTransform) {
46336             val = cssNormalTransform[name];
46337           }
46338
46339           // Make numeric if forced or a qualifier was provided and val looks
46340           // numeric
46341           if (extra === "" || extra) {
46342             num = parseFloat(val);
46343             return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
46344           }
46345           return val;
46346         }
46347       });
46348
46349       jQuery.each(["height", "width"], function(i, name) {
46350         jQuery.cssHooks[name] = {
46351           get: function(elem, computed, extra) {
46352             if (computed) {
46353
46354               // Certain elements can have dimension info if we invisibly show
46355               // them
46356               // but it must have a current display style that would benefit
46357               return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ?
46358                 jQuery.swap(elem, cssShow, function() {
46359                   return getWidthOrHeight(elem, name, extra);
46360                 }) :
46361                 getWidthOrHeight(elem, name, extra);
46362             }
46363           },
46364
46365           set: function(elem, value, extra) {
46366             var styles = extra && getStyles(elem);
46367             return setPositiveNumber(elem, value, extra ?
46368               augmentWidthOrHeight(
46369                 elem,
46370                 name,
46371                 extra,
46372                 jQuery.css(elem, "boxSizing", false, styles) === "border-box",
46373                 styles
46374               ) : 0
46375             );
46376           }
46377         };
46378       });
46379
46380       // Support: Android 2.3
46381       jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight,
46382         function(elem, computed) {
46383           if (computed) {
46384             return jQuery.swap(elem, {
46385                 "display": "inline-block"
46386               },
46387               curCSS, [elem, "marginRight"]);
46388           }
46389         }
46390       );
46391
46392       // These hooks are used by animate to expand properties
46393       jQuery.each({
46394         margin: "",
46395         padding: "",
46396         border: "Width"
46397       }, function(prefix, suffix) {
46398         jQuery.cssHooks[prefix + suffix] = {
46399           expand: function(value) {
46400             var i = 0,
46401               expanded = {},
46402
46403               // Assumes a single number if not a string
46404               parts = typeof value === "string" ? value.split(" ") : [value];
46405
46406             for (; i < 4; i++) {
46407               expanded[prefix + cssExpand[i] + suffix] =
46408                 parts[i] || parts[i - 2] || parts[0];
46409             }
46410
46411             return expanded;
46412           }
46413         };
46414
46415         if (!rmargin.test(prefix)) {
46416           jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
46417         }
46418       });
46419
46420       jQuery.fn.extend({
46421         css: function(name, value) {
46422           return access(this, function(elem, name, value) {
46423             var styles, len,
46424               map = {},
46425               i = 0;
46426
46427             if (jQuery.isArray(name)) {
46428               styles = getStyles(elem);
46429               len = name.length;
46430
46431               for (; i < len; i++) {
46432                 map[name[i]] = jQuery.css(elem, name[i], false, styles);
46433               }
46434
46435               return map;
46436             }
46437
46438             return value !== undefined ?
46439               jQuery.style(elem, name, value) :
46440               jQuery.css(elem, name);
46441           }, name, value, arguments.length > 1);
46442         },
46443         show: function() {
46444           return showHide(this, true);
46445         },
46446         hide: function() {
46447           return showHide(this);
46448         },
46449         toggle: function(state) {
46450           if (typeof state === "boolean") {
46451             return state ? this.show() : this.hide();
46452           }
46453
46454           return this.each(function() {
46455             if (isHidden(this)) {
46456               jQuery(this).show();
46457             } else {
46458               jQuery(this).hide();
46459             }
46460           });
46461         }
46462       });
46463
46464
46465       function Tween(elem, options, prop, end, easing) {
46466         return new Tween.prototype.init(elem, options, prop, end, easing);
46467       }
46468       jQuery.Tween = Tween;
46469
46470       Tween.prototype = {
46471         constructor: Tween,
46472         init: function(elem, options, prop, end, easing, unit) {
46473           this.elem = elem;
46474           this.prop = prop;
46475           this.easing = easing || "swing";
46476           this.options = options;
46477           this.start = this.now = this.cur();
46478           this.end = end;
46479           this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
46480         },
46481         cur: function() {
46482           var hooks = Tween.propHooks[this.prop];
46483
46484           return hooks && hooks.get ?
46485             hooks.get(this) :
46486             Tween.propHooks._default.get(this);
46487         },
46488         run: function(percent) {
46489           var eased,
46490             hooks = Tween.propHooks[this.prop];
46491
46492           if (this.options.duration) {
46493             this.pos = eased = jQuery.easing[this.easing](
46494               percent, this.options.duration * percent, 0, 1, this.options.duration
46495             );
46496           } else {
46497             this.pos = eased = percent;
46498           }
46499           this.now = (this.end - this.start) * eased + this.start;
46500
46501           if (this.options.step) {
46502             this.options.step.call(this.elem, this.now, this);
46503           }
46504
46505           if (hooks && hooks.set) {
46506             hooks.set(this);
46507           } else {
46508             Tween.propHooks._default.set(this);
46509           }
46510           return this;
46511         }
46512       };
46513
46514       Tween.prototype.init.prototype = Tween.prototype;
46515
46516       Tween.propHooks = {
46517         _default: {
46518           get: function(tween) {
46519             var result;
46520
46521             if (tween.elem[tween.prop] != null &&
46522               (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
46523               return tween.elem[tween.prop];
46524             }
46525
46526             // Passing an empty string as a 3rd parameter to .css will
46527             // automatically
46528             // attempt a parseFloat and fallback to a string if the parse fails.
46529             // Simple values such as "10px" are parsed to Float;
46530             // complex values such as "rotate(1rad)" are returned as-is.
46531             result = jQuery.css(tween.elem, tween.prop, "");
46532             // Empty strings, null, undefined and "auto" are converted to 0.
46533             return !result || result === "auto" ? 0 : result;
46534           },
46535           set: function(tween) {
46536             // Use step hook for back compat.
46537             // Use cssHook if its there.
46538             // Use .style if available and use plain properties where available.
46539             if (jQuery.fx.step[tween.prop]) {
46540               jQuery.fx.step[tween.prop](tween);
46541             } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
46542               jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
46543             } else {
46544               tween.elem[tween.prop] = tween.now;
46545             }
46546           }
46547         }
46548       };
46549
46550       // Support: IE9
46551       // Panic based approach to setting things on disconnected nodes
46552       Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
46553         set: function(tween) {
46554           if (tween.elem.nodeType && tween.elem.parentNode) {
46555             tween.elem[tween.prop] = tween.now;
46556           }
46557         }
46558       };
46559
46560       jQuery.easing = {
46561         linear: function(p) {
46562           return p;
46563         },
46564         swing: function(p) {
46565           return 0.5 - Math.cos(p * Math.PI) / 2;
46566         }
46567       };
46568
46569       jQuery.fx = Tween.prototype.init;
46570
46571       // Back Compat <1.8 extension point
46572       jQuery.fx.step = {};
46573
46574
46575
46576
46577       var
46578         fxNow, timerId,
46579         rfxtypes = /^(?:toggle|show|hide)$/,
46580         rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"),
46581         rrun = /queueHooks$/,
46582         animationPrefilters = [defaultPrefilter],
46583         tweeners = {
46584           "*": [function(prop, value) {
46585             var tween = this.createTween(prop, value),
46586               target = tween.cur(),
46587               parts = rfxnum.exec(value),
46588               unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
46589
46590               // Starting value computation is required for potential unit
46591               // mismatches
46592               start = (jQuery.cssNumber[prop] || unit !== "px" && +target) &&
46593               rfxnum.exec(jQuery.css(tween.elem, prop)),
46594               scale = 1,
46595               maxIterations = 20;
46596
46597             if (start && start[3] !== unit) {
46598               // Trust units reported by jQuery.css
46599               unit = unit || start[3];
46600
46601               // Make sure we update the tween properties later on
46602               parts = parts || [];
46603
46604               // Iteratively approximate from a nonzero starting point
46605               start = +target || 1;
46606
46607               do {
46608                 // If previous iteration zeroed out, double until we get
46609                 // *something*.
46610                 // Use string for doubling so we don't accidentally see
46611                 // scale as unchanged below
46612                 scale = scale || ".5";
46613
46614                 // Adjust and apply
46615                 start = start / scale;
46616                 jQuery.style(tween.elem, prop, start + unit);
46617
46618                 // Update scale, tolerating zero or NaN from tween.cur(),
46619                 // break the loop if scale is unchanged or perfect, or if we've
46620                 // just had enough
46621               } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations);
46622             }
46623
46624             // Update tween properties
46625             if (parts) {
46626               start = tween.start = +start || +target || 0;
46627               tween.unit = unit;
46628               // If a +=/-= token was provided, we're doing a relative
46629               // animation
46630               tween.end = parts[1] ?
46631                 start + (parts[1] + 1) * parts[2] :
46632                 +parts[2];
46633             }
46634
46635             return tween;
46636           }]
46637         };
46638
46639       // Animations created synchronously will run synchronously
46640       function createFxNow() {
46641         setTimeout(function() {
46642           fxNow = undefined;
46643         });
46644         return (fxNow = jQuery.now());
46645       }
46646
46647       // Generate parameters to create a standard animation
46648       function genFx(type, includeWidth) {
46649         var which,
46650           i = 0,
46651           attrs = {
46652             height: type
46653           };
46654
46655         // If we include width, step value is 1 to do all cssExpand values,
46656         // otherwise step value is 2 to skip over Left and Right
46657         includeWidth = includeWidth ? 1 : 0;
46658         for (; i < 4; i += 2 - includeWidth) {
46659           which = cssExpand[i];
46660           attrs["margin" + which] = attrs["padding" + which] = type;
46661         }
46662
46663         if (includeWidth) {
46664           attrs.opacity = attrs.width = type;
46665         }
46666
46667         return attrs;
46668       }
46669
46670       function createTween(value, prop, animation) {
46671         var tween,
46672           collection = (tweeners[prop] || []).concat(tweeners["*"]),
46673           index = 0,
46674           length = collection.length;
46675         for (; index < length; index++) {
46676           if ((tween = collection[index].call(animation, prop, value))) {
46677
46678             // We're done with this property
46679             return tween;
46680           }
46681         }
46682       }
46683
46684       function defaultPrefilter(elem, props, opts) {
46685         /* jshint validthis: true */
46686         var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
46687           anim = this,
46688           orig = {},
46689           style = elem.style,
46690           hidden = elem.nodeType && isHidden(elem),
46691           dataShow = data_priv.get(elem, "fxshow");
46692
46693         // Handle queue: false promises
46694         if (!opts.queue) {
46695           hooks = jQuery._queueHooks(elem, "fx");
46696           if (hooks.unqueued == null) {
46697             hooks.unqueued = 0;
46698             oldfire = hooks.empty.fire;
46699             hooks.empty.fire = function() {
46700               if (!hooks.unqueued) {
46701                 oldfire();
46702               }
46703             };
46704           }
46705           hooks.unqueued++;
46706
46707           anim.always(function() {
46708             // Ensure the complete handler is called before this completes
46709             anim.always(function() {
46710               hooks.unqueued--;
46711               if (!jQuery.queue(elem, "fx").length) {
46712                 hooks.empty.fire();
46713               }
46714             });
46715           });
46716         }
46717
46718         // Height/width overflow pass
46719         if (elem.nodeType === 1 && ("height" in props || "width" in props)) {
46720           // Make sure that nothing sneaks out
46721           // Record all 3 overflow attributes because IE9-10 do not
46722           // change the overflow attribute when overflowX and
46723           // overflowY are set to the same value
46724           opts.overflow = [style.overflow, style.overflowX, style.overflowY];
46725
46726           // Set display property to inline-block for height/width
46727           // animations on inline elements that are having width/height animated
46728           display = jQuery.css(elem, "display");
46729
46730           // Test default display if display is currently "none"
46731           checkDisplay = display === "none" ?
46732             data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display;
46733
46734           if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") {
46735             style.display = "inline-block";
46736           }
46737         }
46738
46739         if (opts.overflow) {
46740           style.overflow = "hidden";
46741           anim.always(function() {
46742             style.overflow = opts.overflow[0];
46743             style.overflowX = opts.overflow[1];
46744             style.overflowY = opts.overflow[2];
46745           });
46746         }
46747
46748         // show/hide pass
46749         for (prop in props) {
46750           value = props[prop];
46751           if (rfxtypes.exec(value)) {
46752             delete props[prop];
46753             toggle = toggle || value === "toggle";
46754             if (value === (hidden ? "hide" : "show")) {
46755
46756               // If there is dataShow left over from a stopped hide or show
46757               // and we are going to proceed with show, we should pretend to
46758               // be hidden
46759               if (value === "show" && dataShow && dataShow[prop] !== undefined) {
46760                 hidden = true;
46761               } else {
46762                 continue;
46763               }
46764             }
46765             orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
46766
46767             // Any non-fx value stops us from restoring the original display value
46768           } else {
46769             display = undefined;
46770           }
46771         }
46772
46773         if (!jQuery.isEmptyObject(orig)) {
46774           if (dataShow) {
46775             if ("hidden" in dataShow) {
46776               hidden = dataShow.hidden;
46777             }
46778           } else {
46779             dataShow = data_priv.access(elem, "fxshow", {});
46780           }
46781
46782           // Store state if its toggle - enables .stop().toggle() to "reverse"
46783           if (toggle) {
46784             dataShow.hidden = !hidden;
46785           }
46786           if (hidden) {
46787             jQuery(elem).show();
46788           } else {
46789             anim.done(function() {
46790               jQuery(elem).hide();
46791             });
46792           }
46793           anim.done(function() {
46794             var prop;
46795
46796             data_priv.remove(elem, "fxshow");
46797             for (prop in orig) {
46798               jQuery.style(elem, prop, orig[prop]);
46799             }
46800           });
46801           for (prop in orig) {
46802             tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
46803
46804             if (!(prop in dataShow)) {
46805               dataShow[prop] = tween.start;
46806               if (hidden) {
46807                 tween.end = tween.start;
46808                 tween.start = prop === "width" || prop === "height" ? 1 : 0;
46809               }
46810             }
46811           }
46812
46813           // If this is a noop like .hide().hide(), restore an overwritten display
46814           // value
46815         } else if ((display === "none" ? defaultDisplay(elem.nodeName) : display) === "inline") {
46816           style.display = display;
46817         }
46818       }
46819
46820       function propFilter(props, specialEasing) {
46821         var index, name, easing, value, hooks;
46822
46823         // camelCase, specialEasing and expand cssHook pass
46824         for (index in props) {
46825           name = jQuery.camelCase(index);
46826           easing = specialEasing[name];
46827           value = props[index];
46828           if (jQuery.isArray(value)) {
46829             easing = value[1];
46830             value = props[index] = value[0];
46831           }
46832
46833           if (index !== name) {
46834             props[name] = value;
46835             delete props[index];
46836           }
46837
46838           hooks = jQuery.cssHooks[name];
46839           if (hooks && "expand" in hooks) {
46840             value = hooks.expand(value);
46841             delete props[name];
46842
46843             // Not quite $.extend, this won't overwrite existing keys.
46844             // Reusing 'index' because we have the correct "name"
46845             for (index in value) {
46846               if (!(index in props)) {
46847                 props[index] = value[index];
46848                 specialEasing[index] = easing;
46849               }
46850             }
46851           } else {
46852             specialEasing[name] = easing;
46853           }
46854         }
46855       }
46856
46857       function Animation(elem, properties, options) {
46858         var result,
46859           stopped,
46860           index = 0,
46861           length = animationPrefilters.length,
46862           deferred = jQuery.Deferred().always(function() {
46863             // Don't match elem in the :animated selector
46864             delete tick.elem;
46865           }),
46866           tick = function() {
46867             if (stopped) {
46868               return false;
46869             }
46870             var currentTime = fxNow || createFxNow(),
46871               remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
46872               // Support: Android 2.3
46873               // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )`
46874               // (#12497)
46875               temp = remaining / animation.duration || 0,
46876               percent = 1 - temp,
46877               index = 0,
46878               length = animation.tweens.length;
46879
46880             for (; index < length; index++) {
46881               animation.tweens[index].run(percent);
46882             }
46883
46884             deferred.notifyWith(elem, [animation, percent, remaining]);
46885
46886             if (percent < 1 && length) {
46887               return remaining;
46888             } else {
46889               deferred.resolveWith(elem, [animation]);
46890               return false;
46891             }
46892           },
46893           animation = deferred.promise({
46894             elem: elem,
46895             props: jQuery.extend({}, properties),
46896             opts: jQuery.extend(true, {
46897               specialEasing: {}
46898             }, options),
46899             originalProperties: properties,
46900             originalOptions: options,
46901             startTime: fxNow || createFxNow(),
46902             duration: options.duration,
46903             tweens: [],
46904             createTween: function(prop, end) {
46905               var tween = jQuery.Tween(elem, animation.opts, prop, end,
46906                 animation.opts.specialEasing[prop] || animation.opts.easing);
46907               animation.tweens.push(tween);
46908               return tween;
46909             },
46910             stop: function(gotoEnd) {
46911               var index = 0,
46912                 // If we are going to the end, we want to run all the tweens
46913                 // otherwise we skip this part
46914                 length = gotoEnd ? animation.tweens.length : 0;
46915               if (stopped) {
46916                 return this;
46917               }
46918               stopped = true;
46919               for (; index < length; index++) {
46920                 animation.tweens[index].run(1);
46921               }
46922
46923               // Resolve when we played the last frame; otherwise, reject
46924               if (gotoEnd) {
46925                 deferred.resolveWith(elem, [animation, gotoEnd]);
46926               } else {
46927                 deferred.rejectWith(elem, [animation, gotoEnd]);
46928               }
46929               return this;
46930             }
46931           }),
46932           props = animation.props;
46933
46934         propFilter(props, animation.opts.specialEasing);
46935
46936         for (; index < length; index++) {
46937           result = animationPrefilters[index].call(animation, elem, props, animation.opts);
46938           if (result) {
46939             return result;
46940           }
46941         }
46942
46943         jQuery.map(props, createTween, animation);
46944
46945         if (jQuery.isFunction(animation.opts.start)) {
46946           animation.opts.start.call(elem, animation);
46947         }
46948
46949         jQuery.fx.timer(
46950           jQuery.extend(tick, {
46951             elem: elem,
46952             anim: animation,
46953             queue: animation.opts.queue
46954           })
46955         );
46956
46957         // attach callbacks from options
46958         return animation.progress(animation.opts.progress)
46959           .done(animation.opts.done, animation.opts.complete)
46960           .fail(animation.opts.fail)
46961           .always(animation.opts.always);
46962       }
46963
46964       jQuery.Animation = jQuery.extend(Animation, {
46965
46966         tweener: function(props, callback) {
46967           if (jQuery.isFunction(props)) {
46968             callback = props;
46969             props = ["*"];
46970           } else {
46971             props = props.split(" ");
46972           }
46973
46974           var prop,
46975             index = 0,
46976             length = props.length;
46977
46978           for (; index < length; index++) {
46979             prop = props[index];
46980             tweeners[prop] = tweeners[prop] || [];
46981             tweeners[prop].unshift(callback);
46982           }
46983         },
46984
46985         prefilter: function(callback, prepend) {
46986           if (prepend) {
46987             animationPrefilters.unshift(callback);
46988           } else {
46989             animationPrefilters.push(callback);
46990           }
46991         }
46992       });
46993
46994       jQuery.speed = function(speed, easing, fn) {
46995         var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
46996           complete: fn || !fn && easing ||
46997             jQuery.isFunction(speed) && speed,
46998           duration: speed,
46999           easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
47000         };
47001
47002         opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
47003           opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
47004
47005         // Normalize opt.queue - true/undefined/null -> "fx"
47006         if (opt.queue == null || opt.queue === true) {
47007           opt.queue = "fx";
47008         }
47009
47010         // Queueing
47011         opt.old = opt.complete;
47012
47013         opt.complete = function() {
47014           if (jQuery.isFunction(opt.old)) {
47015             opt.old.call(this);
47016           }
47017
47018           if (opt.queue) {
47019             jQuery.dequeue(this, opt.queue);
47020           }
47021         };
47022
47023         return opt;
47024       };
47025
47026       jQuery.fn.extend({
47027         fadeTo: function(speed, to, easing, callback) {
47028
47029           // Show any hidden elements after setting opacity to 0
47030           return this.filter(isHidden).css("opacity", 0).show()
47031
47032             // Animate to the value specified
47033             .end().animate({
47034               opacity: to
47035             }, speed, easing, callback);
47036         },
47037         animate: function(prop, speed, easing, callback) {
47038           var empty = jQuery.isEmptyObject(prop),
47039             optall = jQuery.speed(speed, easing, callback),
47040             doAnimation = function() {
47041               // Operate on a copy of prop so per-property easing won't be
47042               // lost
47043               var anim = Animation(this, jQuery.extend({}, prop), optall);
47044
47045               // Empty animations, or finishing resolves immediately
47046               if (empty || data_priv.get(this, "finish")) {
47047                 anim.stop(true);
47048               }
47049             };
47050           doAnimation.finish = doAnimation;
47051
47052           return empty || optall.queue === false ?
47053             this.each(doAnimation) :
47054             this.queue(optall.queue, doAnimation);
47055         },
47056         stop: function(type, clearQueue, gotoEnd) {
47057           var stopQueue = function(hooks) {
47058             var stop = hooks.stop;
47059             delete hooks.stop;
47060             stop(gotoEnd);
47061           };
47062
47063           if (typeof type !== "string") {
47064             gotoEnd = clearQueue;
47065             clearQueue = type;
47066             type = undefined;
47067           }
47068           if (clearQueue && type !== false) {
47069             this.queue(type || "fx", []);
47070           }
47071
47072           return this.each(function() {
47073             var dequeue = true,
47074               index = type != null && type + "queueHooks",
47075               timers = jQuery.timers,
47076               data = data_priv.get(this);
47077
47078             if (index) {
47079               if (data[index] && data[index].stop) {
47080                 stopQueue(data[index]);
47081               }
47082             } else {
47083               for (index in data) {
47084                 if (data[index] && data[index].stop && rrun.test(index)) {
47085                   stopQueue(data[index]);
47086                 }
47087               }
47088             }
47089
47090             for (index = timers.length; index--;) {
47091               if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
47092                 timers[index].anim.stop(gotoEnd);
47093                 dequeue = false;
47094                 timers.splice(index, 1);
47095               }
47096             }
47097
47098             // Start the next in the queue if the last step wasn't forced.
47099             // Timers currently will call their complete callbacks, which
47100             // will dequeue but only if they were gotoEnd.
47101             if (dequeue || !gotoEnd) {
47102               jQuery.dequeue(this, type);
47103             }
47104           });
47105         },
47106         finish: function(type) {
47107           if (type !== false) {
47108             type = type || "fx";
47109           }
47110           return this.each(function() {
47111             var index,
47112               data = data_priv.get(this),
47113               queue = data[type + "queue"],
47114               hooks = data[type + "queueHooks"],
47115               timers = jQuery.timers,
47116               length = queue ? queue.length : 0;
47117
47118             // Enable finishing flag on private data
47119             data.finish = true;
47120
47121             // Empty the queue first
47122             jQuery.queue(this, type, []);
47123
47124             if (hooks && hooks.stop) {
47125               hooks.stop.call(this, true);
47126             }
47127
47128             // Look for any active animations, and finish them
47129             for (index = timers.length; index--;) {
47130               if (timers[index].elem === this && timers[index].queue === type) {
47131                 timers[index].anim.stop(true);
47132                 timers.splice(index, 1);
47133               }
47134             }
47135
47136             // Look for any animations in the old queue and finish them
47137             for (index = 0; index < length; index++) {
47138               if (queue[index] && queue[index].finish) {
47139                 queue[index].finish.call(this);
47140               }
47141             }
47142
47143             // Turn off finishing flag
47144             delete data.finish;
47145           });
47146         }
47147       });
47148
47149       jQuery.each(["toggle", "show", "hide"], function(i, name) {
47150         var cssFn = jQuery.fn[name];
47151         jQuery.fn[name] = function(speed, easing, callback) {
47152           return speed == null || typeof speed === "boolean" ?
47153             cssFn.apply(this, arguments) :
47154             this.animate(genFx(name, true), speed, easing, callback);
47155         };
47156       });
47157
47158       // Generate shortcuts for custom animations
47159       jQuery.each({
47160         slideDown: genFx("show"),
47161         slideUp: genFx("hide"),
47162         slideToggle: genFx("toggle"),
47163         fadeIn: {
47164           opacity: "show"
47165         },
47166         fadeOut: {
47167           opacity: "hide"
47168         },
47169         fadeToggle: {
47170           opacity: "toggle"
47171         }
47172       }, function(name, props) {
47173         jQuery.fn[name] = function(speed, easing, callback) {
47174           return this.animate(props, speed, easing, callback);
47175         };
47176       });
47177
47178       jQuery.timers = [];
47179       jQuery.fx.tick = function() {
47180         var timer,
47181           i = 0,
47182           timers = jQuery.timers;
47183
47184         fxNow = jQuery.now();
47185
47186         for (; i < timers.length; i++) {
47187           timer = timers[i];
47188           // Checks the timer has not already been removed
47189           if (!timer() && timers[i] === timer) {
47190             timers.splice(i--, 1);
47191           }
47192         }
47193
47194         if (!timers.length) {
47195           jQuery.fx.stop();
47196         }
47197         fxNow = undefined;
47198       };
47199
47200       jQuery.fx.timer = function(timer) {
47201         jQuery.timers.push(timer);
47202         if (timer()) {
47203           jQuery.fx.start();
47204         } else {
47205           jQuery.timers.pop();
47206         }
47207       };
47208
47209       jQuery.fx.interval = 13;
47210
47211       jQuery.fx.start = function() {
47212         if (!timerId) {
47213           timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
47214         }
47215       };
47216
47217       jQuery.fx.stop = function() {
47218         clearInterval(timerId);
47219         timerId = null;
47220       };
47221
47222       jQuery.fx.speeds = {
47223         slow: 600,
47224         fast: 200,
47225         // Default speed
47226         _default: 400
47227       };
47228
47229
47230       // Based off of the plugin by Clint Helfers, with permission.
47231       // http://blindsignals.com/index.php/2009/07/jquery-delay/
47232       jQuery.fn.delay = function(time, type) {
47233         time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
47234         type = type || "fx";
47235
47236         return this.queue(type, function(next, hooks) {
47237           var timeout = setTimeout(next, time);
47238           hooks.stop = function() {
47239             clearTimeout(timeout);
47240           };
47241         });
47242       };
47243
47244
47245       (function() {
47246         var input = document.createElement("input"),
47247           select = document.createElement("select"),
47248           opt = select.appendChild(document.createElement("option"));
47249
47250         input.type = "checkbox";
47251
47252         // Support: iOS<=5.1, Android<=4.2+
47253         // Default value for a checkbox should be "on"
47254         support.checkOn = input.value !== "";
47255
47256         // Support: IE<=11+
47257         // Must access selectedIndex to make default options select
47258         support.optSelected = opt.selected;
47259
47260         // Support: Android<=2.3
47261         // Options inside disabled selects are incorrectly marked as disabled
47262         select.disabled = true;
47263         support.optDisabled = !opt.disabled;
47264
47265         // Support: IE<=11+
47266         // An input loses its value after becoming a radio
47267         input = document.createElement("input");
47268         input.value = "t";
47269         input.type = "radio";
47270         support.radioValue = input.value === "t";
47271       })();
47272
47273
47274       var nodeHook, boolHook,
47275         attrHandle = jQuery.expr.attrHandle;
47276
47277       jQuery.fn.extend({
47278         attr: function(name, value) {
47279           return access(this, jQuery.attr, name, value, arguments.length > 1);
47280         },
47281
47282         removeAttr: function(name) {
47283           return this.each(function() {
47284             jQuery.removeAttr(this, name);
47285           });
47286         }
47287       });
47288
47289       jQuery.extend({
47290         attr: function(elem, name, value) {
47291           var hooks, ret,
47292             nType = elem.nodeType;
47293
47294           // don't get/set attributes on text, comment and attribute nodes
47295           if (!elem || nType === 3 || nType === 8 || nType === 2) {
47296             return;
47297           }
47298
47299           // Fallback to prop when attributes are not supported
47300           if (typeof elem.getAttribute === strundefined) {
47301             return jQuery.prop(elem, name, value);
47302           }
47303
47304           // All attributes are lowercase
47305           // Grab necessary hook if one is defined
47306           if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
47307             name = name.toLowerCase();
47308             hooks = jQuery.attrHooks[name] ||
47309               (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
47310           }
47311
47312           if (value !== undefined) {
47313
47314             if (value === null) {
47315               jQuery.removeAttr(elem, name);
47316
47317             } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
47318               return ret;
47319
47320             } else {
47321               elem.setAttribute(name, value + "");
47322               return value;
47323             }
47324
47325           } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
47326             return ret;
47327
47328           } else {
47329             ret = jQuery.find.attr(elem, name);
47330
47331             // Non-existent attributes return null, we normalize to undefined
47332             return ret == null ?
47333               undefined :
47334               ret;
47335           }
47336         },
47337
47338         removeAttr: function(elem, value) {
47339           var name, propName,
47340             i = 0,
47341             attrNames = value && value.match(rnotwhite);
47342
47343           if (attrNames && elem.nodeType === 1) {
47344             while ((name = attrNames[i++])) {
47345               propName = jQuery.propFix[name] || name;
47346
47347               // Boolean attributes get special treatment (#10870)
47348               if (jQuery.expr.match.bool.test(name)) {
47349                 // Set corresponding property to false
47350                 elem[propName] = false;
47351               }
47352
47353               elem.removeAttribute(name);
47354             }
47355           }
47356         },
47357
47358         attrHooks: {
47359           type: {
47360             set: function(elem, value) {
47361               if (!support.radioValue && value === "radio" &&
47362                 jQuery.nodeName(elem, "input")) {
47363                 var val = elem.value;
47364                 elem.setAttribute("type", value);
47365                 if (val) {
47366                   elem.value = val;
47367                 }
47368                 return value;
47369               }
47370             }
47371           }
47372         }
47373       });
47374
47375       // Hooks for boolean attributes
47376       boolHook = {
47377         set: function(elem, value, name) {
47378           if (value === false) {
47379             // Remove boolean attributes when set to false
47380             jQuery.removeAttr(elem, name);
47381           } else {
47382             elem.setAttribute(name, name);
47383           }
47384           return name;
47385         }
47386       };
47387       jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) {
47388         var getter = attrHandle[name] || jQuery.find.attr;
47389
47390         attrHandle[name] = function(elem, name, isXML) {
47391           var ret, handle;
47392           if (!isXML) {
47393             // Avoid an infinite loop by temporarily removing this function from
47394             // the getter
47395             handle = attrHandle[name];
47396             attrHandle[name] = ret;
47397             ret = getter(elem, name, isXML) != null ?
47398               name.toLowerCase() :
47399               null;
47400             attrHandle[name] = handle;
47401           }
47402           return ret;
47403         };
47404       });
47405
47406
47407
47408
47409       var rfocusable = /^(?:input|select|textarea|button)$/i;
47410
47411       jQuery.fn.extend({
47412         prop: function(name, value) {
47413           return access(this, jQuery.prop, name, value, arguments.length > 1);
47414         },
47415
47416         removeProp: function(name) {
47417           return this.each(function() {
47418             delete this[jQuery.propFix[name] || name];
47419           });
47420         }
47421       });
47422
47423       jQuery.extend({
47424         propFix: {
47425           "for": "htmlFor",
47426           "class": "className"
47427         },
47428
47429         prop: function(elem, name, value) {
47430           var ret, hooks, notxml,
47431             nType = elem.nodeType;
47432
47433           // Don't get/set properties on text, comment and attribute nodes
47434           if (!elem || nType === 3 || nType === 8 || nType === 2) {
47435             return;
47436           }
47437
47438           notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
47439
47440           if (notxml) {
47441             // Fix name and attach hooks
47442             name = jQuery.propFix[name] || name;
47443             hooks = jQuery.propHooks[name];
47444           }
47445
47446           if (value !== undefined) {
47447             return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ?
47448               ret :
47449               (elem[name] = value);
47450
47451           } else {
47452             return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ?
47453               ret :
47454               elem[name];
47455           }
47456         },
47457
47458         propHooks: {
47459           tabIndex: {
47460             get: function(elem) {
47461               return elem.hasAttribute("tabindex") || rfocusable.test(elem.nodeName) || elem.href ?
47462                 elem.tabIndex :
47463                 -1;
47464             }
47465           }
47466         }
47467       });
47468
47469       if (!support.optSelected) {
47470         jQuery.propHooks.selected = {
47471           get: function(elem) {
47472             var parent = elem.parentNode;
47473             if (parent && parent.parentNode) {
47474               parent.parentNode.selectedIndex;
47475             }
47476             return null;
47477           }
47478         };
47479       }
47480
47481       jQuery.each([
47482         "tabIndex",
47483         "readOnly",
47484         "maxLength",
47485         "cellSpacing",
47486         "cellPadding",
47487         "rowSpan",
47488         "colSpan",
47489         "useMap",
47490         "frameBorder",
47491         "contentEditable"
47492       ], function() {
47493         jQuery.propFix[this.toLowerCase()] = this;
47494       });
47495
47496
47497
47498
47499       var rclass = /[\t\r\n\f]/g;
47500
47501       jQuery.fn.extend({
47502         addClass: function(value) {
47503           var classes, elem, cur, clazz, j, finalValue,
47504             proceed = typeof value === "string" && value,
47505             i = 0,
47506             len = this.length;
47507
47508           if (jQuery.isFunction(value)) {
47509             return this.each(function(j) {
47510               jQuery(this).addClass(value.call(this, j, this.className));
47511             });
47512           }
47513
47514           if (proceed) {
47515             // The disjunction here is for better compressibility (see
47516             // removeClass)
47517             classes = (value || "").match(rnotwhite) || [];
47518
47519             for (; i < len; i++) {
47520               elem = this[i];
47521               cur = elem.nodeType === 1 && (elem.className ?
47522                 (" " + elem.className + " ").replace(rclass, " ") :
47523                 " "
47524               );
47525
47526               if (cur) {
47527                 j = 0;
47528                 while ((clazz = classes[j++])) {
47529                   if (cur.indexOf(" " + clazz + " ") < 0) {
47530                     cur += clazz + " ";
47531                   }
47532                 }
47533
47534                 // only assign if different to avoid unneeded rendering.
47535                 finalValue = jQuery.trim(cur);
47536                 if (elem.className !== finalValue) {
47537                   elem.className = finalValue;
47538                 }
47539               }
47540             }
47541           }
47542
47543           return this;
47544         },
47545
47546         removeClass: function(value) {
47547           var classes, elem, cur, clazz, j, finalValue,
47548             proceed = arguments.length === 0 || typeof value === "string" && value,
47549             i = 0,
47550             len = this.length;
47551
47552           if (jQuery.isFunction(value)) {
47553             return this.each(function(j) {
47554               jQuery(this).removeClass(value.call(this, j, this.className));
47555             });
47556           }
47557           if (proceed) {
47558             classes = (value || "").match(rnotwhite) || [];
47559
47560             for (; i < len; i++) {
47561               elem = this[i];
47562               // This expression is here for better compressibility (see
47563               // addClass)
47564               cur = elem.nodeType === 1 && (elem.className ?
47565                 (" " + elem.className + " ").replace(rclass, " ") :
47566                 ""
47567               );
47568
47569               if (cur) {
47570                 j = 0;
47571                 while ((clazz = classes[j++])) {
47572                   // Remove *all* instances
47573                   while (cur.indexOf(" " + clazz + " ") >= 0) {
47574                     cur = cur.replace(" " + clazz + " ", " ");
47575                   }
47576                 }
47577
47578                 // Only assign if different to avoid unneeded rendering.
47579                 finalValue = value ? jQuery.trim(cur) : "";
47580                 if (elem.className !== finalValue) {
47581                   elem.className = finalValue;
47582                 }
47583               }
47584             }
47585           }
47586
47587           return this;
47588         },
47589
47590         toggleClass: function(value, stateVal) {
47591           var type = typeof value;
47592
47593           if (typeof stateVal === "boolean" && type === "string") {
47594             return stateVal ? this.addClass(value) : this.removeClass(value);
47595           }
47596
47597           if (jQuery.isFunction(value)) {
47598             return this.each(function(i) {
47599               jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
47600             });
47601           }
47602
47603           return this.each(function() {
47604             if (type === "string") {
47605               // Toggle individual class names
47606               var className,
47607                 i = 0,
47608                 self = jQuery(this),
47609                 classNames = value.match(rnotwhite) || [];
47610
47611               while ((className = classNames[i++])) {
47612                 // Check each className given, space separated list
47613                 if (self.hasClass(className)) {
47614                   self.removeClass(className);
47615                 } else {
47616                   self.addClass(className);
47617                 }
47618               }
47619
47620               // Toggle whole class name
47621             } else if (type === strundefined || type === "boolean") {
47622               if (this.className) {
47623                 // store className if set
47624                 data_priv.set(this, "__className__", this.className);
47625               }
47626
47627               // If the element has a class name or if we're passed `false`,
47628               // then remove the whole classname (if there was one, the above
47629               // saved it).
47630               // Otherwise bring back whatever was previously saved (if
47631               // anything),
47632               // falling back to the empty string if nothing was stored.
47633               this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
47634             }
47635           });
47636         },
47637
47638         hasClass: function(selector) {
47639           var className = " " + selector + " ",
47640             i = 0,
47641             l = this.length;
47642           for (; i < l; i++) {
47643             if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
47644               return true;
47645             }
47646           }
47647
47648           return false;
47649         }
47650       });
47651
47652
47653
47654
47655       var rreturn = /\r/g;
47656
47657       jQuery.fn.extend({
47658         val: function(value) {
47659           var hooks, ret, isFunction,
47660             elem = this[0];
47661
47662           if (!arguments.length) {
47663             if (elem) {
47664               hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
47665
47666               if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
47667                 return ret;
47668               }
47669
47670               ret = elem.value;
47671
47672               return typeof ret === "string" ?
47673                 // Handle most common string cases
47674                 ret.replace(rreturn, "") :
47675                 // Handle cases where value is null/undef or number
47676                 ret == null ? "" : ret;
47677             }
47678
47679             return;
47680           }
47681
47682           isFunction = jQuery.isFunction(value);
47683
47684           return this.each(function(i) {
47685             var val;
47686
47687             if (this.nodeType !== 1) {
47688               return;
47689             }
47690
47691             if (isFunction) {
47692               val = value.call(this, i, jQuery(this).val());
47693             } else {
47694               val = value;
47695             }
47696
47697             // Treat null/undefined as ""; convert numbers to string
47698             if (val == null) {
47699               val = "";
47700
47701             } else if (typeof val === "number") {
47702               val += "";
47703
47704             } else if (jQuery.isArray(val)) {
47705               val = jQuery.map(val, function(value) {
47706                 return value == null ? "" : value + "";
47707               });
47708             }
47709
47710             hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
47711
47712             // If set returns undefined, fall back to normal setting
47713             if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
47714               this.value = val;
47715             }
47716           });
47717         }
47718       });
47719
47720       jQuery.extend({
47721         valHooks: {
47722           option: {
47723             get: function(elem) {
47724               var val = jQuery.find.attr(elem, "value");
47725               return val != null ?
47726                 val :
47727                 // Support: IE10-11+
47728                 // option.text throws exceptions (#14686, #14858)
47729                 jQuery.trim(jQuery.text(elem));
47730             }
47731           },
47732           select: {
47733             get: function(elem) {
47734               var value, option,
47735                 options = elem.options,
47736                 index = elem.selectedIndex,
47737                 one = elem.type === "select-one" || index < 0,
47738                 values = one ? null : [],
47739                 max = one ? index + 1 : options.length,
47740                 i = index < 0 ?
47741                 max :
47742                 one ? index : 0;
47743
47744               // Loop through all the selected options
47745               for (; i < max; i++) {
47746                 option = options[i];
47747
47748                 // IE6-9 doesn't update selected after form reset (#2551)
47749                 if ((option.selected || i === index) &&
47750                   // Don't return options that are disabled or in a
47751                   // disabled optgroup
47752                   (support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
47753                   (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
47754
47755                   // Get the specific value for the option
47756                   value = jQuery(option).val();
47757
47758                   // We don't need an array for one selects
47759                   if (one) {
47760                     return value;
47761                   }
47762
47763                   // Multi-Selects return an array
47764                   values.push(value);
47765                 }
47766               }
47767
47768               return values;
47769             },
47770
47771             set: function(elem, value) {
47772               var optionSet, option,
47773                 options = elem.options,
47774                 values = jQuery.makeArray(value),
47775                 i = options.length;
47776
47777               while (i--) {
47778                 option = options[i];
47779                 if ((option.selected = jQuery.inArray(option.value, values) >= 0)) {
47780                   optionSet = true;
47781                 }
47782               }
47783
47784               // Force browsers to behave consistently when non-matching value
47785               // is set
47786               if (!optionSet) {
47787                 elem.selectedIndex = -1;
47788               }
47789               return values;
47790             }
47791           }
47792         }
47793       });
47794
47795       // Radios and checkboxes getter/setter
47796       jQuery.each(["radio", "checkbox"], function() {
47797         jQuery.valHooks[this] = {
47798           set: function(elem, value) {
47799             if (jQuery.isArray(value)) {
47800               return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
47801             }
47802           }
47803         };
47804         if (!support.checkOn) {
47805           jQuery.valHooks[this].get = function(elem) {
47806             return elem.getAttribute("value") === null ? "on" : elem.value;
47807           };
47808         }
47809       });
47810
47811
47812
47813
47814       // Return jQuery for attributes-only inclusion
47815
47816
47817       jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
47818         "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
47819         "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
47820
47821         // Handle event binding
47822         jQuery.fn[name] = function(data, fn) {
47823           return arguments.length > 0 ?
47824             this.on(name, null, data, fn) :
47825             this.trigger(name);
47826         };
47827       });
47828
47829       jQuery.fn.extend({
47830         hover: function(fnOver, fnOut) {
47831           return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
47832         },
47833
47834         bind: function(types, data, fn) {
47835           return this.on(types, null, data, fn);
47836         },
47837         unbind: function(types, fn) {
47838           return this.off(types, null, fn);
47839         },
47840
47841         delegate: function(selector, types, data, fn) {
47842           return this.on(types, selector, data, fn);
47843         },
47844         undelegate: function(selector, types, fn) {
47845           // ( namespace ) or ( selector, types [, fn] )
47846           return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
47847         }
47848       });
47849
47850
47851       var nonce = jQuery.now();
47852
47853       var rquery = (/\?/);
47854
47855
47856
47857       // Support: Android 2.3
47858       // Workaround failure to string-cast null input
47859       jQuery.parseJSON = function(data) {
47860         return JSON.parse(data + "");
47861       };
47862
47863
47864       // Cross-browser xml parsing
47865       jQuery.parseXML = function(data) {
47866         var xml, tmp;
47867         if (!data || typeof data !== "string") {
47868           return null;
47869         }
47870
47871         // Support: IE9
47872         try {
47873           tmp = new DOMParser();
47874           xml = tmp.parseFromString(data, "text/xml");
47875         } catch (e) {
47876           xml = undefined;
47877         }
47878
47879         if (!xml || xml.getElementsByTagName("parsererror").length) {
47880           jQuery.error("Invalid XML: " + data);
47881         }
47882         return xml;
47883       };
47884
47885
47886       var
47887         rhash = /#.*$/,
47888         rts = /([?&])_=[^&]*/,
47889         rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
47890         // #7653, #8125, #8152: local protocol detection
47891         rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
47892         rnoContent = /^(?:GET|HEAD)$/,
47893         rprotocol = /^\/\//,
47894         rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
47895
47896         /*
47897          * Prefilters 1) They are useful to introduce custom dataTypes (see
47898          * ajax/jsonp.js for an example) 2) These are called: - BEFORE asking for a
47899          * transport - AFTER param serialization (s.data is a string if
47900          * s.processData is true) 3) key is the dataType 4) the catchall symbol "*"
47901          * can be used 5) execution will start with transport dataType and THEN
47902          * continue down to "*" if needed
47903          */
47904         prefilters = {},
47905
47906         /*
47907          * Transports bindings 1) key is the dataType 2) the catchall symbol "*" can
47908          * be used 3) selection will start with transport dataType and THEN go to
47909          * "*" if needed
47910          */
47911         transports = {},
47912
47913         // Avoid comment-prolog char sequence (#10098); must appease lint and evade
47914         // compression
47915         allTypes = "*/".concat("*"),
47916
47917         // Document location
47918         ajaxLocation = window.location.href,
47919
47920         // Segment location into parts
47921         ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];
47922
47923       // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
47924       function addToPrefiltersOrTransports(structure) {
47925
47926         // dataTypeExpression is optional and defaults to "*"
47927         return function(dataTypeExpression, func) {
47928
47929           if (typeof dataTypeExpression !== "string") {
47930             func = dataTypeExpression;
47931             dataTypeExpression = "*";
47932           }
47933
47934           var dataType,
47935             i = 0,
47936             dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];
47937
47938           if (jQuery.isFunction(func)) {
47939             // For each dataType in the dataTypeExpression
47940             while ((dataType = dataTypes[i++])) {
47941               // Prepend if requested
47942               if (dataType[0] === "+") {
47943                 dataType = dataType.slice(1) || "*";
47944                 (structure[dataType] = structure[dataType] || []).unshift(func);
47945
47946                 // Otherwise append
47947               } else {
47948                 (structure[dataType] = structure[dataType] || []).push(func);
47949               }
47950             }
47951           }
47952         };
47953       }
47954
47955       // Base inspection function for prefilters and transports
47956       function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
47957
47958         var inspected = {},
47959           seekingTransport = (structure === transports);
47960
47961         function inspect(dataType) {
47962           var selected;
47963           inspected[dataType] = true;
47964           jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
47965             var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
47966             if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
47967               options.dataTypes.unshift(dataTypeOrTransport);
47968               inspect(dataTypeOrTransport);
47969               return false;
47970             } else if (seekingTransport) {
47971               return !(selected = dataTypeOrTransport);
47972             }
47973           });
47974           return selected;
47975         }
47976
47977         return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
47978       }
47979
47980       // A special extend for ajax options
47981       // that takes "flat" options (not to be deep extended)
47982       // Fixes #9887
47983       function ajaxExtend(target, src) {
47984         var key, deep,
47985           flatOptions = jQuery.ajaxSettings.flatOptions || {};
47986
47987         for (key in src) {
47988           if (src[key] !== undefined) {
47989             (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];
47990           }
47991         }
47992         if (deep) {
47993           jQuery.extend(true, target, deep);
47994         }
47995
47996         return target;
47997       }
47998
47999       /*
48000        * Handles responses to an ajax request: - finds the right dataType (mediates
48001        * between content-type and expected dataType) - returns the corresponding
48002        * response
48003        */
48004       function ajaxHandleResponses(s, jqXHR, responses) {
48005
48006         var ct, type, finalDataType, firstDataType,
48007           contents = s.contents,
48008           dataTypes = s.dataTypes;
48009
48010         // Remove auto dataType and get content-type in the process
48011         while (dataTypes[0] === "*") {
48012           dataTypes.shift();
48013           if (ct === undefined) {
48014             ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
48015           }
48016         }
48017
48018         // Check if we're dealing with a known content-type
48019         if (ct) {
48020           for (type in contents) {
48021             if (contents[type] && contents[type].test(ct)) {
48022               dataTypes.unshift(type);
48023               break;
48024             }
48025           }
48026         }
48027
48028         // Check to see if we have a response for the expected dataType
48029         if (dataTypes[0] in responses) {
48030           finalDataType = dataTypes[0];
48031         } else {
48032           // Try convertible dataTypes
48033           for (type in responses) {
48034             if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
48035               finalDataType = type;
48036               break;
48037             }
48038             if (!firstDataType) {
48039               firstDataType = type;
48040             }
48041           }
48042           // Or just use first one
48043           finalDataType = finalDataType || firstDataType;
48044         }
48045
48046         // If we found a dataType
48047         // We add the dataType to the list if needed
48048         // and return the corresponding response
48049         if (finalDataType) {
48050           if (finalDataType !== dataTypes[0]) {
48051             dataTypes.unshift(finalDataType);
48052           }
48053           return responses[finalDataType];
48054         }
48055       }
48056
48057       /*
48058        * Chain conversions given the request and the original response Also sets the
48059        * responseXXX fields on the jqXHR instance
48060        */
48061       function ajaxConvert(s, response, jqXHR, isSuccess) {
48062         var conv2, current, conv, tmp, prev,
48063           converters = {},
48064           // Work with a copy of dataTypes in case we need to modify it for
48065           // conversion
48066           dataTypes = s.dataTypes.slice();
48067
48068         // Create converters map with lowercased keys
48069         if (dataTypes[1]) {
48070           for (conv in s.converters) {
48071             converters[conv.toLowerCase()] = s.converters[conv];
48072           }
48073         }
48074
48075         current = dataTypes.shift();
48076
48077         // Convert to each sequential dataType
48078         while (current) {
48079
48080           if (s.responseFields[current]) {
48081             jqXHR[s.responseFields[current]] = response;
48082           }
48083
48084           // Apply the dataFilter if provided
48085           if (!prev && isSuccess && s.dataFilter) {
48086             response = s.dataFilter(response, s.dataType);
48087           }
48088
48089           prev = current;
48090           current = dataTypes.shift();
48091
48092           if (current) {
48093
48094             // There's only work to do if current dataType is non-auto
48095             if (current === "*") {
48096
48097               current = prev;
48098
48099               // Convert response if prev dataType is non-auto and differs from
48100               // current
48101             } else if (prev !== "*" && prev !== current) {
48102
48103               // Seek a direct converter
48104               conv = converters[prev + " " + current] || converters["* " + current];
48105
48106               // If none found, seek a pair
48107               if (!conv) {
48108                 for (conv2 in converters) {
48109
48110                   // If conv2 outputs current
48111                   tmp = conv2.split(" ");
48112                   if (tmp[1] === current) {
48113
48114                     // If prev can be converted to accepted input
48115                     conv = converters[prev + " " + tmp[0]] ||
48116                       converters["* " + tmp[0]];
48117                     if (conv) {
48118                       // Condense equivalence converters
48119                       if (conv === true) {
48120                         conv = converters[conv2];
48121
48122                         // Otherwise, insert the intermediate dataType
48123                       } else if (converters[conv2] !== true) {
48124                         current = tmp[0];
48125                         dataTypes.unshift(tmp[1]);
48126                       }
48127                       break;
48128                     }
48129                   }
48130                 }
48131               }
48132
48133               // Apply converter (if not an equivalence)
48134               if (conv !== true) {
48135
48136                 // Unless errors are allowed to bubble, catch and return
48137                 // them
48138                 if (conv && s["throws"]) {
48139                   response = conv(response);
48140                 } else {
48141                   try {
48142                     response = conv(response);
48143                   } catch (e) {
48144                     return {
48145                       state: "parsererror",
48146                       error: conv ? e : "No conversion from " + prev + " to " + current
48147                     };
48148                   }
48149                 }
48150               }
48151             }
48152           }
48153         }
48154
48155         return {
48156           state: "success",
48157           data: response
48158         };
48159       }
48160
48161       jQuery.extend({
48162
48163         // Counter for holding the number of active queries
48164         active: 0,
48165
48166         // Last-Modified header cache for next request
48167         lastModified: {},
48168         etag: {},
48169
48170         ajaxSettings: {
48171           url: ajaxLocation,
48172           type: "GET",
48173           isLocal: rlocalProtocol.test(ajaxLocParts[1]),
48174           global: true,
48175           processData: true,
48176           async: true,
48177           contentType: "application/x-www-form-urlencoded; charset=UTF-8",
48178           /*
48179            * timeout: 0, data: null, dataType: null, username: null, password:
48180            * null, cache: null, throws: false, traditional: false, headers: {},
48181            */
48182
48183           accepts: {
48184             "*": allTypes,
48185             text: "text/plain",
48186             html: "text/html",
48187             xml: "application/xml, text/xml",
48188             json: "application/json, text/javascript"
48189           },
48190
48191           contents: {
48192             xml: /xml/,
48193             html: /html/,
48194             json: /json/
48195           },
48196
48197           responseFields: {
48198             xml: "responseXML",
48199             text: "responseText",
48200             json: "responseJSON"
48201           },
48202
48203           // Data converters
48204           // Keys separate source (or catchall "*") and destination types with a
48205           // single space
48206           converters: {
48207
48208             // Convert anything to text
48209             "* text": String,
48210
48211             // Text to html (true = no transformation)
48212             "text html": true,
48213
48214             // Evaluate text as a json expression
48215             "text json": jQuery.parseJSON,
48216
48217             // Parse text as xml
48218             "text xml": jQuery.parseXML
48219           },
48220
48221           // For options that shouldn't be deep extended:
48222           // you can add your own custom options here if
48223           // and when you create one that shouldn't be
48224           // deep extended (see ajaxExtend)
48225           flatOptions: {
48226             url: true,
48227             context: true
48228           }
48229         },
48230
48231         // Creates a full fledged settings object into target
48232         // with both ajaxSettings and settings fields.
48233         // If target is omitted, writes into ajaxSettings.
48234         ajaxSetup: function(target, settings) {
48235           return settings ?
48236
48237             // Building a settings object
48238             ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
48239
48240             // Extending ajaxSettings
48241             ajaxExtend(jQuery.ajaxSettings, target);
48242         },
48243
48244         ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
48245         ajaxTransport: addToPrefiltersOrTransports(transports),
48246
48247         // Main method
48248         ajax: function(url, options) {
48249
48250           // If url is an object, simulate pre-1.5 signature
48251           if (typeof url === "object") {
48252             options = url;
48253             url = undefined;
48254           }
48255
48256           // Force options to be an object
48257           options = options || {};
48258
48259           var transport,
48260             // URL without anti-cache param
48261             cacheURL,
48262             // Response headers
48263             responseHeadersString,
48264             responseHeaders,
48265             // timeout handle
48266             timeoutTimer,
48267             // Cross-domain detection vars
48268             parts,
48269             // To know if global events are to be dispatched
48270             fireGlobals,
48271             // Loop variable
48272             i,
48273             // Create the final options object
48274             s = jQuery.ajaxSetup({}, options),
48275             // Callbacks context
48276             callbackContext = s.context || s,
48277             // Context for global events is callbackContext if it is a DOM node
48278             // or jQuery collection
48279             globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ?
48280             jQuery(callbackContext) :
48281             jQuery.event,
48282             // Deferreds
48283             deferred = jQuery.Deferred(),
48284             completeDeferred = jQuery.Callbacks("once memory"),
48285             // Status-dependent callbacks
48286             statusCode = s.statusCode || {},
48287             // Headers (they are sent all at once)
48288             requestHeaders = {},
48289             requestHeadersNames = {},
48290             // The jqXHR state
48291             state = 0,
48292             // Default abort message
48293             strAbort = "canceled",
48294             // Fake xhr
48295             jqXHR = {
48296               readyState: 0,
48297
48298               // Builds headers hashtable if needed
48299               getResponseHeader: function(key) {
48300                 var match;
48301                 if (state === 2) {
48302                   if (!responseHeaders) {
48303                     responseHeaders = {};
48304                     while ((match = rheaders.exec(responseHeadersString))) {
48305                       responseHeaders[match[1].toLowerCase()] = match[2];
48306                     }
48307                   }
48308                   match = responseHeaders[key.toLowerCase()];
48309                 }
48310                 return match == null ? null : match;
48311               },
48312
48313               // Raw string
48314               getAllResponseHeaders: function() {
48315                 return state === 2 ? responseHeadersString : null;
48316               },
48317
48318               // Caches the header
48319               setRequestHeader: function(name, value) {
48320                 var lname = name.toLowerCase();
48321                 if (!state) {
48322                   name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
48323                   requestHeaders[name] = value;
48324                 }
48325                 return this;
48326               },
48327
48328               // Overrides response content-type header
48329               overrideMimeType: function(type) {
48330                 if (!state) {
48331                   s.mimeType = type;
48332                 }
48333                 return this;
48334               },
48335
48336               // Status-dependent callbacks
48337               statusCode: function(map) {
48338                 var code;
48339                 if (map) {
48340                   if (state < 2) {
48341                     for (code in map) {
48342                       // Lazy-add the new callback in a way that
48343                       // preserves old ones
48344                       statusCode[code] = [statusCode[code], map[code]];
48345                     }
48346                   } else {
48347                     // Execute the appropriate callbacks
48348                     jqXHR.always(map[jqXHR.status]);
48349                   }
48350                 }
48351                 return this;
48352               },
48353
48354               // Cancel the request
48355               abort: function(statusText) {
48356                 var finalText = statusText || strAbort;
48357                 if (transport) {
48358                   transport.abort(finalText);
48359                 }
48360                 done(0, finalText);
48361                 return this;
48362               }
48363             };
48364
48365           // Attach deferreds
48366           deferred.promise(jqXHR).complete = completeDeferred.add;
48367           jqXHR.success = jqXHR.done;
48368           jqXHR.error = jqXHR.fail;
48369
48370           // Remove hash character (#7531: and string promotion)
48371           // Add protocol if not provided (prefilters might expect it)
48372           // Handle falsy url in the settings object (#10093: consistency with old
48373           // signature)
48374           // We also use the url parameter if available
48375           s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "")
48376             .replace(rprotocol, ajaxLocParts[1] + "//");
48377
48378           // Alias method option to type as per ticket #12004
48379           s.type = options.method || options.type || s.method || s.type;
48380
48381           // Extract dataTypes list
48382           s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""];
48383
48384           // A cross-domain request is in order when we have a protocol:host:port
48385           // mismatch
48386           if (s.crossDomain == null) {
48387             parts = rurl.exec(s.url.toLowerCase());
48388             s.crossDomain = !!(parts &&
48389               (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
48390                 (parts[3] || (parts[1] === "http:" ? "80" : "443")) !==
48391                 (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))
48392             );
48393           }
48394
48395           // Convert data if not already a string
48396           if (s.data && s.processData && typeof s.data !== "string") {
48397             s.data = jQuery.param(s.data, s.traditional);
48398           }
48399
48400           // Apply prefilters
48401           inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
48402
48403           // If request was aborted inside a prefilter, stop there
48404           if (state === 2) {
48405             return jqXHR;
48406           }
48407
48408           // We can fire global events as of now if asked to
48409           // Don't fire events if jQuery.event is undefined in an AMD-usage
48410           // scenario (#15118)
48411           fireGlobals = jQuery.event && s.global;
48412
48413           // Watch for a new set of requests
48414           if (fireGlobals && jQuery.active++ === 0) {
48415             jQuery.event.trigger("ajaxStart");
48416           }
48417
48418           // Uppercase the type
48419           s.type = s.type.toUpperCase();
48420
48421           // Determine if request has content
48422           s.hasContent = !rnoContent.test(s.type);
48423
48424           // Save the URL in case we're toying with the If-Modified-Since
48425           // and/or If-None-Match header later on
48426           cacheURL = s.url;
48427
48428           // More options handling for requests with no content
48429           if (!s.hasContent) {
48430
48431             // If data is available, append data to url
48432             if (s.data) {
48433               cacheURL = (s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data);
48434               // #9682: remove data so that it's not used in an eventual retry
48435               delete s.data;
48436             }
48437
48438             // Add anti-cache in url if needed
48439             if (s.cache === false) {
48440               s.url = rts.test(cacheURL) ?
48441
48442                 // If there is already a '_' parameter, set its value
48443                 cacheURL.replace(rts, "$1_=" + nonce++) :
48444
48445                 // Otherwise add one to the end
48446                 cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++;
48447             }
48448           }
48449
48450           // Set the If-Modified-Since and/or If-None-Match header, if in
48451           // ifModified mode.
48452           if (s.ifModified) {
48453             if (jQuery.lastModified[cacheURL]) {
48454               jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
48455             }
48456             if (jQuery.etag[cacheURL]) {
48457               jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
48458             }
48459           }
48460
48461           // Set the correct header, if data is being sent
48462           if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
48463             jqXHR.setRequestHeader("Content-Type", s.contentType);
48464           }
48465
48466           // Set the Accepts header for the server, depending on the dataType
48467           jqXHR.setRequestHeader(
48468             "Accept",
48469             s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
48470             s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") :
48471             s.accepts["*"]
48472           );
48473
48474           // Check for headers option
48475           for (i in s.headers) {
48476             jqXHR.setRequestHeader(i, s.headers[i]);
48477           }
48478
48479           // Allow custom headers/mimetypes and early abort
48480           if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
48481             // Abort if not done already and return
48482             return jqXHR.abort();
48483           }
48484
48485           // Aborting is no longer a cancellation
48486           strAbort = "abort";
48487
48488           // Install callbacks on deferreds
48489           for (i in {
48490               success: 1,
48491               error: 1,
48492               complete: 1
48493             }) {
48494             jqXHR[i](s[i]);
48495           }
48496
48497           // Get transport
48498           transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
48499
48500           // If no transport, we auto-abort
48501           if (!transport) {
48502             done(-1, "No Transport");
48503           } else {
48504             jqXHR.readyState = 1;
48505
48506             // Send global event
48507             if (fireGlobals) {
48508               globalEventContext.trigger("ajaxSend", [jqXHR, s]);
48509             }
48510             // Timeout
48511             if (s.async && s.timeout > 0) {
48512               timeoutTimer = setTimeout(function() {
48513                 jqXHR.abort("timeout");
48514               }, s.timeout);
48515             }
48516
48517             try {
48518               state = 1;
48519               transport.send(requestHeaders, done);
48520             } catch (e) {
48521               // Propagate exception as error if not done
48522               if (state < 2) {
48523                 done(-1, e);
48524                 // Simply rethrow otherwise
48525               } else {
48526                 throw e;
48527               }
48528             }
48529           }
48530
48531           // Callback for when everything is done
48532           function done(status, nativeStatusText, responses, headers) {
48533             var isSuccess, success, error, response, modified,
48534               statusText = nativeStatusText;
48535
48536             // Called once
48537             if (state === 2) {
48538               return;
48539             }
48540
48541             // State is "done" now
48542             state = 2;
48543
48544             // Clear timeout if it exists
48545             if (timeoutTimer) {
48546               clearTimeout(timeoutTimer);
48547             }
48548
48549             // Dereference transport for early garbage collection
48550             // (no matter how long the jqXHR object will be used)
48551             transport = undefined;
48552
48553             // Cache response headers
48554             responseHeadersString = headers || "";
48555
48556             // Set readyState
48557             jqXHR.readyState = status > 0 ? 4 : 0;
48558
48559             // Determine if successful
48560             isSuccess = status >= 200 && status < 300 || status === 304;
48561
48562             // Get response data
48563             if (responses) {
48564               response = ajaxHandleResponses(s, jqXHR, responses);
48565             }
48566
48567             // Convert no matter what (that way responseXXX fields are always
48568             // set)
48569             response = ajaxConvert(s, response, jqXHR, isSuccess);
48570
48571             // If successful, handle type chaining
48572             if (isSuccess) {
48573
48574               // Set the If-Modified-Since and/or If-None-Match header, if in
48575               // ifModified mode.
48576               if (s.ifModified) {
48577                 modified = jqXHR.getResponseHeader("Last-Modified");
48578                 if (modified) {
48579                   jQuery.lastModified[cacheURL] = modified;
48580                 }
48581                 modified = jqXHR.getResponseHeader("etag");
48582                 if (modified) {
48583                   jQuery.etag[cacheURL] = modified;
48584                 }
48585               }
48586
48587               // if no content
48588               if (status === 204 || s.type === "HEAD") {
48589                 statusText = "nocontent";
48590
48591                 // if not modified
48592               } else if (status === 304) {
48593                 statusText = "notmodified";
48594
48595                 // If we have data, let's convert it
48596               } else {
48597                 statusText = response.state;
48598                 success = response.data;
48599                 error = response.error;
48600                 isSuccess = !error;
48601               }
48602             } else {
48603               // Extract error from statusText and normalize for non-aborts
48604               error = statusText;
48605               if (status || !statusText) {
48606                 statusText = "error";
48607                 if (status < 0) {
48608                   status = 0;
48609                 }
48610               }
48611             }
48612
48613             // Set data for the fake xhr object
48614             jqXHR.status = status;
48615             jqXHR.statusText = (nativeStatusText || statusText) + "";
48616
48617             // Success/Error
48618             if (isSuccess) {
48619               deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
48620             } else {
48621               deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
48622             }
48623
48624             // Status-dependent callbacks
48625             jqXHR.statusCode(statusCode);
48626             statusCode = undefined;
48627
48628             if (fireGlobals) {
48629               globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
48630             }
48631
48632             // Complete
48633             completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
48634
48635             if (fireGlobals) {
48636               globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
48637               // Handle the global AJAX counter
48638               if (!(--jQuery.active)) {
48639                 jQuery.event.trigger("ajaxStop");
48640               }
48641             }
48642           }
48643
48644           return jqXHR;
48645         },
48646
48647         getJSON: function(url, data, callback) {
48648           return jQuery.get(url, data, callback, "json");
48649         },
48650
48651         getScript: function(url, callback) {
48652           return jQuery.get(url, undefined, callback, "script");
48653         }
48654       });
48655
48656       jQuery.each(["get", "post"], function(i, method) {
48657         jQuery[method] = function(url, data, callback, type) {
48658           // Shift arguments if data argument was omitted
48659           if (jQuery.isFunction(data)) {
48660             type = type || callback;
48661             callback = data;
48662             data = undefined;
48663           }
48664
48665           return jQuery.ajax({
48666             url: url,
48667             type: method,
48668             dataType: type,
48669             data: data,
48670             success: callback
48671           });
48672         };
48673       });
48674
48675
48676       jQuery._evalUrl = function(url) {
48677         return jQuery.ajax({
48678           url: url,
48679           type: "GET",
48680           dataType: "script",
48681           async: false,
48682           global: false,
48683           "throws": true
48684         });
48685       };
48686
48687
48688       jQuery.fn.extend({
48689         wrapAll: function(html) {
48690           var wrap;
48691
48692           if (jQuery.isFunction(html)) {
48693             return this.each(function(i) {
48694               jQuery(this).wrapAll(html.call(this, i));
48695             });
48696           }
48697
48698           if (this[0]) {
48699
48700             // The elements to wrap the target around
48701             wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
48702
48703             if (this[0].parentNode) {
48704               wrap.insertBefore(this[0]);
48705             }
48706
48707             wrap.map(function() {
48708               var elem = this;
48709
48710               while (elem.firstElementChild) {
48711                 elem = elem.firstElementChild;
48712               }
48713
48714               return elem;
48715             }).append(this);
48716           }
48717
48718           return this;
48719         },
48720
48721         wrapInner: function(html) {
48722           if (jQuery.isFunction(html)) {
48723             return this.each(function(i) {
48724               jQuery(this).wrapInner(html.call(this, i));
48725             });
48726           }
48727
48728           return this.each(function() {
48729             var self = jQuery(this),
48730               contents = self.contents();
48731
48732             if (contents.length) {
48733               contents.wrapAll(html);
48734
48735             } else {
48736               self.append(html);
48737             }
48738           });
48739         },
48740
48741         wrap: function(html) {
48742           var isFunction = jQuery.isFunction(html);
48743
48744           return this.each(function(i) {
48745             jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
48746           });
48747         },
48748
48749         unwrap: function() {
48750           return this.parent().each(function() {
48751             if (!jQuery.nodeName(this, "body")) {
48752               jQuery(this).replaceWith(this.childNodes);
48753             }
48754           }).end();
48755         }
48756       });
48757
48758
48759       jQuery.expr.filters.hidden = function(elem) {
48760         // Support: Opera <= 12.12
48761         // Opera reports offsetWidths and offsetHeights less than zero on some
48762         // elements
48763         return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
48764       };
48765       jQuery.expr.filters.visible = function(elem) {
48766         return !jQuery.expr.filters.hidden(elem);
48767       };
48768
48769
48770
48771
48772       var r20 = /%20/g,
48773         rbracket = /\[\]$/,
48774         rCRLF = /\r?\n/g,
48775         rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
48776         rsubmittable = /^(?:input|select|textarea|keygen)/i;
48777
48778       function buildParams(prefix, obj, traditional, add) {
48779         var name;
48780
48781         if (jQuery.isArray(obj)) {
48782           // Serialize array item.
48783           jQuery.each(obj, function(i, v) {
48784             if (traditional || rbracket.test(prefix)) {
48785               // Treat each array item as a scalar.
48786               add(prefix, v);
48787
48788             } else {
48789               // Item is non-scalar (array or object), encode its numeric
48790               // index.
48791               buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
48792             }
48793           });
48794
48795         } else if (!traditional && jQuery.type(obj) === "object") {
48796           // Serialize object item.
48797           for (name in obj) {
48798             buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
48799           }
48800
48801         } else {
48802           // Serialize scalar item.
48803           add(prefix, obj);
48804         }
48805       }
48806
48807       // Serialize an array of form elements or a set of
48808       // key/values into a query string
48809       jQuery.param = function(a, traditional) {
48810         var prefix,
48811           s = [],
48812           add = function(key, value) {
48813             // If value is a function, invoke it and return its value
48814             value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
48815             s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
48816           };
48817
48818         // Set traditional to true for jQuery <= 1.3.2 behavior.
48819         if (traditional === undefined) {
48820           traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
48821         }
48822
48823         // If an array was passed in, assume that it is an array of form elements.
48824         if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
48825           // Serialize the form elements
48826           jQuery.each(a, function() {
48827             add(this.name, this.value);
48828           });
48829
48830         } else {
48831           // If traditional, encode the "old" way (the way 1.3.2 or older
48832           // did it), otherwise encode params recursively.
48833           for (prefix in a) {
48834             buildParams(prefix, a[prefix], traditional, add);
48835           }
48836         }
48837
48838         // Return the resulting serialization
48839         return s.join("&").replace(r20, "+");
48840       };
48841
48842       jQuery.fn.extend({
48843         serialize: function() {
48844           return jQuery.param(this.serializeArray());
48845         },
48846         serializeArray: function() {
48847           return this.map(function() {
48848               // Can add propHook for "elements" to filter or add form elements
48849               var elements = jQuery.prop(this, "elements");
48850               return elements ? jQuery.makeArray(elements) : this;
48851             })
48852             .filter(function() {
48853               var type = this.type;
48854
48855               // Use .is( ":disabled" ) so that fieldset[disabled] works
48856               return this.name && !jQuery(this).is(":disabled") &&
48857                 rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
48858                 (this.checked || !rcheckableType.test(type));
48859             })
48860             .map(function(i, elem) {
48861               var val = jQuery(this).val();
48862
48863               return val == null ?
48864                 null :
48865                 jQuery.isArray(val) ?
48866                 jQuery.map(val, function(val) {
48867                   return {
48868                     name: elem.name,
48869                     value: val.replace(rCRLF, "\r\n")
48870                   };
48871                 }) : {
48872                   name: elem.name,
48873                   value: val.replace(rCRLF, "\r\n")
48874                 };
48875             }).get();
48876         }
48877       });
48878
48879
48880       jQuery.ajaxSettings.xhr = function() {
48881         try {
48882           return new XMLHttpRequest();
48883         } catch (e) {}
48884       };
48885
48886       var xhrId = 0,
48887         xhrCallbacks = {},
48888         xhrSuccessStatus = {
48889           // file protocol always yields status code 0, assume 200
48890           0: 200,
48891           // Support: IE9
48892           // #1450: sometimes IE returns 1223 when it should be 204
48893           1223: 204
48894         },
48895         xhrSupported = jQuery.ajaxSettings.xhr();
48896
48897       // Support: IE9
48898       // Open requests must be manually aborted on unload (#5280)
48899       // See https://support.microsoft.com/kb/2856746 for more info
48900       if (window.attachEvent) {
48901         window.attachEvent("onunload", function() {
48902           for (var key in xhrCallbacks) {
48903             xhrCallbacks[key]();
48904           }
48905         });
48906       }
48907
48908       support.cors = !!xhrSupported && ("withCredentials" in xhrSupported);
48909       support.ajax = xhrSupported = !!xhrSupported;
48910
48911       jQuery.ajaxTransport(function(options) {
48912         var callback;
48913
48914         // Cross domain only allowed if supported through XMLHttpRequest
48915         if (support.cors || xhrSupported && !options.crossDomain) {
48916           return {
48917             send: function(headers, complete) {
48918               var i,
48919                 xhr = options.xhr(),
48920                 id = ++xhrId;
48921
48922               xhr.open(options.type, options.url, options.async, options.username, options.password);
48923
48924               // Apply custom fields if provided
48925               if (options.xhrFields) {
48926                 for (i in options.xhrFields) {
48927                   xhr[i] = options.xhrFields[i];
48928                 }
48929               }
48930
48931               // Override mime type if needed
48932               if (options.mimeType && xhr.overrideMimeType) {
48933                 xhr.overrideMimeType(options.mimeType);
48934               }
48935
48936               // X-Requested-With header
48937               // For cross-domain requests, seeing as conditions for a
48938               // preflight are
48939               // akin to a jigsaw puzzle, we simply never set it to be sure.
48940               // (it can always be set on a per-request basis or even using
48941               // ajaxSetup)
48942               // For same-domain requests, won't change header if already
48943               // provided.
48944               if (!options.crossDomain && !headers["X-Requested-With"]) {
48945                 headers["X-Requested-With"] = "XMLHttpRequest";
48946               }
48947
48948               // Set headers
48949               for (i in headers) {
48950                 xhr.setRequestHeader(i, headers[i]);
48951               }
48952
48953               // Callback
48954               callback = function(type) {
48955                 return function() {
48956                   if (callback) {
48957                     delete xhrCallbacks[id];
48958                     callback = xhr.onload = xhr.onerror = null;
48959
48960                     if (type === "abort") {
48961                       xhr.abort();
48962                     } else if (type === "error") {
48963                       complete(
48964                         // file: protocol always yields status 0;
48965                         // see #8605, #14207
48966                         xhr.status,
48967                         xhr.statusText
48968                       );
48969                     } else {
48970                       complete(
48971                         xhrSuccessStatus[xhr.status] || xhr.status,
48972                         xhr.statusText,
48973                         // Support: IE9
48974                         // Accessing binary-data responseText throws
48975                         // an exception
48976                         // (#11426)
48977                         typeof xhr.responseText === "string" ? {
48978                           text: xhr.responseText
48979                         } : undefined,
48980                         xhr.getAllResponseHeaders()
48981                       );
48982                     }
48983                   }
48984                 };
48985               };
48986
48987               // Listen to events
48988               xhr.onload = callback();
48989               xhr.onerror = callback("error");
48990
48991               // Create the abort callback
48992               callback = xhrCallbacks[id] = callback("abort");
48993
48994               try {
48995                 // Do send the request (this may raise an exception)
48996                 xhr.send(options.hasContent && options.data || null);
48997               } catch (e) {
48998                 // #14683: Only rethrow if this hasn't been notified as an
48999                 // error yet
49000                 if (callback) {
49001                   throw e;
49002                 }
49003               }
49004             },
49005
49006             abort: function() {
49007               if (callback) {
49008                 callback();
49009               }
49010             }
49011           };
49012         }
49013       });
49014
49015
49016
49017
49018       // Install script dataType
49019       jQuery.ajaxSetup({
49020         accepts: {
49021           script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
49022         },
49023         contents: {
49024           script: /(?:java|ecma)script/
49025         },
49026         converters: {
49027           "text script": function(text) {
49028             jQuery.globalEval(text);
49029             return text;
49030           }
49031         }
49032       });
49033
49034       // Handle cache's special case and crossDomain
49035       jQuery.ajaxPrefilter("script", function(s) {
49036         if (s.cache === undefined) {
49037           s.cache = false;
49038         }
49039         if (s.crossDomain) {
49040           s.type = "GET";
49041         }
49042       });
49043
49044       // Bind script tag hack transport
49045       jQuery.ajaxTransport("script", function(s) {
49046         // This transport only deals with cross domain requests
49047         if (s.crossDomain) {
49048           var script, callback;
49049           return {
49050             send: function(_, complete) {
49051               script = jQuery("<script>").prop({
49052                 async: true,
49053                 charset: s.scriptCharset,
49054                 src: s.url
49055               }).on(
49056                 "load error",
49057                 callback = function(evt) {
49058                   script.remove();
49059                   callback = null;
49060                   if (evt) {
49061                     complete(evt.type === "error" ? 404 : 200, evt.type);
49062                   }
49063                 }
49064               );
49065               document.head.appendChild(script[0]);
49066             },
49067             abort: function() {
49068               if (callback) {
49069                 callback();
49070               }
49071             }
49072           };
49073         }
49074       });
49075
49076
49077
49078
49079       var oldCallbacks = [],
49080         rjsonp = /(=)\?(?=&|$)|\?\?/;
49081
49082       // Default jsonp settings
49083       jQuery.ajaxSetup({
49084         jsonp: "callback",
49085         jsonpCallback: function() {
49086           var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++));
49087           this[callback] = true;
49088           return callback;
49089         }
49090       });
49091
49092       // Detect, normalize options and install callbacks for jsonp requests
49093       jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
49094
49095         var callbackName, overwritten, responseContainer,
49096           jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ?
49097             "url" :
49098             typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"
49099           );
49100
49101         // Handle iff the expected data type is "jsonp" or we have a parameter to
49102         // set
49103         if (jsonProp || s.dataTypes[0] === "jsonp") {
49104
49105           // Get callback name, remembering preexisting value associated with it
49106           callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?
49107             s.jsonpCallback() :
49108             s.jsonpCallback;
49109
49110           // Insert callback into url or form data
49111           if (jsonProp) {
49112             s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
49113           } else if (s.jsonp !== false) {
49114             s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
49115           }
49116
49117           // Use data converter to retrieve json after script execution
49118           s.converters["script json"] = function() {
49119             if (!responseContainer) {
49120               jQuery.error(callbackName + " was not called");
49121             }
49122             return responseContainer[0];
49123           };
49124
49125           // force json dataType
49126           s.dataTypes[0] = "json";
49127
49128           // Install callback
49129           overwritten = window[callbackName];
49130           window[callbackName] = function() {
49131             responseContainer = arguments;
49132           };
49133
49134           // Clean-up function (fires after converters)
49135           jqXHR.always(function() {
49136             // Restore preexisting value
49137             window[callbackName] = overwritten;
49138
49139             // Save back as free
49140             if (s[callbackName]) {
49141               // make sure that re-using the options doesn't screw things
49142               // around
49143               s.jsonpCallback = originalSettings.jsonpCallback;
49144
49145               // save the callback name for future use
49146               oldCallbacks.push(callbackName);
49147             }
49148
49149             // Call if it was a function and we have a response
49150             if (responseContainer && jQuery.isFunction(overwritten)) {
49151               overwritten(responseContainer[0]);
49152             }
49153
49154             responseContainer = overwritten = undefined;
49155           });
49156
49157           // Delegate to script
49158           return "script";
49159         }
49160       });
49161
49162
49163
49164
49165       // data: string of html
49166       // context (optional): If specified, the fragment will be created in this
49167       // context, defaults to document
49168       // keepScripts (optional): If true, will include scripts passed in the html
49169       // string
49170       jQuery.parseHTML = function(data, context, keepScripts) {
49171         if (!data || typeof data !== "string") {
49172           return null;
49173         }
49174         if (typeof context === "boolean") {
49175           keepScripts = context;
49176           context = false;
49177         }
49178         context = context || document;
49179
49180         var parsed = rsingleTag.exec(data),
49181           scripts = !keepScripts && [];
49182
49183         // Single tag
49184         if (parsed) {
49185           return [context.createElement(parsed[1])];
49186         }
49187
49188         parsed = jQuery.buildFragment([data], context, scripts);
49189
49190         if (scripts && scripts.length) {
49191           jQuery(scripts).remove();
49192         }
49193
49194         return jQuery.merge([], parsed.childNodes);
49195       };
49196
49197
49198       // Keep a copy of the old load method
49199       var _load = jQuery.fn.load;
49200
49201       /**
49202        * Load a url into a page
49203        */
49204       jQuery.fn.load = function(url, params, callback) {
49205         if (typeof url !== "string" && _load) {
49206           return _load.apply(this, arguments);
49207         }
49208
49209         var selector, type, response,
49210           self = this,
49211           off = url.indexOf(" ");
49212
49213         if (off >= 0) {
49214           selector = jQuery.trim(url.slice(off));
49215           url = url.slice(0, off);
49216         }
49217
49218         // If it's a function
49219         if (jQuery.isFunction(params)) {
49220
49221           // We assume that it's the callback
49222           callback = params;
49223           params = undefined;
49224
49225           // Otherwise, build a param string
49226         } else if (params && typeof params === "object") {
49227           type = "POST";
49228         }
49229
49230         // If we have elements to modify, make the request
49231         if (self.length > 0) {
49232           jQuery.ajax({
49233             url: url,
49234
49235             // if "type" variable is undefined, then "GET" method will be used
49236             type: type,
49237             dataType: "html",
49238             data: params
49239           }).done(function(responseText) {
49240
49241             // Save response for use in complete callback
49242             response = arguments;
49243
49244             self.html(selector ?
49245
49246               // If a selector was specified, locate the right elements in a
49247               // dummy div
49248               // Exclude scripts to avoid IE 'Permission Denied' errors
49249               jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
49250
49251               // Otherwise use the full result
49252               responseText);
49253
49254           }).complete(callback && function(jqXHR, status) {
49255             self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
49256           });
49257         }
49258
49259         return this;
49260       };
49261
49262
49263
49264
49265       // Attach a bunch of functions for handling common AJAX events
49266       jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
49267         jQuery.fn[type] = function(fn) {
49268           return this.on(type, fn);
49269         };
49270       });
49271
49272
49273
49274
49275       jQuery.expr.filters.animated = function(elem) {
49276         return jQuery.grep(jQuery.timers, function(fn) {
49277           return elem === fn.elem;
49278         }).length;
49279       };
49280
49281
49282
49283
49284       var docElem = window.document.documentElement;
49285
49286       /**
49287        * Gets a window from an element
49288        */
49289       function getWindow(elem) {
49290         return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
49291       }
49292
49293       jQuery.offset = {
49294         setOffset: function(elem, options, i) {
49295           var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
49296             position = jQuery.css(elem, "position"),
49297             curElem = jQuery(elem),
49298             props = {};
49299
49300           // Set position first, in-case top/left are set even on static elem
49301           if (position === "static") {
49302             elem.style.position = "relative";
49303           }
49304
49305           curOffset = curElem.offset();
49306           curCSSTop = jQuery.css(elem, "top");
49307           curCSSLeft = jQuery.css(elem, "left");
49308           calculatePosition = (position === "absolute" || position === "fixed") &&
49309             (curCSSTop + curCSSLeft).indexOf("auto") > -1;
49310
49311           // Need to be able to calculate position if either
49312           // top or left is auto and position is either absolute or fixed
49313           if (calculatePosition) {
49314             curPosition = curElem.position();
49315             curTop = curPosition.top;
49316             curLeft = curPosition.left;
49317
49318           } else {
49319             curTop = parseFloat(curCSSTop) || 0;
49320             curLeft = parseFloat(curCSSLeft) || 0;
49321           }
49322
49323           if (jQuery.isFunction(options)) {
49324             options = options.call(elem, i, curOffset);
49325           }
49326
49327           if (options.top != null) {
49328             props.top = (options.top - curOffset.top) + curTop;
49329           }
49330           if (options.left != null) {
49331             props.left = (options.left - curOffset.left) + curLeft;
49332           }
49333
49334           if ("using" in options) {
49335             options.using.call(elem, props);
49336
49337           } else {
49338             curElem.css(props);
49339           }
49340         }
49341       };
49342
49343       jQuery.fn.extend({
49344         offset: function(options) {
49345           if (arguments.length) {
49346             return options === undefined ?
49347               this :
49348               this.each(function(i) {
49349                 jQuery.offset.setOffset(this, options, i);
49350               });
49351           }
49352
49353           var docElem, win,
49354             elem = this[0],
49355             box = {
49356               top: 0,
49357               left: 0
49358             },
49359             doc = elem && elem.ownerDocument;
49360
49361           if (!doc) {
49362             return;
49363           }
49364
49365           docElem = doc.documentElement;
49366
49367           // Make sure it's not a disconnected DOM node
49368           if (!jQuery.contains(docElem, elem)) {
49369             return box;
49370           }
49371
49372           // Support: BlackBerry 5, iOS 3 (original iPhone)
49373           // If we don't have gBCR, just use 0,0 rather than error
49374           if (typeof elem.getBoundingClientRect !== strundefined) {
49375             box = elem.getBoundingClientRect();
49376           }
49377           win = getWindow(doc);
49378           return {
49379             top: box.top + win.pageYOffset - docElem.clientTop,
49380             left: box.left + win.pageXOffset - docElem.clientLeft
49381           };
49382         },
49383
49384         position: function() {
49385           if (!this[0]) {
49386             return;
49387           }
49388
49389           var offsetParent, offset,
49390             elem = this[0],
49391             parentOffset = {
49392               top: 0,
49393               left: 0
49394             };
49395
49396           // Fixed elements are offset from window (parentOffset = {top:0, left:
49397           // 0}, because it is its only offset parent
49398           if (jQuery.css(elem, "position") === "fixed") {
49399             // Assume getBoundingClientRect is there when computed position is
49400             // fixed
49401             offset = elem.getBoundingClientRect();
49402
49403           } else {
49404             // Get *real* offsetParent
49405             offsetParent = this.offsetParent();
49406
49407             // Get correct offsets
49408             offset = this.offset();
49409             if (!jQuery.nodeName(offsetParent[0], "html")) {
49410               parentOffset = offsetParent.offset();
49411             }
49412
49413             // Add offsetParent borders
49414             parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
49415             parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
49416           }
49417
49418           // Subtract parent offsets and element margins
49419           return {
49420             top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
49421             left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
49422           };
49423         },
49424
49425         offsetParent: function() {
49426           return this.map(function() {
49427             var offsetParent = this.offsetParent || docElem;
49428
49429             while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
49430               offsetParent = offsetParent.offsetParent;
49431             }
49432
49433             return offsetParent || docElem;
49434           });
49435         }
49436       });
49437
49438       // Create scrollLeft and scrollTop methods
49439       jQuery.each({
49440         scrollLeft: "pageXOffset",
49441         scrollTop: "pageYOffset"
49442       }, function(method, prop) {
49443         var top = "pageYOffset" === prop;
49444
49445         jQuery.fn[method] = function(val) {
49446           return access(this, function(elem, method, val) {
49447             var win = getWindow(elem);
49448
49449             if (val === undefined) {
49450               return win ? win[prop] : elem[method];
49451             }
49452
49453             if (win) {
49454               win.scrollTo(!top ? val : window.pageXOffset,
49455                 top ? val : window.pageYOffset
49456               );
49457
49458             } else {
49459               elem[method] = val;
49460             }
49461           }, method, val, arguments.length, null);
49462         };
49463       });
49464
49465       // Support: Safari<7+, Chrome<37+
49466       // Add the top/left cssHooks using jQuery.fn.position
49467       // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
49468       // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
49469       // getComputedStyle returns percent when specified for top/left/bottom/right;
49470       // rather than make the css module depend on the offset module, just check for
49471       // it here
49472       jQuery.each(["top", "left"], function(i, prop) {
49473         jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition,
49474           function(elem, computed) {
49475             if (computed) {
49476               computed = curCSS(elem, prop);
49477               // If curCSS returns percentage, fallback to offset
49478               return rnumnonpx.test(computed) ?
49479                 jQuery(elem).position()[prop] + "px" :
49480                 computed;
49481             }
49482           }
49483         );
49484       });
49485
49486
49487       // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth
49488       // methods
49489       jQuery.each({
49490         Height: "height",
49491         Width: "width"
49492       }, function(name, type) {
49493         jQuery.each({
49494           padding: "inner" + name,
49495           content: type,
49496           "": "outer" + name
49497         }, function(defaultExtra, funcName) {
49498           // Margin is only for outerHeight, outerWidth
49499           jQuery.fn[funcName] = function(margin, value) {
49500             var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
49501               extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
49502
49503             return access(this, function(elem, type, value) {
49504               var doc;
49505
49506               if (jQuery.isWindow(elem)) {
49507                 // As of 5/8/2012 this will yield incorrect results for
49508                 // Mobile Safari, but there
49509                 // isn't a whole lot we can do. See pull request at this URL
49510                 // for discussion:
49511                 // https://github.com/jquery/jquery/pull/764
49512                 return elem.document.documentElement["client" + name];
49513               }
49514
49515               // Get document width or height
49516               if (elem.nodeType === 9) {
49517                 doc = elem.documentElement;
49518
49519                 // Either scroll[Width/Height] or offset[Width/Height] or
49520                 // client[Width/Height],
49521                 // whichever is greatest
49522                 return Math.max(
49523                   elem.body["scroll" + name], doc["scroll" + name],
49524                   elem.body["offset" + name], doc["offset" + name],
49525                   doc["client" + name]
49526                 );
49527               }
49528
49529               return value === undefined ?
49530                 // Get width or height on the element, requesting but not
49531                 // forcing parseFloat
49532                 jQuery.css(elem, type, extra) :
49533
49534                 // Set width or height on the element
49535                 jQuery.style(elem, type, value, extra);
49536             }, type, chainable ? margin : undefined, chainable, null);
49537           };
49538         });
49539       });
49540
49541
49542       // The number of elements contained in the matched element set
49543       jQuery.fn.size = function() {
49544         return this.length;
49545       };
49546
49547       jQuery.fn.andSelf = jQuery.fn.addBack;
49548
49549
49550
49551
49552       // Register as a named AMD module, since jQuery can be concatenated with other
49553       // files that may use define, but not via a proper concatenation script that
49554       // understands anonymous AMD modules. A named AMD is safest and most robust
49555       // way to register. Lowercase jquery is used because AMD module names are
49556       // derived from file names, and jQuery is normally delivered in a lowercase
49557       // file name. Do this after creating the global so that if an AMD module wants
49558       // to call noConflict to hide this version of jQuery, it will work.
49559
49560       // Note that for maximum portability, libraries that are not jQuery should
49561       // declare themselves as anonymous modules, and avoid setting a global if an
49562       // AMD loader is present. jQuery is a special case. For more information, see
49563       // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
49564
49565       if (typeof define === "function" && define.amd) {
49566         define("jquery", [], function() {
49567           return jQuery;
49568         });
49569       }
49570
49571
49572
49573
49574       var
49575         // Map over jQuery in case of overwrite
49576         _jQuery = window.jQuery,
49577
49578         // Map over the $ in case of overwrite
49579         _$ = window.$;
49580
49581       jQuery.noConflict = function(deep) {
49582         if (window.$ === jQuery) {
49583           window.$ = _$;
49584         }
49585
49586         if (deep && window.jQuery === jQuery) {
49587           window.jQuery = _jQuery;
49588         }
49589
49590         return jQuery;
49591       };
49592
49593       // Expose jQuery and $ identifiers, even in AMD
49594       // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
49595       // and CommonJS for browser emulators (#13566)
49596       if (typeof noGlobal === strundefined) {
49597         window.jQuery = window.$ = jQuery;
49598       }
49599
49600
49601
49602
49603       return jQuery;
49604
49605     }));
49606
49607   }, {}],
49608   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js": [function(require, module, exports) {
49609     var baseFlatten = require('../internal/baseFlatten'),
49610       isIterateeCall = require('../internal/isIterateeCall');
49611
49612     /**
49613      * Flattens a nested array. If `isDeep` is `true` the array is recursively
49614      * flattened, otherwise it's only flattened a single level.
49615      *
49616      * @static
49617      * @memberOf _
49618      * @category Array
49619      * @param {Array}
49620      *            array The array to flatten.
49621      * @param {boolean}
49622      *            [isDeep] Specify a deep flatten.
49623      * @param- {Object} [guard] Enables use as a callback for functions like
49624      *         `_.map`.
49625      * @returns {Array} Returns the new flattened array.
49626      * @example
49627      *
49628      * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
49629      *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
49630      */
49631     function flatten(array, isDeep, guard) {
49632       var length = array ? array.length : 0;
49633       if (guard && isIterateeCall(array, isDeep, guard)) {
49634         isDeep = false;
49635       }
49636       return length ? baseFlatten(array, isDeep) : [];
49637     }
49638
49639     module.exports = flatten;
49640
49641   }, {
49642     "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
49643     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
49644   }],
49645   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js": [function(require, module, exports) {
49646     /**
49647      * Gets the last element of `array`.
49648      *
49649      * @static
49650      * @memberOf _
49651      * @category Array
49652      * @param {Array}
49653      *            array The array to query.
49654      * @returns {*} Returns the last element of `array`.
49655      * @example
49656      *
49657      * _.last([1, 2, 3]); // => 3
49658      */
49659     function last(array) {
49660       var length = array ? array.length : 0;
49661       return length ? array[length - 1] : undefined;
49662     }
49663
49664     module.exports = last;
49665
49666   }, {}],
49667   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js": [function(require, module, exports) {
49668     var baseCallback = require('../internal/baseCallback'),
49669       baseUniq = require('../internal/baseUniq'),
49670       isIterateeCall = require('../internal/isIterateeCall'),
49671       sortedUniq = require('../internal/sortedUniq');
49672
49673     /**
49674      * Creates a duplicate-free version of an array, using
49675      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
49676      * for equality comparisons, in which only the first occurence of each element
49677      * is kept. Providing `true` for `isSorted` performs a faster search algorithm
49678      * for sorted arrays. If an iteratee function is provided it's invoked for each
49679      * element in the array to generate the criterion by which uniqueness is
49680      * computed. The `iteratee` is bound to `thisArg` and invoked with three
49681      * arguments: (value, index, array).
49682      *
49683      * If a property name is provided for `iteratee` the created `_.property` style
49684      * callback returns the property value of the given element.
49685      *
49686      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49687      * style callback returns `true` for elements that have a matching property
49688      * value, else `false`.
49689      *
49690      * If an object is provided for `iteratee` the created `_.matches` style
49691      * callback returns `true` for elements that have the properties of the given
49692      * object, else `false`.
49693      *
49694      * @static
49695      * @memberOf _
49696      * @alias unique
49697      * @category Array
49698      * @param {Array}
49699      *            array The array to inspect.
49700      * @param {boolean}
49701      *            [isSorted] Specify the array is sorted.
49702      * @param {Function|Object|string}
49703      *            [iteratee] The function invoked per iteration.
49704      * @param {*}
49705      *            [thisArg] The `this` binding of `iteratee`.
49706      * @returns {Array} Returns the new duplicate-value-free array.
49707      * @example
49708      *
49709      * _.uniq([2, 1, 2]); // => [2, 1]
49710      *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
49711      *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) { return
49712      * this.floor(n); }, Math); // => [1, 2.5]
49713      *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x': 2 }, {
49714      * 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
49715      */
49716     function uniq(array, isSorted, iteratee, thisArg) {
49717       var length = array ? array.length : 0;
49718       if (!length) {
49719         return [];
49720       }
49721       if (isSorted != null && typeof isSorted != 'boolean') {
49722         thisArg = iteratee;
49723         iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
49724         isSorted = false;
49725       }
49726       iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
49727       return (isSorted) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
49728     }
49729
49730     module.exports = uniq;
49731
49732   }, {
49733     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49734     "../internal/baseUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js",
49735     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49736     "../internal/sortedUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js"
49737   }],
49738   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js": [function(require, module, exports) {
49739     module.exports = require('./uniq');
49740
49741   }, {
49742     "./uniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js"
49743   }],
49744   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js": [function(require, module, exports) {
49745     var LazyWrapper = require('../internal/LazyWrapper'),
49746       LodashWrapper = require('../internal/LodashWrapper'),
49747       baseLodash = require('../internal/baseLodash'),
49748       isArray = require('../lang/isArray'),
49749       isObjectLike = require('../internal/isObjectLike'),
49750       wrapperClone = require('../internal/wrapperClone');
49751
49752     /** Used for native method references. */
49753     var objectProto = Object.prototype;
49754
49755     /** Used to check objects for own properties. */
49756     var hasOwnProperty = objectProto.hasOwnProperty;
49757
49758     /**
49759      * Creates a `lodash` object which wraps `value` to enable implicit chaining.
49760      * Methods that operate on and return arrays, collections, and functions can be
49761      * chained together. Methods that retrieve a single value or may return a
49762      * primitive value will automatically end the chain returning the unwrapped
49763      * value. Explicit chaining may be enabled using `_.chain`. The execution of
49764      * chained methods is lazy, that is, execution is deferred until `_#value` is
49765      * implicitly or explicitly called.
49766      *
49767      * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
49768      * fusion is an optimization strategy which merge iteratee calls; this can help
49769      * to avoid the creation of intermediate data structures and greatly reduce the
49770      * number of iteratee executions.
49771      *
49772      * Chaining is supported in custom builds as long as the `_#value` method is
49773      * directly or indirectly included in the build.
49774      *
49775      * In addition to lodash methods, wrappers have `Array` and `String` methods.
49776      *
49777      * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`, `reverse`,
49778      * `shift`, `slice`, `sort`, `splice`, and `unshift`
49779      *
49780      * The wrapper `String` methods are: `replace` and `split`
49781      *
49782      * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
49783      * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
49784      * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
49785      * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
49786      *
49787      * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`, `before`,
49788      * `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`, `commit`,
49789      * `compact`, `concat`, `constant`, `countBy`, `create`, `curry`, `debounce`,
49790      * `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, `drop`,
49791      * `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`,
49792      * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`,
49793      * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`,
49794      * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`,
49795      * `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`,
49796      * `method`, `methodOf`, `mixin`, `modArgs`, `negate`, `omit`, `once`, `pairs`,
49797      * `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, `property`,
49798      * `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`,
49799      * `rest`, `restParam`, `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`,
49800      * `sortByAll`, `sortByOrder`, `splice`, `spread`, `take`, `takeRight`,
49801      * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`,
49802      * `toPlainObject`, `transform`, `union`, `uniq`, `unshift`, `unzip`,
49803      * `unzipWith`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`,
49804      * `zipObject`, `zipWith`
49805      *
49806      * The wrapper methods that are **not** chainable by default are: `add`,
49807      * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, `deburr`,
49808      * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
49809      * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
49810      * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
49811      * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
49812      * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
49813      * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
49814      * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
49815      * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
49816      * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
49817      * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
49818      * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
49819      * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
49820      * `unescape`, `uniqueId`, `value`, and `words`
49821      *
49822      * The wrapper method `sample` will return a wrapped value when `n` is provided,
49823      * otherwise an unwrapped value is returned.
49824      *
49825      * @name _
49826      * @constructor
49827      * @category Chain
49828      * @param {*}
49829      *            value The value to wrap in a `lodash` instance.
49830      * @returns {Object} Returns the new `lodash` wrapper instance.
49831      * @example
49832      *
49833      * var wrapped = _([1, 2, 3]);
49834      *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
49835      * total + n; }); // => 6
49836      *  // returns a wrapped value var squares = wrapped.map(function(n) { return n *
49837      * n; });
49838      *
49839      * _.isArray(squares); // => false
49840      *
49841      * _.isArray(squares.value()); // => true
49842      */
49843     function lodash(value) {
49844       if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
49845         if (value instanceof LodashWrapper) {
49846           return value;
49847         }
49848         if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
49849           return wrapperClone(value);
49850         }
49851       }
49852       return new LodashWrapper(value);
49853     }
49854
49855     // Ensure wrappers are instances of `baseLodash`.
49856     lodash.prototype = baseLodash.prototype;
49857
49858     module.exports = lodash;
49859
49860   }, {
49861     "../internal/LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
49862     "../internal/LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
49863     "../internal/baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js",
49864     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
49865     "../internal/wrapperClone": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js",
49866     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49867   }],
49868   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js": [function(require, module, exports) {
49869     var arrayEvery = require('../internal/arrayEvery'),
49870       baseCallback = require('../internal/baseCallback'),
49871       baseEvery = require('../internal/baseEvery'),
49872       isArray = require('../lang/isArray'),
49873       isIterateeCall = require('../internal/isIterateeCall');
49874
49875     /**
49876      * Checks if `predicate` returns truthy for **all** elements of `collection`.
49877      * The predicate is bound to `thisArg` and invoked with three arguments: (value,
49878      * index|key, collection).
49879      *
49880      * If a property name is provided for `predicate` the created `_.property` style
49881      * callback returns the property value of the given element.
49882      *
49883      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49884      * style callback returns `true` for elements that have a matching property
49885      * value, else `false`.
49886      *
49887      * If an object is provided for `predicate` the created `_.matches` style
49888      * callback returns `true` for elements that have the properties of the given
49889      * object, else `false`.
49890      *
49891      * @static
49892      * @memberOf _
49893      * @alias all
49894      * @category Collection
49895      * @param {Array|Object|string}
49896      *            collection The collection to iterate over.
49897      * @param {Function|Object|string}
49898      *            [predicate=_.identity] The function invoked per iteration.
49899      * @param {*}
49900      *            [thisArg] The `this` binding of `predicate`.
49901      * @returns {boolean} Returns `true` if all elements pass the predicate check,
49902      *          else `false`.
49903      * @example
49904      *
49905      * _.every([true, 1, null, 'yes'], Boolean); // => false
49906      *
49907      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
49908      * 'active': false } ];
49909      *  // using the `_.matches` callback shorthand _.every(users, { 'user':
49910      * 'barney', 'active': false }); // => false
49911      *  // using the `_.matchesProperty` callback shorthand _.every(users, 'active',
49912      * false); // => true
49913      *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
49914      * false
49915      */
49916     function every(collection, predicate, thisArg) {
49917       var func = isArray(collection) ? arrayEvery : baseEvery;
49918       if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
49919         predicate = undefined;
49920       }
49921       if (typeof predicate != 'function' || thisArg !== undefined) {
49922         predicate = baseCallback(predicate, thisArg, 3);
49923       }
49924       return func(collection, predicate);
49925     }
49926
49927     module.exports = every;
49928
49929   }, {
49930     "../internal/arrayEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js",
49931     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49932     "../internal/baseEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js",
49933     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49934     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49935   }],
49936   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js": [function(require, module, exports) {
49937     var arrayFilter = require('../internal/arrayFilter'),
49938       baseCallback = require('../internal/baseCallback'),
49939       baseFilter = require('../internal/baseFilter'),
49940       isArray = require('../lang/isArray');
49941
49942     /**
49943      * Iterates over elements of `collection`, returning an array of all elements
49944      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49945      * invoked with three arguments: (value, index|key, collection).
49946      *
49947      * If a property name is provided for `predicate` the created `_.property` style
49948      * callback returns the property value of the given element.
49949      *
49950      * If a value is also provided for `thisArg` the created `_.matchesProperty`
49951      * style callback returns `true` for elements that have a matching property
49952      * value, else `false`.
49953      *
49954      * If an object is provided for `predicate` the created `_.matches` style
49955      * callback returns `true` for elements that have the properties of the given
49956      * object, else `false`.
49957      *
49958      * @static
49959      * @memberOf _
49960      * @alias select
49961      * @category Collection
49962      * @param {Array|Object|string}
49963      *            collection The collection to iterate over.
49964      * @param {Function|Object|string}
49965      *            [predicate=_.identity] The function invoked per iteration.
49966      * @param {*}
49967      *            [thisArg] The `this` binding of `predicate`.
49968      * @returns {Array} Returns the new filtered array.
49969      * @example
49970      *
49971      * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
49972      *
49973      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49974      * 'fred', 'age': 40, 'active': false } ];
49975      *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, { 'age':
49976      * 36, 'active': true }), 'user'); // => ['barney']
49977      *  // using the `_.matchesProperty` callback shorthand _.pluck(_.filter(users,
49978      * 'active', false), 'user'); // => ['fred']
49979      *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
49980      * 'active'), 'user'); // => ['barney']
49981      */
49982     function filter(collection, predicate, thisArg) {
49983       var func = isArray(collection) ? arrayFilter : baseFilter;
49984       predicate = baseCallback(predicate, thisArg, 3);
49985       return func(collection, predicate);
49986     }
49987
49988     module.exports = filter;
49989
49990   }, {
49991     "../internal/arrayFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js",
49992     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49993     "../internal/baseFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js",
49994     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49995   }],
49996   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js": [function(require, module, exports) {
49997     var baseEach = require('../internal/baseEach'),
49998       createFind = require('../internal/createFind');
49999
50000     /**
50001      * Iterates over elements of `collection`, returning the first element
50002      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
50003      * invoked with three arguments: (value, index|key, collection).
50004      *
50005      * If a property name is provided for `predicate` the created `_.property` style
50006      * callback returns the property value of the given element.
50007      *
50008      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50009      * style callback returns `true` for elements that have a matching property
50010      * value, else `false`.
50011      *
50012      * If an object is provided for `predicate` the created `_.matches` style
50013      * callback returns `true` for elements that have the properties of the given
50014      * object, else `false`.
50015      *
50016      * @static
50017      * @memberOf _
50018      * @alias detect
50019      * @category Collection
50020      * @param {Array|Object|string}
50021      *            collection The collection to search.
50022      * @param {Function|Object|string}
50023      *            [predicate=_.identity] The function invoked per iteration.
50024      * @param {*}
50025      *            [thisArg] The `this` binding of `predicate`.
50026      * @returns {*} Returns the matched element, else `undefined`.
50027      * @example
50028      *
50029      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
50030      * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
50031      * 'active': true } ];
50032      *
50033      * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
50034      * 'barney'
50035      *  // using the `_.matches` callback shorthand _.result(_.find(users, { 'age':
50036      * 1, 'active': true }), 'user'); // => 'pebbles'
50037      *  // using the `_.matchesProperty` callback shorthand _.result(_.find(users,
50038      * 'active', false), 'user'); // => 'fred'
50039      *  // using the `_.property` callback shorthand _.result(_.find(users,
50040      * 'active'), 'user'); // => 'barney'
50041      */
50042     var find = createFind(baseEach);
50043
50044     module.exports = find;
50045
50046   }, {
50047     "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50048     "../internal/createFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js"
50049   }],
50050   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js": [function(require, module, exports) {
50051     var arrayEach = require('../internal/arrayEach'),
50052       baseEach = require('../internal/baseEach'),
50053       createForEach = require('../internal/createForEach');
50054
50055     /**
50056      * Iterates over elements of `collection` invoking `iteratee` for each element.
50057      * The `iteratee` is bound to `thisArg` and invoked with three arguments:
50058      * (value, index|key, collection). Iteratee functions may exit iteration early
50059      * by explicitly returning `false`.
50060      *
50061      * **Note:** As with other "Collections" methods, objects with a "length"
50062      * property are iterated like arrays. To avoid this behavior `_.forIn` or
50063      * `_.forOwn` may be used for object iteration.
50064      *
50065      * @static
50066      * @memberOf _
50067      * @alias each
50068      * @category Collection
50069      * @param {Array|Object|string}
50070      *            collection The collection to iterate over.
50071      * @param {Function}
50072      *            [iteratee=_.identity] The function invoked per iteration.
50073      * @param {*}
50074      *            [thisArg] The `this` binding of `iteratee`.
50075      * @returns {Array|Object|string} Returns `collection`.
50076      * @example
50077      *
50078      * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs each
50079      * value from left to right and returns the array
50080      *
50081      * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
50082      * logs each value-key pair and returns the object (iteration order is not
50083      * guaranteed)
50084      */
50085     var forEach = createForEach(arrayEach, baseEach);
50086
50087     module.exports = forEach;
50088
50089   }, {
50090     "../internal/arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
50091     "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50092     "../internal/createForEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js"
50093   }],
50094   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js": [function(require, module, exports) {
50095     var createAggregator = require('../internal/createAggregator');
50096
50097     /** Used for native method references. */
50098     var objectProto = Object.prototype;
50099
50100     /** Used to check objects for own properties. */
50101     var hasOwnProperty = objectProto.hasOwnProperty;
50102
50103     /**
50104      * Creates an object composed of keys generated from the results of running each
50105      * element of `collection` through `iteratee`. The corresponding value of each
50106      * key is an array of the elements responsible for generating the key. The
50107      * `iteratee` is bound to `thisArg` and invoked with three arguments: (value,
50108      * index|key, collection).
50109      *
50110      * If a property name is provided for `iteratee` the created `_.property` style
50111      * callback returns the property value of the given element.
50112      *
50113      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50114      * style callback returns `true` for elements that have a matching property
50115      * value, else `false`.
50116      *
50117      * If an object is provided for `iteratee` the created `_.matches` style
50118      * callback returns `true` for elements that have the properties of the given
50119      * object, else `false`.
50120      *
50121      * @static
50122      * @memberOf _
50123      * @category Collection
50124      * @param {Array|Object|string}
50125      *            collection The collection to iterate over.
50126      * @param {Function|Object|string}
50127      *            [iteratee=_.identity] The function invoked per iteration.
50128      * @param {*}
50129      *            [thisArg] The `this` binding of `iteratee`.
50130      * @returns {Object} Returns the composed aggregate object.
50131      * @example
50132      *
50133      * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
50134      * '4': [4.2], '6': [6.1, 6.4] }
50135      *
50136      * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
50137      * '4': [4.2], '6': [6.1, 6.4] }
50138      *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
50139      * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
50140      */
50141     var groupBy = createAggregator(function(result, value, key) {
50142       if (hasOwnProperty.call(result, key)) {
50143         result[key].push(value);
50144       } else {
50145         result[key] = [value];
50146       }
50147     });
50148
50149     module.exports = groupBy;
50150
50151   }, {
50152     "../internal/createAggregator": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js"
50153   }],
50154   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js": [function(require, module, exports) {
50155     var baseIndexOf = require('../internal/baseIndexOf'),
50156       getLength = require('../internal/getLength'),
50157       isArray = require('../lang/isArray'),
50158       isIterateeCall = require('../internal/isIterateeCall'),
50159       isLength = require('../internal/isLength'),
50160       isString = require('../lang/isString'),
50161       values = require('../object/values');
50162
50163     /*
50164      * Native method references for those with the same name as other `lodash`
50165      * methods.
50166      */
50167     var nativeMax = Math.max;
50168
50169     /**
50170      * Checks if `target` is in `collection` using
50171      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
50172      * for equality comparisons. If `fromIndex` is negative, it's used as the offset
50173      * from the end of `collection`.
50174      *
50175      * @static
50176      * @memberOf _
50177      * @alias contains, include
50178      * @category Collection
50179      * @param {Array|Object|string}
50180      *            collection The collection to search.
50181      * @param {*}
50182      *            target The value to search for.
50183      * @param {number}
50184      *            [fromIndex=0] The index to search from.
50185      * @param- {Object} [guard] Enables use as a callback for functions like
50186      *         `_.reduce`.
50187      * @returns {boolean} Returns `true` if a matching element is found, else
50188      *          `false`.
50189      * @example
50190      *
50191      * _.includes([1, 2, 3], 1); // => true
50192      *
50193      * _.includes([1, 2, 3], 1, 2); // => false
50194      *
50195      * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
50196      *
50197      * _.includes('pebbles', 'eb'); // => true
50198      */
50199     function includes(collection, target, fromIndex, guard) {
50200       var length = collection ? getLength(collection) : 0;
50201       if (!isLength(length)) {
50202         collection = values(collection);
50203         length = collection.length;
50204       }
50205       if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
50206         fromIndex = 0;
50207       } else {
50208         fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
50209       }
50210       return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
50211     }
50212
50213     module.exports = includes;
50214
50215   }, {
50216     "../internal/baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
50217     "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50218     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50219     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50220     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
50221     "../lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
50222     "../object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
50223   }],
50224   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js": [function(require, module, exports) {
50225     var arrayMap = require('../internal/arrayMap'),
50226       baseCallback = require('../internal/baseCallback'),
50227       baseMap = require('../internal/baseMap'),
50228       isArray = require('../lang/isArray');
50229
50230     /**
50231      * Creates an array of values by running each element in `collection` through
50232      * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
50233      * arguments: (value, index|key, collection).
50234      *
50235      * If a property name is provided for `iteratee` the created `_.property` style
50236      * callback returns the property value of the given element.
50237      *
50238      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50239      * style callback returns `true` for elements that have a matching property
50240      * value, else `false`.
50241      *
50242      * If an object is provided for `iteratee` the created `_.matches` style
50243      * callback returns `true` for elements that have the properties of the given
50244      * object, else `false`.
50245      *
50246      * Many lodash methods are guarded to work as iteratees for methods like
50247      * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
50248      *
50249      * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
50250      * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
50251      * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`, `takeRight`,
50252      * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `random`, `range`,
50253      * `sample`, `some`, `sum`, `uniq`, and `words`
50254      *
50255      * @static
50256      * @memberOf _
50257      * @alias collect
50258      * @category Collection
50259      * @param {Array|Object|string}
50260      *            collection The collection to iterate over.
50261      * @param {Function|Object|string}
50262      *            [iteratee=_.identity] The function invoked per iteration.
50263      * @param {*}
50264      *            [thisArg] The `this` binding of `iteratee`.
50265      * @returns {Array} Returns the new mapped array.
50266      * @example
50267      *
50268      * function timesThree(n) { return n * 3; }
50269      *
50270      * _.map([1, 2], timesThree); // => [3, 6]
50271      *
50272      * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is not
50273      * guaranteed)
50274      *
50275      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
50276      *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
50277      * ['barney', 'fred']
50278      */
50279     function map(collection, iteratee, thisArg) {
50280       var func = isArray(collection) ? arrayMap : baseMap;
50281       iteratee = baseCallback(iteratee, thisArg, 3);
50282       return func(collection, iteratee);
50283     }
50284
50285     module.exports = map;
50286
50287   }, {
50288     "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
50289     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50290     "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50291     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50292   }],
50293   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js": [function(require, module, exports) {
50294     var arrayReduce = require('../internal/arrayReduce'),
50295       baseEach = require('../internal/baseEach'),
50296       createReduce = require('../internal/createReduce');
50297
50298     /**
50299      * Reduces `collection` to a value which is the accumulated result of running
50300      * each element in `collection` through `iteratee`, where each successive
50301      * invocation is supplied the return value of the previous. If `accumulator` is
50302      * not provided the first element of `collection` is used as the initial value.
50303      * The `iteratee` is bound to `thisArg` and invoked with four arguments:
50304      * (accumulator, value, index|key, collection).
50305      *
50306      * Many lodash methods are guarded to work as iteratees for methods like
50307      * `_.reduce`, `_.reduceRight`, and `_.transform`.
50308      *
50309      * The guarded methods are: `assign`, `defaults`, `defaultsDeep`, `includes`,
50310      * `merge`, `sortByAll`, and `sortByOrder`
50311      *
50312      * @static
50313      * @memberOf _
50314      * @alias foldl, inject
50315      * @category Collection
50316      * @param {Array|Object|string}
50317      *            collection The collection to iterate over.
50318      * @param {Function}
50319      *            [iteratee=_.identity] The function invoked per iteration.
50320      * @param {*}
50321      *            [accumulator] The initial value.
50322      * @param {*}
50323      *            [thisArg] The `this` binding of `iteratee`.
50324      * @returns {*} Returns the accumulated value.
50325      * @example
50326      *
50327      * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
50328      *
50329      * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n * 3;
50330      * return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is not
50331      * guaranteed)
50332      */
50333     var reduce = createReduce(arrayReduce, baseEach);
50334
50335     module.exports = reduce;
50336
50337   }, {
50338     "../internal/arrayReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js",
50339     "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50340     "../internal/createReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js"
50341   }],
50342   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js": [function(require, module, exports) {
50343     var getLength = require('../internal/getLength'),
50344       isLength = require('../internal/isLength'),
50345       keys = require('../object/keys');
50346
50347     /**
50348      * Gets the size of `collection` by returning its length for array-like values
50349      * or the number of own enumerable properties for objects.
50350      *
50351      * @static
50352      * @memberOf _
50353      * @category Collection
50354      * @param {Array|Object|string}
50355      *            collection The collection to inspect.
50356      * @returns {number} Returns the size of `collection`.
50357      * @example
50358      *
50359      * _.size([1, 2, 3]); // => 3
50360      *
50361      * _.size({ 'a': 1, 'b': 2 }); // => 2
50362      *
50363      * _.size('pebbles'); // => 7
50364      */
50365     function size(collection) {
50366       var length = collection ? getLength(collection) : 0;
50367       return isLength(length) ? length : keys(collection).length;
50368     }
50369
50370     module.exports = size;
50371
50372   }, {
50373     "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50374     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50375     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
50376   }],
50377   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js": [function(require, module, exports) {
50378     var arraySome = require('../internal/arraySome'),
50379       baseCallback = require('../internal/baseCallback'),
50380       baseSome = require('../internal/baseSome'),
50381       isArray = require('../lang/isArray'),
50382       isIterateeCall = require('../internal/isIterateeCall');
50383
50384     /**
50385      * Checks if `predicate` returns truthy for **any** element of `collection`. The
50386      * function returns as soon as it finds a passing value and does not iterate
50387      * over the entire collection. The predicate is bound to `thisArg` and invoked
50388      * with three arguments: (value, index|key, collection).
50389      *
50390      * If a property name is provided for `predicate` the created `_.property` style
50391      * callback returns the property value of the given element.
50392      *
50393      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50394      * style callback returns `true` for elements that have a matching property
50395      * value, else `false`.
50396      *
50397      * If an object is provided for `predicate` the created `_.matches` style
50398      * callback returns `true` for elements that have the properties of the given
50399      * object, else `false`.
50400      *
50401      * @static
50402      * @memberOf _
50403      * @alias any
50404      * @category Collection
50405      * @param {Array|Object|string}
50406      *            collection The collection to iterate over.
50407      * @param {Function|Object|string}
50408      *            [predicate=_.identity] The function invoked per iteration.
50409      * @param {*}
50410      *            [thisArg] The `this` binding of `predicate`.
50411      * @returns {boolean} Returns `true` if any element passes the predicate check,
50412      *          else `false`.
50413      * @example
50414      *
50415      * _.some([null, 0, 'yes', false], Boolean); // => true
50416      *
50417      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
50418      * 'active': false } ];
50419      *  // using the `_.matches` callback shorthand _.some(users, { 'user':
50420      * 'barney', 'active': false }); // => false
50421      *  // using the `_.matchesProperty` callback shorthand _.some(users, 'active',
50422      * false); // => true
50423      *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
50424      * true
50425      */
50426     function some(collection, predicate, thisArg) {
50427       var func = isArray(collection) ? arraySome : baseSome;
50428       if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
50429         predicate = undefined;
50430       }
50431       if (typeof predicate != 'function' || thisArg !== undefined) {
50432         predicate = baseCallback(predicate, thisArg, 3);
50433       }
50434       return func(collection, predicate);
50435     }
50436
50437     module.exports = some;
50438
50439   }, {
50440     "../internal/arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js",
50441     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50442     "../internal/baseSome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js",
50443     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50444     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50445   }],
50446   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js": [function(require, module, exports) {
50447     var baseCallback = require('../internal/baseCallback'),
50448       baseMap = require('../internal/baseMap'),
50449       baseSortBy = require('../internal/baseSortBy'),
50450       compareAscending = require('../internal/compareAscending'),
50451       isIterateeCall = require('../internal/isIterateeCall');
50452
50453     /**
50454      * Creates an array of elements, sorted in ascending order by the results of
50455      * running each element in a collection through `iteratee`. This method performs
50456      * a stable sort, that is, it preserves the original sort order of equal
50457      * elements. The `iteratee` is bound to `thisArg` and invoked with three
50458      * arguments: (value, index|key, collection).
50459      *
50460      * If a property name is provided for `iteratee` the created `_.property` style
50461      * callback returns the property value of the given element.
50462      *
50463      * If a value is also provided for `thisArg` the created `_.matchesProperty`
50464      * style callback returns `true` for elements that have a matching property
50465      * value, else `false`.
50466      *
50467      * If an object is provided for `iteratee` the created `_.matches` style
50468      * callback returns `true` for elements that have the properties of the given
50469      * object, else `false`.
50470      *
50471      * @static
50472      * @memberOf _
50473      * @category Collection
50474      * @param {Array|Object|string}
50475      *            collection The collection to iterate over.
50476      * @param {Function|Object|string}
50477      *            [iteratee=_.identity] The function invoked per iteration.
50478      * @param {*}
50479      *            [thisArg] The `this` binding of `iteratee`.
50480      * @returns {Array} Returns the new sorted array.
50481      * @example
50482      *
50483      * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
50484      *
50485      * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3, 1,
50486      * 2]
50487      *
50488      * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user': 'barney' } ];
50489      *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
50490      * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
50491      */
50492     function sortBy(collection, iteratee, thisArg) {
50493       if (collection == null) {
50494         return [];
50495       }
50496       if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
50497         iteratee = undefined;
50498       }
50499       var index = -1;
50500       iteratee = baseCallback(iteratee, thisArg, 3);
50501
50502       var result = baseMap(collection, function(value, key, collection) {
50503         return {
50504           'criteria': iteratee(value, key, collection),
50505           'index': ++index,
50506           'value': value
50507         };
50508       });
50509       return baseSortBy(result, compareAscending);
50510     }
50511
50512     module.exports = sortBy;
50513
50514   }, {
50515     "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50516     "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50517     "../internal/baseSortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js",
50518     "../internal/compareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js",
50519     "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
50520   }],
50521   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js": [function(require, module, exports) {
50522     var getNative = require('../internal/getNative');
50523
50524     /*
50525      * Native method references for those with the same name as other `lodash`
50526      * methods.
50527      */
50528     var nativeNow = getNative(Date, 'now');
50529
50530     /**
50531      * Gets the number of milliseconds that have elapsed since the Unix epoch (1
50532      * January 1970 00:00:00 UTC).
50533      *
50534      * @static
50535      * @memberOf _
50536      * @category Date
50537      * @example
50538      *
50539      * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
50540      * logs the number of milliseconds it took for the deferred function to be
50541      * invoked
50542      */
50543     var now = nativeNow || function() {
50544       return new Date().getTime();
50545     };
50546
50547     module.exports = now;
50548
50549   }, {
50550     "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
50551   }],
50552   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js": [function(require, module, exports) {
50553     var createWrapper = require('../internal/createWrapper'),
50554       replaceHolders = require('../internal/replaceHolders'),
50555       restParam = require('./restParam');
50556
50557     /** Used to compose bitmasks for wrapper metadata. */
50558     var BIND_FLAG = 1,
50559       PARTIAL_FLAG = 32;
50560
50561     /**
50562      * Creates a function that invokes `func` with the `this` binding of `thisArg`
50563      * and prepends any additional `_.bind` arguments to those provided to the bound
50564      * function.
50565      *
50566      * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
50567      * may be used as a placeholder for partially applied arguments.
50568      *
50569      * **Note:** Unlike native `Function#bind` this method does not set the "length"
50570      * property of bound functions.
50571      *
50572      * @static
50573      * @memberOf _
50574      * @category Function
50575      * @param {Function}
50576      *            func The function to bind.
50577      * @param {*}
50578      *            thisArg The `this` binding of `func`.
50579      * @param {...*}
50580      *            [partials] The arguments to be partially applied.
50581      * @returns {Function} Returns the new bound function.
50582      * @example
50583      *
50584      * var greet = function(greeting, punctuation) { return greeting + ' ' +
50585      * this.user + punctuation; };
50586      *
50587      * var object = { 'user': 'fred' };
50588      *
50589      * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
50590      *  // using placeholders var bound = _.bind(greet, object, _, '!');
50591      * bound('hi'); // => 'hi fred!'
50592      */
50593     var bind = restParam(function(func, thisArg, partials) {
50594       var bitmask = BIND_FLAG;
50595       if (partials.length) {
50596         var holders = replaceHolders(partials, bind.placeholder);
50597         bitmask |= PARTIAL_FLAG;
50598       }
50599       return createWrapper(func, bitmask, thisArg, partials, holders);
50600     });
50601
50602     // Assign default placeholders.
50603     bind.placeholder = {};
50604
50605     module.exports = bind;
50606
50607   }, {
50608     "../internal/createWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js",
50609     "../internal/replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
50610     "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50611   }],
50612   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js": [function(require, module, exports) {
50613     var isObject = require('../lang/isObject'),
50614       now = require('../date/now');
50615
50616     /** Used as the `TypeError` message for "Functions" methods. */
50617     var FUNC_ERROR_TEXT = 'Expected a function';
50618
50619     /*
50620      * Native method references for those with the same name as other `lodash`
50621      * methods.
50622      */
50623     var nativeMax = Math.max;
50624
50625     /**
50626      * Creates a debounced function that delays invoking `func` until after `wait`
50627      * milliseconds have elapsed since the last time the debounced function was
50628      * invoked. The debounced function comes with a `cancel` method to cancel
50629      * delayed invocations. Provide an options object to indicate that `func` should
50630      * be invoked on the leading and/or trailing edge of the `wait` timeout.
50631      * Subsequent calls to the debounced function return the result of the last
50632      * `func` invocation.
50633      *
50634      * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
50635      * on the trailing edge of the timeout only if the the debounced function is
50636      * invoked more than once during the `wait` timeout.
50637      *
50638      * See [David Corbacho's
50639      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
50640      * for details over the differences between `_.debounce` and `_.throttle`.
50641      *
50642      * @static
50643      * @memberOf _
50644      * @category Function
50645      * @param {Function}
50646      *            func The function to debounce.
50647      * @param {number}
50648      *            [wait=0] The number of milliseconds to delay.
50649      * @param {Object}
50650      *            [options] The options object.
50651      * @param {boolean}
50652      *            [options.leading=false] Specify invoking on the leading edge of
50653      *            the timeout.
50654      * @param {number}
50655      *            [options.maxWait] The maximum time `func` is allowed to be delayed
50656      *            before it's invoked.
50657      * @param {boolean}
50658      *            [options.trailing=true] Specify invoking on the trailing edge of
50659      *            the timeout.
50660      * @returns {Function} Returns the new debounced function.
50661      * @example
50662      *  // avoid costly calculations while the window size is in flux
50663      * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
50664      *  // invoke `sendMail` when the click event is fired, debouncing subsequent
50665      * calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, { 'leading':
50666      * true, 'trailing': false }));
50667      *  // ensure `batchLog` is invoked once after 1 second of debounced calls var
50668      * source = new EventSource('/stream'); jQuery(source).on('message',
50669      * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
50670      *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
50671      * Object.observe(models.todo, todoChanges);
50672      *
50673      * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
50674      * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
50675      *  // ...at some point `models.todo` is changed models.todo.completed = true;
50676      *  // ...before 1 second has passed `models.todo` is deleted // which cancels
50677      * the debounced `todoChanges` call delete models.todo;
50678      */
50679     function debounce(func, wait, options) {
50680       var args,
50681         maxTimeoutId,
50682         result,
50683         stamp,
50684         thisArg,
50685         timeoutId,
50686         trailingCall,
50687         lastCalled = 0,
50688         maxWait = false,
50689         trailing = true;
50690
50691       if (typeof func != 'function') {
50692         throw new TypeError(FUNC_ERROR_TEXT);
50693       }
50694       wait = wait < 0 ? 0 : (+wait || 0);
50695       if (options === true) {
50696         var leading = true;
50697         trailing = false;
50698       } else if (isObject(options)) {
50699         leading = !!options.leading;
50700         maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
50701         trailing = 'trailing' in options ? !!options.trailing : trailing;
50702       }
50703
50704       function cancel() {
50705         if (timeoutId) {
50706           clearTimeout(timeoutId);
50707         }
50708         if (maxTimeoutId) {
50709           clearTimeout(maxTimeoutId);
50710         }
50711         lastCalled = 0;
50712         maxTimeoutId = timeoutId = trailingCall = undefined;
50713       }
50714
50715       function complete(isCalled, id) {
50716         if (id) {
50717           clearTimeout(id);
50718         }
50719         maxTimeoutId = timeoutId = trailingCall = undefined;
50720         if (isCalled) {
50721           lastCalled = now();
50722           result = func.apply(thisArg, args);
50723           if (!timeoutId && !maxTimeoutId) {
50724             args = thisArg = undefined;
50725           }
50726         }
50727       }
50728
50729       function delayed() {
50730         var remaining = wait - (now() - stamp);
50731         if (remaining <= 0 || remaining > wait) {
50732           complete(trailingCall, maxTimeoutId);
50733         } else {
50734           timeoutId = setTimeout(delayed, remaining);
50735         }
50736       }
50737
50738       function maxDelayed() {
50739         complete(trailing, timeoutId);
50740       }
50741
50742       function debounced() {
50743         args = arguments;
50744         stamp = now();
50745         thisArg = this;
50746         trailingCall = trailing && (timeoutId || !leading);
50747
50748         if (maxWait === false) {
50749           var leadingCall = leading && !timeoutId;
50750         } else {
50751           if (!maxTimeoutId && !leading) {
50752             lastCalled = stamp;
50753           }
50754           var remaining = maxWait - (stamp - lastCalled),
50755             isCalled = remaining <= 0 || remaining > maxWait;
50756
50757           if (isCalled) {
50758             if (maxTimeoutId) {
50759               maxTimeoutId = clearTimeout(maxTimeoutId);
50760             }
50761             lastCalled = stamp;
50762             result = func.apply(thisArg, args);
50763           } else if (!maxTimeoutId) {
50764             maxTimeoutId = setTimeout(maxDelayed, remaining);
50765           }
50766         }
50767         if (isCalled && timeoutId) {
50768           timeoutId = clearTimeout(timeoutId);
50769         } else if (!timeoutId && wait !== maxWait) {
50770           timeoutId = setTimeout(delayed, wait);
50771         }
50772         if (leadingCall) {
50773           isCalled = true;
50774           result = func.apply(thisArg, args);
50775         }
50776         if (isCalled && !timeoutId && !maxTimeoutId) {
50777           args = thisArg = undefined;
50778         }
50779         return result;
50780       }
50781       debounced.cancel = cancel;
50782       return debounced;
50783     }
50784
50785     module.exports = debounce;
50786
50787   }, {
50788     "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
50789     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
50790   }],
50791   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js": [function(require, module, exports) {
50792     var baseDelay = require('../internal/baseDelay'),
50793       restParam = require('./restParam');
50794
50795     /**
50796      * Defers invoking the `func` until the current call stack has cleared. Any
50797      * additional arguments are provided to `func` when it's invoked.
50798      *
50799      * @static
50800      * @memberOf _
50801      * @category Function
50802      * @param {Function}
50803      *            func The function to defer.
50804      * @param {...*}
50805      *            [args] The arguments to invoke the function with.
50806      * @returns {number} Returns the timer id.
50807      * @example
50808      *
50809      * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
50810      * 'deferred' after one or more milliseconds
50811      */
50812     var defer = restParam(function(func, args) {
50813       return baseDelay(func, 1, args);
50814     });
50815
50816     module.exports = defer;
50817
50818   }, {
50819     "../internal/baseDelay": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js",
50820     "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50821   }],
50822   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js": [function(require, module, exports) {
50823     /** Used as the `TypeError` message for "Functions" methods. */
50824     var FUNC_ERROR_TEXT = 'Expected a function';
50825
50826     /*
50827      * Native method references for those with the same name as other `lodash`
50828      * methods.
50829      */
50830     var nativeMax = Math.max;
50831
50832     /**
50833      * Creates a function that invokes `func` with the `this` binding of the created
50834      * function and arguments from `start` and beyond provided as an array.
50835      *
50836      * **Note:** This method is based on the [rest
50837      * parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
50838      *
50839      * @static
50840      * @memberOf _
50841      * @category Function
50842      * @param {Function}
50843      *            func The function to apply a rest parameter to.
50844      * @param {number}
50845      *            [start=func.length-1] The start position of the rest parameter.
50846      * @returns {Function} Returns the new function.
50847      * @example
50848      *
50849      * var say = _.restParam(function(what, names) { return what + ' ' +
50850      * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
50851      * _.last(names); });
50852      *
50853      * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
50854      * pebbles'
50855      */
50856     function restParam(func, start) {
50857       if (typeof func != 'function') {
50858         throw new TypeError(FUNC_ERROR_TEXT);
50859       }
50860       start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
50861       return function() {
50862         var args = arguments,
50863           index = -1,
50864           length = nativeMax(args.length - start, 0),
50865           rest = Array(length);
50866
50867         while (++index < length) {
50868           rest[index] = args[start + index];
50869         }
50870         switch (start) {
50871           case 0:
50872             return func.call(this, rest);
50873           case 1:
50874             return func.call(this, args[0], rest);
50875           case 2:
50876             return func.call(this, args[0], args[1], rest);
50877         }
50878         var otherArgs = Array(start + 1);
50879         index = -1;
50880         while (++index < start) {
50881           otherArgs[index] = args[index];
50882         }
50883         otherArgs[start] = rest;
50884         return func.apply(this, otherArgs);
50885       };
50886     }
50887
50888     module.exports = restParam;
50889
50890   }, {}],
50891   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js": [function(require, module, exports) {
50892     (function(global) {
50893       /**
50894        * @license lodash 3.10.1 (Custom Build) <https://lodash.com/> Build: `lodash
50895        *          modern -d -o ./index.js` Copyright 2012-2015 The Dojo Foundation
50896        *          <http://dojofoundation.org/> Based on Underscore.js 1.8.3
50897        *          <http://underscorejs.org/LICENSE> Copyright 2009-2015 Jeremy
50898        *          Ashkenas, DocumentCloud and Investigative Reporters & Editors
50899        *          Available under MIT license <https://lodash.com/license>
50900        */
50901       ;
50902       (function() {
50903
50904         /** Used as a safe reference for `undefined` in pre-ES5 environments. */
50905         var undefined;
50906
50907         /** Used as the semantic version number. */
50908         var VERSION = '3.10.1';
50909
50910         /** Used to compose bitmasks for wrapper metadata. */
50911         var BIND_FLAG = 1,
50912           BIND_KEY_FLAG = 2,
50913           CURRY_BOUND_FLAG = 4,
50914           CURRY_FLAG = 8,
50915           CURRY_RIGHT_FLAG = 16,
50916           PARTIAL_FLAG = 32,
50917           PARTIAL_RIGHT_FLAG = 64,
50918           ARY_FLAG = 128,
50919           REARG_FLAG = 256;
50920
50921         /** Used as default options for `_.trunc`. */
50922         var DEFAULT_TRUNC_LENGTH = 30,
50923           DEFAULT_TRUNC_OMISSION = '...';
50924
50925         /** Used to detect when a function becomes hot. */
50926         var HOT_COUNT = 150,
50927           HOT_SPAN = 16;
50928
50929         /** Used as the size to enable large array optimizations. */
50930         var LARGE_ARRAY_SIZE = 200;
50931
50932         /** Used to indicate the type of lazy iteratees. */
50933         var LAZY_FILTER_FLAG = 1,
50934           LAZY_MAP_FLAG = 2;
50935
50936         /** Used as the `TypeError` message for "Functions" methods. */
50937         var FUNC_ERROR_TEXT = 'Expected a function';
50938
50939         /** Used as the internal argument placeholder. */
50940         var PLACEHOLDER = '__lodash_placeholder__';
50941
50942         /** `Object#toString` result references. */
50943         var argsTag = '[object Arguments]',
50944           arrayTag = '[object Array]',
50945           boolTag = '[object Boolean]',
50946           dateTag = '[object Date]',
50947           errorTag = '[object Error]',
50948           funcTag = '[object Function]',
50949           mapTag = '[object Map]',
50950           numberTag = '[object Number]',
50951           objectTag = '[object Object]',
50952           regexpTag = '[object RegExp]',
50953           setTag = '[object Set]',
50954           stringTag = '[object String]',
50955           weakMapTag = '[object WeakMap]';
50956
50957         var arrayBufferTag = '[object ArrayBuffer]',
50958           float32Tag = '[object Float32Array]',
50959           float64Tag = '[object Float64Array]',
50960           int8Tag = '[object Int8Array]',
50961           int16Tag = '[object Int16Array]',
50962           int32Tag = '[object Int32Array]',
50963           uint8Tag = '[object Uint8Array]',
50964           uint8ClampedTag = '[object Uint8ClampedArray]',
50965           uint16Tag = '[object Uint16Array]',
50966           uint32Tag = '[object Uint32Array]';
50967
50968         /** Used to match empty string literals in compiled template source. */
50969         var reEmptyStringLeading = /\b__p \+= '';/g,
50970           reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
50971           reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
50972
50973         /** Used to match HTML entities and HTML characters. */
50974         var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
50975           reUnescapedHtml = /[&<>"'`]/g,
50976           reHasEscapedHtml = RegExp(reEscapedHtml.source),
50977           reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
50978
50979         /** Used to match template delimiters. */
50980         var reEscape = /<%-([\s\S]+?)%>/g,
50981           reEvaluate = /<%([\s\S]+?)%>/g,
50982           reInterpolate = /<%=([\s\S]+?)%>/g;
50983
50984         /** Used to match property names within property paths. */
50985         var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
50986           reIsPlainProp = /^\w*$/,
50987           rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
50988
50989         /**
50990          * Used to match `RegExp` [syntax
50991          * characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) and
50992          * those outlined by
50993          * [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
50994          */
50995         var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
50996           reHasRegExpChars = RegExp(reRegExpChars.source);
50997
50998         /**
50999          * Used to match [combining diacritical
51000          * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
51001          */
51002         var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
51003
51004         /** Used to match backslashes in property paths. */
51005         var reEscapeChar = /\\(\\)?/g;
51006
51007         /**
51008          * Used to match [ES template
51009          * delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
51010          */
51011         var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
51012
51013         /** Used to match `RegExp` flags from their coerced string values. */
51014         var reFlags = /\w*$/;
51015
51016         /** Used to detect hexadecimal string values. */
51017         var reHasHexPrefix = /^0[xX]/;
51018
51019         /** Used to detect host constructors (Safari > 5). */
51020         var reIsHostCtor = /^\[object .+?Constructor\]$/;
51021
51022         /** Used to detect unsigned integer values. */
51023         var reIsUint = /^\d+$/;
51024
51025         /**
51026          * Used to match latin-1 supplementary letters (excluding mathematical
51027          * operators).
51028          */
51029         var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
51030
51031         /** Used to ensure capturing order of template delimiters. */
51032         var reNoMatch = /($^)/;
51033
51034         /** Used to match unescaped characters in compiled string literals. */
51035         var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
51036
51037         /** Used to match words to create compound words. */
51038         var reWords = (function() {
51039           var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
51040             lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
51041
51042           return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
51043         }());
51044
51045         /** Used to assign default `context` object properties. */
51046         var contextProps = [
51047           'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
51048           'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
51049           'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
51050           'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
51051           'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
51052         ];
51053
51054         /** Used to make template sourceURLs easier to identify. */
51055         var templateCounter = -1;
51056
51057         /** Used to identify `toStringTag` values of typed arrays. */
51058         var typedArrayTags = {};
51059         typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
51060           typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
51061           typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
51062           typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
51063           typedArrayTags[uint32Tag] = true;
51064         typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
51065           typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
51066           typedArrayTags[dateTag] = typedArrayTags[errorTag] =
51067           typedArrayTags[funcTag] = typedArrayTags[mapTag] =
51068           typedArrayTags[numberTag] = typedArrayTags[objectTag] =
51069           typedArrayTags[regexpTag] = typedArrayTags[setTag] =
51070           typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
51071
51072         /** Used to identify `toStringTag` values supported by `_.clone`. */
51073         var cloneableTags = {};
51074         cloneableTags[argsTag] = cloneableTags[arrayTag] =
51075           cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
51076           cloneableTags[dateTag] = cloneableTags[float32Tag] =
51077           cloneableTags[float64Tag] = cloneableTags[int8Tag] =
51078           cloneableTags[int16Tag] = cloneableTags[int32Tag] =
51079           cloneableTags[numberTag] = cloneableTags[objectTag] =
51080           cloneableTags[regexpTag] = cloneableTags[stringTag] =
51081           cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
51082           cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
51083         cloneableTags[errorTag] = cloneableTags[funcTag] =
51084           cloneableTags[mapTag] = cloneableTags[setTag] =
51085           cloneableTags[weakMapTag] = false;
51086
51087         /** Used to map latin-1 supplementary letters to basic latin letters. */
51088         var deburredLetters = {
51089           '\xc0': 'A',
51090           '\xc1': 'A',
51091           '\xc2': 'A',
51092           '\xc3': 'A',
51093           '\xc4': 'A',
51094           '\xc5': 'A',
51095           '\xe0': 'a',
51096           '\xe1': 'a',
51097           '\xe2': 'a',
51098           '\xe3': 'a',
51099           '\xe4': 'a',
51100           '\xe5': 'a',
51101           '\xc7': 'C',
51102           '\xe7': 'c',
51103           '\xd0': 'D',
51104           '\xf0': 'd',
51105           '\xc8': 'E',
51106           '\xc9': 'E',
51107           '\xca': 'E',
51108           '\xcb': 'E',
51109           '\xe8': 'e',
51110           '\xe9': 'e',
51111           '\xea': 'e',
51112           '\xeb': 'e',
51113           '\xcC': 'I',
51114           '\xcd': 'I',
51115           '\xce': 'I',
51116           '\xcf': 'I',
51117           '\xeC': 'i',
51118           '\xed': 'i',
51119           '\xee': 'i',
51120           '\xef': 'i',
51121           '\xd1': 'N',
51122           '\xf1': 'n',
51123           '\xd2': 'O',
51124           '\xd3': 'O',
51125           '\xd4': 'O',
51126           '\xd5': 'O',
51127           '\xd6': 'O',
51128           '\xd8': 'O',
51129           '\xf2': 'o',
51130           '\xf3': 'o',
51131           '\xf4': 'o',
51132           '\xf5': 'o',
51133           '\xf6': 'o',
51134           '\xf8': 'o',
51135           '\xd9': 'U',
51136           '\xda': 'U',
51137           '\xdb': 'U',
51138           '\xdc': 'U',
51139           '\xf9': 'u',
51140           '\xfa': 'u',
51141           '\xfb': 'u',
51142           '\xfc': 'u',
51143           '\xdd': 'Y',
51144           '\xfd': 'y',
51145           '\xff': 'y',
51146           '\xc6': 'Ae',
51147           '\xe6': 'ae',
51148           '\xde': 'Th',
51149           '\xfe': 'th',
51150           '\xdf': 'ss'
51151         };
51152
51153         /** Used to map characters to HTML entities. */
51154         var htmlEscapes = {
51155           '&': '&amp;',
51156           '<': '&lt;',
51157           '>': '&gt;',
51158           '"': '&quot;',
51159           "'": '&#39;',
51160           '`': '&#96;'
51161         };
51162
51163         /** Used to map HTML entities to characters. */
51164         var htmlUnescapes = {
51165           '&amp;': '&',
51166           '&lt;': '<',
51167           '&gt;': '>',
51168           '&quot;': '"',
51169           '&#39;': "'",
51170           '&#96;': '`'
51171         };
51172
51173         /** Used to determine if values are of the language type `Object`. */
51174         var objectTypes = {
51175           'function': true,
51176           'object': true
51177         };
51178
51179         /** Used to escape characters for inclusion in compiled regexes. */
51180         var regexpEscapes = {
51181           '0': 'x30',
51182           '1': 'x31',
51183           '2': 'x32',
51184           '3': 'x33',
51185           '4': 'x34',
51186           '5': 'x35',
51187           '6': 'x36',
51188           '7': 'x37',
51189           '8': 'x38',
51190           '9': 'x39',
51191           'A': 'x41',
51192           'B': 'x42',
51193           'C': 'x43',
51194           'D': 'x44',
51195           'E': 'x45',
51196           'F': 'x46',
51197           'a': 'x61',
51198           'b': 'x62',
51199           'c': 'x63',
51200           'd': 'x64',
51201           'e': 'x65',
51202           'f': 'x66',
51203           'n': 'x6e',
51204           'r': 'x72',
51205           't': 'x74',
51206           'u': 'x75',
51207           'v': 'x76',
51208           'x': 'x78'
51209         };
51210
51211         /** Used to escape characters for inclusion in compiled string literals. */
51212         var stringEscapes = {
51213           '\\': '\\',
51214           "'": "'",
51215           '\n': 'n',
51216           '\r': 'r',
51217           '\u2028': 'u2028',
51218           '\u2029': 'u2029'
51219         };
51220
51221         /** Detect free variable `exports`. */
51222         var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
51223
51224         /** Detect free variable `module`. */
51225         var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
51226
51227         /** Detect free variable `global` from Node.js. */
51228         var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
51229
51230         /** Detect free variable `self`. */
51231         var freeSelf = objectTypes[typeof self] && self && self.Object && self;
51232
51233         /** Detect free variable `window`. */
51234         var freeWindow = objectTypes[typeof window] && window && window.Object && window;
51235
51236         /** Detect the popular CommonJS extension `module.exports`. */
51237         var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
51238
51239         /**
51240          * Used as a reference to the global object.
51241          *
51242          * The `this` value is used if it's the global object to avoid
51243          * Greasemonkey's restricted `window` object, otherwise the `window` object
51244          * is used.
51245          */
51246         var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
51247
51248         /*--------------------------------------------------------------------------*/
51249
51250         /**
51251          * The base implementation of `compareAscending` which compares values and
51252          * sorts them in ascending order without guaranteeing a stable sort.
51253          *
51254          * @private
51255          * @param {*}
51256          *            value The value to compare.
51257          * @param {*}
51258          *            other The other value to compare.
51259          * @returns {number} Returns the sort order indicator for `value`.
51260          */
51261         function baseCompareAscending(value, other) {
51262           if (value !== other) {
51263             var valIsNull = value === null,
51264               valIsUndef = value === undefined,
51265               valIsReflexive = value === value;
51266
51267             var othIsNull = other === null,
51268               othIsUndef = other === undefined,
51269               othIsReflexive = other === other;
51270
51271             if ((value > other && !othIsNull) || !valIsReflexive ||
51272               (valIsNull && !othIsUndef && othIsReflexive) ||
51273               (valIsUndef && othIsReflexive)) {
51274               return 1;
51275             }
51276             if ((value < other && !valIsNull) || !othIsReflexive ||
51277               (othIsNull && !valIsUndef && valIsReflexive) ||
51278               (othIsUndef && valIsReflexive)) {
51279               return -1;
51280             }
51281           }
51282           return 0;
51283         }
51284
51285         /**
51286          * The base implementation of `_.findIndex` and `_.findLastIndex` without
51287          * support for callback shorthands and `this` binding.
51288          *
51289          * @private
51290          * @param {Array}
51291          *            array The array to search.
51292          * @param {Function}
51293          *            predicate The function invoked per iteration.
51294          * @param {boolean}
51295          *            [fromRight] Specify iterating from right to left.
51296          * @returns {number} Returns the index of the matched value, else `-1`.
51297          */
51298         function baseFindIndex(array, predicate, fromRight) {
51299           var length = array.length,
51300             index = fromRight ? length : -1;
51301
51302           while ((fromRight ? index-- : ++index < length)) {
51303             if (predicate(array[index], index, array)) {
51304               return index;
51305             }
51306           }
51307           return -1;
51308         }
51309
51310         /**
51311          * The base implementation of `_.indexOf` without support for binary
51312          * searches.
51313          *
51314          * @private
51315          * @param {Array}
51316          *            array The array to search.
51317          * @param {*}
51318          *            value The value to search for.
51319          * @param {number}
51320          *            fromIndex The index to search from.
51321          * @returns {number} Returns the index of the matched value, else `-1`.
51322          */
51323         function baseIndexOf(array, value, fromIndex) {
51324           if (value !== value) {
51325             return indexOfNaN(array, fromIndex);
51326           }
51327           var index = fromIndex - 1,
51328             length = array.length;
51329
51330           while (++index < length) {
51331             if (array[index] === value) {
51332               return index;
51333             }
51334           }
51335           return -1;
51336         }
51337
51338         /**
51339          * The base implementation of `_.isFunction` without support for
51340          * environments with incorrect `typeof` results.
51341          *
51342          * @private
51343          * @param {*}
51344          *            value The value to check.
51345          * @returns {boolean} Returns `true` if `value` is correctly classified,
51346          *          else `false`.
51347          */
51348         function baseIsFunction(value) {
51349           // Avoid a Chakra JIT bug in compatibility modes of IE 11.
51350           // See https://github.com/jashkenas/underscore/issues/1621 for more details.
51351           return typeof value == 'function' || false;
51352         }
51353
51354         /**
51355          * Converts `value` to a string if it's not one. An empty string is returned
51356          * for `null` or `undefined` values.
51357          *
51358          * @private
51359          * @param {*}
51360          *            value The value to process.
51361          * @returns {string} Returns the string.
51362          */
51363         function baseToString(value) {
51364           return value == null ? '' : (value + '');
51365         }
51366
51367         /**
51368          * Used by `_.trim` and `_.trimLeft` to get the index of the first character
51369          * of `string` that is not found in `chars`.
51370          *
51371          * @private
51372          * @param {string}
51373          *            string The string to inspect.
51374          * @param {string}
51375          *            chars The characters to find.
51376          * @returns {number} Returns the index of the first character not found in
51377          *          `chars`.
51378          */
51379         function charsLeftIndex(string, chars) {
51380           var index = -1,
51381             length = string.length;
51382
51383           while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
51384           return index;
51385         }
51386
51387         /**
51388          * Used by `_.trim` and `_.trimRight` to get the index of the last character
51389          * of `string` that is not found in `chars`.
51390          *
51391          * @private
51392          * @param {string}
51393          *            string The string to inspect.
51394          * @param {string}
51395          *            chars The characters to find.
51396          * @returns {number} Returns the index of the last character not found in
51397          *          `chars`.
51398          */
51399         function charsRightIndex(string, chars) {
51400           var index = string.length;
51401
51402           while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
51403           return index;
51404         }
51405
51406         /**
51407          * Used by `_.sortBy` to compare transformed elements of a collection and
51408          * stable sort them in ascending order.
51409          *
51410          * @private
51411          * @param {Object}
51412          *            object The object to compare.
51413          * @param {Object}
51414          *            other The other object to compare.
51415          * @returns {number} Returns the sort order indicator for `object`.
51416          */
51417         function compareAscending(object, other) {
51418           return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
51419         }
51420
51421         /**
51422          * Used by `_.sortByOrder` to compare multiple properties of a value to
51423          * another and stable sort them.
51424          *
51425          * If `orders` is unspecified, all valuess are sorted in ascending order.
51426          * Otherwise, a value is sorted in ascending order if its corresponding
51427          * order is "asc", and descending if "desc".
51428          *
51429          * @private
51430          * @param {Object}
51431          *            object The object to compare.
51432          * @param {Object}
51433          *            other The other object to compare.
51434          * @param {boolean[]}
51435          *            orders The order to sort by for each property.
51436          * @returns {number} Returns the sort order indicator for `object`.
51437          */
51438         function compareMultiple(object, other, orders) {
51439           var index = -1,
51440             objCriteria = object.criteria,
51441             othCriteria = other.criteria,
51442             length = objCriteria.length,
51443             ordersLength = orders.length;
51444
51445           while (++index < length) {
51446             var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
51447             if (result) {
51448               if (index >= ordersLength) {
51449                 return result;
51450               }
51451               var order = orders[index];
51452               return result * ((order === 'asc' || order === true) ? 1 : -1);
51453             }
51454           }
51455           // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
51456           // that causes it, under certain circumstances, to provide the same value
51457           // for
51458           // `object` and `other`. See
51459           // https://github.com/jashkenas/underscore/pull/1247
51460           // for more details.
51461           //
51462           // This also ensures a stable sort in V8 and other engines.
51463           // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
51464           return object.index - other.index;
51465         }
51466
51467         /**
51468          * Used by `_.deburr` to convert latin-1 supplementary letters to basic
51469          * latin letters.
51470          *
51471          * @private
51472          * @param {string}
51473          *            letter The matched letter to deburr.
51474          * @returns {string} Returns the deburred letter.
51475          */
51476         function deburrLetter(letter) {
51477           return deburredLetters[letter];
51478         }
51479
51480         /**
51481          * Used by `_.escape` to convert characters to HTML entities.
51482          *
51483          * @private
51484          * @param {string}
51485          *            chr The matched character to escape.
51486          * @returns {string} Returns the escaped character.
51487          */
51488         function escapeHtmlChar(chr) {
51489           return htmlEscapes[chr];
51490         }
51491
51492         /**
51493          * Used by `_.escapeRegExp` to escape characters for inclusion in compiled
51494          * regexes.
51495          *
51496          * @private
51497          * @param {string}
51498          *            chr The matched character to escape.
51499          * @param {string}
51500          *            leadingChar The capture group for a leading character.
51501          * @param {string}
51502          *            whitespaceChar The capture group for a whitespace character.
51503          * @returns {string} Returns the escaped character.
51504          */
51505         function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
51506           if (leadingChar) {
51507             chr = regexpEscapes[chr];
51508           } else if (whitespaceChar) {
51509             chr = stringEscapes[chr];
51510           }
51511           return '\\' + chr;
51512         }
51513
51514         /**
51515          * Used by `_.template` to escape characters for inclusion in compiled
51516          * string literals.
51517          *
51518          * @private
51519          * @param {string}
51520          *            chr The matched character to escape.
51521          * @returns {string} Returns the escaped character.
51522          */
51523         function escapeStringChar(chr) {
51524           return '\\' + stringEscapes[chr];
51525         }
51526
51527         /**
51528          * Gets the index at which the first occurrence of `NaN` is found in
51529          * `array`.
51530          *
51531          * @private
51532          * @param {Array}
51533          *            array The array to search.
51534          * @param {number}
51535          *            fromIndex The index to search from.
51536          * @param {boolean}
51537          *            [fromRight] Specify iterating from right to left.
51538          * @returns {number} Returns the index of the matched `NaN`, else `-1`.
51539          */
51540         function indexOfNaN(array, fromIndex, fromRight) {
51541           var length = array.length,
51542             index = fromIndex + (fromRight ? 0 : -1);
51543
51544           while ((fromRight ? index-- : ++index < length)) {
51545             var other = array[index];
51546             if (other !== other) {
51547               return index;
51548             }
51549           }
51550           return -1;
51551         }
51552
51553         /**
51554          * Checks if `value` is object-like.
51555          *
51556          * @private
51557          * @param {*}
51558          *            value The value to check.
51559          * @returns {boolean} Returns `true` if `value` is object-like, else
51560          *          `false`.
51561          */
51562         function isObjectLike(value) {
51563           return !!value && typeof value == 'object';
51564         }
51565
51566         /**
51567          * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
51568          * character code is whitespace.
51569          *
51570          * @private
51571          * @param {number}
51572          *            charCode The character code to inspect.
51573          * @returns {boolean} Returns `true` if `charCode` is whitespace, else
51574          *          `false`.
51575          */
51576         function isSpace(charCode) {
51577           return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
51578             (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
51579         }
51580
51581         /**
51582          * Replaces all `placeholder` elements in `array` with an internal
51583          * placeholder and returns an array of their indexes.
51584          *
51585          * @private
51586          * @param {Array}
51587          *            array The array to modify.
51588          * @param {*}
51589          *            placeholder The placeholder to replace.
51590          * @returns {Array} Returns the new array of placeholder indexes.
51591          */
51592         function replaceHolders(array, placeholder) {
51593           var index = -1,
51594             length = array.length,
51595             resIndex = -1,
51596             result = [];
51597
51598           while (++index < length) {
51599             if (array[index] === placeholder) {
51600               array[index] = PLACEHOLDER;
51601               result[++resIndex] = index;
51602             }
51603           }
51604           return result;
51605         }
51606
51607         /**
51608          * An implementation of `_.uniq` optimized for sorted arrays without support
51609          * for callback shorthands and `this` binding.
51610          *
51611          * @private
51612          * @param {Array}
51613          *            array The array to inspect.
51614          * @param {Function}
51615          *            [iteratee] The function invoked per iteration.
51616          * @returns {Array} Returns the new duplicate-value-free array.
51617          */
51618         function sortedUniq(array, iteratee) {
51619           var seen,
51620             index = -1,
51621             length = array.length,
51622             resIndex = -1,
51623             result = [];
51624
51625           while (++index < length) {
51626             var value = array[index],
51627               computed = iteratee ? iteratee(value, index, array) : value;
51628
51629             if (!index || seen !== computed) {
51630               seen = computed;
51631               result[++resIndex] = value;
51632             }
51633           }
51634           return result;
51635         }
51636
51637         /**
51638          * Used by `_.trim` and `_.trimLeft` to get the index of the first
51639          * non-whitespace character of `string`.
51640          *
51641          * @private
51642          * @param {string}
51643          *            string The string to inspect.
51644          * @returns {number} Returns the index of the first non-whitespace
51645          *          character.
51646          */
51647         function trimmedLeftIndex(string) {
51648           var index = -1,
51649             length = string.length;
51650
51651           while (++index < length && isSpace(string.charCodeAt(index))) {}
51652           return index;
51653         }
51654
51655         /**
51656          * Used by `_.trim` and `_.trimRight` to get the index of the last
51657          * non-whitespace character of `string`.
51658          *
51659          * @private
51660          * @param {string}
51661          *            string The string to inspect.
51662          * @returns {number} Returns the index of the last non-whitespace character.
51663          */
51664         function trimmedRightIndex(string) {
51665           var index = string.length;
51666
51667           while (index-- && isSpace(string.charCodeAt(index))) {}
51668           return index;
51669         }
51670
51671         /**
51672          * Used by `_.unescape` to convert HTML entities to characters.
51673          *
51674          * @private
51675          * @param {string}
51676          *            chr The matched character to unescape.
51677          * @returns {string} Returns the unescaped character.
51678          */
51679         function unescapeHtmlChar(chr) {
51680           return htmlUnescapes[chr];
51681         }
51682
51683         /*--------------------------------------------------------------------------*/
51684
51685         /**
51686          * Create a new pristine `lodash` function using the given `context` object.
51687          *
51688          * @static
51689          * @memberOf _
51690          * @category Utility
51691          * @param {Object}
51692          *            [context=root] The context object.
51693          * @returns {Function} Returns a new `lodash` function.
51694          * @example
51695          *
51696          * _.mixin({ 'foo': _.constant('foo') });
51697          *
51698          * var lodash = _.runInContext(); lodash.mixin({ 'bar':
51699          * lodash.constant('bar') });
51700          *
51701          * _.isFunction(_.foo); // => true _.isFunction(_.bar); // => false
51702          *
51703          * lodash.isFunction(lodash.foo); // => false lodash.isFunction(lodash.bar); // =>
51704          * true
51705          *  // using `context` to mock `Date#getTime` use in `_.now` var mock =
51706          * _.runInContext({ 'Date': function() { return { 'getTime': getTimeMock }; }
51707          * });
51708          *  // or creating a suped-up `defer` in Node.js var defer =
51709          * _.runInContext({ 'setTimeout': setImmediate }).defer;
51710          */
51711         function runInContext(context) {
51712           // Avoid issues with some ES3 environments that attempt to use values, named
51713           // after built-in constructors like `Object`, for the creation of literals.
51714           // ES5 clears this up by stating that literals must use built-in
51715           // constructors.
51716           // See https://es5.github.io/#x11.1.5 for more details.
51717           context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
51718
51719           /** Native constructor references. */
51720           var Array = context.Array,
51721             Date = context.Date,
51722             Error = context.Error,
51723             Function = context.Function,
51724             Math = context.Math,
51725             Number = context.Number,
51726             Object = context.Object,
51727             RegExp = context.RegExp,
51728             String = context.String,
51729             TypeError = context.TypeError;
51730
51731           /** Used for native method references. */
51732           var arrayProto = Array.prototype,
51733             objectProto = Object.prototype,
51734             stringProto = String.prototype;
51735
51736           /** Used to resolve the decompiled source of functions. */
51737           var fnToString = Function.prototype.toString;
51738
51739           /** Used to check objects for own properties. */
51740           var hasOwnProperty = objectProto.hasOwnProperty;
51741
51742           /** Used to generate unique IDs. */
51743           var idCounter = 0;
51744
51745           /**
51746            * Used to resolve the
51747            * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
51748            * of values.
51749            */
51750           var objToString = objectProto.toString;
51751
51752           /** Used to restore the original `_` reference in `_.noConflict`. */
51753           var oldDash = root._;
51754
51755           /** Used to detect if a method is native. */
51756           var reIsNative = RegExp('^' +
51757             fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
51758             .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
51759           );
51760
51761           /** Native method references. */
51762           var ArrayBuffer = context.ArrayBuffer,
51763             clearTimeout = context.clearTimeout,
51764             parseFloat = context.parseFloat,
51765             pow = Math.pow,
51766             propertyIsEnumerable = objectProto.propertyIsEnumerable,
51767             Set = getNative(context, 'Set'),
51768             setTimeout = context.setTimeout,
51769             splice = arrayProto.splice,
51770             Uint8Array = context.Uint8Array,
51771             WeakMap = getNative(context, 'WeakMap');
51772
51773           /*
51774            * Native method references for those with the same name as other `lodash`
51775            * methods.
51776            */
51777           var nativeCeil = Math.ceil,
51778             nativeCreate = getNative(Object, 'create'),
51779             nativeFloor = Math.floor,
51780             nativeIsArray = getNative(Array, 'isArray'),
51781             nativeIsFinite = context.isFinite,
51782             nativeKeys = getNative(Object, 'keys'),
51783             nativeMax = Math.max,
51784             nativeMin = Math.min,
51785             nativeNow = getNative(Date, 'now'),
51786             nativeParseInt = context.parseInt,
51787             nativeRandom = Math.random;
51788
51789           /** Used as references for `-Infinity` and `Infinity`. */
51790           var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
51791             POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
51792
51793           /** Used as references for the maximum length and index of an array. */
51794           var MAX_ARRAY_LENGTH = 4294967295,
51795             MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
51796             HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
51797
51798           /**
51799            * Used as the [maximum
51800            * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
51801            * of an array-like value.
51802            */
51803           var MAX_SAFE_INTEGER = 9007199254740991;
51804
51805           /** Used to store function metadata. */
51806           var metaMap = WeakMap && new WeakMap;
51807
51808           /** Used to lookup unminified function names. */
51809           var realNames = {};
51810
51811           /*------------------------------------------------------------------------*/
51812
51813           /**
51814            * Creates a `lodash` object which wraps `value` to enable implicit
51815            * chaining. Methods that operate on and return arrays, collections, and
51816            * functions can be chained together. Methods that retrieve a single value
51817            * or may return a primitive value will automatically end the chain
51818            * returning the unwrapped value. Explicit chaining may be enabled using
51819            * `_.chain`. The execution of chained methods is lazy, that is, execution
51820            * is deferred until `_#value` is implicitly or explicitly called.
51821            *
51822            * Lazy evaluation allows several methods to support shortcut fusion.
51823            * Shortcut fusion is an optimization strategy which merge iteratee calls;
51824            * this can help to avoid the creation of intermediate data structures and
51825            * greatly reduce the number of iteratee executions.
51826            *
51827            * Chaining is supported in custom builds as long as the `_#value` method is
51828            * directly or indirectly included in the build.
51829            *
51830            * In addition to lodash methods, wrappers have `Array` and `String`
51831            * methods.
51832            *
51833            * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`,
51834            * `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift`
51835            *
51836            * The wrapper `String` methods are: `replace` and `split`
51837            *
51838            * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
51839            * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
51840            * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
51841            * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
51842            *
51843            * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`,
51844            * `before`, `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`,
51845            * `commit`, `compact`, `concat`, `constant`, `countBy`, `create`, `curry`,
51846            * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
51847            * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`,
51848            * `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`,
51849            * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`,
51850            * `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
51851            * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
51852            * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `modArgs`, `negate`,
51853            * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`,
51854            * `plant`, `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`,
51855            * `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, `reverse`,
51856            * `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`,
51857            * `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`,
51858            * `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
51859            * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
51860            * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`,
51861            * `zipWith`
51862            *
51863            * The wrapper methods that are **not** chainable by default are: `add`,
51864            * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
51865            * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`,
51866            * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`,
51867            * `findWhere`, `first`, `floor`, `get`, `gt`, `gte`, `has`, `identity`,
51868            * `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`, `isBoolean`,
51869            * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
51870            * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
51871            * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
51872            * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
51873            * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
51874            * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
51875            * `round`, `runInContext`, `shift`, `size`, `snakeCase`, `some`,
51876            * `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`, `sum`,
51877            * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
51878            * `uniqueId`, `value`, and `words`
51879            *
51880            * The wrapper method `sample` will return a wrapped value when `n` is
51881            * provided, otherwise an unwrapped value is returned.
51882            *
51883            * @name _
51884            * @constructor
51885            * @category Chain
51886            * @param {*}
51887            *            value The value to wrap in a `lodash` instance.
51888            * @returns {Object} Returns the new `lodash` wrapper instance.
51889            * @example
51890            *
51891            * var wrapped = _([1, 2, 3]);
51892            *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
51893            * total + n; }); // => 6
51894            *  // returns a wrapped value var squares = wrapped.map(function(n) {
51895            * return n * n; });
51896            *
51897            * _.isArray(squares); // => false
51898            *
51899            * _.isArray(squares.value()); // => true
51900            */
51901           function lodash(value) {
51902             if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
51903               if (value instanceof LodashWrapper) {
51904                 return value;
51905               }
51906               if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
51907                 return wrapperClone(value);
51908               }
51909             }
51910             return new LodashWrapper(value);
51911           }
51912
51913           /**
51914            * The function whose prototype all chaining wrappers inherit from.
51915            *
51916            * @private
51917            */
51918           function baseLodash() {
51919             // No operation performed.
51920           }
51921
51922           /**
51923            * The base constructor for creating `lodash` wrapper objects.
51924            *
51925            * @private
51926            * @param {*}
51927            *            value The value to wrap.
51928            * @param {boolean}
51929            *            [chainAll] Enable chaining for all wrapper methods.
51930            * @param {Array}
51931            *            [actions=[]] Actions to peform to resolve the unwrapped value.
51932            */
51933           function LodashWrapper(value, chainAll, actions) {
51934             this.__wrapped__ = value;
51935             this.__actions__ = actions || [];
51936             this.__chain__ = !!chainAll;
51937           }
51938
51939           /**
51940            * An object environment feature flags.
51941            *
51942            * @static
51943            * @memberOf _
51944            * @type Object
51945            */
51946           var support = lodash.support = {};
51947
51948           /**
51949            * By default, the template delimiters used by lodash are like those in
51950            * embedded Ruby (ERB). Change the following template settings to use
51951            * alternative delimiters.
51952            *
51953            * @static
51954            * @memberOf _
51955            * @type Object
51956            */
51957           lodash.templateSettings = {
51958
51959             /**
51960              * Used to detect `data` property values to be HTML-escaped.
51961              *
51962              * @memberOf _.templateSettings
51963              * @type RegExp
51964              */
51965             'escape': reEscape,
51966
51967             /**
51968              * Used to detect code to be evaluated.
51969              *
51970              * @memberOf _.templateSettings
51971              * @type RegExp
51972              */
51973             'evaluate': reEvaluate,
51974
51975             /**
51976              * Used to detect `data` property values to inject.
51977              *
51978              * @memberOf _.templateSettings
51979              * @type RegExp
51980              */
51981             'interpolate': reInterpolate,
51982
51983             /**
51984              * Used to reference the data object in the template text.
51985              *
51986              * @memberOf _.templateSettings
51987              * @type string
51988              */
51989             'variable': '',
51990
51991             /**
51992              * Used to import variables into the compiled template.
51993              *
51994              * @memberOf _.templateSettings
51995              * @type Object
51996              */
51997             'imports': {
51998
51999               /**
52000                * A reference to the `lodash` function.
52001                *
52002                * @memberOf _.templateSettings.imports
52003                * @type Function
52004                */
52005               '_': lodash
52006             }
52007           };
52008
52009           /*------------------------------------------------------------------------*/
52010
52011           /**
52012            * Creates a lazy wrapper object which wraps `value` to enable lazy
52013            * evaluation.
52014            *
52015            * @private
52016            * @param {*}
52017            *            value The value to wrap.
52018            */
52019           function LazyWrapper(value) {
52020             this.__wrapped__ = value;
52021             this.__actions__ = [];
52022             this.__dir__ = 1;
52023             this.__filtered__ = false;
52024             this.__iteratees__ = [];
52025             this.__takeCount__ = POSITIVE_INFINITY;
52026             this.__views__ = [];
52027           }
52028
52029           /**
52030            * Creates a clone of the lazy wrapper object.
52031            *
52032            * @private
52033            * @name clone
52034            * @memberOf LazyWrapper
52035            * @returns {Object} Returns the cloned `LazyWrapper` object.
52036            */
52037           function lazyClone() {
52038             var result = new LazyWrapper(this.__wrapped__);
52039             result.__actions__ = arrayCopy(this.__actions__);
52040             result.__dir__ = this.__dir__;
52041             result.__filtered__ = this.__filtered__;
52042             result.__iteratees__ = arrayCopy(this.__iteratees__);
52043             result.__takeCount__ = this.__takeCount__;
52044             result.__views__ = arrayCopy(this.__views__);
52045             return result;
52046           }
52047
52048           /**
52049            * Reverses the direction of lazy iteration.
52050            *
52051            * @private
52052            * @name reverse
52053            * @memberOf LazyWrapper
52054            * @returns {Object} Returns the new reversed `LazyWrapper` object.
52055            */
52056           function lazyReverse() {
52057             if (this.__filtered__) {
52058               var result = new LazyWrapper(this);
52059               result.__dir__ = -1;
52060               result.__filtered__ = true;
52061             } else {
52062               result = this.clone();
52063               result.__dir__ *= -1;
52064             }
52065             return result;
52066           }
52067
52068           /**
52069            * Extracts the unwrapped value from its lazy wrapper.
52070            *
52071            * @private
52072            * @name value
52073            * @memberOf LazyWrapper
52074            * @returns {*} Returns the unwrapped value.
52075            */
52076           function lazyValue() {
52077             var array = this.__wrapped__.value(),
52078               dir = this.__dir__,
52079               isArr = isArray(array),
52080               isRight = dir < 0,
52081               arrLength = isArr ? array.length : 0,
52082               view = getView(0, arrLength, this.__views__),
52083               start = view.start,
52084               end = view.end,
52085               length = end - start,
52086               index = isRight ? end : (start - 1),
52087               iteratees = this.__iteratees__,
52088               iterLength = iteratees.length,
52089               resIndex = 0,
52090               takeCount = nativeMin(length, this.__takeCount__);
52091
52092             if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
52093               return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
52094             }
52095             var result = [];
52096
52097             outer:
52098               while (length-- && resIndex < takeCount) {
52099                 index += dir;
52100
52101                 var iterIndex = -1,
52102                   value = array[index];
52103
52104                 while (++iterIndex < iterLength) {
52105                   var data = iteratees[iterIndex],
52106                     iteratee = data.iteratee,
52107                     type = data.type,
52108                     computed = iteratee(value);
52109
52110                   if (type == LAZY_MAP_FLAG) {
52111                     value = computed;
52112                   } else if (!computed) {
52113                     if (type == LAZY_FILTER_FLAG) {
52114                       continue outer;
52115                     } else {
52116                       break outer;
52117                     }
52118                   }
52119                 }
52120                 result[resIndex++] = value;
52121               }
52122             return result;
52123           }
52124
52125           /*------------------------------------------------------------------------*/
52126
52127           /**
52128            * Creates a cache object to store key/value pairs.
52129            *
52130            * @private
52131            * @static
52132            * @name Cache
52133            * @memberOf _.memoize
52134            */
52135           function MapCache() {
52136             this.__data__ = {};
52137           }
52138
52139           /**
52140            * Removes `key` and its value from the cache.
52141            *
52142            * @private
52143            * @name delete
52144            * @memberOf _.memoize.Cache
52145            * @param {string}
52146            *            key The key of the value to remove.
52147            * @returns {boolean} Returns `true` if the entry was removed successfully,
52148            *          else `false`.
52149            */
52150           function mapDelete(key) {
52151             return this.has(key) && delete this.__data__[key];
52152           }
52153
52154           /**
52155            * Gets the cached value for `key`.
52156            *
52157            * @private
52158            * @name get
52159            * @memberOf _.memoize.Cache
52160            * @param {string}
52161            *            key The key of the value to get.
52162            * @returns {*} Returns the cached value.
52163            */
52164           function mapGet(key) {
52165             return key == '__proto__' ? undefined : this.__data__[key];
52166           }
52167
52168           /**
52169            * Checks if a cached value for `key` exists.
52170            *
52171            * @private
52172            * @name has
52173            * @memberOf _.memoize.Cache
52174            * @param {string}
52175            *            key The key of the entry to check.
52176            * @returns {boolean} Returns `true` if an entry for `key` exists, else
52177            *          `false`.
52178            */
52179           function mapHas(key) {
52180             return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
52181           }
52182
52183           /**
52184            * Sets `value` to `key` of the cache.
52185            *
52186            * @private
52187            * @name set
52188            * @memberOf _.memoize.Cache
52189            * @param {string}
52190            *            key The key of the value to cache.
52191            * @param {*}
52192            *            value The value to cache.
52193            * @returns {Object} Returns the cache object.
52194            */
52195           function mapSet(key, value) {
52196             if (key != '__proto__') {
52197               this.__data__[key] = value;
52198             }
52199             return this;
52200           }
52201
52202           /*------------------------------------------------------------------------*/
52203
52204           /**
52205            *
52206            * Creates a cache object to store unique values.
52207            *
52208            * @private
52209            * @param {Array}
52210            *            [values] The values to cache.
52211            */
52212           function SetCache(values) {
52213             var length = values ? values.length : 0;
52214
52215             this.data = {
52216               'hash': nativeCreate(null),
52217               'set': new Set
52218             };
52219             while (length--) {
52220               this.push(values[length]);
52221             }
52222           }
52223
52224           /**
52225            * Checks if `value` is in `cache` mimicking the return signature of
52226            * `_.indexOf` by returning `0` if the value is found, else `-1`.
52227            *
52228            * @private
52229            * @param {Object}
52230            *            cache The cache to search.
52231            * @param {*}
52232            *            value The value to search for.
52233            * @returns {number} Returns `0` if `value` is found, else `-1`.
52234            */
52235           function cacheIndexOf(cache, value) {
52236             var data = cache.data,
52237               result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
52238
52239             return result ? 0 : -1;
52240           }
52241
52242           /**
52243            * Adds `value` to the cache.
52244            *
52245            * @private
52246            * @name push
52247            * @memberOf SetCache
52248            * @param {*}
52249            *            value The value to cache.
52250            */
52251           function cachePush(value) {
52252             var data = this.data;
52253             if (typeof value == 'string' || isObject(value)) {
52254               data.set.add(value);
52255             } else {
52256               data.hash[value] = true;
52257             }
52258           }
52259
52260           /*------------------------------------------------------------------------*/
52261
52262           /**
52263            * Creates a new array joining `array` with `other`.
52264            *
52265            * @private
52266            * @param {Array}
52267            *            array The array to join.
52268            * @param {Array}
52269            *            other The other array to join.
52270            * @returns {Array} Returns the new concatenated array.
52271            */
52272           function arrayConcat(array, other) {
52273             var index = -1,
52274               length = array.length,
52275               othIndex = -1,
52276               othLength = other.length,
52277               result = Array(length + othLength);
52278
52279             while (++index < length) {
52280               result[index] = array[index];
52281             }
52282             while (++othIndex < othLength) {
52283               result[index++] = other[othIndex];
52284             }
52285             return result;
52286           }
52287
52288           /**
52289            * Copies the values of `source` to `array`.
52290            *
52291            * @private
52292            * @param {Array}
52293            *            source The array to copy values from.
52294            * @param {Array}
52295            *            [array=[]] The array to copy values to.
52296            * @returns {Array} Returns `array`.
52297            */
52298           function arrayCopy(source, array) {
52299             var index = -1,
52300               length = source.length;
52301
52302             array || (array = Array(length));
52303             while (++index < length) {
52304               array[index] = source[index];
52305             }
52306             return array;
52307           }
52308
52309           /**
52310            * A specialized version of `_.forEach` for arrays without support for
52311            * callback shorthands and `this` binding.
52312            *
52313            * @private
52314            * @param {Array}
52315            *            array The array to iterate over.
52316            * @param {Function}
52317            *            iteratee The function invoked per iteration.
52318            * @returns {Array} Returns `array`.
52319            */
52320           function arrayEach(array, iteratee) {
52321             var index = -1,
52322               length = array.length;
52323
52324             while (++index < length) {
52325               if (iteratee(array[index], index, array) === false) {
52326                 break;
52327               }
52328             }
52329             return array;
52330           }
52331
52332           /**
52333            * A specialized version of `_.forEachRight` for arrays without support for
52334            * callback shorthands and `this` binding.
52335            *
52336            * @private
52337            * @param {Array}
52338            *            array The array to iterate over.
52339            * @param {Function}
52340            *            iteratee The function invoked per iteration.
52341            * @returns {Array} Returns `array`.
52342            */
52343           function arrayEachRight(array, iteratee) {
52344             var length = array.length;
52345
52346             while (length--) {
52347               if (iteratee(array[length], length, array) === false) {
52348                 break;
52349               }
52350             }
52351             return array;
52352           }
52353
52354           /**
52355            * A specialized version of `_.every` for arrays without support for
52356            * callback shorthands and `this` binding.
52357            *
52358            * @private
52359            * @param {Array}
52360            *            array The array to iterate over.
52361            * @param {Function}
52362            *            predicate The function invoked per iteration.
52363            * @returns {boolean} Returns `true` if all elements pass the predicate
52364            *          check, else `false`.
52365            */
52366           function arrayEvery(array, predicate) {
52367             var index = -1,
52368               length = array.length;
52369
52370             while (++index < length) {
52371               if (!predicate(array[index], index, array)) {
52372                 return false;
52373               }
52374             }
52375             return true;
52376           }
52377
52378           /**
52379            * A specialized version of `baseExtremum` for arrays which invokes
52380            * `iteratee` with one argument: (value).
52381            *
52382            * @private
52383            * @param {Array}
52384            *            array The array to iterate over.
52385            * @param {Function}
52386            *            iteratee The function invoked per iteration.
52387            * @param {Function}
52388            *            comparator The function used to compare values.
52389            * @param {*}
52390            *            exValue The initial extremum value.
52391            * @returns {*} Returns the extremum value.
52392            */
52393           function arrayExtremum(array, iteratee, comparator, exValue) {
52394             var index = -1,
52395               length = array.length,
52396               computed = exValue,
52397               result = computed;
52398
52399             while (++index < length) {
52400               var value = array[index],
52401                 current = +iteratee(value);
52402
52403               if (comparator(current, computed)) {
52404                 computed = current;
52405                 result = value;
52406               }
52407             }
52408             return result;
52409           }
52410
52411           /**
52412            * A specialized version of `_.filter` for arrays without support for
52413            * callback shorthands and `this` binding.
52414            *
52415            * @private
52416            * @param {Array}
52417            *            array The array to iterate over.
52418            * @param {Function}
52419            *            predicate The function invoked per iteration.
52420            * @returns {Array} Returns the new filtered array.
52421            */
52422           function arrayFilter(array, predicate) {
52423             var index = -1,
52424               length = array.length,
52425               resIndex = -1,
52426               result = [];
52427
52428             while (++index < length) {
52429               var value = array[index];
52430               if (predicate(value, index, array)) {
52431                 result[++resIndex] = value;
52432               }
52433             }
52434             return result;
52435           }
52436
52437           /**
52438            * A specialized version of `_.map` for arrays without support for callback
52439            * shorthands and `this` binding.
52440            *
52441            * @private
52442            * @param {Array}
52443            *            array The array to iterate over.
52444            * @param {Function}
52445            *            iteratee The function invoked per iteration.
52446            * @returns {Array} Returns the new mapped array.
52447            */
52448           function arrayMap(array, iteratee) {
52449             var index = -1,
52450               length = array.length,
52451               result = Array(length);
52452
52453             while (++index < length) {
52454               result[index] = iteratee(array[index], index, array);
52455             }
52456             return result;
52457           }
52458
52459           /**
52460            * Appends the elements of `values` to `array`.
52461            *
52462            * @private
52463            * @param {Array}
52464            *            array The array to modify.
52465            * @param {Array}
52466            *            values The values to append.
52467            * @returns {Array} Returns `array`.
52468            */
52469           function arrayPush(array, values) {
52470             var index = -1,
52471               length = values.length,
52472               offset = array.length;
52473
52474             while (++index < length) {
52475               array[offset + index] = values[index];
52476             }
52477             return array;
52478           }
52479
52480           /**
52481            * A specialized version of `_.reduce` for arrays without support for
52482            * callback shorthands and `this` binding.
52483            *
52484            * @private
52485            * @param {Array}
52486            *            array The array to iterate over.
52487            * @param {Function}
52488            *            iteratee The function invoked per iteration.
52489            * @param {*}
52490            *            [accumulator] The initial value.
52491            * @param {boolean}
52492            *            [initFromArray] Specify using the first element of `array` as
52493            *            the initial value.
52494            * @returns {*} Returns the accumulated value.
52495            */
52496           function arrayReduce(array, iteratee, accumulator, initFromArray) {
52497             var index = -1,
52498               length = array.length;
52499
52500             if (initFromArray && length) {
52501               accumulator = array[++index];
52502             }
52503             while (++index < length) {
52504               accumulator = iteratee(accumulator, array[index], index, array);
52505             }
52506             return accumulator;
52507           }
52508
52509           /**
52510            * A specialized version of `_.reduceRight` for arrays without support for
52511            * callback shorthands and `this` binding.
52512            *
52513            * @private
52514            * @param {Array}
52515            *            array The array to iterate over.
52516            * @param {Function}
52517            *            iteratee The function invoked per iteration.
52518            * @param {*}
52519            *            [accumulator] The initial value.
52520            * @param {boolean}
52521            *            [initFromArray] Specify using the last element of `array` as
52522            *            the initial value.
52523            * @returns {*} Returns the accumulated value.
52524            */
52525           function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
52526             var length = array.length;
52527             if (initFromArray && length) {
52528               accumulator = array[--length];
52529             }
52530             while (length--) {
52531               accumulator = iteratee(accumulator, array[length], length, array);
52532             }
52533             return accumulator;
52534           }
52535
52536           /**
52537            * A specialized version of `_.some` for arrays without support for callback
52538            * shorthands and `this` binding.
52539            *
52540            * @private
52541            * @param {Array}
52542            *            array The array to iterate over.
52543            * @param {Function}
52544            *            predicate The function invoked per iteration.
52545            * @returns {boolean} Returns `true` if any element passes the predicate
52546            *          check, else `false`.
52547            */
52548           function arraySome(array, predicate) {
52549             var index = -1,
52550               length = array.length;
52551
52552             while (++index < length) {
52553               if (predicate(array[index], index, array)) {
52554                 return true;
52555               }
52556             }
52557             return false;
52558           }
52559
52560           /**
52561            * A specialized version of `_.sum` for arrays without support for callback
52562            * shorthands and `this` binding..
52563            *
52564            * @private
52565            * @param {Array}
52566            *            array The array to iterate over.
52567            * @param {Function}
52568            *            iteratee The function invoked per iteration.
52569            * @returns {number} Returns the sum.
52570            */
52571           function arraySum(array, iteratee) {
52572             var length = array.length,
52573               result = 0;
52574
52575             while (length--) {
52576               result += +iteratee(array[length]) || 0;
52577             }
52578             return result;
52579           }
52580
52581           /**
52582            * Used by `_.defaults` to customize its `_.assign` use.
52583            *
52584            * @private
52585            * @param {*}
52586            *            objectValue The destination object property value.
52587            * @param {*}
52588            *            sourceValue The source object property value.
52589            * @returns {*} Returns the value to assign to the destination object.
52590            */
52591           function assignDefaults(objectValue, sourceValue) {
52592             return objectValue === undefined ? sourceValue : objectValue;
52593           }
52594
52595           /**
52596            * Used by `_.template` to customize its `_.assign` use.
52597            *
52598            * **Note:** This function is like `assignDefaults` except that it ignores
52599            * inherited property values when checking if a property is `undefined`.
52600            *
52601            * @private
52602            * @param {*}
52603            *            objectValue The destination object property value.
52604            * @param {*}
52605            *            sourceValue The source object property value.
52606            * @param {string}
52607            *            key The key associated with the object and source values.
52608            * @param {Object}
52609            *            object The destination object.
52610            * @returns {*} Returns the value to assign to the destination object.
52611            */
52612           function assignOwnDefaults(objectValue, sourceValue, key, object) {
52613             return (objectValue === undefined || !hasOwnProperty.call(object, key)) ? sourceValue : objectValue;
52614           }
52615
52616           /**
52617            * A specialized version of `_.assign` for customizing assigned values
52618            * without support for argument juggling, multiple sources, and `this`
52619            * binding `customizer` functions.
52620            *
52621            * @private
52622            * @param {Object}
52623            *            object The destination object.
52624            * @param {Object}
52625            *            source The source object.
52626            * @param {Function}
52627            *            customizer The function to customize assigned values.
52628            * @returns {Object} Returns `object`.
52629            */
52630           function assignWith(object, source, customizer) {
52631             var index = -1,
52632               props = keys(source),
52633               length = props.length;
52634
52635             while (++index < length) {
52636               var key = props[index],
52637                 value = object[key],
52638                 result = customizer(value, source[key], key, object, source);
52639
52640               if ((result === result ? (result !== value) : (value === value)) ||
52641                 (value === undefined && !(key in object))) {
52642                 object[key] = result;
52643               }
52644             }
52645             return object;
52646           }
52647
52648           /**
52649            * The base implementation of `_.assign` without support for argument
52650            * juggling, multiple sources, and `customizer` functions.
52651            *
52652            * @private
52653            * @param {Object}
52654            *            object The destination object.
52655            * @param {Object}
52656            *            source The source object.
52657            * @returns {Object} Returns `object`.
52658            */
52659           function baseAssign(object, source) {
52660             return source == null ? object : baseCopy(source, keys(source), object);
52661           }
52662
52663           /**
52664            * The base implementation of `_.at` without support for string collections
52665            * and individual key arguments.
52666            *
52667            * @private
52668            * @param {Array|Object}
52669            *            collection The collection to iterate over.
52670            * @param {number[]|string[]}
52671            *            props The property names or indexes of elements to pick.
52672            * @returns {Array} Returns the new array of picked elements.
52673            */
52674           function baseAt(collection, props) {
52675             var index = -1,
52676               isNil = collection == null,
52677               isArr = !isNil && isArrayLike(collection),
52678               length = isArr ? collection.length : 0,
52679               propsLength = props.length,
52680               result = Array(propsLength);
52681
52682             while (++index < propsLength) {
52683               var key = props[index];
52684               if (isArr) {
52685                 result[index] = isIndex(key, length) ? collection[key] : undefined;
52686               } else {
52687                 result[index] = isNil ? undefined : collection[key];
52688               }
52689             }
52690             return result;
52691           }
52692
52693           /**
52694            * Copies properties of `source` to `object`.
52695            *
52696            * @private
52697            * @param {Object}
52698            *            source The object to copy properties from.
52699            * @param {Array}
52700            *            props The property names to copy.
52701            * @param {Object}
52702            *            [object={}] The object to copy properties to.
52703            * @returns {Object} Returns `object`.
52704            */
52705           function baseCopy(source, props, object) {
52706             object || (object = {});
52707
52708             var index = -1,
52709               length = props.length;
52710
52711             while (++index < length) {
52712               var key = props[index];
52713               object[key] = source[key];
52714             }
52715             return object;
52716           }
52717
52718           /**
52719            * The base implementation of `_.callback` which supports specifying the
52720            * number of arguments to provide to `func`.
52721            *
52722            * @private
52723            * @param {*}
52724            *            [func=_.identity] The value to convert to a callback.
52725            * @param {*}
52726            *            [thisArg] The `this` binding of `func`.
52727            * @param {number}
52728            *            [argCount] The number of arguments to provide to `func`.
52729            * @returns {Function} Returns the callback.
52730            */
52731           function baseCallback(func, thisArg, argCount) {
52732             var type = typeof func;
52733             if (type == 'function') {
52734               return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
52735             }
52736             if (func == null) {
52737               return identity;
52738             }
52739             if (type == 'object') {
52740               return baseMatches(func);
52741             }
52742             return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
52743           }
52744
52745           /**
52746            * The base implementation of `_.clone` without support for argument
52747            * juggling and `this` binding `customizer` functions.
52748            *
52749            * @private
52750            * @param {*}
52751            *            value The value to clone.
52752            * @param {boolean}
52753            *            [isDeep] Specify a deep clone.
52754            * @param {Function}
52755            *            [customizer] The function to customize cloning values.
52756            * @param {string}
52757            *            [key] The key of `value`.
52758            * @param {Object}
52759            *            [object] The object `value` belongs to.
52760            * @param {Array}
52761            *            [stackA=[]] Tracks traversed source objects.
52762            * @param {Array}
52763            *            [stackB=[]] Associates clones with source counterparts.
52764            * @returns {*} Returns the cloned value.
52765            */
52766           function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
52767             var result;
52768             if (customizer) {
52769               result = object ? customizer(value, key, object) : customizer(value);
52770             }
52771             if (result !== undefined) {
52772               return result;
52773             }
52774             if (!isObject(value)) {
52775               return value;
52776             }
52777             var isArr = isArray(value);
52778             if (isArr) {
52779               result = initCloneArray(value);
52780               if (!isDeep) {
52781                 return arrayCopy(value, result);
52782               }
52783             } else {
52784               var tag = objToString.call(value),
52785                 isFunc = tag == funcTag;
52786
52787               if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
52788                 result = initCloneObject(isFunc ? {} : value);
52789                 if (!isDeep) {
52790                   return baseAssign(result, value);
52791                 }
52792               } else {
52793                 return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : (object ? value : {});
52794               }
52795             }
52796             // Check for circular references and return its corresponding clone.
52797             stackA || (stackA = []);
52798             stackB || (stackB = []);
52799
52800             var length = stackA.length;
52801             while (length--) {
52802               if (stackA[length] == value) {
52803                 return stackB[length];
52804               }
52805             }
52806             // Add the source value to the stack of traversed objects and associate
52807             // it with its clone.
52808             stackA.push(value);
52809             stackB.push(result);
52810
52811             // Recursively populate clone (susceptible to call stack limits).
52812             (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
52813               result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
52814             });
52815             return result;
52816           }
52817
52818           /**
52819            * The base implementation of `_.create` without support for assigning
52820            * properties to the created object.
52821            *
52822            * @private
52823            * @param {Object}
52824            *            prototype The object to inherit from.
52825            * @returns {Object} Returns the new object.
52826            */
52827           var baseCreate = (function() {
52828             function object() {}
52829             return function(prototype) {
52830               if (isObject(prototype)) {
52831                 object.prototype = prototype;
52832                 var result = new object;
52833                 object.prototype = undefined;
52834               }
52835               return result || {};
52836             };
52837           }());
52838
52839           /**
52840            * The base implementation of `_.delay` and `_.defer` which accepts an index
52841            * of where to slice the arguments to provide to `func`.
52842            *
52843            * @private
52844            * @param {Function}
52845            *            func The function to delay.
52846            * @param {number}
52847            *            wait The number of milliseconds to delay invocation.
52848            * @param {Object}
52849            *            args The arguments provide to `func`.
52850            * @returns {number} Returns the timer id.
52851            */
52852           function baseDelay(func, wait, args) {
52853             if (typeof func != 'function') {
52854               throw new TypeError(FUNC_ERROR_TEXT);
52855             }
52856             return setTimeout(function() {
52857               func.apply(undefined, args);
52858             }, wait);
52859           }
52860
52861           /**
52862            * The base implementation of `_.difference` which accepts a single array of
52863            * values to exclude.
52864            *
52865            * @private
52866            * @param {Array}
52867            *            array The array to inspect.
52868            * @param {Array}
52869            *            values The values to exclude.
52870            * @returns {Array} Returns the new array of filtered values.
52871            */
52872           function baseDifference(array, values) {
52873             var length = array ? array.length : 0,
52874               result = [];
52875
52876             if (!length) {
52877               return result;
52878             }
52879             var index = -1,
52880               indexOf = getIndexOf(),
52881               isCommon = indexOf == baseIndexOf,
52882               cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
52883               valuesLength = values.length;
52884
52885             if (cache) {
52886               indexOf = cacheIndexOf;
52887               isCommon = false;
52888               values = cache;
52889             }
52890             outer:
52891               while (++index < length) {
52892                 var value = array[index];
52893
52894                 if (isCommon && value === value) {
52895                   var valuesIndex = valuesLength;
52896                   while (valuesIndex--) {
52897                     if (values[valuesIndex] === value) {
52898                       continue outer;
52899                     }
52900                   }
52901                   result.push(value);
52902                 } else if (indexOf(values, value, 0) < 0) {
52903                   result.push(value);
52904                 }
52905               }
52906             return result;
52907           }
52908
52909           /**
52910            * The base implementation of `_.forEach` without support for callback
52911            * shorthands and `this` binding.
52912            *
52913            * @private
52914            * @param {Array|Object|string}
52915            *            collection The collection to iterate over.
52916            * @param {Function}
52917            *            iteratee The function invoked per iteration.
52918            * @returns {Array|Object|string} Returns `collection`.
52919            */
52920           var baseEach = createBaseEach(baseForOwn);
52921
52922           /**
52923            * The base implementation of `_.forEachRight` without support for callback
52924            * shorthands and `this` binding.
52925            *
52926            * @private
52927            * @param {Array|Object|string}
52928            *            collection The collection to iterate over.
52929            * @param {Function}
52930            *            iteratee The function invoked per iteration.
52931            * @returns {Array|Object|string} Returns `collection`.
52932            */
52933           var baseEachRight = createBaseEach(baseForOwnRight, true);
52934
52935           /**
52936            * The base implementation of `_.every` without support for callback
52937            * shorthands and `this` binding.
52938            *
52939            * @private
52940            * @param {Array|Object|string}
52941            *            collection The collection to iterate over.
52942            * @param {Function}
52943            *            predicate The function invoked per iteration.
52944            * @returns {boolean} Returns `true` if all elements pass the predicate
52945            *          check, else `false`
52946            */
52947           function baseEvery(collection, predicate) {
52948             var result = true;
52949             baseEach(collection, function(value, index, collection) {
52950               result = !!predicate(value, index, collection);
52951               return result;
52952             });
52953             return result;
52954           }
52955
52956           /**
52957            * Gets the extremum value of `collection` invoking `iteratee` for each
52958            * value in `collection` to generate the criterion by which the value is
52959            * ranked. The `iteratee` is invoked with three arguments: (value,
52960            * index|key, collection).
52961            *
52962            * @private
52963            * @param {Array|Object|string}
52964            *            collection The collection to iterate over.
52965            * @param {Function}
52966            *            iteratee The function invoked per iteration.
52967            * @param {Function}
52968            *            comparator The function used to compare values.
52969            * @param {*}
52970            *            exValue The initial extremum value.
52971            * @returns {*} Returns the extremum value.
52972            */
52973           function baseExtremum(collection, iteratee, comparator, exValue) {
52974             var computed = exValue,
52975               result = computed;
52976
52977             baseEach(collection, function(value, index, collection) {
52978               var current = +iteratee(value, index, collection);
52979               if (comparator(current, computed) || (current === exValue && current === result)) {
52980                 computed = current;
52981                 result = value;
52982               }
52983             });
52984             return result;
52985           }
52986
52987           /**
52988            * The base implementation of `_.fill` without an iteratee call guard.
52989            *
52990            * @private
52991            * @param {Array}
52992            *            array The array to fill.
52993            * @param {*}
52994            *            value The value to fill `array` with.
52995            * @param {number}
52996            *            [start=0] The start position.
52997            * @param {number}
52998            *            [end=array.length] The end position.
52999            * @returns {Array} Returns `array`.
53000            */
53001           function baseFill(array, value, start, end) {
53002             var length = array.length;
53003
53004             start = start == null ? 0 : (+start || 0);
53005             if (start < 0) {
53006               start = -start > length ? 0 : (length + start);
53007             }
53008             end = (end === undefined || end > length) ? length : (+end || 0);
53009             if (end < 0) {
53010               end += length;
53011             }
53012             length = start > end ? 0 : (end >>> 0);
53013             start >>>= 0;
53014
53015             while (start < length) {
53016               array[start++] = value;
53017             }
53018             return array;
53019           }
53020
53021           /**
53022            * The base implementation of `_.filter` without support for callback
53023            * shorthands and `this` binding.
53024            *
53025            * @private
53026            * @param {Array|Object|string}
53027            *            collection The collection to iterate over.
53028            * @param {Function}
53029            *            predicate The function invoked per iteration.
53030            * @returns {Array} Returns the new filtered array.
53031            */
53032           function baseFilter(collection, predicate) {
53033             var result = [];
53034             baseEach(collection, function(value, index, collection) {
53035               if (predicate(value, index, collection)) {
53036                 result.push(value);
53037               }
53038             });
53039             return result;
53040           }
53041
53042           /**
53043            * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
53044            * `_.findLastKey`, without support for callback shorthands and `this`
53045            * binding, which iterates over `collection` using the provided `eachFunc`.
53046            *
53047            * @private
53048            * @param {Array|Object|string}
53049            *            collection The collection to search.
53050            * @param {Function}
53051            *            predicate The function invoked per iteration.
53052            * @param {Function}
53053            *            eachFunc The function to iterate over `collection`.
53054            * @param {boolean}
53055            *            [retKey] Specify returning the key of the found element
53056            *            instead of the element itself.
53057            * @returns {*} Returns the found element or its key, else `undefined`.
53058            */
53059           function baseFind(collection, predicate, eachFunc, retKey) {
53060             var result;
53061             eachFunc(collection, function(value, key, collection) {
53062               if (predicate(value, key, collection)) {
53063                 result = retKey ? key : value;
53064                 return false;
53065               }
53066             });
53067             return result;
53068           }
53069
53070           /**
53071            * The base implementation of `_.flatten` with added support for restricting
53072            * flattening and specifying the start index.
53073            *
53074            * @private
53075            * @param {Array}
53076            *            array The array to flatten.
53077            * @param {boolean}
53078            *            [isDeep] Specify a deep flatten.
53079            * @param {boolean}
53080            *            [isStrict] Restrict flattening to arrays-like objects.
53081            * @param {Array}
53082            *            [result=[]] The initial result value.
53083            * @returns {Array} Returns the new flattened array.
53084            */
53085           function baseFlatten(array, isDeep, isStrict, result) {
53086             result || (result = []);
53087
53088             var index = -1,
53089               length = array.length;
53090
53091             while (++index < length) {
53092               var value = array[index];
53093               if (isObjectLike(value) && isArrayLike(value) &&
53094                 (isStrict || isArray(value) || isArguments(value))) {
53095                 if (isDeep) {
53096                   // Recursively flatten arrays (susceptible to call stack limits).
53097                   baseFlatten(value, isDeep, isStrict, result);
53098                 } else {
53099                   arrayPush(result, value);
53100                 }
53101               } else if (!isStrict) {
53102                 result[result.length] = value;
53103               }
53104             }
53105             return result;
53106           }
53107
53108           /**
53109            * The base implementation of `baseForIn` and `baseForOwn` which iterates
53110            * over `object` properties returned by `keysFunc` invoking `iteratee` for
53111            * each property. Iteratee functions may exit iteration early by explicitly
53112            * returning `false`.
53113            *
53114            * @private
53115            * @param {Object}
53116            *            object The object to iterate over.
53117            * @param {Function}
53118            *            iteratee The function invoked per iteration.
53119            * @param {Function}
53120            *            keysFunc The function to get the keys of `object`.
53121            * @returns {Object} Returns `object`.
53122            */
53123           var baseFor = createBaseFor();
53124
53125           /**
53126            * This function is like `baseFor` except that it iterates over properties
53127            * in the opposite order.
53128            *
53129            * @private
53130            * @param {Object}
53131            *            object The object to iterate over.
53132            * @param {Function}
53133            *            iteratee The function invoked per iteration.
53134            * @param {Function}
53135            *            keysFunc The function to get the keys of `object`.
53136            * @returns {Object} Returns `object`.
53137            */
53138           var baseForRight = createBaseFor(true);
53139
53140           /**
53141            * The base implementation of `_.forIn` without support for callback
53142            * shorthands and `this` binding.
53143            *
53144            * @private
53145            * @param {Object}
53146            *            object The object to iterate over.
53147            * @param {Function}
53148            *            iteratee The function invoked per iteration.
53149            * @returns {Object} Returns `object`.
53150            */
53151           function baseForIn(object, iteratee) {
53152             return baseFor(object, iteratee, keysIn);
53153           }
53154
53155           /**
53156            * The base implementation of `_.forOwn` without support for callback
53157            * shorthands and `this` binding.
53158            *
53159            * @private
53160            * @param {Object}
53161            *            object The object to iterate over.
53162            * @param {Function}
53163            *            iteratee The function invoked per iteration.
53164            * @returns {Object} Returns `object`.
53165            */
53166           function baseForOwn(object, iteratee) {
53167             return baseFor(object, iteratee, keys);
53168           }
53169
53170           /**
53171            * The base implementation of `_.forOwnRight` without support for callback
53172            * shorthands and `this` binding.
53173            *
53174            * @private
53175            * @param {Object}
53176            *            object The object to iterate over.
53177            * @param {Function}
53178            *            iteratee The function invoked per iteration.
53179            * @returns {Object} Returns `object`.
53180            */
53181           function baseForOwnRight(object, iteratee) {
53182             return baseForRight(object, iteratee, keys);
53183           }
53184
53185           /**
53186            * The base implementation of `_.functions` which creates an array of
53187            * `object` function property names filtered from those provided.
53188            *
53189            * @private
53190            * @param {Object}
53191            *            object The object to inspect.
53192            * @param {Array}
53193            *            props The property names to filter.
53194            * @returns {Array} Returns the new array of filtered property names.
53195            */
53196           function baseFunctions(object, props) {
53197             var index = -1,
53198               length = props.length,
53199               resIndex = -1,
53200               result = [];
53201
53202             while (++index < length) {
53203               var key = props[index];
53204               if (isFunction(object[key])) {
53205                 result[++resIndex] = key;
53206               }
53207             }
53208             return result;
53209           }
53210
53211           /**
53212            * The base implementation of `get` without support for string paths and
53213            * default values.
53214            *
53215            * @private
53216            * @param {Object}
53217            *            object The object to query.
53218            * @param {Array}
53219            *            path The path of the property to get.
53220            * @param {string}
53221            *            [pathKey] The key representation of path.
53222            * @returns {*} Returns the resolved value.
53223            */
53224           function baseGet(object, path, pathKey) {
53225             if (object == null) {
53226               return;
53227             }
53228             if (pathKey !== undefined && pathKey in toObject(object)) {
53229               path = [pathKey];
53230             }
53231             var index = 0,
53232               length = path.length;
53233
53234             while (object != null && index < length) {
53235               object = object[path[index++]];
53236             }
53237             return (index && index == length) ? object : undefined;
53238           }
53239
53240           /**
53241            * The base implementation of `_.isEqual` without support for `this` binding
53242            * `customizer` functions.
53243            *
53244            * @private
53245            * @param {*}
53246            *            value The value to compare.
53247            * @param {*}
53248            *            other The other value to compare.
53249            * @param {Function}
53250            *            [customizer] The function to customize comparing values.
53251            * @param {boolean}
53252            *            [isLoose] Specify performing partial comparisons.
53253            * @param {Array}
53254            *            [stackA] Tracks traversed `value` objects.
53255            * @param {Array}
53256            *            [stackB] Tracks traversed `other` objects.
53257            * @returns {boolean} Returns `true` if the values are equivalent, else
53258            *          `false`.
53259            */
53260           function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
53261             if (value === other) {
53262               return true;
53263             }
53264             if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
53265               return value !== value && other !== other;
53266             }
53267             return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
53268           }
53269
53270           /**
53271            * A specialized version of `baseIsEqual` for arrays and objects which
53272            * performs deep comparisons and tracks traversed objects enabling objects
53273            * with circular references to be compared.
53274            *
53275            * @private
53276            * @param {Object}
53277            *            object The object to compare.
53278            * @param {Object}
53279            *            other The other object to compare.
53280            * @param {Function}
53281            *            equalFunc The function to determine equivalents of values.
53282            * @param {Function}
53283            *            [customizer] The function to customize comparing objects.
53284            * @param {boolean}
53285            *            [isLoose] Specify performing partial comparisons.
53286            * @param {Array}
53287            *            [stackA=[]] Tracks traversed `value` objects.
53288            * @param {Array}
53289            *            [stackB=[]] Tracks traversed `other` objects.
53290            * @returns {boolean} Returns `true` if the objects are equivalent, else
53291            *          `false`.
53292            */
53293           function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
53294             var objIsArr = isArray(object),
53295               othIsArr = isArray(other),
53296               objTag = arrayTag,
53297               othTag = arrayTag;
53298
53299             if (!objIsArr) {
53300               objTag = objToString.call(object);
53301               if (objTag == argsTag) {
53302                 objTag = objectTag;
53303               } else if (objTag != objectTag) {
53304                 objIsArr = isTypedArray(object);
53305               }
53306             }
53307             if (!othIsArr) {
53308               othTag = objToString.call(other);
53309               if (othTag == argsTag) {
53310                 othTag = objectTag;
53311               } else if (othTag != objectTag) {
53312                 othIsArr = isTypedArray(other);
53313               }
53314             }
53315             var objIsObj = objTag == objectTag,
53316               othIsObj = othTag == objectTag,
53317               isSameTag = objTag == othTag;
53318
53319             if (isSameTag && !(objIsArr || objIsObj)) {
53320               return equalByTag(object, other, objTag);
53321             }
53322             if (!isLoose) {
53323               var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
53324                 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
53325
53326               if (objIsWrapped || othIsWrapped) {
53327                 return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
53328               }
53329             }
53330             if (!isSameTag) {
53331               return false;
53332             }
53333             // Assume cyclic values are equal.
53334             // For more information on detecting circular references see
53335             // https://es5.github.io/#JO.
53336             stackA || (stackA = []);
53337             stackB || (stackB = []);
53338
53339             var length = stackA.length;
53340             while (length--) {
53341               if (stackA[length] == object) {
53342                 return stackB[length] == other;
53343               }
53344             }
53345             // Add `object` and `other` to the stack of traversed objects.
53346             stackA.push(object);
53347             stackB.push(other);
53348
53349             var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
53350
53351             stackA.pop();
53352             stackB.pop();
53353
53354             return result;
53355           }
53356
53357           /**
53358            * The base implementation of `_.isMatch` without support for callback
53359            * shorthands and `this` binding.
53360            *
53361            * @private
53362            * @param {Object}
53363            *            object The object to inspect.
53364            * @param {Array}
53365            *            matchData The propery names, values, and compare flags to
53366            *            match.
53367            * @param {Function}
53368            *            [customizer] The function to customize comparing objects.
53369            * @returns {boolean} Returns `true` if `object` is a match, else `false`.
53370            */
53371           function baseIsMatch(object, matchData, customizer) {
53372             var index = matchData.length,
53373               length = index,
53374               noCustomizer = !customizer;
53375
53376             if (object == null) {
53377               return !length;
53378             }
53379             object = toObject(object);
53380             while (index--) {
53381               var data = matchData[index];
53382               if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
53383                 return false;
53384               }
53385             }
53386             while (++index < length) {
53387               data = matchData[index];
53388               var key = data[0],
53389                 objValue = object[key],
53390                 srcValue = data[1];
53391
53392               if (noCustomizer && data[2]) {
53393                 if (objValue === undefined && !(key in object)) {
53394                   return false;
53395                 }
53396               } else {
53397                 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
53398                 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
53399                   return false;
53400                 }
53401               }
53402             }
53403             return true;
53404           }
53405
53406           /**
53407            * The base implementation of `_.map` without support for callback
53408            * shorthands and `this` binding.
53409            *
53410            * @private
53411            * @param {Array|Object|string}
53412            *            collection The collection to iterate over.
53413            * @param {Function}
53414            *            iteratee The function invoked per iteration.
53415            * @returns {Array} Returns the new mapped array.
53416            */
53417           function baseMap(collection, iteratee) {
53418             var index = -1,
53419               result = isArrayLike(collection) ? Array(collection.length) : [];
53420
53421             baseEach(collection, function(value, key, collection) {
53422               result[++index] = iteratee(value, key, collection);
53423             });
53424             return result;
53425           }
53426
53427           /**
53428            * The base implementation of `_.matches` which does not clone `source`.
53429            *
53430            * @private
53431            * @param {Object}
53432            *            source The object of property values to match.
53433            * @returns {Function} Returns the new function.
53434            */
53435           function baseMatches(source) {
53436             var matchData = getMatchData(source);
53437             if (matchData.length == 1 && matchData[0][2]) {
53438               var key = matchData[0][0],
53439                 value = matchData[0][1];
53440
53441               return function(object) {
53442                 if (object == null) {
53443                   return false;
53444                 }
53445                 return object[key] === value && (value !== undefined || (key in toObject(object)));
53446               };
53447             }
53448             return function(object) {
53449               return baseIsMatch(object, matchData);
53450             };
53451           }
53452
53453           /**
53454            * The base implementation of `_.matchesProperty` which does not clone
53455            * `srcValue`.
53456            *
53457            * @private
53458            * @param {string}
53459            *            path The path of the property to get.
53460            * @param {*}
53461            *            srcValue The value to compare.
53462            * @returns {Function} Returns the new function.
53463            */
53464           function baseMatchesProperty(path, srcValue) {
53465             var isArr = isArray(path),
53466               isCommon = isKey(path) && isStrictComparable(srcValue),
53467               pathKey = (path + '');
53468
53469             path = toPath(path);
53470             return function(object) {
53471               if (object == null) {
53472                 return false;
53473               }
53474               var key = pathKey;
53475               object = toObject(object);
53476               if ((isArr || !isCommon) && !(key in object)) {
53477                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
53478                 if (object == null) {
53479                   return false;
53480                 }
53481                 key = last(path);
53482                 object = toObject(object);
53483               }
53484               return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
53485             };
53486           }
53487
53488           /**
53489            * The base implementation of `_.merge` without support for argument
53490            * juggling, multiple sources, and `this` binding `customizer` functions.
53491            *
53492            * @private
53493            * @param {Object}
53494            *            object The destination object.
53495            * @param {Object}
53496            *            source The source object.
53497            * @param {Function}
53498            *            [customizer] The function to customize merged values.
53499            * @param {Array}
53500            *            [stackA=[]] Tracks traversed source objects.
53501            * @param {Array}
53502            *            [stackB=[]] Associates values with source counterparts.
53503            * @returns {Object} Returns `object`.
53504            */
53505           function baseMerge(object, source, customizer, stackA, stackB) {
53506             if (!isObject(object)) {
53507               return object;
53508             }
53509             var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
53510               props = isSrcArr ? undefined : keys(source);
53511
53512             arrayEach(props || source, function(srcValue, key) {
53513               if (props) {
53514                 key = srcValue;
53515                 srcValue = source[key];
53516               }
53517               if (isObjectLike(srcValue)) {
53518                 stackA || (stackA = []);
53519                 stackB || (stackB = []);
53520                 baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
53521               } else {
53522                 var value = object[key],
53523                   result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53524                   isCommon = result === undefined;
53525
53526                 if (isCommon) {
53527                   result = srcValue;
53528                 }
53529                 if ((result !== undefined || (isSrcArr && !(key in object))) &&
53530                   (isCommon || (result === result ? (result !== value) : (value === value)))) {
53531                   object[key] = result;
53532                 }
53533               }
53534             });
53535             return object;
53536           }
53537
53538           /**
53539            * A specialized version of `baseMerge` for arrays and objects which
53540            * performs deep merges and tracks traversed objects enabling objects with
53541            * circular references to be merged.
53542            *
53543            * @private
53544            * @param {Object}
53545            *            object The destination object.
53546            * @param {Object}
53547            *            source The source object.
53548            * @param {string}
53549            *            key The key of the value to merge.
53550            * @param {Function}
53551            *            mergeFunc The function to merge values.
53552            * @param {Function}
53553            *            [customizer] The function to customize merged values.
53554            * @param {Array}
53555            *            [stackA=[]] Tracks traversed source objects.
53556            * @param {Array}
53557            *            [stackB=[]] Associates values with source counterparts.
53558            * @returns {boolean} Returns `true` if the objects are equivalent, else
53559            *          `false`.
53560            */
53561           function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
53562             var length = stackA.length,
53563               srcValue = source[key];
53564
53565             while (length--) {
53566               if (stackA[length] == srcValue) {
53567                 object[key] = stackB[length];
53568                 return;
53569               }
53570             }
53571             var value = object[key],
53572               result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53573               isCommon = result === undefined;
53574
53575             if (isCommon) {
53576               result = srcValue;
53577               if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
53578                 result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
53579               } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
53580                 result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
53581               } else {
53582                 isCommon = false;
53583               }
53584             }
53585             // Add the source value to the stack of traversed objects and associate
53586             // it with its merged value.
53587             stackA.push(srcValue);
53588             stackB.push(result);
53589
53590             if (isCommon) {
53591               // Recursively merge objects and arrays (susceptible to call stack
53592               // limits).
53593               object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
53594             } else if (result === result ? (result !== value) : (value === value)) {
53595               object[key] = result;
53596             }
53597           }
53598
53599           /**
53600            * The base implementation of `_.property` without support for deep paths.
53601            *
53602            * @private
53603            * @param {string}
53604            *            key The key of the property to get.
53605            * @returns {Function} Returns the new function.
53606            */
53607           function baseProperty(key) {
53608             return function(object) {
53609               return object == null ? undefined : object[key];
53610             };
53611           }
53612
53613           /**
53614            * A specialized version of `baseProperty` which supports deep paths.
53615            *
53616            * @private
53617            * @param {Array|string}
53618            *            path The path of the property to get.
53619            * @returns {Function} Returns the new function.
53620            */
53621           function basePropertyDeep(path) {
53622             var pathKey = (path + '');
53623             path = toPath(path);
53624             return function(object) {
53625               return baseGet(object, path, pathKey);
53626             };
53627           }
53628
53629           /**
53630            * The base implementation of `_.pullAt` without support for individual
53631            * index arguments and capturing the removed elements.
53632            *
53633            * @private
53634            * @param {Array}
53635            *            array The array to modify.
53636            * @param {number[]}
53637            *            indexes The indexes of elements to remove.
53638            * @returns {Array} Returns `array`.
53639            */
53640           function basePullAt(array, indexes) {
53641             var length = array ? indexes.length : 0;
53642             while (length--) {
53643               var index = indexes[length];
53644               if (index != previous && isIndex(index)) {
53645                 var previous = index;
53646                 splice.call(array, index, 1);
53647               }
53648             }
53649             return array;
53650           }
53651
53652           /**
53653            * The base implementation of `_.random` without support for argument
53654            * juggling and returning floating-point numbers.
53655            *
53656            * @private
53657            * @param {number}
53658            *            min The minimum possible value.
53659            * @param {number}
53660            *            max The maximum possible value.
53661            * @returns {number} Returns the random number.
53662            */
53663           function baseRandom(min, max) {
53664             return min + nativeFloor(nativeRandom() * (max - min + 1));
53665           }
53666
53667           /**
53668            * The base implementation of `_.reduce` and `_.reduceRight` without support
53669            * for callback shorthands and `this` binding, which iterates over
53670            * `collection` using the provided `eachFunc`.
53671            *
53672            * @private
53673            * @param {Array|Object|string}
53674            *            collection The collection to iterate over.
53675            * @param {Function}
53676            *            iteratee The function invoked per iteration.
53677            * @param {*}
53678            *            accumulator The initial value.
53679            * @param {boolean}
53680            *            initFromCollection Specify using the first or last element of
53681            *            `collection` as the initial value.
53682            * @param {Function}
53683            *            eachFunc The function to iterate over `collection`.
53684            * @returns {*} Returns the accumulated value.
53685            */
53686           function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
53687             eachFunc(collection, function(value, index, collection) {
53688               accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
53689             });
53690             return accumulator;
53691           }
53692
53693           /**
53694            * The base implementation of `setData` without support for hot loop
53695            * detection.
53696            *
53697            * @private
53698            * @param {Function}
53699            *            func The function to associate metadata with.
53700            * @param {*}
53701            *            data The metadata.
53702            * @returns {Function} Returns `func`.
53703            */
53704           var baseSetData = !metaMap ? identity : function(func, data) {
53705             metaMap.set(func, data);
53706             return func;
53707           };
53708
53709           /**
53710            * The base implementation of `_.slice` without an iteratee call guard.
53711            *
53712            * @private
53713            * @param {Array}
53714            *            array The array to slice.
53715            * @param {number}
53716            *            [start=0] The start position.
53717            * @param {number}
53718            *            [end=array.length] The end position.
53719            * @returns {Array} Returns the slice of `array`.
53720            */
53721           function baseSlice(array, start, end) {
53722             var index = -1,
53723               length = array.length;
53724
53725             start = start == null ? 0 : (+start || 0);
53726             if (start < 0) {
53727               start = -start > length ? 0 : (length + start);
53728             }
53729             end = (end === undefined || end > length) ? length : (+end || 0);
53730             if (end < 0) {
53731               end += length;
53732             }
53733             length = start > end ? 0 : ((end - start) >>> 0);
53734             start >>>= 0;
53735
53736             var result = Array(length);
53737             while (++index < length) {
53738               result[index] = array[index + start];
53739             }
53740             return result;
53741           }
53742
53743           /**
53744            * The base implementation of `_.some` without support for callback
53745            * shorthands and `this` binding.
53746            *
53747            * @private
53748            * @param {Array|Object|string}
53749            *            collection The collection to iterate over.
53750            * @param {Function}
53751            *            predicate The function invoked per iteration.
53752            * @returns {boolean} Returns `true` if any element passes the predicate
53753            *          check, else `false`.
53754            */
53755           function baseSome(collection, predicate) {
53756             var result;
53757
53758             baseEach(collection, function(value, index, collection) {
53759               result = predicate(value, index, collection);
53760               return !result;
53761             });
53762             return !!result;
53763           }
53764
53765           /**
53766            * The base implementation of `_.sortBy` which uses `comparer` to define the
53767            * sort order of `array` and replaces criteria objects with their
53768            * corresponding values.
53769            *
53770            * @private
53771            * @param {Array}
53772            *            array The array to sort.
53773            * @param {Function}
53774            *            comparer The function to define sort order.
53775            * @returns {Array} Returns `array`.
53776            */
53777           function baseSortBy(array, comparer) {
53778             var length = array.length;
53779
53780             array.sort(comparer);
53781             while (length--) {
53782               array[length] = array[length].value;
53783             }
53784             return array;
53785           }
53786
53787           /**
53788            * The base implementation of `_.sortByOrder` without param guards.
53789            *
53790            * @private
53791            * @param {Array|Object|string}
53792            *            collection The collection to iterate over.
53793            * @param {Function[]|Object[]|string[]}
53794            *            iteratees The iteratees to sort by.
53795            * @param {boolean[]}
53796            *            orders The sort orders of `iteratees`.
53797            * @returns {Array} Returns the new sorted array.
53798            */
53799           function baseSortByOrder(collection, iteratees, orders) {
53800             var callback = getCallback(),
53801               index = -1;
53802
53803             iteratees = arrayMap(iteratees, function(iteratee) {
53804               return callback(iteratee);
53805             });
53806
53807             var result = baseMap(collection, function(value) {
53808               var criteria = arrayMap(iteratees, function(iteratee) {
53809                 return iteratee(value);
53810               });
53811               return {
53812                 'criteria': criteria,
53813                 'index': ++index,
53814                 'value': value
53815               };
53816             });
53817
53818             return baseSortBy(result, function(object, other) {
53819               return compareMultiple(object, other, orders);
53820             });
53821           }
53822
53823           /**
53824            * The base implementation of `_.sum` without support for callback
53825            * shorthands and `this` binding.
53826            *
53827            * @private
53828            * @param {Array|Object|string}
53829            *            collection The collection to iterate over.
53830            * @param {Function}
53831            *            iteratee The function invoked per iteration.
53832            * @returns {number} Returns the sum.
53833            */
53834           function baseSum(collection, iteratee) {
53835             var result = 0;
53836             baseEach(collection, function(value, index, collection) {
53837               result += +iteratee(value, index, collection) || 0;
53838             });
53839             return result;
53840           }
53841
53842           /**
53843            * The base implementation of `_.uniq` without support for callback
53844            * shorthands and `this` binding.
53845            *
53846            * @private
53847            * @param {Array}
53848            *            array The array to inspect.
53849            * @param {Function}
53850            *            [iteratee] The function invoked per iteration.
53851            * @returns {Array} Returns the new duplicate-value-free array.
53852            */
53853           function baseUniq(array, iteratee) {
53854             var index = -1,
53855               indexOf = getIndexOf(),
53856               length = array.length,
53857               isCommon = indexOf == baseIndexOf,
53858               isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
53859               seen = isLarge ? createCache() : null,
53860               result = [];
53861
53862             if (seen) {
53863               indexOf = cacheIndexOf;
53864               isCommon = false;
53865             } else {
53866               isLarge = false;
53867               seen = iteratee ? [] : result;
53868             }
53869             outer:
53870               while (++index < length) {
53871                 var value = array[index],
53872                   computed = iteratee ? iteratee(value, index, array) : value;
53873
53874                 if (isCommon && value === value) {
53875                   var seenIndex = seen.length;
53876                   while (seenIndex--) {
53877                     if (seen[seenIndex] === computed) {
53878                       continue outer;
53879                     }
53880                   }
53881                   if (iteratee) {
53882                     seen.push(computed);
53883                   }
53884                   result.push(value);
53885                 } else if (indexOf(seen, computed, 0) < 0) {
53886                   if (iteratee || isLarge) {
53887                     seen.push(computed);
53888                   }
53889                   result.push(value);
53890                 }
53891               }
53892             return result;
53893           }
53894
53895           /**
53896            * The base implementation of `_.values` and `_.valuesIn` which creates an
53897            * array of `object` property values corresponding to the property names of
53898            * `props`.
53899            *
53900            * @private
53901            * @param {Object}
53902            *            object The object to query.
53903            * @param {Array}
53904            *            props The property names to get values for.
53905            * @returns {Object} Returns the array of property values.
53906            */
53907           function baseValues(object, props) {
53908             var index = -1,
53909               length = props.length,
53910               result = Array(length);
53911
53912             while (++index < length) {
53913               result[index] = object[props[index]];
53914             }
53915             return result;
53916           }
53917
53918           /**
53919            * The base implementation of `_.dropRightWhile`, `_.dropWhile`,
53920            * `_.takeRightWhile`, and `_.takeWhile` without support for callback
53921            * shorthands and `this` binding.
53922            *
53923            * @private
53924            * @param {Array}
53925            *            array The array to query.
53926            * @param {Function}
53927            *            predicate The function invoked per iteration.
53928            * @param {boolean}
53929            *            [isDrop] Specify dropping elements instead of taking them.
53930            * @param {boolean}
53931            *            [fromRight] Specify iterating from right to left.
53932            * @returns {Array} Returns the slice of `array`.
53933            */
53934           function baseWhile(array, predicate, isDrop, fromRight) {
53935             var length = array.length,
53936               index = fromRight ? length : -1;
53937
53938             while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
53939             return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
53940           }
53941
53942           /**
53943            * The base implementation of `wrapperValue` which returns the result of
53944            * performing a sequence of actions on the unwrapped `value`, where each
53945            * successive action is supplied the return value of the previous.
53946            *
53947            * @private
53948            * @param {*}
53949            *            value The unwrapped value.
53950            * @param {Array}
53951            *            actions Actions to peform to resolve the unwrapped value.
53952            * @returns {*} Returns the resolved value.
53953            */
53954           function baseWrapperValue(value, actions) {
53955             var result = value;
53956             if (result instanceof LazyWrapper) {
53957               result = result.value();
53958             }
53959             var index = -1,
53960               length = actions.length;
53961
53962             while (++index < length) {
53963               var action = actions[index];
53964               result = action.func.apply(action.thisArg, arrayPush([result], action.args));
53965             }
53966             return result;
53967           }
53968
53969           /**
53970            * Performs a binary search of `array` to determine the index at which
53971            * `value` should be inserted into `array` in order to maintain its sort
53972            * order.
53973            *
53974            * @private
53975            * @param {Array}
53976            *            array The sorted array to inspect.
53977            * @param {*}
53978            *            value The value to evaluate.
53979            * @param {boolean}
53980            *            [retHighest] Specify returning the highest qualified index.
53981            * @returns {number} Returns the index at which `value` should be inserted
53982            *          into `array`.
53983            */
53984           function binaryIndex(array, value, retHighest) {
53985             var low = 0,
53986               high = array ? array.length : low;
53987
53988             if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
53989               while (low < high) {
53990                 var mid = (low + high) >>> 1,
53991                   computed = array[mid];
53992
53993                 if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
53994                   low = mid + 1;
53995                 } else {
53996                   high = mid;
53997                 }
53998               }
53999               return high;
54000             }
54001             return binaryIndexBy(array, value, identity, retHighest);
54002           }
54003
54004           /**
54005            * This function is like `binaryIndex` except that it invokes `iteratee` for
54006            * `value` and each element of `array` to compute their sort ranking. The
54007            * iteratee is invoked with one argument; (value).
54008            *
54009            * @private
54010            * @param {Array}
54011            *            array The sorted array to inspect.
54012            * @param {*}
54013            *            value The value to evaluate.
54014            * @param {Function}
54015            *            iteratee The function invoked per iteration.
54016            * @param {boolean}
54017            *            [retHighest] Specify returning the highest qualified index.
54018            * @returns {number} Returns the index at which `value` should be inserted
54019            *          into `array`.
54020            */
54021           function binaryIndexBy(array, value, iteratee, retHighest) {
54022             value = iteratee(value);
54023
54024             var low = 0,
54025               high = array ? array.length : 0,
54026               valIsNaN = value !== value,
54027               valIsNull = value === null,
54028               valIsUndef = value === undefined;
54029
54030             while (low < high) {
54031               var mid = nativeFloor((low + high) / 2),
54032                 computed = iteratee(array[mid]),
54033                 isDef = computed !== undefined,
54034                 isReflexive = computed === computed;
54035
54036               if (valIsNaN) {
54037                 var setLow = isReflexive || retHighest;
54038               } else if (valIsNull) {
54039                 setLow = isReflexive && isDef && (retHighest || computed != null);
54040               } else if (valIsUndef) {
54041                 setLow = isReflexive && (retHighest || isDef);
54042               } else if (computed == null) {
54043                 setLow = false;
54044               } else {
54045                 setLow = retHighest ? (computed <= value) : (computed < value);
54046               }
54047               if (setLow) {
54048                 low = mid + 1;
54049               } else {
54050                 high = mid;
54051               }
54052             }
54053             return nativeMin(high, MAX_ARRAY_INDEX);
54054           }
54055
54056           /**
54057            * A specialized version of `baseCallback` which only supports `this`
54058            * binding and specifying the number of arguments to provide to `func`.
54059            *
54060            * @private
54061            * @param {Function}
54062            *            func The function to bind.
54063            * @param {*}
54064            *            thisArg The `this` binding of `func`.
54065            * @param {number}
54066            *            [argCount] The number of arguments to provide to `func`.
54067            * @returns {Function} Returns the callback.
54068            */
54069           function bindCallback(func, thisArg, argCount) {
54070             if (typeof func != 'function') {
54071               return identity;
54072             }
54073             if (thisArg === undefined) {
54074               return func;
54075             }
54076             switch (argCount) {
54077               case 1:
54078                 return function(value) {
54079                   return func.call(thisArg, value);
54080                 };
54081               case 3:
54082                 return function(value, index, collection) {
54083                   return func.call(thisArg, value, index, collection);
54084                 };
54085               case 4:
54086                 return function(accumulator, value, index, collection) {
54087                   return func.call(thisArg, accumulator, value, index, collection);
54088                 };
54089               case 5:
54090                 return function(value, other, key, object, source) {
54091                   return func.call(thisArg, value, other, key, object, source);
54092                 };
54093             }
54094             return function() {
54095               return func.apply(thisArg, arguments);
54096             };
54097           }
54098
54099           /**
54100            * Creates a clone of the given array buffer.
54101            *
54102            * @private
54103            * @param {ArrayBuffer}
54104            *            buffer The array buffer to clone.
54105            * @returns {ArrayBuffer} Returns the cloned array buffer.
54106            */
54107           function bufferClone(buffer) {
54108             var result = new ArrayBuffer(buffer.byteLength),
54109               view = new Uint8Array(result);
54110
54111             view.set(new Uint8Array(buffer));
54112             return result;
54113           }
54114
54115           /**
54116            * Creates an array that is the composition of partially applied arguments,
54117            * placeholders, and provided arguments into a single array of arguments.
54118            *
54119            * @private
54120            * @param {Array|Object}
54121            *            args The provided arguments.
54122            * @param {Array}
54123            *            partials The arguments to prepend to those provided.
54124            * @param {Array}
54125            *            holders The `partials` placeholder indexes.
54126            * @returns {Array} Returns the new array of composed arguments.
54127            */
54128           function composeArgs(args, partials, holders) {
54129             var holdersLength = holders.length,
54130               argsIndex = -1,
54131               argsLength = nativeMax(args.length - holdersLength, 0),
54132               leftIndex = -1,
54133               leftLength = partials.length,
54134               result = Array(leftLength + argsLength);
54135
54136             while (++leftIndex < leftLength) {
54137               result[leftIndex] = partials[leftIndex];
54138             }
54139             while (++argsIndex < holdersLength) {
54140               result[holders[argsIndex]] = args[argsIndex];
54141             }
54142             while (argsLength--) {
54143               result[leftIndex++] = args[argsIndex++];
54144             }
54145             return result;
54146           }
54147
54148           /**
54149            * This function is like `composeArgs` except that the arguments composition
54150            * is tailored for `_.partialRight`.
54151            *
54152            * @private
54153            * @param {Array|Object}
54154            *            args The provided arguments.
54155            * @param {Array}
54156            *            partials The arguments to append to those provided.
54157            * @param {Array}
54158            *            holders The `partials` placeholder indexes.
54159            * @returns {Array} Returns the new array of composed arguments.
54160            */
54161           function composeArgsRight(args, partials, holders) {
54162             var holdersIndex = -1,
54163               holdersLength = holders.length,
54164               argsIndex = -1,
54165               argsLength = nativeMax(args.length - holdersLength, 0),
54166               rightIndex = -1,
54167               rightLength = partials.length,
54168               result = Array(argsLength + rightLength);
54169
54170             while (++argsIndex < argsLength) {
54171               result[argsIndex] = args[argsIndex];
54172             }
54173             var offset = argsIndex;
54174             while (++rightIndex < rightLength) {
54175               result[offset + rightIndex] = partials[rightIndex];
54176             }
54177             while (++holdersIndex < holdersLength) {
54178               result[offset + holders[holdersIndex]] = args[argsIndex++];
54179             }
54180             return result;
54181           }
54182
54183           /**
54184            * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition`
54185            * function.
54186            *
54187            * @private
54188            * @param {Function}
54189            *            setter The function to set keys and values of the accumulator
54190            *            object.
54191            * @param {Function}
54192            *            [initializer] The function to initialize the accumulator
54193            *            object.
54194            * @returns {Function} Returns the new aggregator function.
54195            */
54196           function createAggregator(setter, initializer) {
54197             return function(collection, iteratee, thisArg) {
54198               var result = initializer ? initializer() : {};
54199               iteratee = getCallback(iteratee, thisArg, 3);
54200
54201               if (isArray(collection)) {
54202                 var index = -1,
54203                   length = collection.length;
54204
54205                 while (++index < length) {
54206                   var value = collection[index];
54207                   setter(result, value, iteratee(value, index, collection), collection);
54208                 }
54209               } else {
54210                 baseEach(collection, function(value, key, collection) {
54211                   setter(result, value, iteratee(value, key, collection), collection);
54212                 });
54213               }
54214               return result;
54215             };
54216           }
54217
54218           /**
54219            * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
54220            *
54221            * @private
54222            * @param {Function}
54223            *            assigner The function to assign values.
54224            * @returns {Function} Returns the new assigner function.
54225            */
54226           function createAssigner(assigner) {
54227             return restParam(function(object, sources) {
54228               var index = -1,
54229                 length = object == null ? 0 : sources.length,
54230                 customizer = length > 2 ? sources[length - 2] : undefined,
54231                 guard = length > 2 ? sources[2] : undefined,
54232                 thisArg = length > 1 ? sources[length - 1] : undefined;
54233
54234               if (typeof customizer == 'function') {
54235                 customizer = bindCallback(customizer, thisArg, 5);
54236                 length -= 2;
54237               } else {
54238                 customizer = typeof thisArg == 'function' ? thisArg : undefined;
54239                 length -= (customizer ? 1 : 0);
54240               }
54241               if (guard && isIterateeCall(sources[0], sources[1], guard)) {
54242                 customizer = length < 3 ? undefined : customizer;
54243                 length = 1;
54244               }
54245               while (++index < length) {
54246                 var source = sources[index];
54247                 if (source) {
54248                   assigner(object, source, customizer);
54249                 }
54250               }
54251               return object;
54252             });
54253           }
54254
54255           /**
54256            * Creates a `baseEach` or `baseEachRight` function.
54257            *
54258            * @private
54259            * @param {Function}
54260            *            eachFunc The function to iterate over a collection.
54261            * @param {boolean}
54262            *            [fromRight] Specify iterating from right to left.
54263            * @returns {Function} Returns the new base function.
54264            */
54265           function createBaseEach(eachFunc, fromRight) {
54266             return function(collection, iteratee) {
54267               var length = collection ? getLength(collection) : 0;
54268               if (!isLength(length)) {
54269                 return eachFunc(collection, iteratee);
54270               }
54271               var index = fromRight ? length : -1,
54272                 iterable = toObject(collection);
54273
54274               while ((fromRight ? index-- : ++index < length)) {
54275                 if (iteratee(iterable[index], index, iterable) === false) {
54276                   break;
54277                 }
54278               }
54279               return collection;
54280             };
54281           }
54282
54283           /**
54284            * Creates a base function for `_.forIn` or `_.forInRight`.
54285            *
54286            * @private
54287            * @param {boolean}
54288            *            [fromRight] Specify iterating from right to left.
54289            * @returns {Function} Returns the new base function.
54290            */
54291           function createBaseFor(fromRight) {
54292             return function(object, iteratee, keysFunc) {
54293               var iterable = toObject(object),
54294                 props = keysFunc(object),
54295                 length = props.length,
54296                 index = fromRight ? length : -1;
54297
54298               while ((fromRight ? index-- : ++index < length)) {
54299                 var key = props[index];
54300                 if (iteratee(iterable[key], key, iterable) === false) {
54301                   break;
54302                 }
54303               }
54304               return object;
54305             };
54306           }
54307
54308           /**
54309            * Creates a function that wraps `func` and invokes it with the `this`
54310            * binding of `thisArg`.
54311            *
54312            * @private
54313            * @param {Function}
54314            *            func The function to bind.
54315            * @param {*}
54316            *            [thisArg] The `this` binding of `func`.
54317            * @returns {Function} Returns the new bound function.
54318            */
54319           function createBindWrapper(func, thisArg) {
54320             var Ctor = createCtorWrapper(func);
54321
54322             function wrapper() {
54323               var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54324               return fn.apply(thisArg, arguments);
54325             }
54326             return wrapper;
54327           }
54328
54329           /**
54330            * Creates a `Set` cache object to optimize linear searches of large arrays.
54331            *
54332            * @private
54333            * @param {Array}
54334            *            [values] The values to cache.
54335            * @returns {null|Object} Returns the new cache object if `Set` is
54336            *          supported, else `null`.
54337            */
54338           function createCache(values) {
54339             return (nativeCreate && Set) ? new SetCache(values) : null;
54340           }
54341
54342           /**
54343            * Creates a function that produces compound words out of the words in a
54344            * given string.
54345            *
54346            * @private
54347            * @param {Function}
54348            *            callback The function to combine each word.
54349            * @returns {Function} Returns the new compounder function.
54350            */
54351           function createCompounder(callback) {
54352             return function(string) {
54353               var index = -1,
54354                 array = words(deburr(string)),
54355                 length = array.length,
54356                 result = '';
54357
54358               while (++index < length) {
54359                 result = callback(result, array[index], index);
54360               }
54361               return result;
54362             };
54363           }
54364
54365           /**
54366            * Creates a function that produces an instance of `Ctor` regardless of
54367            * whether it was invoked as part of a `new` expression or by `call` or
54368            * `apply`.
54369            *
54370            * @private
54371            * @param {Function}
54372            *            Ctor The constructor to wrap.
54373            * @returns {Function} Returns the new wrapped function.
54374            */
54375           function createCtorWrapper(Ctor) {
54376             return function() {
54377               // Use a `switch` statement to work with class constructors.
54378               // See
54379               // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
54380               // for more details.
54381               var args = arguments;
54382               switch (args.length) {
54383                 case 0:
54384                   return new Ctor;
54385                 case 1:
54386                   return new Ctor(args[0]);
54387                 case 2:
54388                   return new Ctor(args[0], args[1]);
54389                 case 3:
54390                   return new Ctor(args[0], args[1], args[2]);
54391                 case 4:
54392                   return new Ctor(args[0], args[1], args[2], args[3]);
54393                 case 5:
54394                   return new Ctor(args[0], args[1], args[2], args[3], args[4]);
54395                 case 6:
54396                   return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
54397                 case 7:
54398                   return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
54399               }
54400               var thisBinding = baseCreate(Ctor.prototype),
54401                 result = Ctor.apply(thisBinding, args);
54402
54403               // Mimic the constructor's `return` behavior.
54404               // See https://es5.github.io/#x13.2.2 for more details.
54405               return isObject(result) ? result : thisBinding;
54406             };
54407           }
54408
54409           /**
54410            * Creates a `_.curry` or `_.curryRight` function.
54411            *
54412            * @private
54413            * @param {boolean}
54414            *            flag The curry bit flag.
54415            * @returns {Function} Returns the new curry function.
54416            */
54417           function createCurry(flag) {
54418             function curryFunc(func, arity, guard) {
54419               if (guard && isIterateeCall(func, arity, guard)) {
54420                 arity = undefined;
54421               }
54422               var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
54423               result.placeholder = curryFunc.placeholder;
54424               return result;
54425             }
54426             return curryFunc;
54427           }
54428
54429           /**
54430            * Creates a `_.defaults` or `_.defaultsDeep` function.
54431            *
54432            * @private
54433            * @param {Function}
54434            *            assigner The function to assign values.
54435            * @param {Function}
54436            *            customizer The function to customize assigned values.
54437            * @returns {Function} Returns the new defaults function.
54438            */
54439           function createDefaults(assigner, customizer) {
54440             return restParam(function(args) {
54441               var object = args[0];
54442               if (object == null) {
54443                 return object;
54444               }
54445               args.push(customizer);
54446               return assigner.apply(undefined, args);
54447             });
54448           }
54449
54450           /**
54451            * Creates a `_.max` or `_.min` function.
54452            *
54453            * @private
54454            * @param {Function}
54455            *            comparator The function used to compare values.
54456            * @param {*}
54457            *            exValue The initial extremum value.
54458            * @returns {Function} Returns the new extremum function.
54459            */
54460           function createExtremum(comparator, exValue) {
54461             return function(collection, iteratee, thisArg) {
54462               if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
54463                 iteratee = undefined;
54464               }
54465               iteratee = getCallback(iteratee, thisArg, 3);
54466               if (iteratee.length == 1) {
54467                 collection = isArray(collection) ? collection : toIterable(collection);
54468                 var result = arrayExtremum(collection, iteratee, comparator, exValue);
54469                 if (!(collection.length && result === exValue)) {
54470                   return result;
54471                 }
54472               }
54473               return baseExtremum(collection, iteratee, comparator, exValue);
54474             };
54475           }
54476
54477           /**
54478            * Creates a `_.find` or `_.findLast` function.
54479            *
54480            * @private
54481            * @param {Function}
54482            *            eachFunc The function to iterate over a collection.
54483            * @param {boolean}
54484            *            [fromRight] Specify iterating from right to left.
54485            * @returns {Function} Returns the new find function.
54486            */
54487           function createFind(eachFunc, fromRight) {
54488             return function(collection, predicate, thisArg) {
54489               predicate = getCallback(predicate, thisArg, 3);
54490               if (isArray(collection)) {
54491                 var index = baseFindIndex(collection, predicate, fromRight);
54492                 return index > -1 ? collection[index] : undefined;
54493               }
54494               return baseFind(collection, predicate, eachFunc);
54495             };
54496           }
54497
54498           /**
54499            * Creates a `_.findIndex` or `_.findLastIndex` function.
54500            *
54501            * @private
54502            * @param {boolean}
54503            *            [fromRight] Specify iterating from right to left.
54504            * @returns {Function} Returns the new find function.
54505            */
54506           function createFindIndex(fromRight) {
54507             return function(array, predicate, thisArg) {
54508               if (!(array && array.length)) {
54509                 return -1;
54510               }
54511               predicate = getCallback(predicate, thisArg, 3);
54512               return baseFindIndex(array, predicate, fromRight);
54513             };
54514           }
54515
54516           /**
54517            * Creates a `_.findKey` or `_.findLastKey` function.
54518            *
54519            * @private
54520            * @param {Function}
54521            *            objectFunc The function to iterate over an object.
54522            * @returns {Function} Returns the new find function.
54523            */
54524           function createFindKey(objectFunc) {
54525             return function(object, predicate, thisArg) {
54526               predicate = getCallback(predicate, thisArg, 3);
54527               return baseFind(object, predicate, objectFunc, true);
54528             };
54529           }
54530
54531           /**
54532            * Creates a `_.flow` or `_.flowRight` function.
54533            *
54534            * @private
54535            * @param {boolean}
54536            *            [fromRight] Specify iterating from right to left.
54537            * @returns {Function} Returns the new flow function.
54538            */
54539           function createFlow(fromRight) {
54540             return function() {
54541               var wrapper,
54542                 length = arguments.length,
54543                 index = fromRight ? length : -1,
54544                 leftIndex = 0,
54545                 funcs = Array(length);
54546
54547               while ((fromRight ? index-- : ++index < length)) {
54548                 var func = funcs[leftIndex++] = arguments[index];
54549                 if (typeof func != 'function') {
54550                   throw new TypeError(FUNC_ERROR_TEXT);
54551                 }
54552                 if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
54553                   wrapper = new LodashWrapper([], true);
54554                 }
54555               }
54556               index = wrapper ? -1 : length;
54557               while (++index < length) {
54558                 func = funcs[index];
54559
54560                 var funcName = getFuncName(func),
54561                   data = funcName == 'wrapper' ? getData(func) : undefined;
54562
54563                 if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
54564                   wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
54565                 } else {
54566                   wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
54567                 }
54568               }
54569               return function() {
54570                 var args = arguments,
54571                   value = args[0];
54572
54573                 if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
54574                   return wrapper.plant(value).value();
54575                 }
54576                 var index = 0,
54577                   result = length ? funcs[index].apply(this, args) : value;
54578
54579                 while (++index < length) {
54580                   result = funcs[index].call(this, result);
54581                 }
54582                 return result;
54583               };
54584             };
54585           }
54586
54587           /**
54588            * Creates a function for `_.forEach` or `_.forEachRight`.
54589            *
54590            * @private
54591            * @param {Function}
54592            *            arrayFunc The function to iterate over an array.
54593            * @param {Function}
54594            *            eachFunc The function to iterate over a collection.
54595            * @returns {Function} Returns the new each function.
54596            */
54597           function createForEach(arrayFunc, eachFunc) {
54598             return function(collection, iteratee, thisArg) {
54599               return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
54600             };
54601           }
54602
54603           /**
54604            * Creates a function for `_.forIn` or `_.forInRight`.
54605            *
54606            * @private
54607            * @param {Function}
54608            *            objectFunc The function to iterate over an object.
54609            * @returns {Function} Returns the new each function.
54610            */
54611           function createForIn(objectFunc) {
54612             return function(object, iteratee, thisArg) {
54613               if (typeof iteratee != 'function' || thisArg !== undefined) {
54614                 iteratee = bindCallback(iteratee, thisArg, 3);
54615               }
54616               return objectFunc(object, iteratee, keysIn);
54617             };
54618           }
54619
54620           /**
54621            * Creates a function for `_.forOwn` or `_.forOwnRight`.
54622            *
54623            * @private
54624            * @param {Function}
54625            *            objectFunc The function to iterate over an object.
54626            * @returns {Function} Returns the new each function.
54627            */
54628           function createForOwn(objectFunc) {
54629             return function(object, iteratee, thisArg) {
54630               if (typeof iteratee != 'function' || thisArg !== undefined) {
54631                 iteratee = bindCallback(iteratee, thisArg, 3);
54632               }
54633               return objectFunc(object, iteratee);
54634             };
54635           }
54636
54637           /**
54638            * Creates a function for `_.mapKeys` or `_.mapValues`.
54639            *
54640            * @private
54641            * @param {boolean}
54642            *            [isMapKeys] Specify mapping keys instead of values.
54643            * @returns {Function} Returns the new map function.
54644            */
54645           function createObjectMapper(isMapKeys) {
54646             return function(object, iteratee, thisArg) {
54647               var result = {};
54648               iteratee = getCallback(iteratee, thisArg, 3);
54649
54650               baseForOwn(object, function(value, key, object) {
54651                 var mapped = iteratee(value, key, object);
54652                 key = isMapKeys ? mapped : key;
54653                 value = isMapKeys ? value : mapped;
54654                 result[key] = value;
54655               });
54656               return result;
54657             };
54658           }
54659
54660           /**
54661            * Creates a function for `_.padLeft` or `_.padRight`.
54662            *
54663            * @private
54664            * @param {boolean}
54665            *            [fromRight] Specify padding from the right.
54666            * @returns {Function} Returns the new pad function.
54667            */
54668           function createPadDir(fromRight) {
54669             return function(string, length, chars) {
54670               string = baseToString(string);
54671               return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
54672             };
54673           }
54674
54675           /**
54676            * Creates a `_.partial` or `_.partialRight` function.
54677            *
54678            * @private
54679            * @param {boolean}
54680            *            flag The partial bit flag.
54681            * @returns {Function} Returns the new partial function.
54682            */
54683           function createPartial(flag) {
54684             var partialFunc = restParam(function(func, partials) {
54685               var holders = replaceHolders(partials, partialFunc.placeholder);
54686               return createWrapper(func, flag, undefined, partials, holders);
54687             });
54688             return partialFunc;
54689           }
54690
54691           /**
54692            * Creates a function for `_.reduce` or `_.reduceRight`.
54693            *
54694            * @private
54695            * @param {Function}
54696            *            arrayFunc The function to iterate over an array.
54697            * @param {Function}
54698            *            eachFunc The function to iterate over a collection.
54699            * @returns {Function} Returns the new each function.
54700            */
54701           function createReduce(arrayFunc, eachFunc) {
54702             return function(collection, iteratee, accumulator, thisArg) {
54703               var initFromArray = arguments.length < 3;
54704               return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
54705             };
54706           }
54707
54708           /**
54709            * Creates a function that wraps `func` and invokes it with optional `this`
54710            * binding of, partial application, and currying.
54711            *
54712            * @private
54713            * @param {Function|string}
54714            *            func The function or method name to reference.
54715            * @param {number}
54716            *            bitmask The bitmask of flags. See `createWrapper` for more
54717            *            details.
54718            * @param {*}
54719            *            [thisArg] The `this` binding of `func`.
54720            * @param {Array}
54721            *            [partials] The arguments to prepend to those provided to the
54722            *            new function.
54723            * @param {Array}
54724            *            [holders] The `partials` placeholder indexes.
54725            * @param {Array}
54726            *            [partialsRight] The arguments to append to those provided to
54727            *            the new function.
54728            * @param {Array}
54729            *            [holdersRight] The `partialsRight` placeholder indexes.
54730            * @param {Array}
54731            *            [argPos] The argument positions of the new function.
54732            * @param {number}
54733            *            [ary] The arity cap of `func`.
54734            * @param {number}
54735            *            [arity] The arity of `func`.
54736            * @returns {Function} Returns the new wrapped function.
54737            */
54738           function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
54739             var isAry = bitmask & ARY_FLAG,
54740               isBind = bitmask & BIND_FLAG,
54741               isBindKey = bitmask & BIND_KEY_FLAG,
54742               isCurry = bitmask & CURRY_FLAG,
54743               isCurryBound = bitmask & CURRY_BOUND_FLAG,
54744               isCurryRight = bitmask & CURRY_RIGHT_FLAG,
54745               Ctor = isBindKey ? undefined : createCtorWrapper(func);
54746
54747             function wrapper() {
54748               // Avoid `arguments` object use disqualifying optimizations by
54749               // converting it to an array before providing it to other functions.
54750               var length = arguments.length,
54751                 index = length,
54752                 args = Array(length);
54753
54754               while (index--) {
54755                 args[index] = arguments[index];
54756               }
54757               if (partials) {
54758                 args = composeArgs(args, partials, holders);
54759               }
54760               if (partialsRight) {
54761                 args = composeArgsRight(args, partialsRight, holdersRight);
54762               }
54763               if (isCurry || isCurryRight) {
54764                 var placeholder = wrapper.placeholder,
54765                   argsHolders = replaceHolders(args, placeholder);
54766
54767                 length -= argsHolders.length;
54768                 if (length < arity) {
54769                   var newArgPos = argPos ? arrayCopy(argPos) : undefined,
54770                     newArity = nativeMax(arity - length, 0),
54771                     newsHolders = isCurry ? argsHolders : undefined,
54772                     newHoldersRight = isCurry ? undefined : argsHolders,
54773                     newPartials = isCurry ? args : undefined,
54774                     newPartialsRight = isCurry ? undefined : args;
54775
54776                   bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
54777                   bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
54778
54779                   if (!isCurryBound) {
54780                     bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
54781                   }
54782                   var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
54783                     result = createHybridWrapper.apply(undefined, newData);
54784
54785                   if (isLaziable(func)) {
54786                     setData(result, newData);
54787                   }
54788                   result.placeholder = placeholder;
54789                   return result;
54790                 }
54791               }
54792               var thisBinding = isBind ? thisArg : this,
54793                 fn = isBindKey ? thisBinding[func] : func;
54794
54795               if (argPos) {
54796                 args = reorder(args, argPos);
54797               }
54798               if (isAry && ary < args.length) {
54799                 args.length = ary;
54800               }
54801               if (this && this !== root && this instanceof wrapper) {
54802                 fn = Ctor || createCtorWrapper(func);
54803               }
54804               return fn.apply(thisBinding, args);
54805             }
54806             return wrapper;
54807           }
54808
54809           /**
54810            * Creates the padding required for `string` based on the given `length`.
54811            * The `chars` string is truncated if the number of characters exceeds
54812            * `length`.
54813            *
54814            * @private
54815            * @param {string}
54816            *            string The string to create padding for.
54817            * @param {number}
54818            *            [length=0] The padding length.
54819            * @param {string}
54820            *            [chars=' '] The string used as padding.
54821            * @returns {string} Returns the pad for `string`.
54822            */
54823           function createPadding(string, length, chars) {
54824             var strLength = string.length;
54825             length = +length;
54826
54827             if (strLength >= length || !nativeIsFinite(length)) {
54828               return '';
54829             }
54830             var padLength = length - strLength;
54831             chars = chars == null ? ' ' : (chars + '');
54832             return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
54833           }
54834
54835           /**
54836            * Creates a function that wraps `func` and invokes it with the optional
54837            * `this` binding of `thisArg` and the `partials` prepended to those
54838            * provided to the wrapper.
54839            *
54840            * @private
54841            * @param {Function}
54842            *            func The function to partially apply arguments to.
54843            * @param {number}
54844            *            bitmask The bitmask of flags. See `createWrapper` for more
54845            *            details.
54846            * @param {*}
54847            *            thisArg The `this` binding of `func`.
54848            * @param {Array}
54849            *            partials The arguments to prepend to those provided to the new
54850            *            function.
54851            * @returns {Function} Returns the new bound function.
54852            */
54853           function createPartialWrapper(func, bitmask, thisArg, partials) {
54854             var isBind = bitmask & BIND_FLAG,
54855               Ctor = createCtorWrapper(func);
54856
54857             function wrapper() {
54858               // Avoid `arguments` object use disqualifying optimizations by
54859               // converting it to an array before providing it `func`.
54860               var argsIndex = -1,
54861                 argsLength = arguments.length,
54862                 leftIndex = -1,
54863                 leftLength = partials.length,
54864                 args = Array(leftLength + argsLength);
54865
54866               while (++leftIndex < leftLength) {
54867                 args[leftIndex] = partials[leftIndex];
54868               }
54869               while (argsLength--) {
54870                 args[leftIndex++] = arguments[++argsIndex];
54871               }
54872               var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54873               return fn.apply(isBind ? thisArg : this, args);
54874             }
54875             return wrapper;
54876           }
54877
54878           /**
54879            * Creates a `_.ceil`, `_.floor`, or `_.round` function.
54880            *
54881            * @private
54882            * @param {string}
54883            *            methodName The name of the `Math` method to use when rounding.
54884            * @returns {Function} Returns the new round function.
54885            */
54886           function createRound(methodName) {
54887             var func = Math[methodName];
54888             return function(number, precision) {
54889               precision = precision === undefined ? 0 : (+precision || 0);
54890               if (precision) {
54891                 precision = pow(10, precision);
54892                 return func(number * precision) / precision;
54893               }
54894               return func(number);
54895             };
54896           }
54897
54898           /**
54899            * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
54900            *
54901            * @private
54902            * @param {boolean}
54903            *            [retHighest] Specify returning the highest qualified index.
54904            * @returns {Function} Returns the new index function.
54905            */
54906           function createSortedIndex(retHighest) {
54907             return function(array, value, iteratee, thisArg) {
54908               var callback = getCallback(iteratee);
54909               return (iteratee == null && callback === baseCallback) ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
54910             };
54911           }
54912
54913           /**
54914            * Creates a function that either curries or invokes `func` with optional
54915            * `this` binding and partially applied arguments.
54916            *
54917            * @private
54918            * @param {Function|string}
54919            *            func The function or method name to reference.
54920            * @param {number}
54921            *            bitmask The bitmask of flags. The bitmask may be composed of
54922            *            the following flags: 1 - `_.bind` 2 - `_.bindKey` 4 -
54923            *            `_.curry` or `_.curryRight` of a bound function 8 - `_.curry`
54924            *            16 - `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
54925            *            `_.rearg` 256 - `_.ary`
54926            * @param {*}
54927            *            [thisArg] The `this` binding of `func`.
54928            * @param {Array}
54929            *            [partials] The arguments to be partially applied.
54930            * @param {Array}
54931            *            [holders] The `partials` placeholder indexes.
54932            * @param {Array}
54933            *            [argPos] The argument positions of the new function.
54934            * @param {number}
54935            *            [ary] The arity cap of `func`.
54936            * @param {number}
54937            *            [arity] The arity of `func`.
54938            * @returns {Function} Returns the new wrapped function.
54939            */
54940           function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
54941             var isBindKey = bitmask & BIND_KEY_FLAG;
54942             if (!isBindKey && typeof func != 'function') {
54943               throw new TypeError(FUNC_ERROR_TEXT);
54944             }
54945             var length = partials ? partials.length : 0;
54946             if (!length) {
54947               bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
54948               partials = holders = undefined;
54949             }
54950             length -= (holders ? holders.length : 0);
54951             if (bitmask & PARTIAL_RIGHT_FLAG) {
54952               var partialsRight = partials,
54953                 holdersRight = holders;
54954
54955               partials = holders = undefined;
54956             }
54957             var data = isBindKey ? undefined : getData(func),
54958               newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
54959
54960             if (data) {
54961               mergeData(newData, data);
54962               bitmask = newData[1];
54963               arity = newData[9];
54964             }
54965             newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
54966
54967             if (bitmask == BIND_FLAG) {
54968               var result = createBindWrapper(newData[0], newData[2]);
54969             } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
54970               result = createPartialWrapper.apply(undefined, newData);
54971             } else {
54972               result = createHybridWrapper.apply(undefined, newData);
54973             }
54974             var setter = data ? baseSetData : setData;
54975             return setter(result, newData);
54976           }
54977
54978           /**
54979            * A specialized version of `baseIsEqualDeep` for arrays with support for
54980            * partial deep comparisons.
54981            *
54982            * @private
54983            * @param {Array}
54984            *            array The array to compare.
54985            * @param {Array}
54986            *            other The other array to compare.
54987            * @param {Function}
54988            *            equalFunc The function to determine equivalents of values.
54989            * @param {Function}
54990            *            [customizer] The function to customize comparing arrays.
54991            * @param {boolean}
54992            *            [isLoose] Specify performing partial comparisons.
54993            * @param {Array}
54994            *            [stackA] Tracks traversed `value` objects.
54995            * @param {Array}
54996            *            [stackB] Tracks traversed `other` objects.
54997            * @returns {boolean} Returns `true` if the arrays are equivalent, else
54998            *          `false`.
54999            */
55000           function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
55001             var index = -1,
55002               arrLength = array.length,
55003               othLength = other.length;
55004
55005             if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
55006               return false;
55007             }
55008             // Ignore non-index properties.
55009             while (++index < arrLength) {
55010               var arrValue = array[index],
55011                 othValue = other[index],
55012                 result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
55013
55014               if (result !== undefined) {
55015                 if (result) {
55016                   continue;
55017                 }
55018                 return false;
55019               }
55020               // Recursively compare arrays (susceptible to call stack limits).
55021               if (isLoose) {
55022                 if (!arraySome(other, function(othValue) {
55023                     return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
55024                   })) {
55025                   return false;
55026                 }
55027               } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
55028                 return false;
55029               }
55030             }
55031             return true;
55032           }
55033
55034           /**
55035            * A specialized version of `baseIsEqualDeep` for comparing objects of the
55036            * same `toStringTag`.
55037            *
55038            * **Note:** This function only supports comparing values with tags of
55039            * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55040            *
55041            * @private
55042            * @param {Object}
55043            *            object The object to compare.
55044            * @param {Object}
55045            *            other The other object to compare.
55046            * @param {string}
55047            *            tag The `toStringTag` of the objects to compare.
55048            * @returns {boolean} Returns `true` if the objects are equivalent, else
55049            *          `false`.
55050            */
55051           function equalByTag(object, other, tag) {
55052             switch (tag) {
55053               case boolTag:
55054               case dateTag:
55055                 // Coerce dates and booleans to numbers, dates to milliseconds and
55056                 // booleans
55057                 // to `1` or `0` treating invalid dates coerced to `NaN` as not
55058                 // equal.
55059                 return +object == +other;
55060
55061               case errorTag:
55062                 return object.name == other.name && object.message == other.message;
55063
55064               case numberTag:
55065                 // Treat `NaN` vs. `NaN` as equal.
55066                 return (object != +object) ? other != +other : object == +other;
55067
55068               case regexpTag:
55069               case stringTag:
55070                 // Coerce regexes to strings and treat strings primitives and string
55071                 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
55072                 // details.
55073                 return object == (other + '');
55074             }
55075             return false;
55076           }
55077
55078           /**
55079            * A specialized version of `baseIsEqualDeep` for objects with support for
55080            * partial deep comparisons.
55081            *
55082            * @private
55083            * @param {Object}
55084            *            object The object to compare.
55085            * @param {Object}
55086            *            other The other object to compare.
55087            * @param {Function}
55088            *            equalFunc The function to determine equivalents of values.
55089            * @param {Function}
55090            *            [customizer] The function to customize comparing values.
55091            * @param {boolean}
55092            *            [isLoose] Specify performing partial comparisons.
55093            * @param {Array}
55094            *            [stackA] Tracks traversed `value` objects.
55095            * @param {Array}
55096            *            [stackB] Tracks traversed `other` objects.
55097            * @returns {boolean} Returns `true` if the objects are equivalent, else
55098            *          `false`.
55099            */
55100           function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
55101             var objProps = keys(object),
55102               objLength = objProps.length,
55103               othProps = keys(other),
55104               othLength = othProps.length;
55105
55106             if (objLength != othLength && !isLoose) {
55107               return false;
55108             }
55109             var index = objLength;
55110             while (index--) {
55111               var key = objProps[index];
55112               if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
55113                 return false;
55114               }
55115             }
55116             var skipCtor = isLoose;
55117             while (++index < objLength) {
55118               key = objProps[index];
55119               var objValue = object[key],
55120                 othValue = other[key],
55121                 result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
55122
55123               // Recursively compare objects (susceptible to call stack limits).
55124               if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
55125                 return false;
55126               }
55127               skipCtor || (skipCtor = key == 'constructor');
55128             }
55129             if (!skipCtor) {
55130               var objCtor = object.constructor,
55131                 othCtor = other.constructor;
55132
55133               // Non `Object` object instances with different constructors are not
55134               // equal.
55135               if (objCtor != othCtor &&
55136                 ('constructor' in object && 'constructor' in other) &&
55137                 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
55138                   typeof othCtor == 'function' && othCtor instanceof othCtor)) {
55139                 return false;
55140               }
55141             }
55142             return true;
55143           }
55144
55145           /**
55146            * Gets the appropriate "callback" function. If the `_.callback` method is
55147            * customized this function returns the custom method, otherwise it returns
55148            * the `baseCallback` function. If arguments are provided the chosen
55149            * function is invoked with them and its result is returned.
55150            *
55151            * @private
55152            * @returns {Function} Returns the chosen function or its result.
55153            */
55154           function getCallback(func, thisArg, argCount) {
55155             var result = lodash.callback || callback;
55156             result = result === callback ? baseCallback : result;
55157             return argCount ? result(func, thisArg, argCount) : result;
55158           }
55159
55160           /**
55161            * Gets metadata for `func`.
55162            *
55163            * @private
55164            * @param {Function}
55165            *            func The function to query.
55166            * @returns {*} Returns the metadata for `func`.
55167            */
55168           var getData = !metaMap ? noop : function(func) {
55169             return metaMap.get(func);
55170           };
55171
55172           /**
55173            * Gets the name of `func`.
55174            *
55175            * @private
55176            * @param {Function}
55177            *            func The function to query.
55178            * @returns {string} Returns the function name.
55179            */
55180           function getFuncName(func) {
55181             var result = func.name,
55182               array = realNames[result],
55183               length = array ? array.length : 0;
55184
55185             while (length--) {
55186               var data = array[length],
55187                 otherFunc = data.func;
55188               if (otherFunc == null || otherFunc == func) {
55189                 return data.name;
55190               }
55191             }
55192             return result;
55193           }
55194
55195           /**
55196            * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
55197            * customized this function returns the custom method, otherwise it returns
55198            * the `baseIndexOf` function. If arguments are provided the chosen function
55199            * is invoked with them and its result is returned.
55200            *
55201            * @private
55202            * @returns {Function|number} Returns the chosen function or its result.
55203            */
55204           function getIndexOf(collection, target, fromIndex) {
55205             var result = lodash.indexOf || indexOf;
55206             result = result === indexOf ? baseIndexOf : result;
55207             return collection ? result(collection, target, fromIndex) : result;
55208           }
55209
55210           /**
55211            * Gets the "length" property value of `object`.
55212            *
55213            * **Note:** This function is used to avoid a [JIT
55214            * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari
55215            * on at least iOS 8.1-8.3 ARM64.
55216            *
55217            * @private
55218            * @param {Object}
55219            *            object The object to query.
55220            * @returns {*} Returns the "length" value.
55221            */
55222           var getLength = baseProperty('length');
55223
55224           /**
55225            * Gets the propery names, values, and compare flags of `object`.
55226            *
55227            * @private
55228            * @param {Object}
55229            *            object The object to query.
55230            * @returns {Array} Returns the match data of `object`.
55231            */
55232           function getMatchData(object) {
55233             var result = pairs(object),
55234               length = result.length;
55235
55236             while (length--) {
55237               result[length][2] = isStrictComparable(result[length][1]);
55238             }
55239             return result;
55240           }
55241
55242           /**
55243            * Gets the native function at `key` of `object`.
55244            *
55245            * @private
55246            * @param {Object}
55247            *            object The object to query.
55248            * @param {string}
55249            *            key The key of the method to get.
55250            * @returns {*} Returns the function if it's native, else `undefined`.
55251            */
55252           function getNative(object, key) {
55253             var value = object == null ? undefined : object[key];
55254             return isNative(value) ? value : undefined;
55255           }
55256
55257           /**
55258            * Gets the view, applying any `transforms` to the `start` and `end`
55259            * positions.
55260            *
55261            * @private
55262            * @param {number}
55263            *            start The start of the view.
55264            * @param {number}
55265            *            end The end of the view.
55266            * @param {Array}
55267            *            transforms The transformations to apply to the view.
55268            * @returns {Object} Returns an object containing the `start` and `end`
55269            *          positions of the view.
55270            */
55271           function getView(start, end, transforms) {
55272             var index = -1,
55273               length = transforms.length;
55274
55275             while (++index < length) {
55276               var data = transforms[index],
55277                 size = data.size;
55278
55279               switch (data.type) {
55280                 case 'drop':
55281                   start += size;
55282                   break;
55283                 case 'dropRight':
55284                   end -= size;
55285                   break;
55286                 case 'take':
55287                   end = nativeMin(end, start + size);
55288                   break;
55289                 case 'takeRight':
55290                   start = nativeMax(start, end - size);
55291                   break;
55292               }
55293             }
55294             return {
55295               'start': start,
55296               'end': end
55297             };
55298           }
55299
55300           /**
55301            * Initializes an array clone.
55302            *
55303            * @private
55304            * @param {Array}
55305            *            array The array to clone.
55306            * @returns {Array} Returns the initialized clone.
55307            */
55308           function initCloneArray(array) {
55309             var length = array.length,
55310               result = new array.constructor(length);
55311
55312             // Add array properties assigned by `RegExp#exec`.
55313             if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
55314               result.index = array.index;
55315               result.input = array.input;
55316             }
55317             return result;
55318           }
55319
55320           /**
55321            * Initializes an object clone.
55322            *
55323            * @private
55324            * @param {Object}
55325            *            object The object to clone.
55326            * @returns {Object} Returns the initialized clone.
55327            */
55328           function initCloneObject(object) {
55329             var Ctor = object.constructor;
55330             if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
55331               Ctor = Object;
55332             }
55333             return new Ctor;
55334           }
55335
55336           /**
55337            * Initializes an object clone based on its `toStringTag`.
55338            *
55339            * **Note:** This function only supports cloning values with tags of
55340            * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55341            *
55342            * @private
55343            * @param {Object}
55344            *            object The object to clone.
55345            * @param {string}
55346            *            tag The `toStringTag` of the object to clone.
55347            * @param {boolean}
55348            *            [isDeep] Specify a deep clone.
55349            * @returns {Object} Returns the initialized clone.
55350            */
55351           function initCloneByTag(object, tag, isDeep) {
55352             var Ctor = object.constructor;
55353             switch (tag) {
55354               case arrayBufferTag:
55355                 return bufferClone(object);
55356
55357               case boolTag:
55358               case dateTag:
55359                 return new Ctor(+object);
55360
55361               case float32Tag:
55362               case float64Tag:
55363               case int8Tag:
55364               case int16Tag:
55365               case int32Tag:
55366               case uint8Tag:
55367               case uint8ClampedTag:
55368               case uint16Tag:
55369               case uint32Tag:
55370                 var buffer = object.buffer;
55371                 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
55372
55373               case numberTag:
55374               case stringTag:
55375                 return new Ctor(object);
55376
55377               case regexpTag:
55378                 var result = new Ctor(object.source, reFlags.exec(object));
55379                 result.lastIndex = object.lastIndex;
55380             }
55381             return result;
55382           }
55383
55384           /**
55385            * Invokes the method at `path` on `object`.
55386            *
55387            * @private
55388            * @param {Object}
55389            *            object The object to query.
55390            * @param {Array|string}
55391            *            path The path of the method to invoke.
55392            * @param {Array}
55393            *            args The arguments to invoke the method with.
55394            * @returns {*} Returns the result of the invoked method.
55395            */
55396           function invokePath(object, path, args) {
55397             if (object != null && !isKey(path, object)) {
55398               path = toPath(path);
55399               object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
55400               path = last(path);
55401             }
55402             var func = object == null ? object : object[path];
55403             return func == null ? undefined : func.apply(object, args);
55404           }
55405
55406           /**
55407            * Checks if `value` is array-like.
55408            *
55409            * @private
55410            * @param {*}
55411            *            value The value to check.
55412            * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
55413            */
55414           function isArrayLike(value) {
55415             return value != null && isLength(getLength(value));
55416           }
55417
55418           /**
55419            * Checks if `value` is a valid array-like index.
55420            *
55421            * @private
55422            * @param {*}
55423            *            value The value to check.
55424            * @param {number}
55425            *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
55426            * @returns {boolean} Returns `true` if `value` is a valid index, else
55427            *          `false`.
55428            */
55429           function isIndex(value, length) {
55430             value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
55431             length = length == null ? MAX_SAFE_INTEGER : length;
55432             return value > -1 && value % 1 == 0 && value < length;
55433           }
55434
55435           /**
55436            * Checks if the provided arguments are from an iteratee call.
55437            *
55438            * @private
55439            * @param {*}
55440            *            value The potential iteratee value argument.
55441            * @param {*}
55442            *            index The potential iteratee index or key argument.
55443            * @param {*}
55444            *            object The potential iteratee object argument.
55445            * @returns {boolean} Returns `true` if the arguments are from an iteratee
55446            *          call, else `false`.
55447            */
55448           function isIterateeCall(value, index, object) {
55449             if (!isObject(object)) {
55450               return false;
55451             }
55452             var type = typeof index;
55453             if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
55454               var other = object[index];
55455               return value === value ? (value === other) : (other !== other);
55456             }
55457             return false;
55458           }
55459
55460           /**
55461            * Checks if `value` is a property name and not a property path.
55462            *
55463            * @private
55464            * @param {*}
55465            *            value The value to check.
55466            * @param {Object}
55467            *            [object] The object to query keys on.
55468            * @returns {boolean} Returns `true` if `value` is a property name, else
55469            *          `false`.
55470            */
55471           function isKey(value, object) {
55472             var type = typeof value;
55473             if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
55474               return true;
55475             }
55476             if (isArray(value)) {
55477               return false;
55478             }
55479             var result = !reIsDeepProp.test(value);
55480             return result || (object != null && value in toObject(object));
55481           }
55482
55483           /**
55484            * Checks if `func` has a lazy counterpart.
55485            *
55486            * @private
55487            * @param {Function}
55488            *            func The function to check.
55489            * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
55490            *          `false`.
55491            */
55492           function isLaziable(func) {
55493             var funcName = getFuncName(func);
55494             if (!(funcName in LazyWrapper.prototype)) {
55495               return false;
55496             }
55497             var other = lodash[funcName];
55498             if (func === other) {
55499               return true;
55500             }
55501             var data = getData(other);
55502             return !!data && func === data[0];
55503           }
55504
55505           /**
55506            * Checks if `value` is a valid array-like length.
55507            *
55508            * **Note:** This function is based on
55509            * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
55510            *
55511            * @private
55512            * @param {*}
55513            *            value The value to check.
55514            * @returns {boolean} Returns `true` if `value` is a valid length, else
55515            *          `false`.
55516            */
55517           function isLength(value) {
55518             return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
55519           }
55520
55521           /**
55522            * Checks if `value` is suitable for strict equality comparisons, i.e.
55523            * `===`.
55524            *
55525            * @private
55526            * @param {*}
55527            *            value The value to check.
55528            * @returns {boolean} Returns `true` if `value` if suitable for strict
55529            *          equality comparisons, else `false`.
55530            */
55531           function isStrictComparable(value) {
55532             return value === value && !isObject(value);
55533           }
55534
55535           /**
55536            * Merges the function metadata of `source` into `data`.
55537            *
55538            * Merging metadata reduces the number of wrappers required to invoke a
55539            * function. This is possible because methods like `_.bind`, `_.curry`, and
55540            * `_.partial` may be applied regardless of execution order. Methods like
55541            * `_.ary` and `_.rearg` augment function arguments, making the order in
55542            * which they are executed important, preventing the merging of metadata.
55543            * However, we make an exception for a safe common case where curried
55544            * functions have `_.ary` and or `_.rearg` applied.
55545            *
55546            * @private
55547            * @param {Array}
55548            *            data The destination metadata.
55549            * @param {Array}
55550            *            source The source metadata.
55551            * @returns {Array} Returns `data`.
55552            */
55553           function mergeData(data, source) {
55554             var bitmask = data[1],
55555               srcBitmask = source[1],
55556               newBitmask = bitmask | srcBitmask,
55557               isCommon = newBitmask < ARY_FLAG;
55558
55559             var isCombo =
55560               (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
55561               (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
55562               (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
55563
55564             // Exit early if metadata can't be merged.
55565             if (!(isCommon || isCombo)) {
55566               return data;
55567             }
55568             // Use source `thisArg` if available.
55569             if (srcBitmask & BIND_FLAG) {
55570               data[2] = source[2];
55571               // Set when currying a bound function.
55572               newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
55573             }
55574             // Compose partial arguments.
55575             var value = source[3];
55576             if (value) {
55577               var partials = data[3];
55578               data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
55579               data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
55580             }
55581             // Compose partial right arguments.
55582             value = source[5];
55583             if (value) {
55584               partials = data[5];
55585               data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
55586               data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
55587             }
55588             // Use source `argPos` if available.
55589             value = source[7];
55590             if (value) {
55591               data[7] = arrayCopy(value);
55592             }
55593             // Use source `ary` if it's smaller.
55594             if (srcBitmask & ARY_FLAG) {
55595               data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
55596             }
55597             // Use source `arity` if one is not provided.
55598             if (data[9] == null) {
55599               data[9] = source[9];
55600             }
55601             // Use source `func` and merge bitmasks.
55602             data[0] = source[0];
55603             data[1] = newBitmask;
55604
55605             return data;
55606           }
55607
55608           /**
55609            * Used by `_.defaultsDeep` to customize its `_.merge` use.
55610            *
55611            * @private
55612            * @param {*}
55613            *            objectValue The destination object property value.
55614            * @param {*}
55615            *            sourceValue The source object property value.
55616            * @returns {*} Returns the value to assign to the destination object.
55617            */
55618           function mergeDefaults(objectValue, sourceValue) {
55619             return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
55620           }
55621
55622           /**
55623            * A specialized version of `_.pick` which picks `object` properties
55624            * specified by `props`.
55625            *
55626            * @private
55627            * @param {Object}
55628            *            object The source object.
55629            * @param {string[]}
55630            *            props The property names to pick.
55631            * @returns {Object} Returns the new object.
55632            */
55633           function pickByArray(object, props) {
55634             object = toObject(object);
55635
55636             var index = -1,
55637               length = props.length,
55638               result = {};
55639
55640             while (++index < length) {
55641               var key = props[index];
55642               if (key in object) {
55643                 result[key] = object[key];
55644               }
55645             }
55646             return result;
55647           }
55648
55649           /**
55650            * A specialized version of `_.pick` which picks `object` properties
55651            * `predicate` returns truthy for.
55652            *
55653            * @private
55654            * @param {Object}
55655            *            object The source object.
55656            * @param {Function}
55657            *            predicate The function invoked per iteration.
55658            * @returns {Object} Returns the new object.
55659            */
55660           function pickByCallback(object, predicate) {
55661             var result = {};
55662             baseForIn(object, function(value, key, object) {
55663               if (predicate(value, key, object)) {
55664                 result[key] = value;
55665               }
55666             });
55667             return result;
55668           }
55669
55670           /**
55671            * Reorder `array` according to the specified indexes where the element at
55672            * the first index is assigned as the first element, the element at the
55673            * second index is assigned as the second element, and so on.
55674            *
55675            * @private
55676            * @param {Array}
55677            *            array The array to reorder.
55678            * @param {Array}
55679            *            indexes The arranged array indexes.
55680            * @returns {Array} Returns `array`.
55681            */
55682           function reorder(array, indexes) {
55683             var arrLength = array.length,
55684               length = nativeMin(indexes.length, arrLength),
55685               oldArray = arrayCopy(array);
55686
55687             while (length--) {
55688               var index = indexes[length];
55689               array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
55690             }
55691             return array;
55692           }
55693
55694           /**
55695            * Sets metadata for `func`.
55696            *
55697            * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
55698            * period of time, it will trip its breaker and transition to an identity
55699            * function to avoid garbage collection pauses in V8. See [V8 issue
55700            * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more
55701            * details.
55702            *
55703            * @private
55704            * @param {Function}
55705            *            func The function to associate metadata with.
55706            * @param {*}
55707            *            data The metadata.
55708            * @returns {Function} Returns `func`.
55709            */
55710           var setData = (function() {
55711             var count = 0,
55712               lastCalled = 0;
55713
55714             return function(key, value) {
55715               var stamp = now(),
55716                 remaining = HOT_SPAN - (stamp - lastCalled);
55717
55718               lastCalled = stamp;
55719               if (remaining > 0) {
55720                 if (++count >= HOT_COUNT) {
55721                   return key;
55722                 }
55723               } else {
55724                 count = 0;
55725               }
55726               return baseSetData(key, value);
55727             };
55728           }());
55729
55730           /**
55731            * A fallback implementation of `Object.keys` which creates an array of the
55732            * own enumerable property names of `object`.
55733            *
55734            * @private
55735            * @param {Object}
55736            *            object The object to query.
55737            * @returns {Array} Returns the array of property names.
55738            */
55739           function shimKeys(object) {
55740             var props = keysIn(object),
55741               propsLength = props.length,
55742               length = propsLength && object.length;
55743
55744             var allowIndexes = !!length && isLength(length) &&
55745               (isArray(object) || isArguments(object));
55746
55747             var index = -1,
55748               result = [];
55749
55750             while (++index < propsLength) {
55751               var key = props[index];
55752               if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
55753                 result.push(key);
55754               }
55755             }
55756             return result;
55757           }
55758
55759           /**
55760            * Converts `value` to an array-like object if it's not one.
55761            *
55762            * @private
55763            * @param {*}
55764            *            value The value to process.
55765            * @returns {Array|Object} Returns the array-like object.
55766            */
55767           function toIterable(value) {
55768             if (value == null) {
55769               return [];
55770             }
55771             if (!isArrayLike(value)) {
55772               return values(value);
55773             }
55774             return isObject(value) ? value : Object(value);
55775           }
55776
55777           /**
55778            * Converts `value` to an object if it's not one.
55779            *
55780            * @private
55781            * @param {*}
55782            *            value The value to process.
55783            * @returns {Object} Returns the object.
55784            */
55785           function toObject(value) {
55786             return isObject(value) ? value : Object(value);
55787           }
55788
55789           /**
55790            * Converts `value` to property path array if it's not one.
55791            *
55792            * @private
55793            * @param {*}
55794            *            value The value to process.
55795            * @returns {Array} Returns the property path array.
55796            */
55797           function toPath(value) {
55798             if (isArray(value)) {
55799               return value;
55800             }
55801             var result = [];
55802             baseToString(value).replace(rePropName, function(match, number, quote, string) {
55803               result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
55804             });
55805             return result;
55806           }
55807
55808           /**
55809            * Creates a clone of `wrapper`.
55810            *
55811            * @private
55812            * @param {Object}
55813            *            wrapper The wrapper to clone.
55814            * @returns {Object} Returns the cloned wrapper.
55815            */
55816           function wrapperClone(wrapper) {
55817             return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
55818           }
55819
55820           /*------------------------------------------------------------------------*/
55821
55822           /**
55823            * Creates an array of elements split into groups the length of `size`. If
55824            * `collection` can't be split evenly, the final chunk will be the remaining
55825            * elements.
55826            *
55827            * @static
55828            * @memberOf _
55829            * @category Array
55830            * @param {Array}
55831            *            array The array to process.
55832            * @param {number}
55833            *            [size=1] The length of each chunk.
55834            * @param- {Object} [guard] Enables use as a callback for functions like
55835            *         `_.map`.
55836            * @returns {Array} Returns the new array containing chunks.
55837            * @example
55838            *
55839            * _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']]
55840            *
55841            * _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']]
55842            */
55843           function chunk(array, size, guard) {
55844             if (guard ? isIterateeCall(array, size, guard) : size == null) {
55845               size = 1;
55846             } else {
55847               size = nativeMax(nativeFloor(size) || 1, 1);
55848             }
55849             var index = 0,
55850               length = array ? array.length : 0,
55851               resIndex = -1,
55852               result = Array(nativeCeil(length / size));
55853
55854             while (index < length) {
55855               result[++resIndex] = baseSlice(array, index, (index += size));
55856             }
55857             return result;
55858           }
55859
55860           /**
55861            * Creates an array with all falsey values removed. The values `false`,
55862            * `null`, `0`, `""`, `undefined`, and `NaN` are falsey.
55863            *
55864            * @static
55865            * @memberOf _
55866            * @category Array
55867            * @param {Array}
55868            *            array The array to compact.
55869            * @returns {Array} Returns the new array of filtered values.
55870            * @example
55871            *
55872            * _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]
55873            */
55874           function compact(array) {
55875             var index = -1,
55876               length = array ? array.length : 0,
55877               resIndex = -1,
55878               result = [];
55879
55880             while (++index < length) {
55881               var value = array[index];
55882               if (value) {
55883                 result[++resIndex] = value;
55884               }
55885             }
55886             return result;
55887           }
55888
55889           /**
55890            * Creates an array of unique `array` values not included in the other
55891            * provided arrays using
55892            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
55893            * for equality comparisons.
55894            *
55895            * @static
55896            * @memberOf _
55897            * @category Array
55898            * @param {Array}
55899            *            array The array to inspect.
55900            * @param {...Array}
55901            *            [values] The arrays of values to exclude.
55902            * @returns {Array} Returns the new array of filtered values.
55903            * @example
55904            *
55905            * _.difference([1, 2, 3], [4, 2]); // => [1, 3]
55906            */
55907           var difference = restParam(function(array, values) {
55908             return (isObjectLike(array) && isArrayLike(array)) ? baseDifference(array, baseFlatten(values, false, true)) : [];
55909           });
55910
55911           /**
55912            * Creates a slice of `array` with `n` elements dropped from the beginning.
55913            *
55914            * @static
55915            * @memberOf _
55916            * @category Array
55917            * @param {Array}
55918            *            array The array to query.
55919            * @param {number}
55920            *            [n=1] The number of elements to drop.
55921            * @param- {Object} [guard] Enables use as a callback for functions like
55922            *         `_.map`.
55923            * @returns {Array} Returns the slice of `array`.
55924            * @example
55925            *
55926            * _.drop([1, 2, 3]); // => [2, 3]
55927            *
55928            * _.drop([1, 2, 3], 2); // => [3]
55929            *
55930            * _.drop([1, 2, 3], 5); // => []
55931            *
55932            * _.drop([1, 2, 3], 0); // => [1, 2, 3]
55933            */
55934           function drop(array, n, guard) {
55935             var length = array ? array.length : 0;
55936             if (!length) {
55937               return [];
55938             }
55939             if (guard ? isIterateeCall(array, n, guard) : n == null) {
55940               n = 1;
55941             }
55942             return baseSlice(array, n < 0 ? 0 : n);
55943           }
55944
55945           /**
55946            * Creates a slice of `array` with `n` elements dropped from the end.
55947            *
55948            * @static
55949            * @memberOf _
55950            * @category Array
55951            * @param {Array}
55952            *            array The array to query.
55953            * @param {number}
55954            *            [n=1] The number of elements to drop.
55955            * @param- {Object} [guard] Enables use as a callback for functions like
55956            *         `_.map`.
55957            * @returns {Array} Returns the slice of `array`.
55958            * @example
55959            *
55960            * _.dropRight([1, 2, 3]); // => [1, 2]
55961            *
55962            * _.dropRight([1, 2, 3], 2); // => [1]
55963            *
55964            * _.dropRight([1, 2, 3], 5); // => []
55965            *
55966            * _.dropRight([1, 2, 3], 0); // => [1, 2, 3]
55967            */
55968           function dropRight(array, n, guard) {
55969             var length = array ? array.length : 0;
55970             if (!length) {
55971               return [];
55972             }
55973             if (guard ? isIterateeCall(array, n, guard) : n == null) {
55974               n = 1;
55975             }
55976             n = length - (+n || 0);
55977             return baseSlice(array, 0, n < 0 ? 0 : n);
55978           }
55979
55980           /**
55981            * Creates a slice of `array` excluding elements dropped from the end.
55982            * Elements are dropped until `predicate` returns falsey. The predicate is
55983            * bound to `thisArg` and invoked with three arguments: (value, index,
55984            * array).
55985            *
55986            * If a property name is provided for `predicate` the created `_.property`
55987            * style callback returns the property value of the given element.
55988            *
55989            * If a value is also provided for `thisArg` the created `_.matchesProperty`
55990            * style callback returns `true` for elements that have a matching property
55991            * value, else `false`.
55992            *
55993            * If an object is provided for `predicate` the created `_.matches` style
55994            * callback returns `true` for elements that match the properties of the
55995            * given object, else `false`.
55996            *
55997            * @static
55998            * @memberOf _
55999            * @category Array
56000            * @param {Array}
56001            *            array The array to query.
56002            * @param {Function|Object|string}
56003            *            [predicate=_.identity] The function invoked per iteration.
56004            * @param {*}
56005            *            [thisArg] The `this` binding of `predicate`.
56006            * @returns {Array} Returns the slice of `array`.
56007            * @example
56008            *
56009            * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [1]
56010            *
56011            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56012            * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56013            *  // using the `_.matches` callback shorthand
56014            * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }),
56015            * 'user'); // => ['barney', 'fred']
56016            *  // using the `_.matchesProperty` callback shorthand
56017            * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); // =>
56018            * ['barney']
56019            *  // using the `_.property` callback shorthand
56020            * _.pluck(_.dropRightWhile(users, 'active'), 'user'); // => ['barney',
56021            * 'fred', 'pebbles']
56022            */
56023           function dropRightWhile(array, predicate, thisArg) {
56024             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : [];
56025           }
56026
56027           /**
56028            * Creates a slice of `array` excluding elements dropped from the beginning.
56029            * Elements are dropped until `predicate` returns falsey. The predicate is
56030            * bound to `thisArg` and invoked with three arguments: (value, index,
56031            * array).
56032            *
56033            * If a property name is provided for `predicate` the created `_.property`
56034            * style callback returns the property value of the given element.
56035            *
56036            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56037            * style callback returns `true` for elements that have a matching property
56038            * value, else `false`.
56039            *
56040            * If an object is provided for `predicate` the created `_.matches` style
56041            * callback returns `true` for elements that have the properties of the
56042            * given object, else `false`.
56043            *
56044            * @static
56045            * @memberOf _
56046            * @category Array
56047            * @param {Array}
56048            *            array The array to query.
56049            * @param {Function|Object|string}
56050            *            [predicate=_.identity] The function invoked per iteration.
56051            * @param {*}
56052            *            [thisArg] The `this` binding of `predicate`.
56053            * @returns {Array} Returns the slice of `array`.
56054            * @example
56055            *
56056            * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); // => [3]
56057            *
56058            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56059            * 'active': false }, { 'user': 'pebbles', 'active': true } ];
56060            *  // using the `_.matches` callback shorthand _.pluck(_.dropWhile(users, {
56061            * 'user': 'barney', 'active': false }), 'user'); // => ['fred', 'pebbles']
56062            *  // using the `_.matchesProperty` callback shorthand
56063            * _.pluck(_.dropWhile(users, 'active', false), 'user'); // => ['pebbles']
56064            *  // using the `_.property` callback shorthand _.pluck(_.dropWhile(users,
56065            * 'active'), 'user'); // => ['barney', 'fred', 'pebbles']
56066            */
56067           function dropWhile(array, predicate, thisArg) {
56068             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : [];
56069           }
56070
56071           /**
56072            * Fills elements of `array` with `value` from `start` up to, but not
56073            * including, `end`.
56074            *
56075            * **Note:** This method mutates `array`.
56076            *
56077            * @static
56078            * @memberOf _
56079            * @category Array
56080            * @param {Array}
56081            *            array The array to fill.
56082            * @param {*}
56083            *            value The value to fill `array` with.
56084            * @param {number}
56085            *            [start=0] The start position.
56086            * @param {number}
56087            *            [end=array.length] The end position.
56088            * @returns {Array} Returns `array`.
56089            * @example
56090            *
56091            * var array = [1, 2, 3];
56092            *
56093            * _.fill(array, 'a'); console.log(array); // => ['a', 'a', 'a']
56094            *
56095            * _.fill(Array(3), 2); // => [2, 2, 2]
56096            *
56097            * _.fill([4, 6, 8], '*', 1, 2); // => [4, '*', 8]
56098            */
56099           function fill(array, value, start, end) {
56100             var length = array ? array.length : 0;
56101             if (!length) {
56102               return [];
56103             }
56104             if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
56105               start = 0;
56106               end = length;
56107             }
56108             return baseFill(array, value, start, end);
56109           }
56110
56111           /**
56112            * This method is like `_.find` except that it returns the index of the
56113            * first element `predicate` returns truthy for instead of the element
56114            * itself.
56115            *
56116            * If a property name is provided for `predicate` the created `_.property`
56117            * style callback returns the property value of the given element.
56118            *
56119            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56120            * style callback returns `true` for elements that have a matching property
56121            * value, else `false`.
56122            *
56123            * If an object is provided for `predicate` the created `_.matches` style
56124            * callback returns `true` for elements that have the properties of the
56125            * given object, else `false`.
56126            *
56127            * @static
56128            * @memberOf _
56129            * @category Array
56130            * @param {Array}
56131            *            array The array to search.
56132            * @param {Function|Object|string}
56133            *            [predicate=_.identity] The function invoked per iteration.
56134            * @param {*}
56135            *            [thisArg] The `this` binding of `predicate`.
56136            * @returns {number} Returns the index of the found element, else `-1`.
56137            * @example
56138            *
56139            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56140            * 'active': false }, { 'user': 'pebbles', 'active': true } ];
56141            *
56142            * _.findIndex(users, function(chr) { return chr.user == 'barney'; }); // =>
56143            * 0
56144            *  // using the `_.matches` callback shorthand _.findIndex(users, { 'user':
56145            * 'fred', 'active': false }); // => 1
56146            *  // using the `_.matchesProperty` callback shorthand _.findIndex(users,
56147            * 'active', false); // => 0
56148            *  // using the `_.property` callback shorthand _.findIndex(users,
56149            * 'active'); // => 2
56150            */
56151           var findIndex = createFindIndex();
56152
56153           /**
56154            * This method is like `_.findIndex` except that it iterates over elements
56155            * of `collection` from right to left.
56156            *
56157            * If a property name is provided for `predicate` the created `_.property`
56158            * style callback returns the property value of the given element.
56159            *
56160            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56161            * style callback returns `true` for elements that have a matching property
56162            * value, else `false`.
56163            *
56164            * If an object is provided for `predicate` the created `_.matches` style
56165            * callback returns `true` for elements that have the properties of the
56166            * given object, else `false`.
56167            *
56168            * @static
56169            * @memberOf _
56170            * @category Array
56171            * @param {Array}
56172            *            array The array to search.
56173            * @param {Function|Object|string}
56174            *            [predicate=_.identity] The function invoked per iteration.
56175            * @param {*}
56176            *            [thisArg] The `this` binding of `predicate`.
56177            * @returns {number} Returns the index of the found element, else `-1`.
56178            * @example
56179            *
56180            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56181            * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56182            *
56183            * _.findLastIndex(users, function(chr) { return chr.user == 'pebbles'; }); // =>
56184            * 2
56185            *  // using the `_.matches` callback shorthand _.findLastIndex(users, {
56186            * 'user': 'barney', 'active': true }); // => 0
56187            *  // using the `_.matchesProperty` callback shorthand
56188            * _.findLastIndex(users, 'active', false); // => 2
56189            *  // using the `_.property` callback shorthand _.findLastIndex(users,
56190            * 'active'); // => 0
56191            */
56192           var findLastIndex = createFindIndex(true);
56193
56194           /**
56195            * Gets the first element of `array`.
56196            *
56197            * @static
56198            * @memberOf _
56199            * @alias head
56200            * @category Array
56201            * @param {Array}
56202            *            array The array to query.
56203            * @returns {*} Returns the first element of `array`.
56204            * @example
56205            *
56206            * _.first([1, 2, 3]); // => 1
56207            *
56208            * _.first([]); // => undefined
56209            */
56210           function first(array) {
56211             return array ? array[0] : undefined;
56212           }
56213
56214           /**
56215            * Flattens a nested array. If `isDeep` is `true` the array is recursively
56216            * flattened, otherwise it is only flattened a single level.
56217            *
56218            * @static
56219            * @memberOf _
56220            * @category Array
56221            * @param {Array}
56222            *            array The array to flatten.
56223            * @param {boolean}
56224            *            [isDeep] Specify a deep flatten.
56225            * @param- {Object} [guard] Enables use as a callback for functions like
56226            *         `_.map`.
56227            * @returns {Array} Returns the new flattened array.
56228            * @example
56229            *
56230            * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
56231            *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
56232            */
56233           function flatten(array, isDeep, guard) {
56234             var length = array ? array.length : 0;
56235             if (guard && isIterateeCall(array, isDeep, guard)) {
56236               isDeep = false;
56237             }
56238             return length ? baseFlatten(array, isDeep) : [];
56239           }
56240
56241           /**
56242            * Recursively flattens a nested array.
56243            *
56244            * @static
56245            * @memberOf _
56246            * @category Array
56247            * @param {Array}
56248            *            array The array to recursively flatten.
56249            * @returns {Array} Returns the new flattened array.
56250            * @example
56251            *
56252            * _.flattenDeep([1, [2, 3, [4]]]); // => [1, 2, 3, 4]
56253            */
56254           function flattenDeep(array) {
56255             var length = array ? array.length : 0;
56256             return length ? baseFlatten(array, true) : [];
56257           }
56258
56259           /**
56260            * Gets the index at which the first occurrence of `value` is found in
56261            * `array` using
56262            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56263            * for equality comparisons. If `fromIndex` is negative, it is used as the
56264            * offset from the end of `array`. If `array` is sorted providing `true` for
56265            * `fromIndex` performs a faster binary search.
56266            *
56267            * @static
56268            * @memberOf _
56269            * @category Array
56270            * @param {Array}
56271            *            array The array to search.
56272            * @param {*}
56273            *            value The value to search for.
56274            * @param {boolean|number}
56275            *            [fromIndex=0] The index to search from or `true` to perform a
56276            *            binary search on a sorted array.
56277            * @returns {number} Returns the index of the matched value, else `-1`.
56278            * @example
56279            *
56280            * _.indexOf([1, 2, 1, 2], 2); // => 1
56281            *  // using `fromIndex` _.indexOf([1, 2, 1, 2], 2, 2); // => 3
56282            *  // performing a binary search _.indexOf([1, 1, 2, 2], 2, true); // => 2
56283            */
56284           function indexOf(array, value, fromIndex) {
56285             var length = array ? array.length : 0;
56286             if (!length) {
56287               return -1;
56288             }
56289             if (typeof fromIndex == 'number') {
56290               fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
56291             } else if (fromIndex) {
56292               var index = binaryIndex(array, value);
56293               if (index < length &&
56294                 (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
56295                 return index;
56296               }
56297               return -1;
56298             }
56299             return baseIndexOf(array, value, fromIndex || 0);
56300           }
56301
56302           /**
56303            * Gets all but the last element of `array`.
56304            *
56305            * @static
56306            * @memberOf _
56307            * @category Array
56308            * @param {Array}
56309            *            array The array to query.
56310            * @returns {Array} Returns the slice of `array`.
56311            * @example
56312            *
56313            * _.initial([1, 2, 3]); // => [1, 2]
56314            */
56315           function initial(array) {
56316             return dropRight(array, 1);
56317           }
56318
56319           /**
56320            * Creates an array of unique values that are included in all of the
56321            * provided arrays using
56322            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56323            * for equality comparisons.
56324            *
56325            * @static
56326            * @memberOf _
56327            * @category Array
56328            * @param {...Array}
56329            *            [arrays] The arrays to inspect.
56330            * @returns {Array} Returns the new array of shared values.
56331            * @example _.intersection([1, 2], [4, 2], [2, 1]); // => [2]
56332            */
56333           var intersection = restParam(function(arrays) {
56334             var othLength = arrays.length,
56335               othIndex = othLength,
56336               caches = Array(length),
56337               indexOf = getIndexOf(),
56338               isCommon = indexOf == baseIndexOf,
56339               result = [];
56340
56341             while (othIndex--) {
56342               var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
56343               caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
56344             }
56345             var array = arrays[0],
56346               index = -1,
56347               length = array ? array.length : 0,
56348               seen = caches[0];
56349
56350             outer:
56351               while (++index < length) {
56352                 value = array[index];
56353                 if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
56354                   var othIndex = othLength;
56355                   while (--othIndex) {
56356                     var cache = caches[othIndex];
56357                     if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
56358                       continue outer;
56359                     }
56360                   }
56361                   if (seen) {
56362                     seen.push(value);
56363                   }
56364                   result.push(value);
56365                 }
56366               }
56367             return result;
56368           });
56369
56370           /**
56371            * Gets the last element of `array`.
56372            *
56373            * @static
56374            * @memberOf _
56375            * @category Array
56376            * @param {Array}
56377            *            array The array to query.
56378            * @returns {*} Returns the last element of `array`.
56379            * @example
56380            *
56381            * _.last([1, 2, 3]); // => 3
56382            */
56383           function last(array) {
56384             var length = array ? array.length : 0;
56385             return length ? array[length - 1] : undefined;
56386           }
56387
56388           /**
56389            * This method is like `_.indexOf` except that it iterates over elements of
56390            * `array` from right to left.
56391            *
56392            * @static
56393            * @memberOf _
56394            * @category Array
56395            * @param {Array}
56396            *            array The array to search.
56397            * @param {*}
56398            *            value The value to search for.
56399            * @param {boolean|number}
56400            *            [fromIndex=array.length-1] The index to search from or `true`
56401            *            to perform a binary search on a sorted array.
56402            * @returns {number} Returns the index of the matched value, else `-1`.
56403            * @example
56404            *
56405            * _.lastIndexOf([1, 2, 1, 2], 2); // => 3
56406            *  // using `fromIndex` _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1
56407            *  // performing a binary search _.lastIndexOf([1, 1, 2, 2], 2, true); // =>
56408            * 3
56409            */
56410           function lastIndexOf(array, value, fromIndex) {
56411             var length = array ? array.length : 0;
56412             if (!length) {
56413               return -1;
56414             }
56415             var index = length;
56416             if (typeof fromIndex == 'number') {
56417               index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
56418             } else if (fromIndex) {
56419               index = binaryIndex(array, value, true) - 1;
56420               var other = array[index];
56421               if (value === value ? (value === other) : (other !== other)) {
56422                 return index;
56423               }
56424               return -1;
56425             }
56426             if (value !== value) {
56427               return indexOfNaN(array, index, true);
56428             }
56429             while (index--) {
56430               if (array[index] === value) {
56431                 return index;
56432               }
56433             }
56434             return -1;
56435           }
56436
56437           /**
56438            * Removes all provided values from `array` using
56439            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56440            * for equality comparisons.
56441            *
56442            * **Note:** Unlike `_.without`, this method mutates `array`.
56443            *
56444            * @static
56445            * @memberOf _
56446            * @category Array
56447            * @param {Array}
56448            *            array The array to modify.
56449            * @param {...*}
56450            *            [values] The values to remove.
56451            * @returns {Array} Returns `array`.
56452            * @example
56453            *
56454            * var array = [1, 2, 3, 1, 2, 3];
56455            *
56456            * _.pull(array, 2, 3); console.log(array); // => [1, 1]
56457            */
56458           function pull() {
56459             var args = arguments,
56460               array = args[0];
56461
56462             if (!(array && array.length)) {
56463               return array;
56464             }
56465             var index = 0,
56466               indexOf = getIndexOf(),
56467               length = args.length;
56468
56469             while (++index < length) {
56470               var fromIndex = 0,
56471                 value = args[index];
56472
56473               while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
56474                 splice.call(array, fromIndex, 1);
56475               }
56476             }
56477             return array;
56478           }
56479
56480           /**
56481            * Removes elements from `array` corresponding to the given indexes and
56482            * returns an array of the removed elements. Indexes may be specified as an
56483            * array of indexes or as individual arguments.
56484            *
56485            * **Note:** Unlike `_.at`, this method mutates `array`.
56486            *
56487            * @static
56488            * @memberOf _
56489            * @category Array
56490            * @param {Array}
56491            *            array The array to modify.
56492            * @param {...(number|number[])}
56493            *            [indexes] The indexes of elements to remove, specified as
56494            *            individual indexes or arrays of indexes.
56495            * @returns {Array} Returns the new array of removed elements.
56496            * @example
56497            *
56498            * var array = [5, 10, 15, 20]; var evens = _.pullAt(array, 1, 3);
56499            *
56500            * console.log(array); // => [5, 15]
56501            *
56502            * console.log(evens); // => [10, 20]
56503            */
56504           var pullAt = restParam(function(array, indexes) {
56505             indexes = baseFlatten(indexes);
56506
56507             var result = baseAt(array, indexes);
56508             basePullAt(array, indexes.sort(baseCompareAscending));
56509             return result;
56510           });
56511
56512           /**
56513            * Removes all elements from `array` that `predicate` returns truthy for and
56514            * returns an array of the removed elements. The predicate is bound to
56515            * `thisArg` and invoked with three arguments: (value, index, array).
56516            *
56517            * If a property name is provided for `predicate` the created `_.property`
56518            * style callback returns the property value of the given element.
56519            *
56520            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56521            * style callback returns `true` for elements that have a matching property
56522            * value, else `false`.
56523            *
56524            * If an object is provided for `predicate` the created `_.matches` style
56525            * callback returns `true` for elements that have the properties of the
56526            * given object, else `false`.
56527            *
56528            * **Note:** Unlike `_.filter`, this method mutates `array`.
56529            *
56530            * @static
56531            * @memberOf _
56532            * @category Array
56533            * @param {Array}
56534            *            array The array to modify.
56535            * @param {Function|Object|string}
56536            *            [predicate=_.identity] The function invoked per iteration.
56537            * @param {*}
56538            *            [thisArg] The `this` binding of `predicate`.
56539            * @returns {Array} Returns the new array of removed elements.
56540            * @example
56541            *
56542            * var array = [1, 2, 3, 4]; var evens = _.remove(array, function(n) {
56543            * return n % 2 == 0; });
56544            *
56545            * console.log(array); // => [1, 3]
56546            *
56547            * console.log(evens); // => [2, 4]
56548            */
56549           function remove(array, predicate, thisArg) {
56550             var result = [];
56551             if (!(array && array.length)) {
56552               return result;
56553             }
56554             var index = -1,
56555               indexes = [],
56556               length = array.length;
56557
56558             predicate = getCallback(predicate, thisArg, 3);
56559             while (++index < length) {
56560               var value = array[index];
56561               if (predicate(value, index, array)) {
56562                 result.push(value);
56563                 indexes.push(index);
56564               }
56565             }
56566             basePullAt(array, indexes);
56567             return result;
56568           }
56569
56570           /**
56571            * Gets all but the first element of `array`.
56572            *
56573            * @static
56574            * @memberOf _
56575            * @alias tail
56576            * @category Array
56577            * @param {Array}
56578            *            array The array to query.
56579            * @returns {Array} Returns the slice of `array`.
56580            * @example
56581            *
56582            * _.rest([1, 2, 3]); // => [2, 3]
56583            */
56584           function rest(array) {
56585             return drop(array, 1);
56586           }
56587
56588           /**
56589            * Creates a slice of `array` from `start` up to, but not including, `end`.
56590            *
56591            * **Note:** This method is used instead of `Array#slice` to support node
56592            * lists in IE < 9 and to ensure dense arrays are returned.
56593            *
56594            * @static
56595            * @memberOf _
56596            * @category Array
56597            * @param {Array}
56598            *            array The array to slice.
56599            * @param {number}
56600            *            [start=0] The start position.
56601            * @param {number}
56602            *            [end=array.length] The end position.
56603            * @returns {Array} Returns the slice of `array`.
56604            */
56605           function slice(array, start, end) {
56606             var length = array ? array.length : 0;
56607             if (!length) {
56608               return [];
56609             }
56610             if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
56611               start = 0;
56612               end = length;
56613             }
56614             return baseSlice(array, start, end);
56615           }
56616
56617           /**
56618            * Uses a binary search to determine the lowest index at which `value`
56619            * should be inserted into `array` in order to maintain its sort order. If
56620            * an iteratee function is provided it is invoked for `value` and each
56621            * element of `array` to compute their sort ranking. The iteratee is bound
56622            * to `thisArg` and invoked with one argument; (value).
56623            *
56624            * If a property name is provided for `iteratee` the created `_.property`
56625            * style callback returns the property value of the given element.
56626            *
56627            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56628            * style callback returns `true` for elements that have a matching property
56629            * value, else `false`.
56630            *
56631            * If an object is provided for `iteratee` the created `_.matches` style
56632            * callback returns `true` for elements that have the properties of the
56633            * given object, else `false`.
56634            *
56635            * @static
56636            * @memberOf _
56637            * @category Array
56638            * @param {Array}
56639            *            array The sorted array to inspect.
56640            * @param {*}
56641            *            value The value to evaluate.
56642            * @param {Function|Object|string}
56643            *            [iteratee=_.identity] The function invoked per iteration.
56644            * @param {*}
56645            *            [thisArg] The `this` binding of `iteratee`.
56646            * @returns {number} Returns the index at which `value` should be inserted
56647            *          into `array`.
56648            * @example
56649            *
56650            * _.sortedIndex([30, 50], 40); // => 1
56651            *
56652            * _.sortedIndex([4, 4, 5, 5], 5); // => 2
56653            *
56654            * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
56655            *  // using an iteratee function _.sortedIndex(['thirty', 'fifty'],
56656            * 'forty', function(word) { return this.data[word]; }, dict); // => 1
56657            *  // using the `_.property` callback shorthand _.sortedIndex([{ 'x': 30 }, {
56658            * 'x': 50 }], { 'x': 40 }, 'x'); // => 1
56659            */
56660           var sortedIndex = createSortedIndex();
56661
56662           /**
56663            * This method is like `_.sortedIndex` except that it returns the highest
56664            * index at which `value` should be inserted into `array` in order to
56665            * maintain its sort order.
56666            *
56667            * @static
56668            * @memberOf _
56669            * @category Array
56670            * @param {Array}
56671            *            array The sorted array to inspect.
56672            * @param {*}
56673            *            value The value to evaluate.
56674            * @param {Function|Object|string}
56675            *            [iteratee=_.identity] The function invoked per iteration.
56676            * @param {*}
56677            *            [thisArg] The `this` binding of `iteratee`.
56678            * @returns {number} Returns the index at which `value` should be inserted
56679            *          into `array`.
56680            * @example
56681            *
56682            * _.sortedLastIndex([4, 4, 5, 5], 5); // => 4
56683            */
56684           var sortedLastIndex = createSortedIndex(true);
56685
56686           /**
56687            * Creates a slice of `array` with `n` elements taken from the beginning.
56688            *
56689            * @static
56690            * @memberOf _
56691            * @category Array
56692            * @param {Array}
56693            *            array The array to query.
56694            * @param {number}
56695            *            [n=1] The number of elements to take.
56696            * @param- {Object} [guard] Enables use as a callback for functions like
56697            *         `_.map`.
56698            * @returns {Array} Returns the slice of `array`.
56699            * @example
56700            *
56701            * _.take([1, 2, 3]); // => [1]
56702            *
56703            * _.take([1, 2, 3], 2); // => [1, 2]
56704            *
56705            * _.take([1, 2, 3], 5); // => [1, 2, 3]
56706            *
56707            * _.take([1, 2, 3], 0); // => []
56708            */
56709           function take(array, n, guard) {
56710             var length = array ? array.length : 0;
56711             if (!length) {
56712               return [];
56713             }
56714             if (guard ? isIterateeCall(array, n, guard) : n == null) {
56715               n = 1;
56716             }
56717             return baseSlice(array, 0, n < 0 ? 0 : n);
56718           }
56719
56720           /**
56721            * Creates a slice of `array` with `n` elements taken from the end.
56722            *
56723            * @static
56724            * @memberOf _
56725            * @category Array
56726            * @param {Array}
56727            *            array The array to query.
56728            * @param {number}
56729            *            [n=1] The number of elements to take.
56730            * @param- {Object} [guard] Enables use as a callback for functions like
56731            *         `_.map`.
56732            * @returns {Array} Returns the slice of `array`.
56733            * @example
56734            *
56735            * _.takeRight([1, 2, 3]); // => [3]
56736            *
56737            * _.takeRight([1, 2, 3], 2); // => [2, 3]
56738            *
56739            * _.takeRight([1, 2, 3], 5); // => [1, 2, 3]
56740            *
56741            * _.takeRight([1, 2, 3], 0); // => []
56742            */
56743           function takeRight(array, n, guard) {
56744             var length = array ? array.length : 0;
56745             if (!length) {
56746               return [];
56747             }
56748             if (guard ? isIterateeCall(array, n, guard) : n == null) {
56749               n = 1;
56750             }
56751             n = length - (+n || 0);
56752             return baseSlice(array, n < 0 ? 0 : n);
56753           }
56754
56755           /**
56756            * Creates a slice of `array` with elements taken from the end. Elements are
56757            * taken until `predicate` returns falsey. The predicate is bound to
56758            * `thisArg` and invoked with three arguments: (value, index, array).
56759            *
56760            * If a property name is provided for `predicate` the created `_.property`
56761            * style callback returns the property value of the given element.
56762            *
56763            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56764            * style callback returns `true` for elements that have a matching property
56765            * value, else `false`.
56766            *
56767            * If an object is provided for `predicate` the created `_.matches` style
56768            * callback returns `true` for elements that have the properties of the
56769            * given object, else `false`.
56770            *
56771            * @static
56772            * @memberOf _
56773            * @category Array
56774            * @param {Array}
56775            *            array The array to query.
56776            * @param {Function|Object|string}
56777            *            [predicate=_.identity] The function invoked per iteration.
56778            * @param {*}
56779            *            [thisArg] The `this` binding of `predicate`.
56780            * @returns {Array} Returns the slice of `array`.
56781            * @example
56782            *
56783            * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [2, 3]
56784            *
56785            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56786            * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56787            *  // using the `_.matches` callback shorthand
56788            * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }),
56789            * 'user'); // => ['pebbles']
56790            *  // using the `_.matchesProperty` callback shorthand
56791            * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); // => ['fred',
56792            * 'pebbles']
56793            *  // using the `_.property` callback shorthand
56794            * _.pluck(_.takeRightWhile(users, 'active'), 'user'); // => []
56795            */
56796           function takeRightWhile(array, predicate, thisArg) {
56797             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : [];
56798           }
56799
56800           /**
56801            * Creates a slice of `array` with elements taken from the beginning.
56802            * Elements are taken until `predicate` returns falsey. The predicate is
56803            * bound to `thisArg` and invoked with three arguments: (value, index,
56804            * array).
56805            *
56806            * If a property name is provided for `predicate` the created `_.property`
56807            * style callback returns the property value of the given element.
56808            *
56809            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56810            * style callback returns `true` for elements that have a matching property
56811            * value, else `false`.
56812            *
56813            * If an object is provided for `predicate` the created `_.matches` style
56814            * callback returns `true` for elements that have the properties of the
56815            * given object, else `false`.
56816            *
56817            * @static
56818            * @memberOf _
56819            * @category Array
56820            * @param {Array}
56821            *            array The array to query.
56822            * @param {Function|Object|string}
56823            *            [predicate=_.identity] The function invoked per iteration.
56824            * @param {*}
56825            *            [thisArg] The `this` binding of `predicate`.
56826            * @returns {Array} Returns the slice of `array`.
56827            * @example
56828            *
56829            * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); // => [1, 2]
56830            *
56831            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56832            * 'active': false}, { 'user': 'pebbles', 'active': true } ];
56833            *  // using the `_.matches` callback shorthand _.pluck(_.takeWhile(users, {
56834            * 'user': 'barney', 'active': false }), 'user'); // => ['barney']
56835            *  // using the `_.matchesProperty` callback shorthand
56836            * _.pluck(_.takeWhile(users, 'active', false), 'user'); // => ['barney',
56837            * 'fred']
56838            *  // using the `_.property` callback shorthand _.pluck(_.takeWhile(users,
56839            * 'active'), 'user'); // => []
56840            */
56841           function takeWhile(array, predicate, thisArg) {
56842             return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3)) : [];
56843           }
56844
56845           /**
56846            * Creates an array of unique values, in order, from all of the provided
56847            * arrays using
56848            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56849            * for equality comparisons.
56850            *
56851            * @static
56852            * @memberOf _
56853            * @category Array
56854            * @param {...Array}
56855            *            [arrays] The arrays to inspect.
56856            * @returns {Array} Returns the new array of combined values.
56857            * @example
56858            *
56859            * _.union([1, 2], [4, 2], [2, 1]); // => [1, 2, 4]
56860            */
56861           var union = restParam(function(arrays) {
56862             return baseUniq(baseFlatten(arrays, false, true));
56863           });
56864
56865           /**
56866            * Creates a duplicate-free version of an array, using
56867            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56868            * for equality comparisons, in which only the first occurence of each
56869            * element is kept. Providing `true` for `isSorted` performs a faster search
56870            * algorithm for sorted arrays. If an iteratee function is provided it is
56871            * invoked for each element in the array to generate the criterion by which
56872            * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
56873            * with three arguments: (value, index, array).
56874            *
56875            * If a property name is provided for `iteratee` the created `_.property`
56876            * style callback returns the property value of the given element.
56877            *
56878            * If a value is also provided for `thisArg` the created `_.matchesProperty`
56879            * style callback returns `true` for elements that have a matching property
56880            * value, else `false`.
56881            *
56882            * If an object is provided for `iteratee` the created `_.matches` style
56883            * callback returns `true` for elements that have the properties of the
56884            * given object, else `false`.
56885            *
56886            * @static
56887            * @memberOf _
56888            * @alias unique
56889            * @category Array
56890            * @param {Array}
56891            *            array The array to inspect.
56892            * @param {boolean}
56893            *            [isSorted] Specify the array is sorted.
56894            * @param {Function|Object|string}
56895            *            [iteratee] The function invoked per iteration.
56896            * @param {*}
56897            *            [thisArg] The `this` binding of `iteratee`.
56898            * @returns {Array} Returns the new duplicate-value-free array.
56899            * @example
56900            *
56901            * _.uniq([2, 1, 2]); // => [2, 1]
56902            *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
56903            *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) {
56904            * return this.floor(n); }, Math); // => [1, 2.5]
56905            *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x':
56906            * 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
56907            */
56908           function uniq(array, isSorted, iteratee, thisArg) {
56909             var length = array ? array.length : 0;
56910             if (!length) {
56911               return [];
56912             }
56913             if (isSorted != null && typeof isSorted != 'boolean') {
56914               thisArg = iteratee;
56915               iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
56916               isSorted = false;
56917             }
56918             var callback = getCallback();
56919             if (!(iteratee == null && callback === baseCallback)) {
56920               iteratee = callback(iteratee, thisArg, 3);
56921             }
56922             return (isSorted && getIndexOf() == baseIndexOf) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
56923           }
56924
56925           /**
56926            * This method is like `_.zip` except that it accepts an array of grouped
56927            * elements and creates an array regrouping the elements to their pre-zip
56928            * configuration.
56929            *
56930            * @static
56931            * @memberOf _
56932            * @category Array
56933            * @param {Array}
56934            *            array The array of grouped elements to process.
56935            * @returns {Array} Returns the new array of regrouped elements.
56936            * @example
56937            *
56938            * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); // =>
56939            * [['fred', 30, true], ['barney', 40, false]]
56940            *
56941            * _.unzip(zipped); // => [['fred', 'barney'], [30, 40], [true, false]]
56942            */
56943           function unzip(array) {
56944             if (!(array && array.length)) {
56945               return [];
56946             }
56947             var index = -1,
56948               length = 0;
56949
56950             array = arrayFilter(array, function(group) {
56951               if (isArrayLike(group)) {
56952                 length = nativeMax(group.length, length);
56953                 return true;
56954               }
56955             });
56956             var result = Array(length);
56957             while (++index < length) {
56958               result[index] = arrayMap(array, baseProperty(index));
56959             }
56960             return result;
56961           }
56962
56963           /**
56964            * This method is like `_.unzip` except that it accepts an iteratee to
56965            * specify how regrouped values should be combined. The `iteratee` is bound
56966            * to `thisArg` and invoked with four arguments: (accumulator, value, index,
56967            * group).
56968            *
56969            * @static
56970            * @memberOf _
56971            * @category Array
56972            * @param {Array}
56973            *            array The array of grouped elements to process.
56974            * @param {Function}
56975            *            [iteratee] The function to combine regrouped values.
56976            * @param {*}
56977            *            [thisArg] The `this` binding of `iteratee`.
56978            * @returns {Array} Returns the new array of regrouped elements.
56979            * @example
56980            *
56981            * var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100],
56982            * [2, 20, 200]]
56983            *
56984            * _.unzipWith(zipped, _.add); // => [3, 30, 300]
56985            */
56986           function unzipWith(array, iteratee, thisArg) {
56987             var length = array ? array.length : 0;
56988             if (!length) {
56989               return [];
56990             }
56991             var result = unzip(array);
56992             if (iteratee == null) {
56993               return result;
56994             }
56995             iteratee = bindCallback(iteratee, thisArg, 4);
56996             return arrayMap(result, function(group) {
56997               return arrayReduce(group, iteratee, undefined, true);
56998             });
56999           }
57000
57001           /**
57002            * Creates an array excluding all provided values using
57003            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
57004            * for equality comparisons.
57005            *
57006            * @static
57007            * @memberOf _
57008            * @category Array
57009            * @param {Array}
57010            *            array The array to filter.
57011            * @param {...*}
57012            *            [values] The values to exclude.
57013            * @returns {Array} Returns the new array of filtered values.
57014            * @example
57015            *
57016            * _.without([1, 2, 1, 3], 1, 2); // => [3]
57017            */
57018           var without = restParam(function(array, values) {
57019             return isArrayLike(array) ? baseDifference(array, values) : [];
57020           });
57021
57022           /**
57023            * Creates an array of unique values that is the [symmetric
57024            * difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the
57025            * provided arrays.
57026            *
57027            * @static
57028            * @memberOf _
57029            * @category Array
57030            * @param {...Array}
57031            *            [arrays] The arrays to inspect.
57032            * @returns {Array} Returns the new array of values.
57033            * @example
57034            *
57035            * _.xor([1, 2], [4, 2]); // => [1, 4]
57036            */
57037           function xor() {
57038             var index = -1,
57039               length = arguments.length;
57040
57041             while (++index < length) {
57042               var array = arguments[index];
57043               if (isArrayLike(array)) {
57044                 var result = result ? arrayPush(baseDifference(result, array), baseDifference(array, result)) : array;
57045               }
57046             }
57047             return result ? baseUniq(result) : [];
57048           }
57049
57050           /**
57051            * Creates an array of grouped elements, the first of which contains the
57052            * first elements of the given arrays, the second of which contains the
57053            * second elements of the given arrays, and so on.
57054            *
57055            * @static
57056            * @memberOf _
57057            * @category Array
57058            * @param {...Array}
57059            *            [arrays] The arrays to process.
57060            * @returns {Array} Returns the new array of grouped elements.
57061            * @example
57062            *
57063            * _.zip(['fred', 'barney'], [30, 40], [true, false]); // => [['fred', 30,
57064            * true], ['barney', 40, false]]
57065            */
57066           var zip = restParam(unzip);
57067
57068           /**
57069            * The inverse of `_.pairs`; this method returns an object composed from
57070            * arrays of property names and values. Provide either a single two
57071            * dimensional array, e.g. `[[key1, value1], [key2, value2]]` or two arrays,
57072            * one of property names and one of corresponding values.
57073            *
57074            * @static
57075            * @memberOf _
57076            * @alias object
57077            * @category Array
57078            * @param {Array}
57079            *            props The property names.
57080            * @param {Array}
57081            *            [values=[]] The property values.
57082            * @returns {Object} Returns the new object.
57083            * @example
57084            *
57085            * _.zipObject([['fred', 30], ['barney', 40]]); // => { 'fred': 30,
57086            * 'barney': 40 }
57087            *
57088            * _.zipObject(['fred', 'barney'], [30, 40]); // => { 'fred': 30, 'barney':
57089            * 40 }
57090            */
57091           function zipObject(props, values) {
57092             var index = -1,
57093               length = props ? props.length : 0,
57094               result = {};
57095
57096             if (length && !values && !isArray(props[0])) {
57097               values = [];
57098             }
57099             while (++index < length) {
57100               var key = props[index];
57101               if (values) {
57102                 result[key] = values[index];
57103               } else if (key) {
57104                 result[key[0]] = key[1];
57105               }
57106             }
57107             return result;
57108           }
57109
57110           /**
57111            * This method is like `_.zip` except that it accepts an iteratee to specify
57112            * how grouped values should be combined. The `iteratee` is bound to
57113            * `thisArg` and invoked with four arguments: (accumulator, value, index,
57114            * group).
57115            *
57116            * @static
57117            * @memberOf _
57118            * @category Array
57119            * @param {...Array}
57120            *            [arrays] The arrays to process.
57121            * @param {Function}
57122            *            [iteratee] The function to combine grouped values.
57123            * @param {*}
57124            *            [thisArg] The `this` binding of `iteratee`.
57125            * @returns {Array} Returns the new array of grouped elements.
57126            * @example
57127            *
57128            * _.zipWith([1, 2], [10, 20], [100, 200], _.add); // => [111, 222]
57129            */
57130           var zipWith = restParam(function(arrays) {
57131             var length = arrays.length,
57132               iteratee = length > 2 ? arrays[length - 2] : undefined,
57133               thisArg = length > 1 ? arrays[length - 1] : undefined;
57134
57135             if (length > 2 && typeof iteratee == 'function') {
57136               length -= 2;
57137             } else {
57138               iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
57139               thisArg = undefined;
57140             }
57141             arrays.length = length;
57142             return unzipWith(arrays, iteratee, thisArg);
57143           });
57144
57145           /*------------------------------------------------------------------------*/
57146
57147           /**
57148            * Creates a `lodash` object that wraps `value` with explicit method
57149            * chaining enabled.
57150            *
57151            * @static
57152            * @memberOf _
57153            * @category Chain
57154            * @param {*}
57155            *            value The value to wrap.
57156            * @returns {Object} Returns the new `lodash` wrapper instance.
57157            * @example
57158            *
57159            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57160            * 40 }, { 'user': 'pebbles', 'age': 1 } ];
57161            *
57162            * var youngest = _.chain(users) .sortBy('age') .map(function(chr) { return
57163            * chr.user + ' is ' + chr.age; }) .first() .value(); // => 'pebbles is 1'
57164            */
57165           function chain(value) {
57166             var result = lodash(value);
57167             result.__chain__ = true;
57168             return result;
57169           }
57170
57171           /**
57172            * This method invokes `interceptor` and returns `value`. The interceptor is
57173            * bound to `thisArg` and invoked with one argument; (value). The purpose of
57174            * this method is to "tap into" a method chain in order to perform
57175            * operations on intermediate results within the chain.
57176            *
57177            * @static
57178            * @memberOf _
57179            * @category Chain
57180            * @param {*}
57181            *            value The value to provide to `interceptor`.
57182            * @param {Function}
57183            *            interceptor The function to invoke.
57184            * @param {*}
57185            *            [thisArg] The `this` binding of `interceptor`.
57186            * @returns {*} Returns `value`.
57187            * @example
57188            *
57189            * _([1, 2, 3]) .tap(function(array) { array.pop(); }) .reverse() .value(); // =>
57190            * [2, 1]
57191            */
57192           function tap(value, interceptor, thisArg) {
57193             interceptor.call(thisArg, value);
57194             return value;
57195           }
57196
57197           /**
57198            * This method is like `_.tap` except that it returns the result of
57199            * `interceptor`.
57200            *
57201            * @static
57202            * @memberOf _
57203            * @category Chain
57204            * @param {*}
57205            *            value The value to provide to `interceptor`.
57206            * @param {Function}
57207            *            interceptor The function to invoke.
57208            * @param {*}
57209            *            [thisArg] The `this` binding of `interceptor`.
57210            * @returns {*} Returns the result of `interceptor`.
57211            * @example
57212            *
57213            * _(' abc ') .chain() .trim() .thru(function(value) { return [value]; })
57214            * .value(); // => ['abc']
57215            */
57216           function thru(value, interceptor, thisArg) {
57217             return interceptor.call(thisArg, value);
57218           }
57219
57220           /**
57221            * Enables explicit method chaining on the wrapper object.
57222            *
57223            * @name chain
57224            * @memberOf _
57225            * @category Chain
57226            * @returns {Object} Returns the new `lodash` wrapper instance.
57227            * @example
57228            *
57229            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57230            * 40 } ];
57231            *  // without explicit chaining _(users).first(); // => { 'user': 'barney',
57232            * 'age': 36 }
57233            *  // with explicit chaining _(users).chain() .first() .pick('user')
57234            * .value(); // => { 'user': 'barney' }
57235            */
57236           function wrapperChain() {
57237             return chain(this);
57238           }
57239
57240           /**
57241            * Executes the chained sequence and returns the wrapped result.
57242            *
57243            * @name commit
57244            * @memberOf _
57245            * @category Chain
57246            * @returns {Object} Returns the new `lodash` wrapper instance.
57247            * @example
57248            *
57249            * var array = [1, 2]; var wrapped = _(array).push(3);
57250            *
57251            * console.log(array); // => [1, 2]
57252            *
57253            * wrapped = wrapped.commit(); console.log(array); // => [1, 2, 3]
57254            *
57255            * wrapped.last(); // => 3
57256            *
57257            * console.log(array); // => [1, 2, 3]
57258            */
57259           function wrapperCommit() {
57260             return new LodashWrapper(this.value(), this.__chain__);
57261           }
57262
57263           /**
57264            * Creates a new array joining a wrapped array with any additional arrays
57265            * and/or values.
57266            *
57267            * @name concat
57268            * @memberOf _
57269            * @category Chain
57270            * @param {...*}
57271            *            [values] The values to concatenate.
57272            * @returns {Array} Returns the new concatenated array.
57273            * @example
57274            *
57275            * var array = [1]; var wrapped = _(array).concat(2, [3], [[4]]);
57276            *
57277            * console.log(wrapped.value()); // => [1, 2, 3, [4]]
57278            *
57279            * console.log(array); // => [1]
57280            */
57281           var wrapperConcat = restParam(function(values) {
57282             values = baseFlatten(values);
57283             return this.thru(function(array) {
57284               return arrayConcat(isArray(array) ? array : [toObject(array)], values);
57285             });
57286           });
57287
57288           /**
57289            * Creates a clone of the chained sequence planting `value` as the wrapped
57290            * value.
57291            *
57292            * @name plant
57293            * @memberOf _
57294            * @category Chain
57295            * @returns {Object} Returns the new `lodash` wrapper instance.
57296            * @example
57297            *
57298            * var array = [1, 2]; var wrapped = _(array).map(function(value) { return
57299            * Math.pow(value, 2); });
57300            *
57301            * var other = [3, 4]; var otherWrapped = wrapped.plant(other);
57302            *
57303            * otherWrapped.value(); // => [9, 16]
57304            *
57305            * wrapped.value(); // => [1, 4]
57306            */
57307           function wrapperPlant(value) {
57308             var result,
57309               parent = this;
57310
57311             while (parent instanceof baseLodash) {
57312               var clone = wrapperClone(parent);
57313               if (result) {
57314                 previous.__wrapped__ = clone;
57315               } else {
57316                 result = clone;
57317               }
57318               var previous = clone;
57319               parent = parent.__wrapped__;
57320             }
57321             previous.__wrapped__ = value;
57322             return result;
57323           }
57324
57325           /**
57326            * Reverses the wrapped array so the first element becomes the last, the
57327            * second element becomes the second to last, and so on.
57328            *
57329            * **Note:** This method mutates the wrapped array.
57330            *
57331            * @name reverse
57332            * @memberOf _
57333            * @category Chain
57334            * @returns {Object} Returns the new reversed `lodash` wrapper instance.
57335            * @example
57336            *
57337            * var array = [1, 2, 3];
57338            *
57339            * _(array).reverse().value() // => [3, 2, 1]
57340            *
57341            * console.log(array); // => [3, 2, 1]
57342            */
57343           function wrapperReverse() {
57344             var value = this.__wrapped__;
57345
57346             var interceptor = function(value) {
57347               return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
57348             };
57349             if (value instanceof LazyWrapper) {
57350               var wrapped = value;
57351               if (this.__actions__.length) {
57352                 wrapped = new LazyWrapper(this);
57353               }
57354               wrapped = wrapped.reverse();
57355               wrapped.__actions__.push({
57356                 'func': thru,
57357                 'args': [interceptor],
57358                 'thisArg': undefined
57359               });
57360               return new LodashWrapper(wrapped, this.__chain__);
57361             }
57362             return this.thru(interceptor);
57363           }
57364
57365           /**
57366            * Produces the result of coercing the unwrapped value to a string.
57367            *
57368            * @name toString
57369            * @memberOf _
57370            * @category Chain
57371            * @returns {string} Returns the coerced string value.
57372            * @example
57373            *
57374            * _([1, 2, 3]).toString(); // => '1,2,3'
57375            */
57376           function wrapperToString() {
57377             return (this.value() + '');
57378           }
57379
57380           /**
57381            * Executes the chained sequence to extract the unwrapped value.
57382            *
57383            * @name value
57384            * @memberOf _
57385            * @alias run, toJSON, valueOf
57386            * @category Chain
57387            * @returns {*} Returns the resolved unwrapped value.
57388            * @example
57389            *
57390            * _([1, 2, 3]).value(); // => [1, 2, 3]
57391            */
57392           function wrapperValue() {
57393             return baseWrapperValue(this.__wrapped__, this.__actions__);
57394           }
57395
57396           /*------------------------------------------------------------------------*/
57397
57398           /**
57399            * Creates an array of elements corresponding to the given keys, or indexes,
57400            * of `collection`. Keys may be specified as individual arguments or as
57401            * arrays of keys.
57402            *
57403            * @static
57404            * @memberOf _
57405            * @category Collection
57406            * @param {Array|Object|string}
57407            *            collection The collection to iterate over.
57408            * @param {...(number|number[]|string|string[])}
57409            *            [props] The property names or indexes of elements to pick,
57410            *            specified individually or in arrays.
57411            * @returns {Array} Returns the new array of picked elements.
57412            * @example
57413            *
57414            * _.at(['a', 'b', 'c'], [0, 2]); // => ['a', 'c']
57415            *
57416            * _.at(['barney', 'fred', 'pebbles'], 0, 2); // => ['barney', 'pebbles']
57417            */
57418           var at = restParam(function(collection, props) {
57419             return baseAt(collection, baseFlatten(props));
57420           });
57421
57422           /**
57423            * Creates an object composed of keys generated from the results of running
57424            * each element of `collection` through `iteratee`. The corresponding value
57425            * of each key is the number of times the key was returned by `iteratee`.
57426            * The `iteratee` is bound to `thisArg` and invoked with three arguments:
57427            * (value, index|key, collection).
57428            *
57429            * If a property name is provided for `iteratee` the created `_.property`
57430            * style callback returns the property value of the given element.
57431            *
57432            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57433            * style callback returns `true` for elements that have a matching property
57434            * value, else `false`.
57435            *
57436            * If an object is provided for `iteratee` the created `_.matches` style
57437            * callback returns `true` for elements that have the properties of the
57438            * given object, else `false`.
57439            *
57440            * @static
57441            * @memberOf _
57442            * @category Collection
57443            * @param {Array|Object|string}
57444            *            collection The collection to iterate over.
57445            * @param {Function|Object|string}
57446            *            [iteratee=_.identity] The function invoked per iteration.
57447            * @param {*}
57448            *            [thisArg] The `this` binding of `iteratee`.
57449            * @returns {Object} Returns the composed aggregate object.
57450            * @example
57451            *
57452            * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57453            * '4': 1, '6': 2 }
57454            *
57455            * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57456            * '4': 1, '6': 2 }
57457            *
57458            * _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 }
57459            */
57460           var countBy = createAggregator(function(result, value, key) {
57461             hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
57462           });
57463
57464           /**
57465            * Checks if `predicate` returns truthy for **all** elements of
57466            * `collection`. The predicate is bound to `thisArg` and invoked with three
57467            * arguments: (value, index|key, collection).
57468            *
57469            * If a property name is provided for `predicate` the created `_.property`
57470            * style callback returns the property value of the given element.
57471            *
57472            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57473            * style callback returns `true` for elements that have a matching property
57474            * value, else `false`.
57475            *
57476            * If an object is provided for `predicate` the created `_.matches` style
57477            * callback returns `true` for elements that have the properties of the
57478            * given object, else `false`.
57479            *
57480            * @static
57481            * @memberOf _
57482            * @alias all
57483            * @category Collection
57484            * @param {Array|Object|string}
57485            *            collection The collection to iterate over.
57486            * @param {Function|Object|string}
57487            *            [predicate=_.identity] The function invoked per iteration.
57488            * @param {*}
57489            *            [thisArg] The `this` binding of `predicate`.
57490            * @returns {boolean} Returns `true` if all elements pass the predicate
57491            *          check, else `false`.
57492            * @example
57493            *
57494            * _.every([true, 1, null, 'yes'], Boolean); // => false
57495            *
57496            * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
57497            * 'active': false } ];
57498            *  // using the `_.matches` callback shorthand _.every(users, { 'user':
57499            * 'barney', 'active': false }); // => false
57500            *  // using the `_.matchesProperty` callback shorthand _.every(users,
57501            * 'active', false); // => true
57502            *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
57503            * false
57504            */
57505           function every(collection, predicate, thisArg) {
57506             var func = isArray(collection) ? arrayEvery : baseEvery;
57507             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
57508               predicate = undefined;
57509             }
57510             if (typeof predicate != 'function' || thisArg !== undefined) {
57511               predicate = getCallback(predicate, thisArg, 3);
57512             }
57513             return func(collection, predicate);
57514           }
57515
57516           /**
57517            * Iterates over elements of `collection`, returning an array of all
57518            * elements `predicate` returns truthy for. The predicate is bound to
57519            * `thisArg` and invoked with three arguments: (value, index|key,
57520            * collection).
57521            *
57522            * If a property name is provided for `predicate` the created `_.property`
57523            * style callback returns the property value of the given element.
57524            *
57525            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57526            * style callback returns `true` for elements that have a matching property
57527            * value, else `false`.
57528            *
57529            * If an object is provided for `predicate` the created `_.matches` style
57530            * callback returns `true` for elements that have the properties of the
57531            * given object, else `false`.
57532            *
57533            * @static
57534            * @memberOf _
57535            * @alias select
57536            * @category Collection
57537            * @param {Array|Object|string}
57538            *            collection The collection to iterate over.
57539            * @param {Function|Object|string}
57540            *            [predicate=_.identity] The function invoked per iteration.
57541            * @param {*}
57542            *            [thisArg] The `this` binding of `predicate`.
57543            * @returns {Array} Returns the new filtered array.
57544            * @example
57545            *
57546            * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
57547            *
57548            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57549            * 'fred', 'age': 40, 'active': false } ];
57550            *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, {
57551            * 'age': 36, 'active': true }), 'user'); // => ['barney']
57552            *  // using the `_.matchesProperty` callback shorthand
57553            * _.pluck(_.filter(users, 'active', false), 'user'); // => ['fred']
57554            *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
57555            * 'active'), 'user'); // => ['barney']
57556            */
57557           function filter(collection, predicate, thisArg) {
57558             var func = isArray(collection) ? arrayFilter : baseFilter;
57559             predicate = getCallback(predicate, thisArg, 3);
57560             return func(collection, predicate);
57561           }
57562
57563           /**
57564            * Iterates over elements of `collection`, returning the first element
57565            * `predicate` returns truthy for. The predicate is bound to `thisArg` and
57566            * invoked with three arguments: (value, index|key, collection).
57567            *
57568            * If a property name is provided for `predicate` the created `_.property`
57569            * style callback returns the property value of the given element.
57570            *
57571            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57572            * style callback returns `true` for elements that have a matching property
57573            * value, else `false`.
57574            *
57575            * If an object is provided for `predicate` the created `_.matches` style
57576            * callback returns `true` for elements that have the properties of the
57577            * given object, else `false`.
57578            *
57579            * @static
57580            * @memberOf _
57581            * @alias detect
57582            * @category Collection
57583            * @param {Array|Object|string}
57584            *            collection The collection to search.
57585            * @param {Function|Object|string}
57586            *            [predicate=_.identity] The function invoked per iteration.
57587            * @param {*}
57588            *            [thisArg] The `this` binding of `predicate`.
57589            * @returns {*} Returns the matched element, else `undefined`.
57590            * @example
57591            *
57592            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57593            * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
57594            * 'active': true } ];
57595            *
57596            * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
57597            * 'barney'
57598            *  // using the `_.matches` callback shorthand _.result(_.find(users, {
57599            * 'age': 1, 'active': true }), 'user'); // => 'pebbles'
57600            *  // using the `_.matchesProperty` callback shorthand
57601            * _.result(_.find(users, 'active', false), 'user'); // => 'fred'
57602            *  // using the `_.property` callback shorthand _.result(_.find(users,
57603            * 'active'), 'user'); // => 'barney'
57604            */
57605           var find = createFind(baseEach);
57606
57607           /**
57608            * This method is like `_.find` except that it iterates over elements of
57609            * `collection` from right to left.
57610            *
57611            * @static
57612            * @memberOf _
57613            * @category Collection
57614            * @param {Array|Object|string}
57615            *            collection The collection to search.
57616            * @param {Function|Object|string}
57617            *            [predicate=_.identity] The function invoked per iteration.
57618            * @param {*}
57619            *            [thisArg] The `this` binding of `predicate`.
57620            * @returns {*} Returns the matched element, else `undefined`.
57621            * @example
57622            *
57623            * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3
57624            */
57625           var findLast = createFind(baseEachRight, true);
57626
57627           /**
57628            * Performs a deep comparison between each element in `collection` and the
57629            * source object, returning the first element that has equivalent property
57630            * values.
57631            *
57632            * **Note:** This method supports comparing arrays, booleans, `Date`
57633            * objects, numbers, `Object` objects, regexes, and strings. Objects are
57634            * compared by their own, not inherited, enumerable properties. For
57635            * comparing a single own or inherited property value see
57636            * `_.matchesProperty`.
57637            *
57638            * @static
57639            * @memberOf _
57640            * @category Collection
57641            * @param {Array|Object|string}
57642            *            collection The collection to search.
57643            * @param {Object}
57644            *            source The object of property values to match.
57645            * @returns {*} Returns the matched element, else `undefined`.
57646            * @example
57647            *
57648            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57649            * 'fred', 'age': 40, 'active': false } ];
57650            *
57651            * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); // =>
57652            * 'barney'
57653            *
57654            * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); // =>
57655            * 'fred'
57656            */
57657           function findWhere(collection, source) {
57658             return find(collection, baseMatches(source));
57659           }
57660
57661           /**
57662            * Iterates over elements of `collection` invoking `iteratee` for each
57663            * element. The `iteratee` is bound to `thisArg` and invoked with three
57664            * arguments: (value, index|key, collection). Iteratee functions may exit
57665            * iteration early by explicitly returning `false`.
57666            *
57667            * **Note:** As with other "Collections" methods, objects with a "length"
57668            * property are iterated like arrays. To avoid this behavior `_.forIn` or
57669            * `_.forOwn` may be used for object iteration.
57670            *
57671            * @static
57672            * @memberOf _
57673            * @alias each
57674            * @category Collection
57675            * @param {Array|Object|string}
57676            *            collection The collection to iterate over.
57677            * @param {Function}
57678            *            [iteratee=_.identity] The function invoked per iteration.
57679            * @param {*}
57680            *            [thisArg] The `this` binding of `iteratee`.
57681            * @returns {Array|Object|string} Returns `collection`.
57682            * @example
57683            *
57684            * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs
57685            * each value from left to right and returns the array
57686            *
57687            * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
57688            * logs each value-key pair and returns the object (iteration order is not
57689            * guaranteed)
57690            */
57691           var forEach = createForEach(arrayEach, baseEach);
57692
57693           /**
57694            * This method is like `_.forEach` except that it iterates over elements of
57695            * `collection` from right to left.
57696            *
57697            * @static
57698            * @memberOf _
57699            * @alias eachRight
57700            * @category Collection
57701            * @param {Array|Object|string}
57702            *            collection The collection to iterate over.
57703            * @param {Function}
57704            *            [iteratee=_.identity] The function invoked per iteration.
57705            * @param {*}
57706            *            [thisArg] The `this` binding of `iteratee`.
57707            * @returns {Array|Object|string} Returns `collection`.
57708            * @example
57709            *
57710            * _([1, 2]).forEachRight(function(n) { console.log(n); }).value(); // =>
57711            * logs each value from right to left and returns the array
57712            */
57713           var forEachRight = createForEach(arrayEachRight, baseEachRight);
57714
57715           /**
57716            * Creates an object composed of keys generated from the results of running
57717            * each element of `collection` through `iteratee`. The corresponding value
57718            * of each key is an array of the elements responsible for generating the
57719            * key. The `iteratee` is bound to `thisArg` and invoked with three
57720            * arguments: (value, index|key, collection).
57721            *
57722            * If a property name is provided for `iteratee` the created `_.property`
57723            * style callback returns the property value of the given element.
57724            *
57725            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57726            * style callback returns `true` for elements that have a matching property
57727            * value, else `false`.
57728            *
57729            * If an object is provided for `iteratee` the created `_.matches` style
57730            * callback returns `true` for elements that have the properties of the
57731            * given object, else `false`.
57732            *
57733            * @static
57734            * @memberOf _
57735            * @category Collection
57736            * @param {Array|Object|string}
57737            *            collection The collection to iterate over.
57738            * @param {Function|Object|string}
57739            *            [iteratee=_.identity] The function invoked per iteration.
57740            * @param {*}
57741            *            [thisArg] The `this` binding of `iteratee`.
57742            * @returns {Object} Returns the composed aggregate object.
57743            * @example
57744            *
57745            * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57746            * '4': [4.2], '6': [6.1, 6.4] }
57747            *
57748            * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57749            * '4': [4.2], '6': [6.1, 6.4] }
57750            *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
57751            * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
57752            */
57753           var groupBy = createAggregator(function(result, value, key) {
57754             if (hasOwnProperty.call(result, key)) {
57755               result[key].push(value);
57756             } else {
57757               result[key] = [value];
57758             }
57759           });
57760
57761           /**
57762            * Checks if `value` is in `collection` using
57763            * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
57764            * for equality comparisons. If `fromIndex` is negative, it is used as the
57765            * offset from the end of `collection`.
57766            *
57767            * @static
57768            * @memberOf _
57769            * @alias contains, include
57770            * @category Collection
57771            * @param {Array|Object|string}
57772            *            collection The collection to search.
57773            * @param {*}
57774            *            target The value to search for.
57775            * @param {number}
57776            *            [fromIndex=0] The index to search from.
57777            * @param- {Object} [guard] Enables use as a callback for functions like
57778            *         `_.reduce`.
57779            * @returns {boolean} Returns `true` if a matching element is found, else
57780            *          `false`.
57781            * @example
57782            *
57783            * _.includes([1, 2, 3], 1); // => true
57784            *
57785            * _.includes([1, 2, 3], 1, 2); // => false
57786            *
57787            * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
57788            *
57789            * _.includes('pebbles', 'eb'); // => true
57790            */
57791           function includes(collection, target, fromIndex, guard) {
57792             var length = collection ? getLength(collection) : 0;
57793             if (!isLength(length)) {
57794               collection = values(collection);
57795               length = collection.length;
57796             }
57797             if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
57798               fromIndex = 0;
57799             } else {
57800               fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
57801             }
57802             return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && getIndexOf(collection, target, fromIndex) > -1);
57803           }
57804
57805           /**
57806            * Creates an object composed of keys generated from the results of running
57807            * each element of `collection` through `iteratee`. The corresponding value
57808            * of each key is the last element responsible for generating the key. The
57809            * iteratee function is bound to `thisArg` and invoked with three arguments:
57810            * (value, index|key, collection).
57811            *
57812            * If a property name is provided for `iteratee` the created `_.property`
57813            * style callback returns the property value of the given element.
57814            *
57815            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57816            * style callback returns `true` for elements that have a matching property
57817            * value, else `false`.
57818            *
57819            * If an object is provided for `iteratee` the created `_.matches` style
57820            * callback returns `true` for elements that have the properties of the
57821            * given object, else `false`.
57822            *
57823            * @static
57824            * @memberOf _
57825            * @category Collection
57826            * @param {Array|Object|string}
57827            *            collection The collection to iterate over.
57828            * @param {Function|Object|string}
57829            *            [iteratee=_.identity] The function invoked per iteration.
57830            * @param {*}
57831            *            [thisArg] The `this` binding of `iteratee`.
57832            * @returns {Object} Returns the composed aggregate object.
57833            * @example
57834            *
57835            * var keyData = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code':
57836            * 100 } ];
57837            *
57838            * _.indexBy(keyData, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 },
57839            * 'right': { 'dir': 'right', 'code': 100 } }
57840            *
57841            * _.indexBy(keyData, function(object) { return
57842            * String.fromCharCode(object.code); }); // => { 'a': { 'dir': 'left',
57843            * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57844            *
57845            * _.indexBy(keyData, function(object) { return
57846            * this.fromCharCode(object.code); }, String); // => { 'a': { 'dir': 'left',
57847            * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57848            */
57849           var indexBy = createAggregator(function(result, value, key) {
57850             result[key] = value;
57851           });
57852
57853           /**
57854            * Invokes the method at `path` of each element in `collection`, returning
57855            * an array of the results of each invoked method. Any additional arguments
57856            * are provided to each invoked method. If `methodName` is a function it is
57857            * invoked for, and `this` bound to, each element in `collection`.
57858            *
57859            * @static
57860            * @memberOf _
57861            * @category Collection
57862            * @param {Array|Object|string}
57863            *            collection The collection to iterate over.
57864            * @param {Array|Function|string}
57865            *            path The path of the method to invoke or the function invoked
57866            *            per iteration.
57867            * @param {...*}
57868            *            [args] The arguments to invoke the method with.
57869            * @returns {Array} Returns the array of results.
57870            * @example
57871            *
57872            * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); // => [[1, 5, 7], [1, 2, 3]]
57873            *
57874            * _.invoke([123, 456], String.prototype.split, ''); // => [['1', '2', '3'],
57875            * ['4', '5', '6']]
57876            */
57877           var invoke = restParam(function(collection, path, args) {
57878             var index = -1,
57879               isFunc = typeof path == 'function',
57880               isProp = isKey(path),
57881               result = isArrayLike(collection) ? Array(collection.length) : [];
57882
57883             baseEach(collection, function(value) {
57884               var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
57885               result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
57886             });
57887             return result;
57888           });
57889
57890           /**
57891            * Creates an array of values by running each element in `collection`
57892            * through `iteratee`. The `iteratee` is bound to `thisArg` and invoked with
57893            * three arguments: (value, index|key, collection).
57894            *
57895            * If a property name is provided for `iteratee` the created `_.property`
57896            * style callback returns the property value of the given element.
57897            *
57898            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57899            * style callback returns `true` for elements that have a matching property
57900            * value, else `false`.
57901            *
57902            * If an object is provided for `iteratee` the created `_.matches` style
57903            * callback returns `true` for elements that have the properties of the
57904            * given object, else `false`.
57905            *
57906            * Many lodash methods are guarded to work as iteratees for methods like
57907            * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
57908            *
57909            * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
57910            * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
57911            * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`,
57912            * `takeRight`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
57913            * `random`, `range`, `sample`, `some`, `sum`, `uniq`, and `words`
57914            *
57915            * @static
57916            * @memberOf _
57917            * @alias collect
57918            * @category Collection
57919            * @param {Array|Object|string}
57920            *            collection The collection to iterate over.
57921            * @param {Function|Object|string}
57922            *            [iteratee=_.identity] The function invoked per iteration.
57923            * @param {*}
57924            *            [thisArg] The `this` binding of `iteratee`.
57925            * @returns {Array} Returns the new mapped array.
57926            * @example
57927            *
57928            * function timesThree(n) { return n * 3; }
57929            *
57930            * _.map([1, 2], timesThree); // => [3, 6]
57931            *
57932            * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is
57933            * not guaranteed)
57934            *
57935            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
57936            *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
57937            * ['barney', 'fred']
57938            */
57939           function map(collection, iteratee, thisArg) {
57940             var func = isArray(collection) ? arrayMap : baseMap;
57941             iteratee = getCallback(iteratee, thisArg, 3);
57942             return func(collection, iteratee);
57943           }
57944
57945           /**
57946            * Creates an array of elements split into two groups, the first of which
57947            * contains elements `predicate` returns truthy for, while the second of
57948            * which contains elements `predicate` returns falsey for. The predicate is
57949            * bound to `thisArg` and invoked with three arguments: (value, index|key,
57950            * collection).
57951            *
57952            * If a property name is provided for `predicate` the created `_.property`
57953            * style callback returns the property value of the given element.
57954            *
57955            * If a value is also provided for `thisArg` the created `_.matchesProperty`
57956            * style callback returns `true` for elements that have a matching property
57957            * value, else `false`.
57958            *
57959            * If an object is provided for `predicate` the created `_.matches` style
57960            * callback returns `true` for elements that have the properties of the
57961            * given object, else `false`.
57962            *
57963            * @static
57964            * @memberOf _
57965            * @category Collection
57966            * @param {Array|Object|string}
57967            *            collection The collection to iterate over.
57968            * @param {Function|Object|string}
57969            *            [predicate=_.identity] The function invoked per iteration.
57970            * @param {*}
57971            *            [thisArg] The `this` binding of `predicate`.
57972            * @returns {Array} Returns the array of grouped elements.
57973            * @example
57974            *
57975            * _.partition([1, 2, 3], function(n) { return n % 2; }); // => [[1, 3],
57976            * [2]]
57977            *
57978            * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; },
57979            * Math); // => [[1.2, 3.4], [2.3]]
57980            *
57981            * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57982            * 'fred', 'age': 40, 'active': true }, { 'user': 'pebbles', 'age': 1,
57983            * 'active': false } ];
57984            *
57985            * var mapper = function(array) { return _.pluck(array, 'user'); };
57986            *  // using the `_.matches` callback shorthand _.map(_.partition(users, {
57987            * 'age': 1, 'active': false }), mapper); // => [['pebbles'], ['barney',
57988            * 'fred']]
57989            *  // using the `_.matchesProperty` callback shorthand
57990            * _.map(_.partition(users, 'active', false), mapper); // => [['barney',
57991            * 'pebbles'], ['fred']]
57992            *  // using the `_.property` callback shorthand _.map(_.partition(users,
57993            * 'active'), mapper); // => [['fred'], ['barney', 'pebbles']]
57994            */
57995           var partition = createAggregator(function(result, value, key) {
57996             result[key ? 0 : 1].push(value);
57997           }, function() {
57998             return [
57999               [],
58000               []
58001             ];
58002           });
58003
58004           /**
58005            * Gets the property value of `path` from all elements in `collection`.
58006            *
58007            * @static
58008            * @memberOf _
58009            * @category Collection
58010            * @param {Array|Object|string}
58011            *            collection The collection to iterate over.
58012            * @param {Array|string}
58013            *            path The path of the property to pluck.
58014            * @returns {Array} Returns the property values.
58015            * @example
58016            *
58017            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
58018            * 40 } ];
58019            *
58020            * _.pluck(users, 'user'); // => ['barney', 'fred']
58021            *
58022            * var userIndex = _.indexBy(users, 'user'); _.pluck(userIndex, 'age'); // =>
58023            * [36, 40] (iteration order is not guaranteed)
58024            */
58025           function pluck(collection, path) {
58026             return map(collection, property(path));
58027           }
58028
58029           /**
58030            * Reduces `collection` to a value which is the accumulated result of
58031            * running each element in `collection` through `iteratee`, where each
58032            * successive invocation is supplied the return value of the previous. If
58033            * `accumulator` is not provided the first element of `collection` is used
58034            * as the initial value. The `iteratee` is bound to `thisArg` and invoked
58035            * with four arguments: (accumulator, value, index|key, collection).
58036            *
58037            * Many lodash methods are guarded to work as iteratees for methods like
58038            * `_.reduce`, `_.reduceRight`, and `_.transform`.
58039            *
58040            * The guarded methods are: `assign`, `defaults`, `defaultsDeep`,
58041            * `includes`, `merge`, `sortByAll`, and `sortByOrder`
58042            *
58043            * @static
58044            * @memberOf _
58045            * @alias foldl, inject
58046            * @category Collection
58047            * @param {Array|Object|string}
58048            *            collection The collection to iterate over.
58049            * @param {Function}
58050            *            [iteratee=_.identity] The function invoked per iteration.
58051            * @param {*}
58052            *            [accumulator] The initial value.
58053            * @param {*}
58054            *            [thisArg] The `this` binding of `iteratee`.
58055            * @returns {*} Returns the accumulated value.
58056            * @example
58057            *
58058            * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
58059            *
58060            * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n *
58061            * 3; return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is
58062            * not guaranteed)
58063            */
58064           var reduce = createReduce(arrayReduce, baseEach);
58065
58066           /**
58067            * This method is like `_.reduce` except that it iterates over elements of
58068            * `collection` from right to left.
58069            *
58070            * @static
58071            * @memberOf _
58072            * @alias foldr
58073            * @category Collection
58074            * @param {Array|Object|string}
58075            *            collection The collection to iterate over.
58076            * @param {Function}
58077            *            [iteratee=_.identity] The function invoked per iteration.
58078            * @param {*}
58079            *            [accumulator] The initial value.
58080            * @param {*}
58081            *            [thisArg] The `this` binding of `iteratee`.
58082            * @returns {*} Returns the accumulated value.
58083            * @example
58084            *
58085            * var array = [[0, 1], [2, 3], [4, 5]];
58086            *
58087            * _.reduceRight(array, function(flattened, other) { return
58088            * flattened.concat(other); }, []); // => [4, 5, 2, 3, 0, 1]
58089            */
58090           var reduceRight = createReduce(arrayReduceRight, baseEachRight);
58091
58092           /**
58093            * The opposite of `_.filter`; this method returns the elements of
58094            * `collection` that `predicate` does **not** return truthy for.
58095            *
58096            * @static
58097            * @memberOf _
58098            * @category Collection
58099            * @param {Array|Object|string}
58100            *            collection The collection to iterate over.
58101            * @param {Function|Object|string}
58102            *            [predicate=_.identity] The function invoked per iteration.
58103            * @param {*}
58104            *            [thisArg] The `this` binding of `predicate`.
58105            * @returns {Array} Returns the new filtered array.
58106            * @example
58107            *
58108            * _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); // => [1, 3]
58109            *
58110            * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
58111            * 'fred', 'age': 40, 'active': true } ];
58112            *  // using the `_.matches` callback shorthand _.pluck(_.reject(users, {
58113            * 'age': 40, 'active': true }), 'user'); // => ['barney']
58114            *  // using the `_.matchesProperty` callback shorthand
58115            * _.pluck(_.reject(users, 'active', false), 'user'); // => ['fred']
58116            *  // using the `_.property` callback shorthand _.pluck(_.reject(users,
58117            * 'active'), 'user'); // => ['barney']
58118            */
58119           function reject(collection, predicate, thisArg) {
58120             var func = isArray(collection) ? arrayFilter : baseFilter;
58121             predicate = getCallback(predicate, thisArg, 3);
58122             return func(collection, function(value, index, collection) {
58123               return !predicate(value, index, collection);
58124             });
58125           }
58126
58127           /**
58128            * Gets a random element or `n` random elements from a collection.
58129            *
58130            * @static
58131            * @memberOf _
58132            * @category Collection
58133            * @param {Array|Object|string}
58134            *            collection The collection to sample.
58135            * @param {number}
58136            *            [n] The number of elements to sample.
58137            * @param- {Object} [guard] Enables use as a callback for functions like
58138            *         `_.map`.
58139            * @returns {*} Returns the random sample(s).
58140            * @example
58141            *
58142            * _.sample([1, 2, 3, 4]); // => 2
58143            *
58144            * _.sample([1, 2, 3, 4], 2); // => [3, 1]
58145            */
58146           function sample(collection, n, guard) {
58147             if (guard ? isIterateeCall(collection, n, guard) : n == null) {
58148               collection = toIterable(collection);
58149               var length = collection.length;
58150               return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
58151             }
58152             var index = -1,
58153               result = toArray(collection),
58154               length = result.length,
58155               lastIndex = length - 1;
58156
58157             n = nativeMin(n < 0 ? 0 : (+n || 0), length);
58158             while (++index < n) {
58159               var rand = baseRandom(index, lastIndex),
58160                 value = result[rand];
58161
58162               result[rand] = result[index];
58163               result[index] = value;
58164             }
58165             result.length = n;
58166             return result;
58167           }
58168
58169           /**
58170            * Creates an array of shuffled values, using a version of the [Fisher-Yates
58171            * shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
58172            *
58173            * @static
58174            * @memberOf _
58175            * @category Collection
58176            * @param {Array|Object|string}
58177            *            collection The collection to shuffle.
58178            * @returns {Array} Returns the new shuffled array.
58179            * @example
58180            *
58181            * _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2]
58182            */
58183           function shuffle(collection) {
58184             return sample(collection, POSITIVE_INFINITY);
58185           }
58186
58187           /**
58188            * Gets the size of `collection` by returning its length for array-like
58189            * values or the number of own enumerable properties for objects.
58190            *
58191            * @static
58192            * @memberOf _
58193            * @category Collection
58194            * @param {Array|Object|string}
58195            *            collection The collection to inspect.
58196            * @returns {number} Returns the size of `collection`.
58197            * @example
58198            *
58199            * _.size([1, 2, 3]); // => 3
58200            *
58201            * _.size({ 'a': 1, 'b': 2 }); // => 2
58202            *
58203            * _.size('pebbles'); // => 7
58204            */
58205           function size(collection) {
58206             var length = collection ? getLength(collection) : 0;
58207             return isLength(length) ? length : keys(collection).length;
58208           }
58209
58210           /**
58211            * Checks if `predicate` returns truthy for **any** element of `collection`.
58212            * The function returns as soon as it finds a passing value and does not
58213            * iterate over the entire collection. The predicate is bound to `thisArg`
58214            * and invoked with three arguments: (value, index|key, collection).
58215            *
58216            * If a property name is provided for `predicate` the created `_.property`
58217            * style callback returns the property value of the given element.
58218            *
58219            * If a value is also provided for `thisArg` the created `_.matchesProperty`
58220            * style callback returns `true` for elements that have a matching property
58221            * value, else `false`.
58222            *
58223            * If an object is provided for `predicate` the created `_.matches` style
58224            * callback returns `true` for elements that have the properties of the
58225            * given object, else `false`.
58226            *
58227            * @static
58228            * @memberOf _
58229            * @alias any
58230            * @category Collection
58231            * @param {Array|Object|string}
58232            *            collection The collection to iterate over.
58233            * @param {Function|Object|string}
58234            *            [predicate=_.identity] The function invoked per iteration.
58235            * @param {*}
58236            *            [thisArg] The `this` binding of `predicate`.
58237            * @returns {boolean} Returns `true` if any element passes the predicate
58238            *          check, else `false`.
58239            * @example
58240            *
58241            * _.some([null, 0, 'yes', false], Boolean); // => true
58242            *
58243            * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
58244            * 'active': false } ];
58245            *  // using the `_.matches` callback shorthand _.some(users, { 'user':
58246            * 'barney', 'active': false }); // => false
58247            *  // using the `_.matchesProperty` callback shorthand _.some(users,
58248            * 'active', false); // => true
58249            *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
58250            * true
58251            */
58252           function some(collection, predicate, thisArg) {
58253             var func = isArray(collection) ? arraySome : baseSome;
58254             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
58255               predicate = undefined;
58256             }
58257             if (typeof predicate != 'function' || thisArg !== undefined) {
58258               predicate = getCallback(predicate, thisArg, 3);
58259             }
58260             return func(collection, predicate);
58261           }
58262
58263           /**
58264            * Creates an array of elements, sorted in ascending order by the results of
58265            * running each element in a collection through `iteratee`. This method
58266            * performs a stable sort, that is, it preserves the original sort order of
58267            * equal elements. The `iteratee` is bound to `thisArg` and invoked with
58268            * three arguments: (value, index|key, collection).
58269            *
58270            * If a property name is provided for `iteratee` the created `_.property`
58271            * style callback returns the property value of the given element.
58272            *
58273            * If a value is also provided for `thisArg` the created `_.matchesProperty`
58274            * style callback returns `true` for elements that have a matching property
58275            * value, else `false`.
58276            *
58277            * If an object is provided for `iteratee` the created `_.matches` style
58278            * callback returns `true` for elements that have the properties of the
58279            * given object, else `false`.
58280            *
58281            * @static
58282            * @memberOf _
58283            * @category Collection
58284            * @param {Array|Object|string}
58285            *            collection The collection to iterate over.
58286            * @param {Function|Object|string}
58287            *            [iteratee=_.identity] The function invoked per iteration.
58288            * @param {*}
58289            *            [thisArg] The `this` binding of `iteratee`.
58290            * @returns {Array} Returns the new sorted array.
58291            * @example
58292            *
58293            * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
58294            *
58295            * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3,
58296            * 1, 2]
58297            *
58298            * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user':
58299            * 'barney' } ];
58300            *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
58301            * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
58302            */
58303           function sortBy(collection, iteratee, thisArg) {
58304             if (collection == null) {
58305               return [];
58306             }
58307             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
58308               iteratee = undefined;
58309             }
58310             var index = -1;
58311             iteratee = getCallback(iteratee, thisArg, 3);
58312
58313             var result = baseMap(collection, function(value, key, collection) {
58314               return {
58315                 'criteria': iteratee(value, key, collection),
58316                 'index': ++index,
58317                 'value': value
58318               };
58319             });
58320             return baseSortBy(result, compareAscending);
58321           }
58322
58323           /**
58324            * This method is like `_.sortBy` except that it can sort by multiple
58325            * iteratees or property names.
58326            *
58327            * If a property name is provided for an iteratee the created `_.property`
58328            * style callback returns the property value of the given element.
58329            *
58330            * If an object is provided for an iteratee the created `_.matches` style
58331            * callback returns `true` for elements that have the properties of the
58332            * given object, else `false`.
58333            *
58334            * @static
58335            * @memberOf _
58336            * @category Collection
58337            * @param {Array|Object|string}
58338            *            collection The collection to iterate over.
58339            * @param {...(Function|Function[]|Object|Object[]|string|string[])}
58340            *            iteratees The iteratees to sort by, specified as individual
58341            *            values or arrays of values.
58342            * @returns {Array} Returns the new sorted array.
58343            * @example
58344            *
58345            * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58346            * 36 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 34 } ];
58347            *
58348            * _.map(_.sortByAll(users, ['user', 'age']), _.values); // => [['barney',
58349            * 34], ['barney', 36], ['fred', 42], ['fred', 48]]
58350            *
58351            * _.map(_.sortByAll(users, 'user', function(chr) { return
58352            * Math.floor(chr.age / 10); }), _.values); // => [['barney', 36],
58353            * ['barney', 34], ['fred', 48], ['fred', 42]]
58354            */
58355           var sortByAll = restParam(function(collection, iteratees) {
58356             if (collection == null) {
58357               return [];
58358             }
58359             var guard = iteratees[2];
58360             if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
58361               iteratees.length = 1;
58362             }
58363             return baseSortByOrder(collection, baseFlatten(iteratees), []);
58364           });
58365
58366           /**
58367            * This method is like `_.sortByAll` except that it allows specifying the
58368            * sort orders of the iteratees to sort by. If `orders` is unspecified, all
58369            * values are sorted in ascending order. Otherwise, a value is sorted in
58370            * ascending order if its corresponding order is "asc", and descending if
58371            * "desc".
58372            *
58373            * If a property name is provided for an iteratee the created `_.property`
58374            * style callback returns the property value of the given element.
58375            *
58376            * If an object is provided for an iteratee the created `_.matches` style
58377            * callback returns `true` for elements that have the properties of the
58378            * given object, else `false`.
58379            *
58380            * @static
58381            * @memberOf _
58382            * @category Collection
58383            * @param {Array|Object|string}
58384            *            collection The collection to iterate over.
58385            * @param {Function[]|Object[]|string[]}
58386            *            iteratees The iteratees to sort by.
58387            * @param {boolean[]}
58388            *            [orders] The sort orders of `iteratees`.
58389            * @param- {Object} [guard] Enables use as a callback for functions like
58390            *         `_.reduce`.
58391            * @returns {Array} Returns the new sorted array.
58392            * @example
58393            *
58394            * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58395            * 34 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 36 } ];
58396            *  // sort by `user` in ascending order and by `age` in descending order
58397            * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); // =>
58398            * [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
58399            */
58400           function sortByOrder(collection, iteratees, orders, guard) {
58401             if (collection == null) {
58402               return [];
58403             }
58404             if (guard && isIterateeCall(iteratees, orders, guard)) {
58405               orders = undefined;
58406             }
58407             if (!isArray(iteratees)) {
58408               iteratees = iteratees == null ? [] : [iteratees];
58409             }
58410             if (!isArray(orders)) {
58411               orders = orders == null ? [] : [orders];
58412             }
58413             return baseSortByOrder(collection, iteratees, orders);
58414           }
58415
58416           /**
58417            * Performs a deep comparison between each element in `collection` and the
58418            * source object, returning an array of all elements that have equivalent
58419            * property values.
58420            *
58421            * **Note:** This method supports comparing arrays, booleans, `Date`
58422            * objects, numbers, `Object` objects, regexes, and strings. Objects are
58423            * compared by their own, not inherited, enumerable properties. For
58424            * comparing a single own or inherited property value see
58425            * `_.matchesProperty`.
58426            *
58427            * @static
58428            * @memberOf _
58429            * @category Collection
58430            * @param {Array|Object|string}
58431            *            collection The collection to search.
58432            * @param {Object}
58433            *            source The object of property values to match.
58434            * @returns {Array} Returns the new filtered array.
58435            * @example
58436            *
58437            * var users = [ { 'user': 'barney', 'age': 36, 'active': false, 'pets':
58438            * ['hoppy'] }, { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby
58439            * puss', 'dino'] } ];
58440            *
58441            * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); // =>
58442            * ['barney']
58443            *
58444            * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); // => ['fred']
58445            */
58446           function where(collection, source) {
58447             return filter(collection, baseMatches(source));
58448           }
58449
58450           /*------------------------------------------------------------------------*/
58451
58452           /**
58453            * Gets the number of milliseconds that have elapsed since the Unix epoch (1
58454            * January 1970 00:00:00 UTC).
58455            *
58456            * @static
58457            * @memberOf _
58458            * @category Date
58459            * @example
58460            *
58461            * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
58462            * logs the number of milliseconds it took for the deferred function to be
58463            * invoked
58464            */
58465           var now = nativeNow || function() {
58466             return new Date().getTime();
58467           };
58468
58469           /*------------------------------------------------------------------------*/
58470
58471           /**
58472            * The opposite of `_.before`; this method creates a function that invokes
58473            * `func` once it is called `n` or more times.
58474            *
58475            * @static
58476            * @memberOf _
58477            * @category Function
58478            * @param {number}
58479            *            n The number of calls before `func` is invoked.
58480            * @param {Function}
58481            *            func The function to restrict.
58482            * @returns {Function} Returns the new restricted function.
58483            * @example
58484            *
58485            * var saves = ['profile', 'settings'];
58486            *
58487            * var done = _.after(saves.length, function() { console.log('done
58488            * saving!'); });
58489            *
58490            * _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete':
58491            * done }); }); // => logs 'done saving!' after the two async saves have
58492            * completed
58493            */
58494           function after(n, func) {
58495             if (typeof func != 'function') {
58496               if (typeof n == 'function') {
58497                 var temp = n;
58498                 n = func;
58499                 func = temp;
58500               } else {
58501                 throw new TypeError(FUNC_ERROR_TEXT);
58502               }
58503             }
58504             n = nativeIsFinite(n = +n) ? n : 0;
58505             return function() {
58506               if (--n < 1) {
58507                 return func.apply(this, arguments);
58508               }
58509             };
58510           }
58511
58512           /**
58513            * Creates a function that accepts up to `n` arguments ignoring any
58514            * additional arguments.
58515            *
58516            * @static
58517            * @memberOf _
58518            * @category Function
58519            * @param {Function}
58520            *            func The function to cap arguments for.
58521            * @param {number}
58522            *            [n=func.length] The arity cap.
58523            * @param- {Object} [guard] Enables use as a callback for functions like
58524            *         `_.map`.
58525            * @returns {Function} Returns the new function.
58526            * @example
58527            *
58528            * _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10]
58529            */
58530           function ary(func, n, guard) {
58531             if (guard && isIterateeCall(func, n, guard)) {
58532               n = undefined;
58533             }
58534             n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
58535             return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
58536           }
58537
58538           /**
58539            * Creates a function that invokes `func`, with the `this` binding and
58540            * arguments of the created function, while it is called less than `n`
58541            * times. Subsequent calls to the created function return the result of the
58542            * last `func` invocation.
58543            *
58544            * @static
58545            * @memberOf _
58546            * @category Function
58547            * @param {number}
58548            *            n The number of calls at which `func` is no longer invoked.
58549            * @param {Function}
58550            *            func The function to restrict.
58551            * @returns {Function} Returns the new restricted function.
58552            * @example
58553            *
58554            * jQuery('#add').on('click', _.before(5, addContactToList)); // => allows
58555            * adding up to 4 contacts to the list
58556            */
58557           function before(n, func) {
58558             var result;
58559             if (typeof func != 'function') {
58560               if (typeof n == 'function') {
58561                 var temp = n;
58562                 n = func;
58563                 func = temp;
58564               } else {
58565                 throw new TypeError(FUNC_ERROR_TEXT);
58566               }
58567             }
58568             return function() {
58569               if (--n > 0) {
58570                 result = func.apply(this, arguments);
58571               }
58572               if (n <= 1) {
58573                 func = undefined;
58574               }
58575               return result;
58576             };
58577           }
58578
58579           /**
58580            * Creates a function that invokes `func` with the `this` binding of
58581            * `thisArg` and prepends any additional `_.bind` arguments to those
58582            * provided to the bound function.
58583            *
58584            * The `_.bind.placeholder` value, which defaults to `_` in monolithic
58585            * builds, may be used as a placeholder for partially applied arguments.
58586            *
58587            * **Note:** Unlike native `Function#bind` this method does not set the
58588            * "length" property of bound functions.
58589            *
58590            * @static
58591            * @memberOf _
58592            * @category Function
58593            * @param {Function}
58594            *            func The function to bind.
58595            * @param {*}
58596            *            thisArg The `this` binding of `func`.
58597            * @param {...*}
58598            *            [partials] The arguments to be partially applied.
58599            * @returns {Function} Returns the new bound function.
58600            * @example
58601            *
58602            * var greet = function(greeting, punctuation) { return greeting + ' ' +
58603            * this.user + punctuation; };
58604            *
58605            * var object = { 'user': 'fred' };
58606            *
58607            * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
58608            *  // using placeholders var bound = _.bind(greet, object, _, '!');
58609            * bound('hi'); // => 'hi fred!'
58610            */
58611           var bind = restParam(function(func, thisArg, partials) {
58612             var bitmask = BIND_FLAG;
58613             if (partials.length) {
58614               var holders = replaceHolders(partials, bind.placeholder);
58615               bitmask |= PARTIAL_FLAG;
58616             }
58617             return createWrapper(func, bitmask, thisArg, partials, holders);
58618           });
58619
58620           /**
58621            * Binds methods of an object to the object itself, overwriting the existing
58622            * method. Method names may be specified as individual arguments or as
58623            * arrays of method names. If no method names are provided all enumerable
58624            * function properties, own and inherited, of `object` are bound.
58625            *
58626            * **Note:** This method does not set the "length" property of bound
58627            * functions.
58628            *
58629            * @static
58630            * @memberOf _
58631            * @category Function
58632            * @param {Object}
58633            *            object The object to bind and assign the bound methods to.
58634            * @param {...(string|string[])}
58635            *            [methodNames] The object method names to bind, specified as
58636            *            individual method names or arrays of method names.
58637            * @returns {Object} Returns `object`.
58638            * @example
58639            *
58640            * var view = { 'label': 'docs', 'onClick': function() {
58641            * console.log('clicked ' + this.label); } };
58642            *
58643            * _.bindAll(view); jQuery('#docs').on('click', view.onClick); // => logs
58644            * 'clicked docs' when the element is clicked
58645            */
58646           var bindAll = restParam(function(object, methodNames) {
58647             methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
58648
58649             var index = -1,
58650               length = methodNames.length;
58651
58652             while (++index < length) {
58653               var key = methodNames[index];
58654               object[key] = createWrapper(object[key], BIND_FLAG, object);
58655             }
58656             return object;
58657           });
58658
58659           /**
58660            * Creates a function that invokes the method at `object[key]` and prepends
58661            * any additional `_.bindKey` arguments to those provided to the bound
58662            * function.
58663            *
58664            * This method differs from `_.bind` by allowing bound functions to
58665            * reference methods that may be redefined or don't yet exist. See [Peter
58666            * Michaux's
58667            * article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
58668            * for more details.
58669            *
58670            * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
58671            * builds, may be used as a placeholder for partially applied arguments.
58672            *
58673            * @static
58674            * @memberOf _
58675            * @category Function
58676            * @param {Object}
58677            *            object The object the method belongs to.
58678            * @param {string}
58679            *            key The key of the method.
58680            * @param {...*}
58681            *            [partials] The arguments to be partially applied.
58682            * @returns {Function} Returns the new bound function.
58683            * @example
58684            *
58685            * var object = { 'user': 'fred', 'greet': function(greeting, punctuation) {
58686            * return greeting + ' ' + this.user + punctuation; } };
58687            *
58688            * var bound = _.bindKey(object, 'greet', 'hi'); bound('!'); // => 'hi
58689            * fred!'
58690            *
58691            * object.greet = function(greeting, punctuation) { return greeting + 'ya ' +
58692            * this.user + punctuation; };
58693            *
58694            * bound('!'); // => 'hiya fred!'
58695            *  // using placeholders var bound = _.bindKey(object, 'greet', _, '!');
58696            * bound('hi'); // => 'hiya fred!'
58697            */
58698           var bindKey = restParam(function(object, key, partials) {
58699             var bitmask = BIND_FLAG | BIND_KEY_FLAG;
58700             if (partials.length) {
58701               var holders = replaceHolders(partials, bindKey.placeholder);
58702               bitmask |= PARTIAL_FLAG;
58703             }
58704             return createWrapper(key, bitmask, object, partials, holders);
58705           });
58706
58707           /**
58708            * Creates a function that accepts one or more arguments of `func` that when
58709            * called either invokes `func` returning its result, if all `func`
58710            * arguments have been provided, or returns a function that accepts one or
58711            * more of the remaining `func` arguments, and so on. The arity of `func`
58712            * may be specified if `func.length` is not sufficient.
58713            *
58714            * The `_.curry.placeholder` value, which defaults to `_` in monolithic
58715            * builds, may be used as a placeholder for provided arguments.
58716            *
58717            * **Note:** This method does not set the "length" property of curried
58718            * functions.
58719            *
58720            * @static
58721            * @memberOf _
58722            * @category Function
58723            * @param {Function}
58724            *            func The function to curry.
58725            * @param {number}
58726            *            [arity=func.length] The arity of `func`.
58727            * @param- {Object} [guard] Enables use as a callback for functions like
58728            *         `_.map`.
58729            * @returns {Function} Returns the new curried function.
58730            * @example
58731            *
58732            * var abc = function(a, b, c) { return [a, b, c]; };
58733            *
58734            * var curried = _.curry(abc);
58735            *
58736            * curried(1)(2)(3); // => [1, 2, 3]
58737            *
58738            * curried(1, 2)(3); // => [1, 2, 3]
58739            *
58740            * curried(1, 2, 3); // => [1, 2, 3]
58741            *  // using placeholders curried(1)(_, 3)(2); // => [1, 2, 3]
58742            */
58743           var curry = createCurry(CURRY_FLAG);
58744
58745           /**
58746            * This method is like `_.curry` except that arguments are applied to `func`
58747            * in the manner of `_.partialRight` instead of `_.partial`.
58748            *
58749            * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
58750            * builds, may be used as a placeholder for provided arguments.
58751            *
58752            * **Note:** This method does not set the "length" property of curried
58753            * functions.
58754            *
58755            * @static
58756            * @memberOf _
58757            * @category Function
58758            * @param {Function}
58759            *            func The function to curry.
58760            * @param {number}
58761            *            [arity=func.length] The arity of `func`.
58762            * @param- {Object} [guard] Enables use as a callback for functions like
58763            *         `_.map`.
58764            * @returns {Function} Returns the new curried function.
58765            * @example
58766            *
58767            * var abc = function(a, b, c) { return [a, b, c]; };
58768            *
58769            * var curried = _.curryRight(abc);
58770            *
58771            * curried(3)(2)(1); // => [1, 2, 3]
58772            *
58773            * curried(2, 3)(1); // => [1, 2, 3]
58774            *
58775            * curried(1, 2, 3); // => [1, 2, 3]
58776            *  // using placeholders curried(3)(1, _)(2); // => [1, 2, 3]
58777            */
58778           var curryRight = createCurry(CURRY_RIGHT_FLAG);
58779
58780           /**
58781            * Creates a debounced function that delays invoking `func` until after
58782            * `wait` milliseconds have elapsed since the last time the debounced
58783            * function was invoked. The debounced function comes with a `cancel` method
58784            * to cancel delayed invocations. Provide an options object to indicate that
58785            * `func` should be invoked on the leading and/or trailing edge of the
58786            * `wait` timeout. Subsequent calls to the debounced function return the
58787            * result of the last `func` invocation.
58788            *
58789            * **Note:** If `leading` and `trailing` options are `true`, `func` is
58790            * invoked on the trailing edge of the timeout only if the the debounced
58791            * function is invoked more than once during the `wait` timeout.
58792            *
58793            * See [David Corbacho's
58794            * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
58795            * for details over the differences between `_.debounce` and `_.throttle`.
58796            *
58797            * @static
58798            * @memberOf _
58799            * @category Function
58800            * @param {Function}
58801            *            func The function to debounce.
58802            * @param {number}
58803            *            [wait=0] The number of milliseconds to delay.
58804            * @param {Object}
58805            *            [options] The options object.
58806            * @param {boolean}
58807            *            [options.leading=false] Specify invoking on the leading edge
58808            *            of the timeout.
58809            * @param {number}
58810            *            [options.maxWait] The maximum time `func` is allowed to be
58811            *            delayed before it is invoked.
58812            * @param {boolean}
58813            *            [options.trailing=true] Specify invoking on the trailing edge
58814            *            of the timeout.
58815            * @returns {Function} Returns the new debounced function.
58816            * @example
58817            *  // avoid costly calculations while the window size is in flux
58818            * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
58819            *  // invoke `sendMail` when the click event is fired, debouncing
58820            * subsequent calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
58821            * 'leading': true, 'trailing': false }));
58822            *  // ensure `batchLog` is invoked once after 1 second of debounced calls
58823            * var source = new EventSource('/stream'); jQuery(source).on('message',
58824            * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
58825            *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
58826            * Object.observe(models.todo, todoChanges);
58827            *
58828            * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
58829            * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
58830            *  // ...at some point `models.todo` is changed models.todo.completed =
58831            * true;
58832            *  // ...before 1 second has passed `models.todo` is deleted // which
58833            * cancels the debounced `todoChanges` call delete models.todo;
58834            */
58835           function debounce(func, wait, options) {
58836             var args,
58837               maxTimeoutId,
58838               result,
58839               stamp,
58840               thisArg,
58841               timeoutId,
58842               trailingCall,
58843               lastCalled = 0,
58844               maxWait = false,
58845               trailing = true;
58846
58847             if (typeof func != 'function') {
58848               throw new TypeError(FUNC_ERROR_TEXT);
58849             }
58850             wait = wait < 0 ? 0 : (+wait || 0);
58851             if (options === true) {
58852               var leading = true;
58853               trailing = false;
58854             } else if (isObject(options)) {
58855               leading = !!options.leading;
58856               maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
58857               trailing = 'trailing' in options ? !!options.trailing : trailing;
58858             }
58859
58860             function cancel() {
58861               if (timeoutId) {
58862                 clearTimeout(timeoutId);
58863               }
58864               if (maxTimeoutId) {
58865                 clearTimeout(maxTimeoutId);
58866               }
58867               lastCalled = 0;
58868               maxTimeoutId = timeoutId = trailingCall = undefined;
58869             }
58870
58871             function complete(isCalled, id) {
58872               if (id) {
58873                 clearTimeout(id);
58874               }
58875               maxTimeoutId = timeoutId = trailingCall = undefined;
58876               if (isCalled) {
58877                 lastCalled = now();
58878                 result = func.apply(thisArg, args);
58879                 if (!timeoutId && !maxTimeoutId) {
58880                   args = thisArg = undefined;
58881                 }
58882               }
58883             }
58884
58885             function delayed() {
58886               var remaining = wait - (now() - stamp);
58887               if (remaining <= 0 || remaining > wait) {
58888                 complete(trailingCall, maxTimeoutId);
58889               } else {
58890                 timeoutId = setTimeout(delayed, remaining);
58891               }
58892             }
58893
58894             function maxDelayed() {
58895               complete(trailing, timeoutId);
58896             }
58897
58898             function debounced() {
58899               args = arguments;
58900               stamp = now();
58901               thisArg = this;
58902               trailingCall = trailing && (timeoutId || !leading);
58903
58904               if (maxWait === false) {
58905                 var leadingCall = leading && !timeoutId;
58906               } else {
58907                 if (!maxTimeoutId && !leading) {
58908                   lastCalled = stamp;
58909                 }
58910                 var remaining = maxWait - (stamp - lastCalled),
58911                   isCalled = remaining <= 0 || remaining > maxWait;
58912
58913                 if (isCalled) {
58914                   if (maxTimeoutId) {
58915                     maxTimeoutId = clearTimeout(maxTimeoutId);
58916                   }
58917                   lastCalled = stamp;
58918                   result = func.apply(thisArg, args);
58919                 } else if (!maxTimeoutId) {
58920                   maxTimeoutId = setTimeout(maxDelayed, remaining);
58921                 }
58922               }
58923               if (isCalled && timeoutId) {
58924                 timeoutId = clearTimeout(timeoutId);
58925               } else if (!timeoutId && wait !== maxWait) {
58926                 timeoutId = setTimeout(delayed, wait);
58927               }
58928               if (leadingCall) {
58929                 isCalled = true;
58930                 result = func.apply(thisArg, args);
58931               }
58932               if (isCalled && !timeoutId && !maxTimeoutId) {
58933                 args = thisArg = undefined;
58934               }
58935               return result;
58936             }
58937             debounced.cancel = cancel;
58938             return debounced;
58939           }
58940
58941           /**
58942            * Defers invoking the `func` until the current call stack has cleared. Any
58943            * additional arguments are provided to `func` when it is invoked.
58944            *
58945            * @static
58946            * @memberOf _
58947            * @category Function
58948            * @param {Function}
58949            *            func The function to defer.
58950            * @param {...*}
58951            *            [args] The arguments to invoke the function with.
58952            * @returns {number} Returns the timer id.
58953            * @example
58954            *
58955            * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
58956            * 'deferred' after one or more milliseconds
58957            */
58958           var defer = restParam(function(func, args) {
58959             return baseDelay(func, 1, args);
58960           });
58961
58962           /**
58963            * Invokes `func` after `wait` milliseconds. Any additional arguments are
58964            * provided to `func` when it is invoked.
58965            *
58966            * @static
58967            * @memberOf _
58968            * @category Function
58969            * @param {Function}
58970            *            func The function to delay.
58971            * @param {number}
58972            *            wait The number of milliseconds to delay invocation.
58973            * @param {...*}
58974            *            [args] The arguments to invoke the function with.
58975            * @returns {number} Returns the timer id.
58976            * @example
58977            *
58978            * _.delay(function(text) { console.log(text); }, 1000, 'later'); // => logs
58979            * 'later' after one second
58980            */
58981           var delay = restParam(function(func, wait, args) {
58982             return baseDelay(func, wait, args);
58983           });
58984
58985           /**
58986            * Creates a function that returns the result of invoking the provided
58987            * functions with the `this` binding of the created function, where each
58988            * successive invocation is supplied the return value of the previous.
58989            *
58990            * @static
58991            * @memberOf _
58992            * @category Function
58993            * @param {...Function}
58994            *            [funcs] Functions to invoke.
58995            * @returns {Function} Returns the new function.
58996            * @example
58997            *
58998            * function square(n) { return n * n; }
58999            *
59000            * var addSquare = _.flow(_.add, square); addSquare(1, 2); // => 9
59001            */
59002           var flow = createFlow();
59003
59004           /**
59005            * This method is like `_.flow` except that it creates a function that
59006            * invokes the provided functions from right to left.
59007            *
59008            * @static
59009            * @memberOf _
59010            * @alias backflow, compose
59011            * @category Function
59012            * @param {...Function}
59013            *            [funcs] Functions to invoke.
59014            * @returns {Function} Returns the new function.
59015            * @example
59016            *
59017            * function square(n) { return n * n; }
59018            *
59019            * var addSquare = _.flowRight(square, _.add); addSquare(1, 2); // => 9
59020            */
59021           var flowRight = createFlow(true);
59022
59023           /**
59024            * Creates a function that memoizes the result of `func`. If `resolver` is
59025            * provided it determines the cache key for storing the result based on the
59026            * arguments provided to the memoized function. By default, the first
59027            * argument provided to the memoized function is coerced to a string and
59028            * used as the cache key. The `func` is invoked with the `this` binding of
59029            * the memoized function.
59030            *
59031            * **Note:** The cache is exposed as the `cache` property on the memoized
59032            * function. Its creation may be customized by replacing the
59033            * `_.memoize.Cache` constructor with one whose instances implement the
59034            * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
59035            * method interface of `get`, `has`, and `set`.
59036            *
59037            * @static
59038            * @memberOf _
59039            * @category Function
59040            * @param {Function}
59041            *            func The function to have its output memoized.
59042            * @param {Function}
59043            *            [resolver] The function to resolve the cache key.
59044            * @returns {Function} Returns the new memoizing function.
59045            * @example
59046            *
59047            * var upperCase = _.memoize(function(string) { return string.toUpperCase();
59048            * });
59049            *
59050            * upperCase('fred'); // => 'FRED'
59051            *  // modifying the result cache upperCase.cache.set('fred', 'BARNEY');
59052            * upperCase('fred'); // => 'BARNEY'
59053            *  // replacing `_.memoize.Cache` var object = { 'user': 'fred' }; var
59054            * other = { 'user': 'barney' }; var identity = _.memoize(_.identity);
59055            *
59056            * identity(object); // => { 'user': 'fred' } identity(other); // => {
59057            * 'user': 'fred' }
59058            *
59059            * _.memoize.Cache = WeakMap; var identity = _.memoize(_.identity);
59060            *
59061            * identity(object); // => { 'user': 'fred' } identity(other); // => {
59062            * 'user': 'barney' }
59063            */
59064           function memoize(func, resolver) {
59065             if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
59066               throw new TypeError(FUNC_ERROR_TEXT);
59067             }
59068             var memoized = function() {
59069               var args = arguments,
59070                 key = resolver ? resolver.apply(this, args) : args[0],
59071                 cache = memoized.cache;
59072
59073               if (cache.has(key)) {
59074                 return cache.get(key);
59075               }
59076               var result = func.apply(this, args);
59077               memoized.cache = cache.set(key, result);
59078               return result;
59079             };
59080             memoized.cache = new memoize.Cache;
59081             return memoized;
59082           }
59083
59084           /**
59085            * Creates a function that runs each argument through a corresponding
59086            * transform function.
59087            *
59088            * @static
59089            * @memberOf _
59090            * @category Function
59091            * @param {Function}
59092            *            func The function to wrap.
59093            * @param {...(Function|Function[])}
59094            *            [transforms] The functions to transform arguments, specified
59095            *            as individual functions or arrays of functions.
59096            * @returns {Function} Returns the new function.
59097            * @example
59098            *
59099            * function doubled(n) { return n * 2; }
59100            *
59101            * function square(n) { return n * n; }
59102            *
59103            * var modded = _.modArgs(function(x, y) { return [x, y]; }, square,
59104            * doubled);
59105            *
59106            * modded(1, 2); // => [1, 4]
59107            *
59108            * modded(5, 10); // => [25, 20]
59109            */
59110           var modArgs = restParam(function(func, transforms) {
59111             transforms = baseFlatten(transforms);
59112             if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
59113               throw new TypeError(FUNC_ERROR_TEXT);
59114             }
59115             var length = transforms.length;
59116             return restParam(function(args) {
59117               var index = nativeMin(args.length, length);
59118               while (index--) {
59119                 args[index] = transforms[index](args[index]);
59120               }
59121               return func.apply(this, args);
59122             });
59123           });
59124
59125           /**
59126            * Creates a function that negates the result of the predicate `func`. The
59127            * `func` predicate is invoked with the `this` binding and arguments of the
59128            * created function.
59129            *
59130            * @static
59131            * @memberOf _
59132            * @category Function
59133            * @param {Function}
59134            *            predicate The predicate to negate.
59135            * @returns {Function} Returns the new function.
59136            * @example
59137            *
59138            * function isEven(n) { return n % 2 == 0; }
59139            *
59140            * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5]
59141            */
59142           function negate(predicate) {
59143             if (typeof predicate != 'function') {
59144               throw new TypeError(FUNC_ERROR_TEXT);
59145             }
59146             return function() {
59147               return !predicate.apply(this, arguments);
59148             };
59149           }
59150
59151           /**
59152            * Creates a function that is restricted to invoking `func` once. Repeat
59153            * calls to the function return the value of the first call. The `func` is
59154            * invoked with the `this` binding and arguments of the created function.
59155            *
59156            * @static
59157            * @memberOf _
59158            * @category Function
59159            * @param {Function}
59160            *            func The function to restrict.
59161            * @returns {Function} Returns the new restricted function.
59162            * @example
59163            *
59164            * var initialize = _.once(createApplication); initialize(); initialize(); //
59165            * `initialize` invokes `createApplication` once
59166            */
59167           function once(func) {
59168             return before(2, func);
59169           }
59170
59171           /**
59172            * Creates a function that invokes `func` with `partial` arguments prepended
59173            * to those provided to the new function. This method is like `_.bind`
59174            * except it does **not** alter the `this` binding.
59175            *
59176            * The `_.partial.placeholder` value, which defaults to `_` in monolithic
59177            * builds, may be used as a placeholder for partially applied arguments.
59178            *
59179            * **Note:** This method does not set the "length" property of partially
59180            * applied functions.
59181            *
59182            * @static
59183            * @memberOf _
59184            * @category Function
59185            * @param {Function}
59186            *            func The function to partially apply arguments to.
59187            * @param {...*}
59188            *            [partials] The arguments to be partially applied.
59189            * @returns {Function} Returns the new partially applied function.
59190            * @example
59191            *
59192            * var greet = function(greeting, name) { return greeting + ' ' + name; };
59193            *
59194            * var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); // =>
59195            * 'hello fred'
59196            *  // using placeholders var greetFred = _.partial(greet, _, 'fred');
59197            * greetFred('hi'); // => 'hi fred'
59198            */
59199           var partial = createPartial(PARTIAL_FLAG);
59200
59201           /**
59202            * This method is like `_.partial` except that partially applied arguments
59203            * are appended to those provided to the new function.
59204            *
59205            * The `_.partialRight.placeholder` value, which defaults to `_` in
59206            * monolithic builds, may be used as a placeholder for partially applied
59207            * arguments.
59208            *
59209            * **Note:** This method does not set the "length" property of partially
59210            * applied functions.
59211            *
59212            * @static
59213            * @memberOf _
59214            * @category Function
59215            * @param {Function}
59216            *            func The function to partially apply arguments to.
59217            * @param {...*}
59218            *            [partials] The arguments to be partially applied.
59219            * @returns {Function} Returns the new partially applied function.
59220            * @example
59221            *
59222            * var greet = function(greeting, name) { return greeting + ' ' + name; };
59223            *
59224            * var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); // => 'hi
59225            * fred'
59226            *  // using placeholders var sayHelloTo = _.partialRight(greet, 'hello',
59227            * _); sayHelloTo('fred'); // => 'hello fred'
59228            */
59229           var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
59230
59231           /**
59232            * Creates a function that invokes `func` with arguments arranged according
59233            * to the specified indexes where the argument value at the first index is
59234            * provided as the first argument, the argument value at the second index is
59235            * provided as the second argument, and so on.
59236            *
59237            * @static
59238            * @memberOf _
59239            * @category Function
59240            * @param {Function}
59241            *            func The function to rearrange arguments for.
59242            * @param {...(number|number[])}
59243            *            indexes The arranged argument indexes, specified as individual
59244            *            indexes or arrays of indexes.
59245            * @returns {Function} Returns the new function.
59246            * @example
59247            *
59248            * var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, 2, 0, 1);
59249            *
59250            * rearged('b', 'c', 'a') // => ['a', 'b', 'c']
59251            *
59252            * var map = _.rearg(_.map, [1, 0]); map(function(n) { return n * 3; }, [1,
59253            * 2, 3]); // => [3, 6, 9]
59254            */
59255           var rearg = restParam(function(func, indexes) {
59256             return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
59257           });
59258
59259           /**
59260            * Creates a function that invokes `func` with the `this` binding of the
59261            * created function and arguments from `start` and beyond provided as an
59262            * array.
59263            *
59264            * **Note:** This method is based on the [rest
59265            * parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
59266            *
59267            * @static
59268            * @memberOf _
59269            * @category Function
59270            * @param {Function}
59271            *            func The function to apply a rest parameter to.
59272            * @param {number}
59273            *            [start=func.length-1] The start position of the rest
59274            *            parameter.
59275            * @returns {Function} Returns the new function.
59276            * @example
59277            *
59278            * var say = _.restParam(function(what, names) { return what + ' ' +
59279            * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
59280            * _.last(names); });
59281            *
59282            * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
59283            * pebbles'
59284            */
59285           function restParam(func, start) {
59286             if (typeof func != 'function') {
59287               throw new TypeError(FUNC_ERROR_TEXT);
59288             }
59289             start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
59290             return function() {
59291               var args = arguments,
59292                 index = -1,
59293                 length = nativeMax(args.length - start, 0),
59294                 rest = Array(length);
59295
59296               while (++index < length) {
59297                 rest[index] = args[start + index];
59298               }
59299               switch (start) {
59300                 case 0:
59301                   return func.call(this, rest);
59302                 case 1:
59303                   return func.call(this, args[0], rest);
59304                 case 2:
59305                   return func.call(this, args[0], args[1], rest);
59306               }
59307               var otherArgs = Array(start + 1);
59308               index = -1;
59309               while (++index < start) {
59310                 otherArgs[index] = args[index];
59311               }
59312               otherArgs[start] = rest;
59313               return func.apply(this, otherArgs);
59314             };
59315           }
59316
59317           /**
59318            * Creates a function that invokes `func` with the `this` binding of the
59319            * created function and an array of arguments much like
59320            * [`Function#apply`](https://es5.github.io/#x15.3.4.3).
59321            *
59322            * **Note:** This method is based on the [spread
59323            * operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
59324            *
59325            * @static
59326            * @memberOf _
59327            * @category Function
59328            * @param {Function}
59329            *            func The function to spread arguments over.
59330            * @returns {Function} Returns the new function.
59331            * @example
59332            *
59333            * var say = _.spread(function(who, what) { return who + ' says ' + what;
59334            * });
59335            *
59336            * say(['fred', 'hello']); // => 'fred says hello'
59337            *  // with a Promise var numbers = Promise.all([ Promise.resolve(40),
59338            * Promise.resolve(36) ]);
59339            *
59340            * numbers.then(_.spread(function(x, y) { return x + y; })); // => a Promise
59341            * of 76
59342            */
59343           function spread(func) {
59344             if (typeof func != 'function') {
59345               throw new TypeError(FUNC_ERROR_TEXT);
59346             }
59347             return function(array) {
59348               return func.apply(this, array);
59349             };
59350           }
59351
59352           /**
59353            * Creates a throttled function that only invokes `func` at most once per
59354            * every `wait` milliseconds. The throttled function comes with a `cancel`
59355            * method to cancel delayed invocations. Provide an options object to
59356            * indicate that `func` should be invoked on the leading and/or trailing
59357            * edge of the `wait` timeout. Subsequent calls to the throttled function
59358            * return the result of the last `func` call.
59359            *
59360            * **Note:** If `leading` and `trailing` options are `true`, `func` is
59361            * invoked on the trailing edge of the timeout only if the the throttled
59362            * function is invoked more than once during the `wait` timeout.
59363            *
59364            * See [David Corbacho's
59365            * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
59366            * for details over the differences between `_.throttle` and `_.debounce`.
59367            *
59368            * @static
59369            * @memberOf _
59370            * @category Function
59371            * @param {Function}
59372            *            func The function to throttle.
59373            * @param {number}
59374            *            [wait=0] The number of milliseconds to throttle invocations
59375            *            to.
59376            * @param {Object}
59377            *            [options] The options object.
59378            * @param {boolean}
59379            *            [options.leading=true] Specify invoking on the leading edge of
59380            *            the timeout.
59381            * @param {boolean}
59382            *            [options.trailing=true] Specify invoking on the trailing edge
59383            *            of the timeout.
59384            * @returns {Function} Returns the new throttled function.
59385            * @example
59386            *  // avoid excessively updating the position while scrolling
59387            * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
59388            *  // invoke `renewToken` when the click event is fired, but not more than
59389            * once every 5 minutes jQuery('.interactive').on('click',
59390            * _.throttle(renewToken, 300000, { 'trailing': false }));
59391            *  // cancel a trailing throttled call jQuery(window).on('popstate',
59392            * throttled.cancel);
59393            */
59394           function throttle(func, wait, options) {
59395             var leading = true,
59396               trailing = true;
59397
59398             if (typeof func != 'function') {
59399               throw new TypeError(FUNC_ERROR_TEXT);
59400             }
59401             if (options === false) {
59402               leading = false;
59403             } else if (isObject(options)) {
59404               leading = 'leading' in options ? !!options.leading : leading;
59405               trailing = 'trailing' in options ? !!options.trailing : trailing;
59406             }
59407             return debounce(func, wait, {
59408               'leading': leading,
59409               'maxWait': +wait,
59410               'trailing': trailing
59411             });
59412           }
59413
59414           /**
59415            * Creates a function that provides `value` to the wrapper function as its
59416            * first argument. Any additional arguments provided to the function are
59417            * appended to those provided to the wrapper function. The wrapper is
59418            * invoked with the `this` binding of the created function.
59419            *
59420            * @static
59421            * @memberOf _
59422            * @category Function
59423            * @param {*}
59424            *            value The value to wrap.
59425            * @param {Function}
59426            *            wrapper The wrapper function.
59427            * @returns {Function} Returns the new function.
59428            * @example
59429            *
59430            * var p = _.wrap(_.escape, function(func, text) { return '
59431            * <p>' + func(text) + '
59432            * </p>'; });
59433            *
59434            * p('fred, barney, & pebbles'); // => '
59435            * <p>
59436            * fred, barney, &amp; pebbles
59437            * </p>'
59438            */
59439           function wrap(value, wrapper) {
59440             wrapper = wrapper == null ? identity : wrapper;
59441             return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
59442           }
59443
59444           /*------------------------------------------------------------------------*/
59445
59446           /**
59447            * Creates a clone of `value`. If `isDeep` is `true` nested objects are
59448            * cloned, otherwise they are assigned by reference. If `customizer` is
59449            * provided it is invoked to produce the cloned values. If `customizer`
59450            * returns `undefined` cloning is handled by the method instead. The
59451            * `customizer` is bound to `thisArg` and invoked with two argument; (value [,
59452            * index|key, object]).
59453            *
59454            * **Note:** This method is loosely based on the [structured clone
59455            * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59456            * The enumerable properties of `arguments` objects and objects created by
59457            * constructors other than `Object` are cloned to plain `Object` objects. An
59458            * empty object is returned for uncloneable values such as functions, DOM
59459            * nodes, Maps, Sets, and WeakMaps.
59460            *
59461            * @static
59462            * @memberOf _
59463            * @category Lang
59464            * @param {*}
59465            *            value The value to clone.
59466            * @param {boolean}
59467            *            [isDeep] Specify a deep clone.
59468            * @param {Function}
59469            *            [customizer] The function to customize cloning values.
59470            * @param {*}
59471            *            [thisArg] The `this` binding of `customizer`.
59472            * @returns {*} Returns the cloned value.
59473            * @example
59474            *
59475            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59476            *
59477            * var shallow = _.clone(users); shallow[0] === users[0]; // => true
59478            *
59479            * var deep = _.clone(users, true); deep[0] === users[0]; // => false
59480            *  // using a customizer callback var el = _.clone(document.body,
59481            * function(value) { if (_.isElement(value)) { return
59482            * value.cloneNode(false); } });
59483            *
59484            * el === document.body // => false el.nodeName // => BODY
59485            * el.childNodes.length; // => 0
59486            */
59487           function clone(value, isDeep, customizer, thisArg) {
59488             if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
59489               isDeep = false;
59490             } else if (typeof isDeep == 'function') {
59491               thisArg = customizer;
59492               customizer = isDeep;
59493               isDeep = false;
59494             }
59495             return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) : baseClone(value, isDeep);
59496           }
59497
59498           /**
59499            * Creates a deep clone of `value`. If `customizer` is provided it is
59500            * invoked to produce the cloned values. If `customizer` returns `undefined`
59501            * cloning is handled by the method instead. The `customizer` is bound to
59502            * `thisArg` and invoked with two argument; (value [, index|key, object]).
59503            *
59504            * **Note:** This method is loosely based on the [structured clone
59505            * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59506            * The enumerable properties of `arguments` objects and objects created by
59507            * constructors other than `Object` are cloned to plain `Object` objects. An
59508            * empty object is returned for uncloneable values such as functions, DOM
59509            * nodes, Maps, Sets, and WeakMaps.
59510            *
59511            * @static
59512            * @memberOf _
59513            * @category Lang
59514            * @param {*}
59515            *            value The value to deep clone.
59516            * @param {Function}
59517            *            [customizer] The function to customize cloning values.
59518            * @param {*}
59519            *            [thisArg] The `this` binding of `customizer`.
59520            * @returns {*} Returns the deep cloned value.
59521            * @example
59522            *
59523            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59524            *
59525            * var deep = _.cloneDeep(users); deep[0] === users[0]; // => false
59526            *  // using a customizer callback var el = _.cloneDeep(document.body,
59527            * function(value) { if (_.isElement(value)) { return value.cloneNode(true); }
59528            * });
59529            *
59530            * el === document.body // => false el.nodeName // => BODY
59531            * el.childNodes.length; // => 20
59532            */
59533           function cloneDeep(value, customizer, thisArg) {
59534             return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) : baseClone(value, true);
59535           }
59536
59537           /**
59538            * Checks if `value` is greater than `other`.
59539            *
59540            * @static
59541            * @memberOf _
59542            * @category Lang
59543            * @param {*}
59544            *            value The value to compare.
59545            * @param {*}
59546            *            other The other value to compare.
59547            * @returns {boolean} Returns `true` if `value` is greater than `other`,
59548            *          else `false`.
59549            * @example
59550            *
59551            * _.gt(3, 1); // => true
59552            *
59553            * _.gt(3, 3); // => false
59554            *
59555            * _.gt(1, 3); // => false
59556            */
59557           function gt(value, other) {
59558             return value > other;
59559           }
59560
59561           /**
59562            * Checks if `value` is greater than or equal to `other`.
59563            *
59564            * @static
59565            * @memberOf _
59566            * @category Lang
59567            * @param {*}
59568            *            value The value to compare.
59569            * @param {*}
59570            *            other The other value to compare.
59571            * @returns {boolean} Returns `true` if `value` is greater than or equal to
59572            *          `other`, else `false`.
59573            * @example
59574            *
59575            * _.gte(3, 1); // => true
59576            *
59577            * _.gte(3, 3); // => true
59578            *
59579            * _.gte(1, 3); // => false
59580            */
59581           function gte(value, other) {
59582             return value >= other;
59583           }
59584
59585           /**
59586            * Checks if `value` is classified as an `arguments` object.
59587            *
59588            * @static
59589            * @memberOf _
59590            * @category Lang
59591            * @param {*}
59592            *            value The value to check.
59593            * @returns {boolean} Returns `true` if `value` is correctly classified,
59594            *          else `false`.
59595            * @example
59596            *
59597            * _.isArguments(function() { return arguments; }()); // => true
59598            *
59599            * _.isArguments([1, 2, 3]); // => false
59600            */
59601           function isArguments(value) {
59602             return isObjectLike(value) && isArrayLike(value) &&
59603               hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
59604           }
59605
59606           /**
59607            * Checks if `value` is classified as an `Array` object.
59608            *
59609            * @static
59610            * @memberOf _
59611            * @category Lang
59612            * @param {*}
59613            *            value The value to check.
59614            * @returns {boolean} Returns `true` if `value` is correctly classified,
59615            *          else `false`.
59616            * @example
59617            *
59618            * _.isArray([1, 2, 3]); // => true
59619            *
59620            * _.isArray(function() { return arguments; }()); // => false
59621            */
59622           var isArray = nativeIsArray || function(value) {
59623             return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
59624           };
59625
59626           /**
59627            * Checks if `value` is classified as a boolean primitive or object.
59628            *
59629            * @static
59630            * @memberOf _
59631            * @category Lang
59632            * @param {*}
59633            *            value The value to check.
59634            * @returns {boolean} Returns `true` if `value` is correctly classified,
59635            *          else `false`.
59636            * @example
59637            *
59638            * _.isBoolean(false); // => true
59639            *
59640            * _.isBoolean(null); // => false
59641            */
59642           function isBoolean(value) {
59643             return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
59644           }
59645
59646           /**
59647            * Checks if `value` is classified as a `Date` object.
59648            *
59649            * @static
59650            * @memberOf _
59651            * @category Lang
59652            * @param {*}
59653            *            value The value to check.
59654            * @returns {boolean} Returns `true` if `value` is correctly classified,
59655            *          else `false`.
59656            * @example
59657            *
59658            * _.isDate(new Date); // => true
59659            *
59660            * _.isDate('Mon April 23 2012'); // => false
59661            */
59662           function isDate(value) {
59663             return isObjectLike(value) && objToString.call(value) == dateTag;
59664           }
59665
59666           /**
59667            * Checks if `value` is a DOM element.
59668            *
59669            * @static
59670            * @memberOf _
59671            * @category Lang
59672            * @param {*}
59673            *            value The value to check.
59674            * @returns {boolean} Returns `true` if `value` is a DOM element, else
59675            *          `false`.
59676            * @example
59677            *
59678            * _.isElement(document.body); // => true
59679            *
59680            * _.isElement('<body>'); // => false
59681            */
59682           function isElement(value) {
59683             return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
59684           }
59685
59686           /**
59687            * Checks if `value` is empty. A value is considered empty unless it is an
59688            * `arguments` object, array, string, or jQuery-like collection with a
59689            * length greater than `0` or an object with own enumerable properties.
59690            *
59691            * @static
59692            * @memberOf _
59693            * @category Lang
59694            * @param {Array|Object|string}
59695            *            value The value to inspect.
59696            * @returns {boolean} Returns `true` if `value` is empty, else `false`.
59697            * @example
59698            *
59699            * _.isEmpty(null); // => true
59700            *
59701            * _.isEmpty(true); // => true
59702            *
59703            * _.isEmpty(1); // => true
59704            *
59705            * _.isEmpty([1, 2, 3]); // => false
59706            *
59707            * _.isEmpty({ 'a': 1 }); // => false
59708            */
59709           function isEmpty(value) {
59710             if (value == null) {
59711               return true;
59712             }
59713             if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
59714                 (isObjectLike(value) && isFunction(value.splice)))) {
59715               return !value.length;
59716             }
59717             return !keys(value).length;
59718           }
59719
59720           /**
59721            * Performs a deep comparison between two values to determine if they are
59722            * equivalent. If `customizer` is provided it is invoked to compare values.
59723            * If `customizer` returns `undefined` comparisons are handled by the method
59724            * instead. The `customizer` is bound to `thisArg` and invoked with three
59725            * arguments: (value, other [, index|key]).
59726            *
59727            * **Note:** This method supports comparing arrays, booleans, `Date`
59728            * objects, numbers, `Object` objects, regexes, and strings. Objects are
59729            * compared by their own, not inherited, enumerable properties. Functions
59730            * and DOM nodes are **not** supported. Provide a customizer function to
59731            * extend support for comparing other values.
59732            *
59733            * @static
59734            * @memberOf _
59735            * @alias eq
59736            * @category Lang
59737            * @param {*}
59738            *            value The value to compare.
59739            * @param {*}
59740            *            other The other value to compare.
59741            * @param {Function}
59742            *            [customizer] The function to customize value comparisons.
59743            * @param {*}
59744            *            [thisArg] The `this` binding of `customizer`.
59745            * @returns {boolean} Returns `true` if the values are equivalent, else
59746            *          `false`.
59747            * @example
59748            *
59749            * var object = { 'user': 'fred' }; var other = { 'user': 'fred' };
59750            *
59751            * object == other; // => false
59752            *
59753            * _.isEqual(object, other); // => true
59754            *  // using a customizer callback var array = ['hello', 'goodbye']; var
59755            * other = ['hi', 'goodbye'];
59756            *
59757            * _.isEqual(array, other, function(value, other) { if (_.every([value,
59758            * other], RegExp.prototype.test, /^h(?:i|ello)$/)) { return true; } }); // =>
59759            * true
59760            */
59761           function isEqual(value, other, customizer, thisArg) {
59762             customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59763             var result = customizer ? customizer(value, other) : undefined;
59764             return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
59765           }
59766
59767           /**
59768            * Checks if `value` is an `Error`, `EvalError`, `RangeError`,
59769            * `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object.
59770            *
59771            * @static
59772            * @memberOf _
59773            * @category Lang
59774            * @param {*}
59775            *            value The value to check.
59776            * @returns {boolean} Returns `true` if `value` is an error object, else
59777            *          `false`.
59778            * @example
59779            *
59780            * _.isError(new Error); // => true
59781            *
59782            * _.isError(Error); // => false
59783            */
59784           function isError(value) {
59785             return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
59786           }
59787
59788           /**
59789            * Checks if `value` is a finite primitive number.
59790            *
59791            * **Note:** This method is based on
59792            * [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
59793            *
59794            * @static
59795            * @memberOf _
59796            * @category Lang
59797            * @param {*}
59798            *            value The value to check.
59799            * @returns {boolean} Returns `true` if `value` is a finite number, else
59800            *          `false`.
59801            * @example
59802            *
59803            * _.isFinite(10); // => true
59804            *
59805            * _.isFinite('10'); // => false
59806            *
59807            * _.isFinite(true); // => false
59808            *
59809            * _.isFinite(Object(10)); // => false
59810            *
59811            * _.isFinite(Infinity); // => false
59812            */
59813           function isFinite(value) {
59814             return typeof value == 'number' && nativeIsFinite(value);
59815           }
59816
59817           /**
59818            * Checks if `value` is classified as a `Function` object.
59819            *
59820            * @static
59821            * @memberOf _
59822            * @category Lang
59823            * @param {*}
59824            *            value The value to check.
59825            * @returns {boolean} Returns `true` if `value` is correctly classified,
59826            *          else `false`.
59827            * @example
59828            *
59829            * _.isFunction(_); // => true
59830            *
59831            * _.isFunction(/abc/); // => false
59832            */
59833           function isFunction(value) {
59834             // The use of `Object#toString` avoids issues with the `typeof` operator
59835             // in older versions of Chrome and Safari which return 'function' for
59836             // regexes
59837             // and Safari 8 equivalents which return 'object' for typed array
59838             // constructors.
59839             return isObject(value) && objToString.call(value) == funcTag;
59840           }
59841
59842           /**
59843            * Checks if `value` is the [language type](https://es5.github.io/#x8) of
59844            * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
59845            * `new String('')`)
59846            *
59847            * @static
59848            * @memberOf _
59849            * @category Lang
59850            * @param {*}
59851            *            value The value to check.
59852            * @returns {boolean} Returns `true` if `value` is an object, else `false`.
59853            * @example
59854            *
59855            * _.isObject({}); // => true
59856            *
59857            * _.isObject([1, 2, 3]); // => true
59858            *
59859            * _.isObject(1); // => false
59860            */
59861           function isObject(value) {
59862             // Avoid a V8 JIT bug in Chrome 19-20.
59863             // See https://code.google.com/p/v8/issues/detail?id=2291 for more
59864             // details.
59865             var type = typeof value;
59866             return !!value && (type == 'object' || type == 'function');
59867           }
59868
59869           /**
59870            * Performs a deep comparison between `object` and `source` to determine if
59871            * `object` contains equivalent property values. If `customizer` is provided
59872            * it is invoked to compare values. If `customizer` returns `undefined`
59873            * comparisons are handled by the method instead. The `customizer` is bound
59874            * to `thisArg` and invoked with three arguments: (value, other, index|key).
59875            *
59876            * **Note:** This method supports comparing properties of arrays, booleans,
59877            * `Date` objects, numbers, `Object` objects, regexes, and strings.
59878            * Functions and DOM nodes are **not** supported. Provide a customizer
59879            * function to extend support for comparing other values.
59880            *
59881            * @static
59882            * @memberOf _
59883            * @category Lang
59884            * @param {Object}
59885            *            object The object to inspect.
59886            * @param {Object}
59887            *            source The object of property values to match.
59888            * @param {Function}
59889            *            [customizer] The function to customize value comparisons.
59890            * @param {*}
59891            *            [thisArg] The `this` binding of `customizer`.
59892            * @returns {boolean} Returns `true` if `object` is a match, else `false`.
59893            * @example
59894            *
59895            * var object = { 'user': 'fred', 'age': 40 };
59896            *
59897            * _.isMatch(object, { 'age': 40 }); // => true
59898            *
59899            * _.isMatch(object, { 'age': 36 }); // => false
59900            *  // using a customizer callback var object = { 'greeting': 'hello' }; var
59901            * source = { 'greeting': 'hi' };
59902            *
59903            * _.isMatch(object, source, function(value, other) { return _.every([value,
59904            * other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; }); // =>
59905            * true
59906            */
59907           function isMatch(object, source, customizer, thisArg) {
59908             customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59909             return baseIsMatch(object, getMatchData(source), customizer);
59910           }
59911
59912           /**
59913            * Checks if `value` is `NaN`.
59914            *
59915            * **Note:** This method is not the same as
59916            * [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
59917            * `undefined` and other non-numeric values.
59918            *
59919            * @static
59920            * @memberOf _
59921            * @category Lang
59922            * @param {*}
59923            *            value The value to check.
59924            * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
59925            * @example
59926            *
59927            * _.isNaN(NaN); // => true
59928            *
59929            * _.isNaN(new Number(NaN)); // => true
59930            *
59931            * isNaN(undefined); // => true
59932            *
59933            * _.isNaN(undefined); // => false
59934            */
59935           function isNaN(value) {
59936             // An `NaN` primitive is the only value that is not equal to itself.
59937             // Perform the `toStringTag` check first to avoid errors with some host
59938             // objects in IE.
59939             return isNumber(value) && value != +value;
59940           }
59941
59942           /**
59943            * Checks if `value` is a native function.
59944            *
59945            * @static
59946            * @memberOf _
59947            * @category Lang
59948            * @param {*}
59949            *            value The value to check.
59950            * @returns {boolean} Returns `true` if `value` is a native function, else
59951            *          `false`.
59952            * @example
59953            *
59954            * _.isNative(Array.prototype.push); // => true
59955            *
59956            * _.isNative(_); // => false
59957            */
59958           function isNative(value) {
59959             if (value == null) {
59960               return false;
59961             }
59962             if (isFunction(value)) {
59963               return reIsNative.test(fnToString.call(value));
59964             }
59965             return isObjectLike(value) && reIsHostCtor.test(value);
59966           }
59967
59968           /**
59969            * Checks if `value` is `null`.
59970            *
59971            * @static
59972            * @memberOf _
59973            * @category Lang
59974            * @param {*}
59975            *            value The value to check.
59976            * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
59977            * @example
59978            *
59979            * _.isNull(null); // => true
59980            *
59981            * _.isNull(void 0); // => false
59982            */
59983           function isNull(value) {
59984             return value === null;
59985           }
59986
59987           /**
59988            * Checks if `value` is classified as a `Number` primitive or object.
59989            *
59990            * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
59991            * classified as numbers, use the `_.isFinite` method.
59992            *
59993            * @static
59994            * @memberOf _
59995            * @category Lang
59996            * @param {*}
59997            *            value The value to check.
59998            * @returns {boolean} Returns `true` if `value` is correctly classified,
59999            *          else `false`.
60000            * @example
60001            *
60002            * _.isNumber(8.4); // => true
60003            *
60004            * _.isNumber(NaN); // => true
60005            *
60006            * _.isNumber('8.4'); // => false
60007            */
60008           function isNumber(value) {
60009             return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
60010           }
60011
60012           /**
60013            * Checks if `value` is a plain object, that is, an object created by the
60014            * `Object` constructor or one with a `[[Prototype]]` of `null`.
60015            *
60016            * **Note:** This method assumes objects created by the `Object` constructor
60017            * have no inherited enumerable properties.
60018            *
60019            * @static
60020            * @memberOf _
60021            * @category Lang
60022            * @param {*}
60023            *            value The value to check.
60024            * @returns {boolean} Returns `true` if `value` is a plain object, else
60025            *          `false`.
60026            * @example
60027            *
60028            * function Foo() { this.a = 1; }
60029            *
60030            * _.isPlainObject(new Foo); // => false
60031            *
60032            * _.isPlainObject([1, 2, 3]); // => false
60033            *
60034            * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
60035            *
60036            * _.isPlainObject(Object.create(null)); // => true
60037            */
60038           function isPlainObject(value) {
60039             var Ctor;
60040
60041             // Exit early for non `Object` objects.
60042             if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
60043               (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
60044               return false;
60045             }
60046             // IE < 9 iterates inherited properties before own properties. If the
60047             // first
60048             // iterated property is an object's own property then there are no
60049             // inherited
60050             // enumerable properties.
60051             var result;
60052             // In most environments an object's own properties are iterated before
60053             // its inherited properties. If the last iterated property is an
60054             // object's
60055             // own property then there are no inherited enumerable properties.
60056             baseForIn(value, function(subValue, key) {
60057               result = key;
60058             });
60059             return result === undefined || hasOwnProperty.call(value, result);
60060           }
60061
60062           /**
60063            * Checks if `value` is classified as a `RegExp` object.
60064            *
60065            * @static
60066            * @memberOf _
60067            * @category Lang
60068            * @param {*}
60069            *            value The value to check.
60070            * @returns {boolean} Returns `true` if `value` is correctly classified,
60071            *          else `false`.
60072            * @example
60073            *
60074            * _.isRegExp(/abc/); // => true
60075            *
60076            * _.isRegExp('/abc/'); // => false
60077            */
60078           function isRegExp(value) {
60079             return isObject(value) && objToString.call(value) == regexpTag;
60080           }
60081
60082           /**
60083            * Checks if `value` is classified as a `String` primitive or object.
60084            *
60085            * @static
60086            * @memberOf _
60087            * @category Lang
60088            * @param {*}
60089            *            value The value to check.
60090            * @returns {boolean} Returns `true` if `value` is correctly classified,
60091            *          else `false`.
60092            * @example
60093            *
60094            * _.isString('abc'); // => true
60095            *
60096            * _.isString(1); // => false
60097            */
60098           function isString(value) {
60099             return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
60100           }
60101
60102           /**
60103            * Checks if `value` is classified as a typed array.
60104            *
60105            * @static
60106            * @memberOf _
60107            * @category Lang
60108            * @param {*}
60109            *            value The value to check.
60110            * @returns {boolean} Returns `true` if `value` is correctly classified,
60111            *          else `false`.
60112            * @example
60113            *
60114            * _.isTypedArray(new Uint8Array); // => true
60115            *
60116            * _.isTypedArray([]); // => false
60117            */
60118           function isTypedArray(value) {
60119             return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
60120           }
60121
60122           /**
60123            * Checks if `value` is `undefined`.
60124            *
60125            * @static
60126            * @memberOf _
60127            * @category Lang
60128            * @param {*}
60129            *            value The value to check.
60130            * @returns {boolean} Returns `true` if `value` is `undefined`, else
60131            *          `false`.
60132            * @example
60133            *
60134            * _.isUndefined(void 0); // => true
60135            *
60136            * _.isUndefined(null); // => false
60137            */
60138           function isUndefined(value) {
60139             return value === undefined;
60140           }
60141
60142           /**
60143            * Checks if `value` is less than `other`.
60144            *
60145            * @static
60146            * @memberOf _
60147            * @category Lang
60148            * @param {*}
60149            *            value The value to compare.
60150            * @param {*}
60151            *            other The other value to compare.
60152            * @returns {boolean} Returns `true` if `value` is less than `other`, else
60153            *          `false`.
60154            * @example
60155            *
60156            * _.lt(1, 3); // => true
60157            *
60158            * _.lt(3, 3); // => false
60159            *
60160            * _.lt(3, 1); // => false
60161            */
60162           function lt(value, other) {
60163             return value < other;
60164           }
60165
60166           /**
60167            * Checks if `value` is less than or equal to `other`.
60168            *
60169            * @static
60170            * @memberOf _
60171            * @category Lang
60172            * @param {*}
60173            *            value The value to compare.
60174            * @param {*}
60175            *            other The other value to compare.
60176            * @returns {boolean} Returns `true` if `value` is less than or equal to
60177            *          `other`, else `false`.
60178            * @example
60179            *
60180            * _.lte(1, 3); // => true
60181            *
60182            * _.lte(3, 3); // => true
60183            *
60184            * _.lte(3, 1); // => false
60185            */
60186           function lte(value, other) {
60187             return value <= other;
60188           }
60189
60190           /**
60191            * Converts `value` to an array.
60192            *
60193            * @static
60194            * @memberOf _
60195            * @category Lang
60196            * @param {*}
60197            *            value The value to convert.
60198            * @returns {Array} Returns the converted array.
60199            * @example
60200            *
60201            * (function() { return _.toArray(arguments).slice(1); }(1, 2, 3)); // =>
60202            * [2, 3]
60203            */
60204           function toArray(value) {
60205             var length = value ? getLength(value) : 0;
60206             if (!isLength(length)) {
60207               return values(value);
60208             }
60209             if (!length) {
60210               return [];
60211             }
60212             return arrayCopy(value);
60213           }
60214
60215           /**
60216            * Converts `value` to a plain object flattening inherited enumerable
60217            * properties of `value` to own properties of the plain object.
60218            *
60219            * @static
60220            * @memberOf _
60221            * @category Lang
60222            * @param {*}
60223            *            value The value to convert.
60224            * @returns {Object} Returns the converted plain object.
60225            * @example
60226            *
60227            * function Foo() { this.b = 2; }
60228            *
60229            * Foo.prototype.c = 3;
60230            *
60231            * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
60232            *
60233            * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2,
60234            * 'c': 3 }
60235            */
60236           function toPlainObject(value) {
60237             return baseCopy(value, keysIn(value));
60238           }
60239
60240           /*------------------------------------------------------------------------*/
60241
60242           /**
60243            * Recursively merges own enumerable properties of the source object(s),
60244            * that don't resolve to `undefined` into the destination object. Subsequent
60245            * sources overwrite property assignments of previous sources. If
60246            * `customizer` is provided it is invoked to produce the merged values of
60247            * the destination and source properties. If `customizer` returns
60248            * `undefined` merging is handled by the method instead. The `customizer` is
60249            * bound to `thisArg` and invoked with five arguments: (objectValue,
60250            * sourceValue, key, object, source).
60251            *
60252            * @static
60253            * @memberOf _
60254            * @category Object
60255            * @param {Object}
60256            *            object The destination object.
60257            * @param {...Object}
60258            *            [sources] The source objects.
60259            * @param {Function}
60260            *            [customizer] The function to customize assigned values.
60261            * @param {*}
60262            *            [thisArg] The `this` binding of `customizer`.
60263            * @returns {Object} Returns `object`.
60264            * @example
60265            *
60266            * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
60267            *
60268            * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
60269            *
60270            * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
60271            * 'user': 'fred', 'age': 40 }] }
60272            *  // using a customizer callback var object = { 'fruits': ['apple'],
60273            * 'vegetables': ['beet'] };
60274            *
60275            * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
60276            *
60277            * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
60278            * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
60279            * ['beet', 'carrot'] }
60280            */
60281           var merge = createAssigner(baseMerge);
60282
60283           /**
60284            * Assigns own enumerable properties of source object(s) to the destination
60285            * object. Subsequent sources overwrite property assignments of previous
60286            * sources. If `customizer` is provided it is invoked to produce the
60287            * assigned values. The `customizer` is bound to `thisArg` and invoked with
60288            * five arguments: (objectValue, sourceValue, key, object, source).
60289            *
60290            * **Note:** This method mutates `object` and is based on
60291            * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
60292            *
60293            * @static
60294            * @memberOf _
60295            * @alias extend
60296            * @category Object
60297            * @param {Object}
60298            *            object The destination object.
60299            * @param {...Object}
60300            *            [sources] The source objects.
60301            * @param {Function}
60302            *            [customizer] The function to customize assigned values.
60303            * @param {*}
60304            *            [thisArg] The `this` binding of `customizer`.
60305            * @returns {Object} Returns `object`.
60306            * @example
60307            *
60308            * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
60309            * 'user': 'fred', 'age': 40 }
60310            *  // using a customizer callback var defaults = _.partialRight(_.assign,
60311            * function(value, other) { return _.isUndefined(value) ? other : value; });
60312            *
60313            * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60314            * 'user': 'barney', 'age': 36 }
60315            */
60316           var assign = createAssigner(function(object, source, customizer) {
60317             return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
60318           });
60319
60320           /**
60321            * Creates an object that inherits from the given `prototype` object. If a
60322            * `properties` object is provided its own enumerable properties are
60323            * assigned to the created object.
60324            *
60325            * @static
60326            * @memberOf _
60327            * @category Object
60328            * @param {Object}
60329            *            prototype The object to inherit from.
60330            * @param {Object}
60331            *            [properties] The properties to assign to the object.
60332            * @param- {Object} [guard] Enables use as a callback for functions like
60333            *         `_.map`.
60334            * @returns {Object} Returns the new object.
60335            * @example
60336            *
60337            * function Shape() { this.x = 0; this.y = 0; }
60338            *
60339            * function Circle() { Shape.call(this); }
60340            *
60341            * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
60342            *
60343            * var circle = new Circle; circle instanceof Circle; // => true
60344            *
60345            * circle instanceof Shape; // => true
60346            */
60347           function create(prototype, properties, guard) {
60348             var result = baseCreate(prototype);
60349             if (guard && isIterateeCall(prototype, properties, guard)) {
60350               properties = undefined;
60351             }
60352             return properties ? baseAssign(result, properties) : result;
60353           }
60354
60355           /**
60356            * Assigns own enumerable properties of source object(s) to the destination
60357            * object for all destination properties that resolve to `undefined`. Once a
60358            * property is set, additional values of the same property are ignored.
60359            *
60360            * **Note:** This method mutates `object`.
60361            *
60362            * @static
60363            * @memberOf _
60364            * @category Object
60365            * @param {Object}
60366            *            object The destination object.
60367            * @param {...Object}
60368            *            [sources] The source objects.
60369            * @returns {Object} Returns `object`.
60370            * @example
60371            *
60372            * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60373            * 'user': 'barney', 'age': 36 }
60374            */
60375           var defaults = createDefaults(assign, assignDefaults);
60376
60377           /**
60378            * This method is like `_.defaults` except that it recursively assigns
60379            * default properties.
60380            *
60381            * **Note:** This method mutates `object`.
60382            *
60383            * @static
60384            * @memberOf _
60385            * @category Object
60386            * @param {Object}
60387            *            object The destination object.
60388            * @param {...Object}
60389            *            [sources] The source objects.
60390            * @returns {Object} Returns `object`.
60391            * @example
60392            *
60393            * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name':
60394            * 'fred', 'age': 36 } }); // => { 'user': { 'name': 'barney', 'age': 36 } }
60395            *
60396            */
60397           var defaultsDeep = createDefaults(merge, mergeDefaults);
60398
60399           /**
60400            * This method is like `_.find` except that it returns the key of the first
60401            * element `predicate` returns truthy for instead of the element itself.
60402            *
60403            * If a property name is provided for `predicate` the created `_.property`
60404            * style callback returns the property value of the given element.
60405            *
60406            * If a value is also provided for `thisArg` the created `_.matchesProperty`
60407            * style callback returns `true` for elements that have a matching property
60408            * value, else `false`.
60409            *
60410            * If an object is provided for `predicate` the created `_.matches` style
60411            * callback returns `true` for elements that have the properties of the
60412            * given object, else `false`.
60413            *
60414            * @static
60415            * @memberOf _
60416            * @category Object
60417            * @param {Object}
60418            *            object The object to search.
60419            * @param {Function|Object|string}
60420            *            [predicate=_.identity] The function invoked per iteration.
60421            * @param {*}
60422            *            [thisArg] The `this` binding of `predicate`.
60423            * @returns {string|undefined} Returns the key of the matched element, else
60424            *          `undefined`.
60425            * @example
60426            *
60427            * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60428            * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60429            *
60430            * _.findKey(users, function(chr) { return chr.age < 40; }); // => 'barney'
60431            * (iteration order is not guaranteed)
60432            *  // using the `_.matches` callback shorthand _.findKey(users, { 'age': 1,
60433            * 'active': true }); // => 'pebbles'
60434            *  // using the `_.matchesProperty` callback shorthand _.findKey(users,
60435            * 'active', false); // => 'fred'
60436            *  // using the `_.property` callback shorthand _.findKey(users, 'active'); // =>
60437            * 'barney'
60438            */
60439           var findKey = createFindKey(baseForOwn);
60440
60441           /**
60442            * This method is like `_.findKey` except that it iterates over elements of
60443            * a collection in the opposite order.
60444            *
60445            * If a property name is provided for `predicate` the created `_.property`
60446            * style callback returns the property value of the given element.
60447            *
60448            * If a value is also provided for `thisArg` the created `_.matchesProperty`
60449            * style callback returns `true` for elements that have a matching property
60450            * value, else `false`.
60451            *
60452            * If an object is provided for `predicate` the created `_.matches` style
60453            * callback returns `true` for elements that have the properties of the
60454            * given object, else `false`.
60455            *
60456            * @static
60457            * @memberOf _
60458            * @category Object
60459            * @param {Object}
60460            *            object The object to search.
60461            * @param {Function|Object|string}
60462            *            [predicate=_.identity] The function invoked per iteration.
60463            * @param {*}
60464            *            [thisArg] The `this` binding of `predicate`.
60465            * @returns {string|undefined} Returns the key of the matched element, else
60466            *          `undefined`.
60467            * @example
60468            *
60469            * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60470            * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60471            *
60472            * _.findLastKey(users, function(chr) { return chr.age < 40; }); // =>
60473            * returns `pebbles` assuming `_.findKey` returns `barney`
60474            *  // using the `_.matches` callback shorthand _.findLastKey(users, {
60475            * 'age': 36, 'active': true }); // => 'barney'
60476            *  // using the `_.matchesProperty` callback shorthand _.findLastKey(users,
60477            * 'active', false); // => 'fred'
60478            *  // using the `_.property` callback shorthand _.findLastKey(users,
60479            * 'active'); // => 'pebbles'
60480            */
60481           var findLastKey = createFindKey(baseForOwnRight);
60482
60483           /**
60484            * Iterates over own and inherited enumerable properties of an object
60485            * invoking `iteratee` for each property. The `iteratee` is bound to
60486            * `thisArg` and invoked with three arguments: (value, key, object).
60487            * Iteratee functions may exit iteration early by explicitly returning
60488            * `false`.
60489            *
60490            * @static
60491            * @memberOf _
60492            * @category Object
60493            * @param {Object}
60494            *            object The object to iterate over.
60495            * @param {Function}
60496            *            [iteratee=_.identity] The function invoked per iteration.
60497            * @param {*}
60498            *            [thisArg] The `this` binding of `iteratee`.
60499            * @returns {Object} Returns `object`.
60500            * @example
60501            *
60502            * function Foo() { this.a = 1; this.b = 2; }
60503            *
60504            * Foo.prototype.c = 3;
60505            *
60506            * _.forIn(new Foo, function(value, key) { console.log(key); }); // => logs
60507            * 'a', 'b', and 'c' (iteration order is not guaranteed)
60508            */
60509           var forIn = createForIn(baseFor);
60510
60511           /**
60512            * This method is like `_.forIn` except that it iterates over properties of
60513            * `object` in the opposite order.
60514            *
60515            * @static
60516            * @memberOf _
60517            * @category Object
60518            * @param {Object}
60519            *            object The object to iterate over.
60520            * @param {Function}
60521            *            [iteratee=_.identity] The function invoked per iteration.
60522            * @param {*}
60523            *            [thisArg] The `this` binding of `iteratee`.
60524            * @returns {Object} Returns `object`.
60525            * @example
60526            *
60527            * function Foo() { this.a = 1; this.b = 2; }
60528            *
60529            * Foo.prototype.c = 3;
60530            *
60531            * _.forInRight(new Foo, function(value, key) { console.log(key); }); // =>
60532            * logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
60533            */
60534           var forInRight = createForIn(baseForRight);
60535
60536           /**
60537            * Iterates over own enumerable properties of an object invoking `iteratee`
60538            * for each property. The `iteratee` is bound to `thisArg` and invoked with
60539            * three arguments: (value, key, object). Iteratee functions may exit
60540            * iteration early by explicitly returning `false`.
60541            *
60542            * @static
60543            * @memberOf _
60544            * @category Object
60545            * @param {Object}
60546            *            object The object to iterate over.
60547            * @param {Function}
60548            *            [iteratee=_.identity] The function invoked per iteration.
60549            * @param {*}
60550            *            [thisArg] The `this` binding of `iteratee`.
60551            * @returns {Object} Returns `object`.
60552            * @example
60553            *
60554            * function Foo() { this.a = 1; this.b = 2; }
60555            *
60556            * Foo.prototype.c = 3;
60557            *
60558            * _.forOwn(new Foo, function(value, key) { console.log(key); }); // => logs
60559            * 'a' and 'b' (iteration order is not guaranteed)
60560            */
60561           var forOwn = createForOwn(baseForOwn);
60562
60563           /**
60564            * This method is like `_.forOwn` except that it iterates over properties of
60565            * `object` in the opposite order.
60566            *
60567            * @static
60568            * @memberOf _
60569            * @category Object
60570            * @param {Object}
60571            *            object The object to iterate over.
60572            * @param {Function}
60573            *            [iteratee=_.identity] The function invoked per iteration.
60574            * @param {*}
60575            *            [thisArg] The `this` binding of `iteratee`.
60576            * @returns {Object} Returns `object`.
60577            * @example
60578            *
60579            * function Foo() { this.a = 1; this.b = 2; }
60580            *
60581            * Foo.prototype.c = 3;
60582            *
60583            * _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // =>
60584            * logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
60585            */
60586           var forOwnRight = createForOwn(baseForOwnRight);
60587
60588           /**
60589            * Creates an array of function property names from all enumerable
60590            * properties, own and inherited, of `object`.
60591            *
60592            * @static
60593            * @memberOf _
60594            * @alias methods
60595            * @category Object
60596            * @param {Object}
60597            *            object The object to inspect.
60598            * @returns {Array} Returns the new array of property names.
60599            * @example
60600            *
60601            * _.functions(_); // => ['after', 'ary', 'assign', ...]
60602            */
60603           function functions(object) {
60604             return baseFunctions(object, keysIn(object));
60605           }
60606
60607           /**
60608            * Gets the property value at `path` of `object`. If the resolved value is
60609            * `undefined` the `defaultValue` is used in its place.
60610            *
60611            * @static
60612            * @memberOf _
60613            * @category Object
60614            * @param {Object}
60615            *            object The object to query.
60616            * @param {Array|string}
60617            *            path The path of the property to get.
60618            * @param {*}
60619            *            [defaultValue] The value returned if the resolved value is
60620            *            `undefined`.
60621            * @returns {*} Returns the resolved value.
60622            * @example
60623            *
60624            * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60625            *
60626            * _.get(object, 'a[0].b.c'); // => 3
60627            *
60628            * _.get(object, ['a', '0', 'b', 'c']); // => 3
60629            *
60630            * _.get(object, 'a.b.c', 'default'); // => 'default'
60631            */
60632           function get(object, path, defaultValue) {
60633             var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
60634             return result === undefined ? defaultValue : result;
60635           }
60636
60637           /**
60638            * Checks if `path` is a direct property.
60639            *
60640            * @static
60641            * @memberOf _
60642            * @category Object
60643            * @param {Object}
60644            *            object The object to query.
60645            * @param {Array|string}
60646            *            path The path to check.
60647            * @returns {boolean} Returns `true` if `path` is a direct property, else
60648            *          `false`.
60649            * @example
60650            *
60651            * var object = { 'a': { 'b': { 'c': 3 } } };
60652            *
60653            * _.has(object, 'a'); // => true
60654            *
60655            * _.has(object, 'a.b.c'); // => true
60656            *
60657            * _.has(object, ['a', 'b', 'c']); // => true
60658            */
60659           function has(object, path) {
60660             if (object == null) {
60661               return false;
60662             }
60663             var result = hasOwnProperty.call(object, path);
60664             if (!result && !isKey(path)) {
60665               path = toPath(path);
60666               object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60667               if (object == null) {
60668                 return false;
60669               }
60670               path = last(path);
60671               result = hasOwnProperty.call(object, path);
60672             }
60673             return result || (isLength(object.length) && isIndex(path, object.length) &&
60674               (isArray(object) || isArguments(object)));
60675           }
60676
60677           /**
60678            * Creates an object composed of the inverted keys and values of `object`.
60679            * If `object` contains duplicate values, subsequent values overwrite
60680            * property assignments of previous values unless `multiValue` is `true`.
60681            *
60682            * @static
60683            * @memberOf _
60684            * @category Object
60685            * @param {Object}
60686            *            object The object to invert.
60687            * @param {boolean}
60688            *            [multiValue] Allow multiple values per key.
60689            * @param- {Object} [guard] Enables use as a callback for functions like
60690            *         `_.map`.
60691            * @returns {Object} Returns the new inverted object.
60692            * @example
60693            *
60694            * var object = { 'a': 1, 'b': 2, 'c': 1 };
60695            *
60696            * _.invert(object); // => { '1': 'c', '2': 'b' }
60697            *  // with `multiValue` _.invert(object, true); // => { '1': ['a', 'c'],
60698            * '2': ['b'] }
60699            */
60700           function invert(object, multiValue, guard) {
60701             if (guard && isIterateeCall(object, multiValue, guard)) {
60702               multiValue = undefined;
60703             }
60704             var index = -1,
60705               props = keys(object),
60706               length = props.length,
60707               result = {};
60708
60709             while (++index < length) {
60710               var key = props[index],
60711                 value = object[key];
60712
60713               if (multiValue) {
60714                 if (hasOwnProperty.call(result, value)) {
60715                   result[value].push(key);
60716                 } else {
60717                   result[value] = [key];
60718                 }
60719               } else {
60720                 result[value] = key;
60721               }
60722             }
60723             return result;
60724           }
60725
60726           /**
60727            * Creates an array of the own enumerable property names of `object`.
60728            *
60729            * **Note:** Non-object values are coerced to objects. See the [ES
60730            * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for
60731            * more details.
60732            *
60733            * @static
60734            * @memberOf _
60735            * @category Object
60736            * @param {Object}
60737            *            object The object to query.
60738            * @returns {Array} Returns the array of property names.
60739            * @example
60740            *
60741            * function Foo() { this.a = 1; this.b = 2; }
60742            *
60743            * Foo.prototype.c = 3;
60744            *
60745            * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
60746            *
60747            * _.keys('hi'); // => ['0', '1']
60748            */
60749           var keys = !nativeKeys ? shimKeys : function(object) {
60750             var Ctor = object == null ? undefined : object.constructor;
60751             if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
60752               (typeof object != 'function' && isArrayLike(object))) {
60753               return shimKeys(object);
60754             }
60755             return isObject(object) ? nativeKeys(object) : [];
60756           };
60757
60758           /**
60759            * Creates an array of the own and inherited enumerable property names of
60760            * `object`.
60761            *
60762            * **Note:** Non-object values are coerced to objects.
60763            *
60764            * @static
60765            * @memberOf _
60766            * @category Object
60767            * @param {Object}
60768            *            object The object to query.
60769            * @returns {Array} Returns the array of property names.
60770            * @example
60771            *
60772            * function Foo() { this.a = 1; this.b = 2; }
60773            *
60774            * Foo.prototype.c = 3;
60775            *
60776            * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not
60777            * guaranteed)
60778            */
60779           function keysIn(object) {
60780             if (object == null) {
60781               return [];
60782             }
60783             if (!isObject(object)) {
60784               object = Object(object);
60785             }
60786             var length = object.length;
60787             length = (length && isLength(length) &&
60788               (isArray(object) || isArguments(object)) && length) || 0;
60789
60790             var Ctor = object.constructor,
60791               index = -1,
60792               isProto = typeof Ctor == 'function' && Ctor.prototype === object,
60793               result = Array(length),
60794               skipIndexes = length > 0;
60795
60796             while (++index < length) {
60797               result[index] = (index + '');
60798             }
60799             for (var key in object) {
60800               if (!(skipIndexes && isIndex(key, length)) &&
60801                 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
60802                 result.push(key);
60803               }
60804             }
60805             return result;
60806           }
60807
60808           /**
60809            * The opposite of `_.mapValues`; this method creates an object with the
60810            * same values as `object` and keys generated by running each own enumerable
60811            * property of `object` through `iteratee`.
60812            *
60813            * @static
60814            * @memberOf _
60815            * @category Object
60816            * @param {Object}
60817            *            object The object to iterate over.
60818            * @param {Function|Object|string}
60819            *            [iteratee=_.identity] The function invoked per iteration.
60820            * @param {*}
60821            *            [thisArg] The `this` binding of `iteratee`.
60822            * @returns {Object} Returns the new mapped object.
60823            * @example
60824            *
60825            * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { return key + value;
60826            * }); // => { 'a1': 1, 'b2': 2 }
60827            */
60828           var mapKeys = createObjectMapper(true);
60829
60830           /**
60831            * Creates an object with the same keys as `object` and values generated by
60832            * running each own enumerable property of `object` through `iteratee`. The
60833            * iteratee function is bound to `thisArg` and invoked with three arguments:
60834            * (value, key, object).
60835            *
60836            * If a property name is provided for `iteratee` the created `_.property`
60837            * style callback returns the property value of the given element.
60838            *
60839            * If a value is also provided for `thisArg` the created `_.matchesProperty`
60840            * style callback returns `true` for elements that have a matching property
60841            * value, else `false`.
60842            *
60843            * If an object is provided for `iteratee` the created `_.matches` style
60844            * callback returns `true` for elements that have the properties of the
60845            * given object, else `false`.
60846            *
60847            * @static
60848            * @memberOf _
60849            * @category Object
60850            * @param {Object}
60851            *            object The object to iterate over.
60852            * @param {Function|Object|string}
60853            *            [iteratee=_.identity] The function invoked per iteration.
60854            * @param {*}
60855            *            [thisArg] The `this` binding of `iteratee`.
60856            * @returns {Object} Returns the new mapped object.
60857            * @example
60858            *
60859            * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { return n * 3; }); // => {
60860            * 'a': 3, 'b': 6 }
60861            *
60862            * var users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user':
60863            * 'pebbles', 'age': 1 } };
60864            *  // using the `_.property` callback shorthand _.mapValues(users, 'age'); // => {
60865            * 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
60866            */
60867           var mapValues = createObjectMapper();
60868
60869           /**
60870            * The opposite of `_.pick`; this method creates an object composed of the
60871            * own and inherited enumerable properties of `object` that are not omitted.
60872            *
60873            * @static
60874            * @memberOf _
60875            * @category Object
60876            * @param {Object}
60877            *            object The source object.
60878            * @param {Function|...(string|string[])}
60879            *            [predicate] The function invoked per iteration or property
60880            *            names to omit, specified as individual property names or
60881            *            arrays of property names.
60882            * @param {*}
60883            *            [thisArg] The `this` binding of `predicate`.
60884            * @returns {Object} Returns the new object.
60885            * @example
60886            *
60887            * var object = { 'user': 'fred', 'age': 40 };
60888            *
60889            * _.omit(object, 'age'); // => { 'user': 'fred' }
60890            *
60891            * _.omit(object, _.isNumber); // => { 'user': 'fred' }
60892            */
60893           var omit = restParam(function(object, props) {
60894             if (object == null) {
60895               return {};
60896             }
60897             if (typeof props[0] != 'function') {
60898               var props = arrayMap(baseFlatten(props), String);
60899               return pickByArray(object, baseDifference(keysIn(object), props));
60900             }
60901             var predicate = bindCallback(props[0], props[1], 3);
60902             return pickByCallback(object, function(value, key, object) {
60903               return !predicate(value, key, object);
60904             });
60905           });
60906
60907           /**
60908            * Creates a two dimensional array of the key-value pairs for `object`, e.g.
60909            * `[[key1, value1], [key2, value2]]`.
60910            *
60911            * @static
60912            * @memberOf _
60913            * @category Object
60914            * @param {Object}
60915            *            object The object to query.
60916            * @returns {Array} Returns the new array of key-value pairs.
60917            * @example
60918            *
60919            * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred',
60920            * 40]] (iteration order is not guaranteed)
60921            */
60922           function pairs(object) {
60923             object = toObject(object);
60924
60925             var index = -1,
60926               props = keys(object),
60927               length = props.length,
60928               result = Array(length);
60929
60930             while (++index < length) {
60931               var key = props[index];
60932               result[index] = [key, object[key]];
60933             }
60934             return result;
60935           }
60936
60937           /**
60938            * Creates an object composed of the picked `object` properties. Property
60939            * names may be specified as individual arguments or as arrays of property
60940            * names. If `predicate` is provided it is invoked for each property of
60941            * `object` picking the properties `predicate` returns truthy for. The
60942            * predicate is bound to `thisArg` and invoked with three arguments: (value,
60943            * key, object).
60944            *
60945            * @static
60946            * @memberOf _
60947            * @category Object
60948            * @param {Object}
60949            *            object The source object.
60950            * @param {Function|...(string|string[])}
60951            *            [predicate] The function invoked per iteration or property
60952            *            names to pick, specified as individual property names or
60953            *            arrays of property names.
60954            * @param {*}
60955            *            [thisArg] The `this` binding of `predicate`.
60956            * @returns {Object} Returns the new object.
60957            * @example
60958            *
60959            * var object = { 'user': 'fred', 'age': 40 };
60960            *
60961            * _.pick(object, 'user'); // => { 'user': 'fred' }
60962            *
60963            * _.pick(object, _.isString); // => { 'user': 'fred' }
60964            */
60965           var pick = restParam(function(object, props) {
60966             if (object == null) {
60967               return {};
60968             }
60969             return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
60970           });
60971
60972           /**
60973            * This method is like `_.get` except that if the resolved value is a
60974            * function it is invoked with the `this` binding of its parent object and
60975            * its result is returned.
60976            *
60977            * @static
60978            * @memberOf _
60979            * @category Object
60980            * @param {Object}
60981            *            object The object to query.
60982            * @param {Array|string}
60983            *            path The path of the property to resolve.
60984            * @param {*}
60985            *            [defaultValue] The value returned if the resolved value is
60986            *            `undefined`.
60987            * @returns {*} Returns the resolved value.
60988            * @example
60989            *
60990            * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
60991            *
60992            * _.result(object, 'a[0].b.c1'); // => 3
60993            *
60994            * _.result(object, 'a[0].b.c2'); // => 4
60995            *
60996            * _.result(object, 'a.b.c', 'default'); // => 'default'
60997            *
60998            * _.result(object, 'a.b.c', _.constant('default')); // => 'default'
60999            */
61000           function result(object, path, defaultValue) {
61001             var result = object == null ? undefined : object[path];
61002             if (result === undefined) {
61003               if (object != null && !isKey(path, object)) {
61004                 path = toPath(path);
61005                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
61006                 result = object == null ? undefined : object[last(path)];
61007               }
61008               result = result === undefined ? defaultValue : result;
61009             }
61010             return isFunction(result) ? result.call(object) : result;
61011           }
61012
61013           /**
61014            * Sets the property value of `path` on `object`. If a portion of `path`
61015            * does not exist it is created.
61016            *
61017            * @static
61018            * @memberOf _
61019            * @category Object
61020            * @param {Object}
61021            *            object The object to augment.
61022            * @param {Array|string}
61023            *            path The path of the property to set.
61024            * @param {*}
61025            *            value The value to set.
61026            * @returns {Object} Returns `object`.
61027            * @example
61028            *
61029            * var object = { 'a': [{ 'b': { 'c': 3 } }] };
61030            *
61031            * _.set(object, 'a[0].b.c', 4); console.log(object.a[0].b.c); // => 4
61032            *
61033            * _.set(object, 'x[0].y.z', 5); console.log(object.x[0].y.z); // => 5
61034            */
61035           function set(object, path, value) {
61036             if (object == null) {
61037               return object;
61038             }
61039             var pathKey = (path + '');
61040             path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
61041
61042             var index = -1,
61043               length = path.length,
61044               lastIndex = length - 1,
61045               nested = object;
61046
61047             while (nested != null && ++index < length) {
61048               var key = path[index];
61049               if (isObject(nested)) {
61050                 if (index == lastIndex) {
61051                   nested[key] = value;
61052                 } else if (nested[key] == null) {
61053                   nested[key] = isIndex(path[index + 1]) ? [] : {};
61054                 }
61055               }
61056               nested = nested[key];
61057             }
61058             return object;
61059           }
61060
61061           /**
61062            * An alternative to `_.reduce`; this method transforms `object` to a new
61063            * `accumulator` object which is the result of running each of its own
61064            * enumerable properties through `iteratee`, with each invocation
61065            * potentially mutating the `accumulator` object. The `iteratee` is bound to
61066            * `thisArg` and invoked with four arguments: (accumulator, value, key,
61067            * object). Iteratee functions may exit iteration early by explicitly
61068            * returning `false`.
61069            *
61070            * @static
61071            * @memberOf _
61072            * @category Object
61073            * @param {Array|Object}
61074            *            object The object to iterate over.
61075            * @param {Function}
61076            *            [iteratee=_.identity] The function invoked per iteration.
61077            * @param {*}
61078            *            [accumulator] The custom accumulator value.
61079            * @param {*}
61080            *            [thisArg] The `this` binding of `iteratee`.
61081            * @returns {*} Returns the accumulated value.
61082            * @example
61083            *
61084            * _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return
61085            * n % 2 == 0; }); // => [4, 9]
61086            *
61087            * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] =
61088            * n * 3; }); // => { 'a': 3, 'b': 6 }
61089            */
61090           function transform(object, iteratee, accumulator, thisArg) {
61091             var isArr = isArray(object) || isTypedArray(object);
61092             iteratee = getCallback(iteratee, thisArg, 4);
61093
61094             if (accumulator == null) {
61095               if (isArr || isObject(object)) {
61096                 var Ctor = object.constructor;
61097                 if (isArr) {
61098                   accumulator = isArray(object) ? new Ctor : [];
61099                 } else {
61100                   accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
61101                 }
61102               } else {
61103                 accumulator = {};
61104               }
61105             }
61106             (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
61107               return iteratee(accumulator, value, index, object);
61108             });
61109             return accumulator;
61110           }
61111
61112           /**
61113            * Creates an array of the own enumerable property values of `object`.
61114            *
61115            * **Note:** Non-object values are coerced to objects.
61116            *
61117            * @static
61118            * @memberOf _
61119            * @category Object
61120            * @param {Object}
61121            *            object The object to query.
61122            * @returns {Array} Returns the array of property values.
61123            * @example
61124            *
61125            * function Foo() { this.a = 1; this.b = 2; }
61126            *
61127            * Foo.prototype.c = 3;
61128            *
61129            * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
61130            *
61131            * _.values('hi'); // => ['h', 'i']
61132            */
61133           function values(object) {
61134             return baseValues(object, keys(object));
61135           }
61136
61137           /**
61138            * Creates an array of the own and inherited enumerable property values of
61139            * `object`.
61140            *
61141            * **Note:** Non-object values are coerced to objects.
61142            *
61143            * @static
61144            * @memberOf _
61145            * @category Object
61146            * @param {Object}
61147            *            object The object to query.
61148            * @returns {Array} Returns the array of property values.
61149            * @example
61150            *
61151            * function Foo() { this.a = 1; this.b = 2; }
61152            *
61153            * Foo.prototype.c = 3;
61154            *
61155            * _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed)
61156            */
61157           function valuesIn(object) {
61158             return baseValues(object, keysIn(object));
61159           }
61160
61161           /*------------------------------------------------------------------------*/
61162
61163           /**
61164            * Checks if `n` is between `start` and up to but not including, `end`. If
61165            * `end` is not specified it is set to `start` with `start` then set to `0`.
61166            *
61167            * @static
61168            * @memberOf _
61169            * @category Number
61170            * @param {number}
61171            *            n The number to check.
61172            * @param {number}
61173            *            [start=0] The start of the range.
61174            * @param {number}
61175            *            end The end of the range.
61176            * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
61177            * @example
61178            *
61179            * _.inRange(3, 2, 4); // => true
61180            *
61181            * _.inRange(4, 8); // => true
61182            *
61183            * _.inRange(4, 2); // => false
61184            *
61185            * _.inRange(2, 2); // => false
61186            *
61187            * _.inRange(1.2, 2); // => true
61188            *
61189            * _.inRange(5.2, 4); // => false
61190            */
61191           function inRange(value, start, end) {
61192             start = +start || 0;
61193             if (end === undefined) {
61194               end = start;
61195               start = 0;
61196             } else {
61197               end = +end || 0;
61198             }
61199             return value >= nativeMin(start, end) && value < nativeMax(start, end);
61200           }
61201
61202           /**
61203            * Produces a random number between `min` and `max` (inclusive). If only one
61204            * argument is provided a number between `0` and the given number is
61205            * returned. If `floating` is `true`, or either `min` or `max` are floats, a
61206            * floating-point number is returned instead of an integer.
61207            *
61208            * @static
61209            * @memberOf _
61210            * @category Number
61211            * @param {number}
61212            *            [min=0] The minimum possible value.
61213            * @param {number}
61214            *            [max=1] The maximum possible value.
61215            * @param {boolean}
61216            *            [floating] Specify returning a floating-point number.
61217            * @returns {number} Returns the random number.
61218            * @example
61219            *
61220            * _.random(0, 5); // => an integer between 0 and 5
61221            *
61222            * _.random(5); // => also an integer between 0 and 5
61223            *
61224            * _.random(5, true); // => a floating-point number between 0 and 5
61225            *
61226            * _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2
61227            */
61228           function random(min, max, floating) {
61229             if (floating && isIterateeCall(min, max, floating)) {
61230               max = floating = undefined;
61231             }
61232             var noMin = min == null,
61233               noMax = max == null;
61234
61235             if (floating == null) {
61236               if (noMax && typeof min == 'boolean') {
61237                 floating = min;
61238                 min = 1;
61239               } else if (typeof max == 'boolean') {
61240                 floating = max;
61241                 noMax = true;
61242               }
61243             }
61244             if (noMin && noMax) {
61245               max = 1;
61246               noMax = false;
61247             }
61248             min = +min || 0;
61249             if (noMax) {
61250               max = min;
61251               min = 0;
61252             } else {
61253               max = +max || 0;
61254             }
61255             if (floating || min % 1 || max % 1) {
61256               var rand = nativeRandom();
61257               return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
61258             }
61259             return baseRandom(min, max);
61260           }
61261
61262           /*------------------------------------------------------------------------*/
61263
61264           /**
61265            * Converts `string` to [camel
61266            * case](https://en.wikipedia.org/wiki/CamelCase).
61267            *
61268            * @static
61269            * @memberOf _
61270            * @category String
61271            * @param {string}
61272            *            [string=''] The string to convert.
61273            * @returns {string} Returns the camel cased string.
61274            * @example
61275            *
61276            * _.camelCase('Foo Bar'); // => 'fooBar'
61277            *
61278            * _.camelCase('--foo-bar'); // => 'fooBar'
61279            *
61280            * _.camelCase('__foo_bar__'); // => 'fooBar'
61281            */
61282           var camelCase = createCompounder(function(result, word, index) {
61283             word = word.toLowerCase();
61284             return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
61285           });
61286
61287           /**
61288            * Capitalizes the first character of `string`.
61289            *
61290            * @static
61291            * @memberOf _
61292            * @category String
61293            * @param {string}
61294            *            [string=''] The string to capitalize.
61295            * @returns {string} Returns the capitalized string.
61296            * @example
61297            *
61298            * _.capitalize('fred'); // => 'Fred'
61299            */
61300           function capitalize(string) {
61301             string = baseToString(string);
61302             return string && (string.charAt(0).toUpperCase() + string.slice(1));
61303           }
61304
61305           /**
61306            * Deburrs `string` by converting [latin-1 supplementary
61307            * letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
61308            * to basic latin letters and removing [combining diacritical
61309            * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
61310            *
61311            * @static
61312            * @memberOf _
61313            * @category String
61314            * @param {string}
61315            *            [string=''] The string to deburr.
61316            * @returns {string} Returns the deburred string.
61317            * @example
61318            *
61319            * _.deburr('déjà vu'); // => 'deja vu'
61320            */
61321           function deburr(string) {
61322             string = baseToString(string);
61323             return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
61324           }
61325
61326           /**
61327            * Checks if `string` ends with the given target string.
61328            *
61329            * @static
61330            * @memberOf _
61331            * @category String
61332            * @param {string}
61333            *            [string=''] The string to search.
61334            * @param {string}
61335            *            [target] The string to search for.
61336            * @param {number}
61337            *            [position=string.length] The position to search from.
61338            * @returns {boolean} Returns `true` if `string` ends with `target`, else
61339            *          `false`.
61340            * @example
61341            *
61342            * _.endsWith('abc', 'c'); // => true
61343            *
61344            * _.endsWith('abc', 'b'); // => false
61345            *
61346            * _.endsWith('abc', 'b', 2); // => true
61347            */
61348           function endsWith(string, target, position) {
61349             string = baseToString(string);
61350             target = (target + '');
61351
61352             var length = string.length;
61353             position = position === undefined ? length : nativeMin(position < 0 ? 0 : (+position || 0), length);
61354
61355             position -= target.length;
61356             return position >= 0 && string.indexOf(target, position) == position;
61357           }
61358
61359           /**
61360            * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string`
61361            * to their corresponding HTML entities.
61362            *
61363            * **Note:** No other characters are escaped. To escape additional
61364            * characters use a third-party library like [_he_](https://mths.be/he).
61365            *
61366            * Though the ">" character is escaped for symmetry, characters like ">" and
61367            * "/" don't need escaping in HTML and have no special meaning unless
61368            * they're part of a tag or unquoted attribute value. See [Mathias Bynens's
61369            * article](https://mathiasbynens.be/notes/ambiguous-ampersands) (under
61370            * "semi-related fun fact") for more details.
61371            *
61372            * Backticks are escaped because in Internet Explorer < 9, they can break
61373            * out of attribute values or HTML comments. See
61374            * [#59](https://html5sec.org/#59), [#102](https://html5sec.org/#102),
61375            * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133)
61376            * of the [HTML5 Security Cheatsheet](https://html5sec.org/) for more
61377            * details.
61378            *
61379            * When working with HTML you should always [quote attribute
61380            * values](http://wonko.com/post/html-escaping) to reduce XSS vectors.
61381            *
61382            * @static
61383            * @memberOf _
61384            * @category String
61385            * @param {string}
61386            *            [string=''] The string to escape.
61387            * @returns {string} Returns the escaped string.
61388            * @example
61389            *
61390            * _.escape('fred, barney, & pebbles'); // => 'fred, barney, &amp; pebbles'
61391            */
61392           function escape(string) {
61393             // Reset `lastIndex` because in IE < 9 `String#replace` does not.
61394             string = baseToString(string);
61395             return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
61396           }
61397
61398           /**
61399            * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|",
61400            * "?", "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
61401            *
61402            * @static
61403            * @memberOf _
61404            * @category String
61405            * @param {string}
61406            *            [string=''] The string to escape.
61407            * @returns {string} Returns the escaped string.
61408            * @example
61409            *
61410            * _.escapeRegExp('[lodash](https://lodash.com/)'); // =>
61411            * '\[lodash\]\(https:\/\/lodash\.com\/\)'
61412            */
61413           function escapeRegExp(string) {
61414             string = baseToString(string);
61415             return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, escapeRegExpChar) : (string || '(?:)');
61416           }
61417
61418           /**
61419            * Converts `string` to [kebab
61420            * case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
61421            *
61422            * @static
61423            * @memberOf _
61424            * @category String
61425            * @param {string}
61426            *            [string=''] The string to convert.
61427            * @returns {string} Returns the kebab cased string.
61428            * @example
61429            *
61430            * _.kebabCase('Foo Bar'); // => 'foo-bar'
61431            *
61432            * _.kebabCase('fooBar'); // => 'foo-bar'
61433            *
61434            * _.kebabCase('__foo_bar__'); // => 'foo-bar'
61435            */
61436           var kebabCase = createCompounder(function(result, word, index) {
61437             return result + (index ? '-' : '') + word.toLowerCase();
61438           });
61439
61440           /**
61441            * Pads `string` on the left and right sides if it's shorter than `length`.
61442            * Padding characters are truncated if they can't be evenly divided by
61443            * `length`.
61444            *
61445            * @static
61446            * @memberOf _
61447            * @category String
61448            * @param {string}
61449            *            [string=''] The string to pad.
61450            * @param {number}
61451            *            [length=0] The padding length.
61452            * @param {string}
61453            *            [chars=' '] The string used as padding.
61454            * @returns {string} Returns the padded string.
61455            * @example
61456            *
61457            * _.pad('abc', 8); // => ' abc '
61458            *
61459            * _.pad('abc', 8, '_-'); // => '_-abc_-_'
61460            *
61461            * _.pad('abc', 3); // => 'abc'
61462            */
61463           function pad(string, length, chars) {
61464             string = baseToString(string);
61465             length = +length;
61466
61467             var strLength = string.length;
61468             if (strLength >= length || !nativeIsFinite(length)) {
61469               return string;
61470             }
61471             var mid = (length - strLength) / 2,
61472               leftLength = nativeFloor(mid),
61473               rightLength = nativeCeil(mid);
61474
61475             chars = createPadding('', rightLength, chars);
61476             return chars.slice(0, leftLength) + string + chars;
61477           }
61478
61479           /**
61480            * Pads `string` on the left side if it's shorter than `length`. Padding
61481            * characters are truncated if they exceed `length`.
61482            *
61483            * @static
61484            * @memberOf _
61485            * @category String
61486            * @param {string}
61487            *            [string=''] The string to pad.
61488            * @param {number}
61489            *            [length=0] The padding length.
61490            * @param {string}
61491            *            [chars=' '] The string used as padding.
61492            * @returns {string} Returns the padded string.
61493            * @example
61494            *
61495            * _.padLeft('abc', 6); // => ' abc'
61496            *
61497            * _.padLeft('abc', 6, '_-'); // => '_-_abc'
61498            *
61499            * _.padLeft('abc', 3); // => 'abc'
61500            */
61501           var padLeft = createPadDir();
61502
61503           /**
61504            * Pads `string` on the right side if it's shorter than `length`. Padding
61505            * characters are truncated if they exceed `length`.
61506            *
61507            * @static
61508            * @memberOf _
61509            * @category String
61510            * @param {string}
61511            *            [string=''] The string to pad.
61512            * @param {number}
61513            *            [length=0] The padding length.
61514            * @param {string}
61515            *            [chars=' '] The string used as padding.
61516            * @returns {string} Returns the padded string.
61517            * @example
61518            *
61519            * _.padRight('abc', 6); // => 'abc '
61520            *
61521            * _.padRight('abc', 6, '_-'); // => 'abc_-_'
61522            *
61523            * _.padRight('abc', 3); // => 'abc'
61524            */
61525           var padRight = createPadDir(true);
61526
61527           /**
61528            * Converts `string` to an integer of the specified radix. If `radix` is
61529            * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
61530            * hexadecimal, in which case a `radix` of `16` is used.
61531            *
61532            * **Note:** This method aligns with the [ES5
61533            * implementation](https://es5.github.io/#E) of `parseInt`.
61534            *
61535            * @static
61536            * @memberOf _
61537            * @category String
61538            * @param {string}
61539            *            string The string to convert.
61540            * @param {number}
61541            *            [radix] The radix to interpret `value` by.
61542            * @param- {Object} [guard] Enables use as a callback for functions like
61543            *         `_.map`.
61544            * @returns {number} Returns the converted integer.
61545            * @example
61546            *
61547            * _.parseInt('08'); // => 8
61548            *
61549            * _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10]
61550            */
61551           function parseInt(string, radix, guard) {
61552             // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
61553             // Chrome fails to trim leading <BOM> whitespace characters.
61554             // See https://code.google.com/p/v8/issues/detail?id=3109 for more
61555             // details.
61556             if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
61557               radix = 0;
61558             } else if (radix) {
61559               radix = +radix;
61560             }
61561             string = trim(string);
61562             return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
61563           }
61564
61565           /**
61566            * Repeats the given string `n` times.
61567            *
61568            * @static
61569            * @memberOf _
61570            * @category String
61571            * @param {string}
61572            *            [string=''] The string to repeat.
61573            * @param {number}
61574            *            [n=0] The number of times to repeat the string.
61575            * @returns {string} Returns the repeated string.
61576            * @example
61577            *
61578            * _.repeat('*', 3); // => '***'
61579            *
61580            * _.repeat('abc', 2); // => 'abcabc'
61581            *
61582            * _.repeat('abc', 0); // => ''
61583            */
61584           function repeat(string, n) {
61585             var result = '';
61586             string = baseToString(string);
61587             n = +n;
61588             if (n < 1 || !string || !nativeIsFinite(n)) {
61589               return result;
61590             }
61591             // Leverage the exponentiation by squaring algorithm for a faster
61592             // repeat.
61593             // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more
61594             // details.
61595             do {
61596               if (n % 2) {
61597                 result += string;
61598               }
61599               n = nativeFloor(n / 2);
61600               string += string;
61601             } while (n);
61602
61603             return result;
61604           }
61605
61606           /**
61607            * Converts `string` to [snake
61608            * case](https://en.wikipedia.org/wiki/Snake_case).
61609            *
61610            * @static
61611            * @memberOf _
61612            * @category String
61613            * @param {string}
61614            *            [string=''] The string to convert.
61615            * @returns {string} Returns the snake cased string.
61616            * @example
61617            *
61618            * _.snakeCase('Foo Bar'); // => 'foo_bar'
61619            *
61620            * _.snakeCase('fooBar'); // => 'foo_bar'
61621            *
61622            * _.snakeCase('--foo-bar'); // => 'foo_bar'
61623            */
61624           var snakeCase = createCompounder(function(result, word, index) {
61625             return result + (index ? '_' : '') + word.toLowerCase();
61626           });
61627
61628           /**
61629            * Converts `string` to [start
61630            * case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
61631            *
61632            * @static
61633            * @memberOf _
61634            * @category String
61635            * @param {string}
61636            *            [string=''] The string to convert.
61637            * @returns {string} Returns the start cased string.
61638            * @example
61639            *
61640            * _.startCase('--foo-bar'); // => 'Foo Bar'
61641            *
61642            * _.startCase('fooBar'); // => 'Foo Bar'
61643            *
61644            * _.startCase('__foo_bar__'); // => 'Foo Bar'
61645            */
61646           var startCase = createCompounder(function(result, word, index) {
61647             return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
61648           });
61649
61650           /**
61651            * Checks if `string` starts with the given target string.
61652            *
61653            * @static
61654            * @memberOf _
61655            * @category String
61656            * @param {string}
61657            *            [string=''] The string to search.
61658            * @param {string}
61659            *            [target] The string to search for.
61660            * @param {number}
61661            *            [position=0] The position to search from.
61662            * @returns {boolean} Returns `true` if `string` starts with `target`, else
61663            *          `false`.
61664            * @example
61665            *
61666            * _.startsWith('abc', 'a'); // => true
61667            *
61668            * _.startsWith('abc', 'b'); // => false
61669            *
61670            * _.startsWith('abc', 'b', 1); // => true
61671            */
61672           function startsWith(string, target, position) {
61673             string = baseToString(string);
61674             position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
61675
61676             return string.lastIndexOf(target, position) == position;
61677           }
61678
61679           /**
61680            * Creates a compiled template function that can interpolate data properties
61681            * in "interpolate" delimiters, HTML-escape interpolated data properties in
61682            * "escape" delimiters, and execute JavaScript in "evaluate" delimiters.
61683            * Data properties may be accessed as free variables in the template. If a
61684            * setting object is provided it takes precedence over `_.templateSettings`
61685            * values.
61686            *
61687            * **Note:** In the development build `_.template` utilizes
61688            * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
61689            * for easier debugging.
61690            *
61691            * For more information on precompiling templates see [lodash's custom
61692            * builds documentation](https://lodash.com/custom-builds).
61693            *
61694            * For more information on Chrome extension sandboxes see [Chrome's
61695            * extensions
61696            * documentation](https://developer.chrome.com/extensions/sandboxingEval).
61697            *
61698            * @static
61699            * @memberOf _
61700            * @category String
61701            * @param {string}
61702            *            [string=''] The template string.
61703            * @param {Object}
61704            *            [options] The options object.
61705            * @param {RegExp}
61706            *            [options.escape] The HTML "escape" delimiter.
61707            * @param {RegExp}
61708            *            [options.evaluate] The "evaluate" delimiter.
61709            * @param {Object}
61710            *            [options.imports] An object to import into the template as
61711            *            free variables.
61712            * @param {RegExp}
61713            *            [options.interpolate] The "interpolate" delimiter.
61714            * @param {string}
61715            *            [options.sourceURL] The sourceURL of the template's compiled
61716            *            source.
61717            * @param {string}
61718            *            [options.variable] The data object variable name.
61719            * @param- {Object} [otherOptions] Enables the legacy `options` param
61720            *         signature.
61721            * @returns {Function} Returns the compiled template function.
61722            * @example
61723            *  // using the "interpolate" delimiter to create a compiled
61724            * template var compiled = _.template('hello <%= user %>!'); compiled({
61725            * 'user': 'fred' }); // => 'hello fred!'
61726            *  // using the HTML "escape" delimiter to escape data property values var
61727            * compiled = _.template('<b><%- value %></b>'); compiled({ 'value': '<script>'
61728            * }); // => '<b>&lt;script&gt;</b>'
61729            *  // using the "evaluate" delimiter to execute JavaScript and generate
61730            * HTML var compiled = _.template('<% _.forEach(users, function(user) { %>
61731            * <li><%- user %></li><% }); %>'); compiled({ 'users': ['fred',
61732            * 'barney'] }); // => '
61733            * <li>fred</li>
61734            * <li>barney</li>'
61735            *  // using the internal `print` function in "evaluate" delimiters var
61736            * compiled = _.template('<% print("hello " + user); %>!'); compiled({
61737            * 'user': 'barney' }); // => 'hello barney!'
61738            *  // using the ES delimiter as an alternative to the default "interpolate"
61739            * delimiter var compiled = _.template('hello ${ user }!'); compiled({
61740            * 'user': 'pebbles' }); // => 'hello pebbles!'
61741            *  // using custom template delimiters _.templateSettings.interpolate =
61742            * /{{([\s\S]+?)}}/g; var compiled = _.template('hello {{ user }}!');
61743            * compiled({ 'user': 'mustache' }); // => 'hello mustache!'
61744            *  // using backslashes to treat delimiters as plain text var compiled =
61745            * _.template('<%= "\\<%- value %\\>" %>'); compiled({ 'value': 'ignored'
61746            * }); // => '<%- value %>'
61747            *  // using the `imports` option to import `jQuery` as `jq` var text = '<%
61748            * jq.each(users, function(user) { %>
61749            * <li><%- user %></li><% }); %>'; var compiled = _.template(text, {
61750            * 'imports': { 'jq': jQuery } }); compiled({ 'users': ['fred', 'barney']
61751            * }); // => '
61752            * <li>fred</li>
61753            * <li>barney</li>'
61754            *  // using the `sourceURL` option to specify a custom sourceURL for the
61755            * template var compiled = _.template('hello <%= user %>!', { 'sourceURL':
61756            * '/basic/greeting.jst' }); compiled(data); // => find the source of
61757            * "greeting.jst" under the Sources tab or Resources panel of the web
61758            * inspector
61759            *  // using the `variable` option to ensure a with-statement isn't used in
61760            * the compiled template var compiled = _.template('hi <%= data.user %>!', {
61761            * 'variable': 'data' }); compiled.source; // => function(data) { // var
61762            * __t, __p = ''; // __p += 'hi ' + ((__t = ( data.user )) == null ? '' :
61763            * __t) + '!'; // return __p; // }
61764            *  // using the `source` property to inline compiled templates for
61765            * meaningful // line numbers in error messages and a stack trace
61766            * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ var JST = {\ "main": ' +
61767            * _.template(mainText).source + '\ };\ ');
61768            */
61769           function template(string, options, otherOptions) {
61770             // Based on John Resig's `tmpl` implementation
61771             // (http://ejohn.org/blog/javascript-micro-templating/)
61772             // and Laura Doktorova's doT.js (https://github.com/olado/doT).
61773             var settings = lodash.templateSettings;
61774
61775             if (otherOptions && isIterateeCall(string, options, otherOptions)) {
61776               options = otherOptions = undefined;
61777             }
61778             string = baseToString(string);
61779             options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
61780
61781             var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
61782               importsKeys = keys(imports),
61783               importsValues = baseValues(imports, importsKeys);
61784
61785             var isEscaping,
61786               isEvaluating,
61787               index = 0,
61788               interpolate = options.interpolate || reNoMatch,
61789               source = "__p += '";
61790
61791             // Compile the regexp to match each delimiter.
61792             var reDelimiters = RegExp(
61793               (options.escape || reNoMatch).source + '|' +
61794               interpolate.source + '|' +
61795               (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
61796               (options.evaluate || reNoMatch).source + '|$', 'g');
61797
61798             // Use a sourceURL for easier debugging.
61799             var sourceURL = '//# sourceURL=' +
61800               ('sourceURL' in options ? options.sourceURL : ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n';
61801
61802             string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
61803               interpolateValue || (interpolateValue = esTemplateValue);
61804
61805               // Escape characters that can't be included in string literals.
61806               source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
61807
61808               // Replace delimiters with snippets.
61809               if (escapeValue) {
61810                 isEscaping = true;
61811                 source += "' +\n__e(" + escapeValue + ") +\n'";
61812               }
61813               if (evaluateValue) {
61814                 isEvaluating = true;
61815                 source += "';\n" + evaluateValue + ";\n__p += '";
61816               }
61817               if (interpolateValue) {
61818                 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
61819               }
61820               index = offset + match.length;
61821
61822               // The JS engine embedded in Adobe products requires returning the
61823               // `match`
61824               // string in order to produce the correct `offset` value.
61825               return match;
61826             });
61827
61828             source += "';\n";
61829
61830             // If `variable` is not specified wrap a with-statement around the
61831             // generated
61832             // code to add the data object to the top of the scope chain.
61833             var variable = options.variable;
61834             if (!variable) {
61835               source = 'with (obj) {\n' + source + '\n}\n';
61836             }
61837             // Cleanup code by stripping empty strings.
61838             source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
61839               .replace(reEmptyStringMiddle, '$1')
61840               .replace(reEmptyStringTrailing, '$1;');
61841
61842             // Frame code as the function body.
61843             source = 'function(' + (variable || 'obj') + ') {\n' +
61844               (variable ? '' : 'obj || (obj = {});\n') +
61845               "var __t, __p = ''" +
61846               (isEscaping ? ', __e = _.escape' : '') +
61847               (isEvaluating ? ', __j = Array.prototype.join;\n' +
61848                 "function print() { __p += __j.call(arguments, '') }\n" : ';\n'
61849               ) +
61850               source +
61851               'return __p\n}';
61852
61853             var result = attempt(function() {
61854               return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
61855             });
61856
61857             // Provide the compiled function's source by its `toString` method or
61858             // the `source` property as a convenience for inlining compiled
61859             // templates.
61860             result.source = source;
61861             if (isError(result)) {
61862               throw result;
61863             }
61864             return result;
61865           }
61866
61867           /**
61868            * Removes leading and trailing whitespace or specified characters from
61869            * `string`.
61870            *
61871            * @static
61872            * @memberOf _
61873            * @category String
61874            * @param {string}
61875            *            [string=''] The string to trim.
61876            * @param {string}
61877            *            [chars=whitespace] The characters to trim.
61878            * @param- {Object} [guard] Enables use as a callback for functions like
61879            *         `_.map`.
61880            * @returns {string} Returns the trimmed string.
61881            * @example
61882            *
61883            * _.trim(' abc '); // => 'abc'
61884            *
61885            * _.trim('-_-abc-_-', '_-'); // => 'abc'
61886            *
61887            * _.map([' foo ', ' bar '], _.trim); // => ['foo', 'bar']
61888            */
61889           function trim(string, chars, guard) {
61890             var value = string;
61891             string = baseToString(string);
61892             if (!string) {
61893               return string;
61894             }
61895             if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61896               return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
61897             }
61898             chars = (chars + '');
61899             return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
61900           }
61901
61902           /**
61903            * Removes leading whitespace or specified characters from `string`.
61904            *
61905            * @static
61906            * @memberOf _
61907            * @category String
61908            * @param {string}
61909            *            [string=''] The string to trim.
61910            * @param {string}
61911            *            [chars=whitespace] The characters to trim.
61912            * @param- {Object} [guard] Enables use as a callback for functions like
61913            *         `_.map`.
61914            * @returns {string} Returns the trimmed string.
61915            * @example
61916            *
61917            * _.trimLeft(' abc '); // => 'abc '
61918            *
61919            * _.trimLeft('-_-abc-_-', '_-'); // => 'abc-_-'
61920            */
61921           function trimLeft(string, chars, guard) {
61922             var value = string;
61923             string = baseToString(string);
61924             if (!string) {
61925               return string;
61926             }
61927             if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61928               return string.slice(trimmedLeftIndex(string));
61929             }
61930             return string.slice(charsLeftIndex(string, (chars + '')));
61931           }
61932
61933           /**
61934            * Removes trailing whitespace or specified characters from `string`.
61935            *
61936            * @static
61937            * @memberOf _
61938            * @category String
61939            * @param {string}
61940            *            [string=''] The string to trim.
61941            * @param {string}
61942            *            [chars=whitespace] The characters to trim.
61943            * @param- {Object} [guard] Enables use as a callback for functions like
61944            *         `_.map`.
61945            * @returns {string} Returns the trimmed string.
61946            * @example
61947            *
61948            * _.trimRight(' abc '); // => ' abc'
61949            *
61950            * _.trimRight('-_-abc-_-', '_-'); // => '-_-abc'
61951            */
61952           function trimRight(string, chars, guard) {
61953             var value = string;
61954             string = baseToString(string);
61955             if (!string) {
61956               return string;
61957             }
61958             if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61959               return string.slice(0, trimmedRightIndex(string) + 1);
61960             }
61961             return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
61962           }
61963
61964           /**
61965            * Truncates `string` if it's longer than the given maximum string length.
61966            * The last characters of the truncated string are replaced with the
61967            * omission string which defaults to "...".
61968            *
61969            * @static
61970            * @memberOf _
61971            * @category String
61972            * @param {string}
61973            *            [string=''] The string to truncate.
61974            * @param {Object|number}
61975            *            [options] The options object or maximum string length.
61976            * @param {number}
61977            *            [options.length=30] The maximum string length.
61978            * @param {string}
61979            *            [options.omission='...'] The string to indicate text is
61980            *            omitted.
61981            * @param {RegExp|string}
61982            *            [options.separator] The separator pattern to truncate to.
61983            * @param- {Object} [guard] Enables use as a callback for functions like
61984            *         `_.map`.
61985            * @returns {string} Returns the truncated string.
61986            * @example
61987            *
61988            * _.trunc('hi-diddly-ho there, neighborino'); // => 'hi-diddly-ho there,
61989            * neighbo...'
61990            *
61991            * _.trunc('hi-diddly-ho there, neighborino', 24); // => 'hi-diddly-ho
61992            * there, n...'
61993            *
61994            * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' '
61995            * }); // => 'hi-diddly-ho there,...'
61996            *
61997            * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator':
61998            * /,? +/ }); // => 'hi-diddly-ho there...'
61999            *
62000            * _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); // =>
62001            * 'hi-diddly-ho there, neig [...]'
62002            */
62003           function trunc(string, options, guard) {
62004             if (guard && isIterateeCall(string, options, guard)) {
62005               options = undefined;
62006             }
62007             var length = DEFAULT_TRUNC_LENGTH,
62008               omission = DEFAULT_TRUNC_OMISSION;
62009
62010             if (options != null) {
62011               if (isObject(options)) {
62012                 var separator = 'separator' in options ? options.separator : separator;
62013                 length = 'length' in options ? (+options.length || 0) : length;
62014                 omission = 'omission' in options ? baseToString(options.omission) : omission;
62015               } else {
62016                 length = +options || 0;
62017               }
62018             }
62019             string = baseToString(string);
62020             if (length >= string.length) {
62021               return string;
62022             }
62023             var end = length - omission.length;
62024             if (end < 1) {
62025               return omission;
62026             }
62027             var result = string.slice(0, end);
62028             if (separator == null) {
62029               return result + omission;
62030             }
62031             if (isRegExp(separator)) {
62032               if (string.slice(end).search(separator)) {
62033                 var match,
62034                   newEnd,
62035                   substring = string.slice(0, end);
62036
62037                 if (!separator.global) {
62038                   separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
62039                 }
62040                 separator.lastIndex = 0;
62041                 while ((match = separator.exec(substring))) {
62042                   newEnd = match.index;
62043                 }
62044                 result = result.slice(0, newEnd == null ? end : newEnd);
62045               }
62046             } else if (string.indexOf(separator, end) != end) {
62047               var index = result.lastIndexOf(separator);
62048               if (index > -1) {
62049                 result = result.slice(0, index);
62050               }
62051             }
62052             return result + omission;
62053           }
62054
62055           /**
62056            * The inverse of `_.escape`; this method converts the HTML entities
62057            * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
62058            * their corresponding characters.
62059            *
62060            * **Note:** No other HTML entities are unescaped. To unescape additional
62061            * HTML entities use a third-party library like [_he_](https://mths.be/he).
62062            *
62063            * @static
62064            * @memberOf _
62065            * @category String
62066            * @param {string}
62067            *            [string=''] The string to unescape.
62068            * @returns {string} Returns the unescaped string.
62069            * @example
62070            *
62071            * _.unescape('fred, barney, &amp; pebbles'); // => 'fred, barney, &
62072            * pebbles'
62073            */
62074           function unescape(string) {
62075             string = baseToString(string);
62076             return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
62077           }
62078
62079           /**
62080            * Splits `string` into an array of its words.
62081            *
62082            * @static
62083            * @memberOf _
62084            * @category String
62085            * @param {string}
62086            *            [string=''] The string to inspect.
62087            * @param {RegExp|string}
62088            *            [pattern] The pattern to match words.
62089            * @param- {Object} [guard] Enables use as a callback for functions like
62090            *         `_.map`.
62091            * @returns {Array} Returns the words of `string`.
62092            * @example
62093            *
62094            * _.words('fred, barney, & pebbles'); // => ['fred', 'barney', 'pebbles']
62095            *
62096            * _.words('fred, barney, & pebbles', /[^, ]+/g); // => ['fred', 'barney',
62097            * '&', 'pebbles']
62098            */
62099           function words(string, pattern, guard) {
62100             if (guard && isIterateeCall(string, pattern, guard)) {
62101               pattern = undefined;
62102             }
62103             string = baseToString(string);
62104             return string.match(pattern || reWords) || [];
62105           }
62106
62107           /*------------------------------------------------------------------------*/
62108
62109           /**
62110            * Attempts to invoke `func`, returning either the result or the caught
62111            * error object. Any additional arguments are provided to `func` when it is
62112            * invoked.
62113            *
62114            * @static
62115            * @memberOf _
62116            * @category Utility
62117            * @param {Function}
62118            *            func The function to attempt.
62119            * @returns {*} Returns the `func` result or error object.
62120            * @example
62121            *  // avoid throwing errors for invalid selectors var elements =
62122            * _.attempt(function(selector) { return
62123            * document.querySelectorAll(selector); }, '>_>');
62124            *
62125            * if (_.isError(elements)) { elements = []; }
62126            */
62127           var attempt = restParam(function(func, args) {
62128             try {
62129               return func.apply(undefined, args);
62130             } catch (e) {
62131               return isError(e) ? e : new Error(e);
62132             }
62133           });
62134
62135           /**
62136            * Creates a function that invokes `func` with the `this` binding of
62137            * `thisArg` and arguments of the created function. If `func` is a property
62138            * name the created callback returns the property value for a given element.
62139            * If `func` is an object the created callback returns `true` for elements
62140            * that contain the equivalent object properties, otherwise it returns
62141            * `false`.
62142            *
62143            * @static
62144            * @memberOf _
62145            * @alias iteratee
62146            * @category Utility
62147            * @param {*}
62148            *            [func=_.identity] The value to convert to a callback.
62149            * @param {*}
62150            *            [thisArg] The `this` binding of `func`.
62151            * @param- {Object} [guard] Enables use as a callback for functions like
62152            *         `_.map`.
62153            * @returns {Function} Returns the callback.
62154            * @example
62155            *
62156            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62157            * 40 } ];
62158            *  // wrap to create custom callback shorthands _.callback =
62159            * _.wrap(_.callback, function(callback, func, thisArg) { var match =
62160            * /^(.+?)__([gl]t)(.+)$/.exec(func); if (!match) { return callback(func,
62161            * thisArg); } return function(object) { return match[2] == 'gt' ?
62162            * object[match[1]] > match[3] : object[match[1]] < match[3]; }; });
62163            *
62164            * _.filter(users, 'age__gt36'); // => [{ 'user': 'fred', 'age': 40 }]
62165            */
62166           function callback(func, thisArg, guard) {
62167             if (guard && isIterateeCall(func, thisArg, guard)) {
62168               thisArg = undefined;
62169             }
62170             return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg);
62171           }
62172
62173           /**
62174            * Creates a function that returns `value`.
62175            *
62176            * @static
62177            * @memberOf _
62178            * @category Utility
62179            * @param {*}
62180            *            value The value to return from the new function.
62181            * @returns {Function} Returns the new function.
62182            * @example
62183            *
62184            * var object = { 'user': 'fred' }; var getter = _.constant(object);
62185            *
62186            * getter() === object; // => true
62187            */
62188           function constant(value) {
62189             return function() {
62190               return value;
62191             };
62192           }
62193
62194           /**
62195            * This method returns the first argument provided to it.
62196            *
62197            * @static
62198            * @memberOf _
62199            * @category Utility
62200            * @param {*}
62201            *            value Any value.
62202            * @returns {*} Returns `value`.
62203            * @example
62204            *
62205            * var object = { 'user': 'fred' };
62206            *
62207            * _.identity(object) === object; // => true
62208            */
62209           function identity(value) {
62210             return value;
62211           }
62212
62213           /**
62214            * Creates a function that performs a deep comparison between a given object
62215            * and `source`, returning `true` if the given object has equivalent
62216            * property values, else `false`.
62217            *
62218            * **Note:** This method supports comparing arrays, booleans, `Date`
62219            * objects, numbers, `Object` objects, regexes, and strings. Objects are
62220            * compared by their own, not inherited, enumerable properties. For
62221            * comparing a single own or inherited property value see
62222            * `_.matchesProperty`.
62223            *
62224            * @static
62225            * @memberOf _
62226            * @category Utility
62227            * @param {Object}
62228            *            source The object of property values to match.
62229            * @returns {Function} Returns the new function.
62230            * @example
62231            *
62232            * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
62233            * 'fred', 'age': 40, 'active': false } ];
62234            *
62235            * _.filter(users, _.matches({ 'age': 40, 'active': false })); // => [{
62236            * 'user': 'fred', 'age': 40, 'active': false }]
62237            */
62238           function matches(source) {
62239             return baseMatches(baseClone(source, true));
62240           }
62241
62242           /**
62243            * Creates a function that compares the property value of `path` on a given
62244            * object to `value`.
62245            *
62246            * **Note:** This method supports comparing arrays, booleans, `Date`
62247            * objects, numbers, `Object` objects, regexes, and strings. Objects are
62248            * compared by their own, not inherited, enumerable properties.
62249            *
62250            * @static
62251            * @memberOf _
62252            * @category Utility
62253            * @param {Array|string}
62254            *            path The path of the property to get.
62255            * @param {*}
62256            *            srcValue The value to match.
62257            * @returns {Function} Returns the new function.
62258            * @example
62259            *
62260            * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
62261            *
62262            * _.find(users, _.matchesProperty('user', 'fred')); // => { 'user': 'fred' }
62263            */
62264           function matchesProperty(path, srcValue) {
62265             return baseMatchesProperty(path, baseClone(srcValue, true));
62266           }
62267
62268           /**
62269            * Creates a function that invokes the method at `path` on a given object.
62270            * Any additional arguments are provided to the invoked method.
62271            *
62272            * @static
62273            * @memberOf _
62274            * @category Utility
62275            * @param {Array|string}
62276            *            path The path of the method to invoke.
62277            * @param {...*}
62278            *            [args] The arguments to invoke the method with.
62279            * @returns {Function} Returns the new function.
62280            * @example
62281            *
62282            * var objects = [ { 'a': { 'b': { 'c': _.constant(2) } } }, { 'a': { 'b': {
62283            * 'c': _.constant(1) } } } ];
62284            *
62285            * _.map(objects, _.method('a.b.c')); // => [2, 1]
62286            *
62287            * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); // =>
62288            * [1, 2]
62289            */
62290           var method = restParam(function(path, args) {
62291             return function(object) {
62292               return invokePath(object, path, args);
62293             };
62294           });
62295
62296           /**
62297            * The opposite of `_.method`; this method creates a function that invokes
62298            * the method at a given path on `object`. Any additional arguments are
62299            * provided to the invoked method.
62300            *
62301            * @static
62302            * @memberOf _
62303            * @category Utility
62304            * @param {Object}
62305            *            object The object to query.
62306            * @param {...*}
62307            *            [args] The arguments to invoke the method with.
62308            * @returns {Function} Returns the new function.
62309            * @example
62310            *
62311            * var array = _.times(3, _.constant), object = { 'a': array, 'b': array,
62312            * 'c': array };
62313            *
62314            * _.map(['a[2]', 'c[0]'], _.methodOf(object)); // => [2, 0]
62315            *
62316            * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); // => [2, 0]
62317            */
62318           var methodOf = restParam(function(object, args) {
62319             return function(path) {
62320               return invokePath(object, path, args);
62321             };
62322           });
62323
62324           /**
62325            * Adds all own enumerable function properties of a source object to the
62326            * destination object. If `object` is a function then methods are added to
62327            * its prototype as well.
62328            *
62329            * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
62330            * avoid conflicts caused by modifying the original.
62331            *
62332            * @static
62333            * @memberOf _
62334            * @category Utility
62335            * @param {Function|Object}
62336            *            [object=lodash] The destination object.
62337            * @param {Object}
62338            *            source The object of functions to add.
62339            * @param {Object}
62340            *            [options] The options object.
62341            * @param {boolean}
62342            *            [options.chain=true] Specify whether the functions added are
62343            *            chainable.
62344            * @returns {Function|Object} Returns `object`.
62345            * @example
62346            *
62347            * function vowels(string) { return _.filter(string, function(v) { return
62348            * /[aeiou]/i.test(v); }); }
62349            *
62350            * _.mixin({ 'vowels': vowels }); _.vowels('fred'); // => ['e']
62351            *
62352            * _('fred').vowels().value(); // => ['e']
62353            *
62354            * _.mixin({ 'vowels': vowels }, { 'chain': false }); _('fred').vowels(); // =>
62355            * ['e']
62356            */
62357           function mixin(object, source, options) {
62358             if (options == null) {
62359               var isObj = isObject(source),
62360                 props = isObj ? keys(source) : undefined,
62361                 methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
62362
62363               if (!(methodNames ? methodNames.length : isObj)) {
62364                 methodNames = false;
62365                 options = source;
62366                 source = object;
62367                 object = this;
62368               }
62369             }
62370             if (!methodNames) {
62371               methodNames = baseFunctions(source, keys(source));
62372             }
62373             var chain = true,
62374               index = -1,
62375               isFunc = isFunction(object),
62376               length = methodNames.length;
62377
62378             if (options === false) {
62379               chain = false;
62380             } else if (isObject(options) && 'chain' in options) {
62381               chain = options.chain;
62382             }
62383             while (++index < length) {
62384               var methodName = methodNames[index],
62385                 func = source[methodName];
62386
62387               object[methodName] = func;
62388               if (isFunc) {
62389                 object.prototype[methodName] = (function(func) {
62390                   return function() {
62391                     var chainAll = this.__chain__;
62392                     if (chain || chainAll) {
62393                       var result = object(this.__wrapped__),
62394                         actions = result.__actions__ = arrayCopy(this.__actions__);
62395
62396                       actions.push({
62397                         'func': func,
62398                         'args': arguments,
62399                         'thisArg': object
62400                       });
62401                       result.__chain__ = chainAll;
62402                       return result;
62403                     }
62404                     return func.apply(object, arrayPush([this.value()], arguments));
62405                   };
62406                 }(func));
62407               }
62408             }
62409             return object;
62410           }
62411
62412           /**
62413            * Reverts the `_` variable to its previous value and returns a reference to
62414            * the `lodash` function.
62415            *
62416            * @static
62417            * @memberOf _
62418            * @category Utility
62419            * @returns {Function} Returns the `lodash` function.
62420            * @example
62421            *
62422            * var lodash = _.noConflict();
62423            */
62424           function noConflict() {
62425             root._ = oldDash;
62426             return this;
62427           }
62428
62429           /**
62430            * A no-operation function that returns `undefined` regardless of the
62431            * arguments it receives.
62432            *
62433            * @static
62434            * @memberOf _
62435            * @category Utility
62436            * @example
62437            *
62438            * var object = { 'user': 'fred' };
62439            *
62440            * _.noop(object) === undefined; // => true
62441            */
62442           function noop() {
62443             // No operation performed.
62444           }
62445
62446           /**
62447            * Creates a function that returns the property value at `path` on a given
62448            * object.
62449            *
62450            * @static
62451            * @memberOf _
62452            * @category Utility
62453            * @param {Array|string}
62454            *            path The path of the property to get.
62455            * @returns {Function} Returns the new function.
62456            * @example
62457            *
62458            * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
62459            *
62460            * _.map(objects, _.property('a.b.c')); // => [2, 1]
62461            *
62462            * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // =>
62463            * [1, 2]
62464            */
62465           function property(path) {
62466             return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
62467           }
62468
62469           /**
62470            * The opposite of `_.property`; this method creates a function that returns
62471            * the property value at a given path on `object`.
62472            *
62473            * @static
62474            * @memberOf _
62475            * @category Utility
62476            * @param {Object}
62477            *            object The object to query.
62478            * @returns {Function} Returns the new function.
62479            * @example
62480            *
62481            * var array = [0, 1, 2], object = { 'a': array, 'b': array, 'c': array };
62482            *
62483            * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); // => [2, 0]
62484            *
62485            * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); // => [2, 0]
62486            */
62487           function propertyOf(object) {
62488             return function(path) {
62489               return baseGet(object, toPath(path), path + '');
62490             };
62491           }
62492
62493           /**
62494            * Creates an array of numbers (positive and/or negative) progressing from
62495            * `start` up to, but not including, `end`. If `end` is not specified it is
62496            * set to `start` with `start` then set to `0`. If `end` is less than
62497            * `start` a zero-length range is created unless a negative `step` is
62498            * specified.
62499            *
62500            * @static
62501            * @memberOf _
62502            * @category Utility
62503            * @param {number}
62504            *            [start=0] The start of the range.
62505            * @param {number}
62506            *            end The end of the range.
62507            * @param {number}
62508            *            [step=1] The value to increment or decrement by.
62509            * @returns {Array} Returns the new array of numbers.
62510            * @example
62511            *
62512            * _.range(4); // => [0, 1, 2, 3]
62513            *
62514            * _.range(1, 5); // => [1, 2, 3, 4]
62515            *
62516            * _.range(0, 20, 5); // => [0, 5, 10, 15]
62517            *
62518            * _.range(0, -4, -1); // => [0, -1, -2, -3]
62519            *
62520            * _.range(1, 4, 0); // => [1, 1, 1]
62521            *
62522            * _.range(0); // => []
62523            */
62524           function range(start, end, step) {
62525             if (step && isIterateeCall(start, end, step)) {
62526               end = step = undefined;
62527             }
62528             start = +start || 0;
62529             step = step == null ? 1 : (+step || 0);
62530
62531             if (end == null) {
62532               end = start;
62533               start = 0;
62534             } else {
62535               end = +end || 0;
62536             }
62537             // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
62538             // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
62539             var index = -1,
62540               length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
62541               result = Array(length);
62542
62543             while (++index < length) {
62544               result[index] = start;
62545               start += step;
62546             }
62547             return result;
62548           }
62549
62550           /**
62551            * Invokes the iteratee function `n` times, returning an array of the
62552            * results of each invocation. The `iteratee` is bound to `thisArg` and
62553            * invoked with one argument; (index).
62554            *
62555            * @static
62556            * @memberOf _
62557            * @category Utility
62558            * @param {number}
62559            *            n The number of times to invoke `iteratee`.
62560            * @param {Function}
62561            *            [iteratee=_.identity] The function invoked per iteration.
62562            * @param {*}
62563            *            [thisArg] The `this` binding of `iteratee`.
62564            * @returns {Array} Returns the array of results.
62565            * @example
62566            *
62567            * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false)); // => [3,
62568            * 6, 4]
62569            *
62570            * _.times(3, function(n) { mage.castSpell(n); }); // => invokes
62571            * `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
62572            *
62573            * _.times(3, function(n) { this.cast(n); }, mage); // => also invokes
62574            * `mage.castSpell(n)` three times
62575            */
62576           function times(n, iteratee, thisArg) {
62577             n = nativeFloor(n);
62578
62579             // Exit early to avoid a JSC JIT bug in Safari 8
62580             // where `Array(0)` is treated as `Array(1)`.
62581             if (n < 1 || !nativeIsFinite(n)) {
62582               return [];
62583             }
62584             var index = -1,
62585               result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
62586
62587             iteratee = bindCallback(iteratee, thisArg, 1);
62588             while (++index < n) {
62589               if (index < MAX_ARRAY_LENGTH) {
62590                 result[index] = iteratee(index);
62591               } else {
62592                 iteratee(index);
62593               }
62594             }
62595             return result;
62596           }
62597
62598           /**
62599            * Generates a unique ID. If `prefix` is provided the ID is appended to it.
62600            *
62601            * @static
62602            * @memberOf _
62603            * @category Utility
62604            * @param {string}
62605            *            [prefix] The value to prefix the ID with.
62606            * @returns {string} Returns the unique ID.
62607            * @example
62608            *
62609            * _.uniqueId('contact_'); // => 'contact_104'
62610            *
62611            * _.uniqueId(); // => '105'
62612            */
62613           function uniqueId(prefix) {
62614             var id = ++idCounter;
62615             return baseToString(prefix) + id;
62616           }
62617
62618           /*------------------------------------------------------------------------*/
62619
62620           /**
62621            * Adds two numbers.
62622            *
62623            * @static
62624            * @memberOf _
62625            * @category Math
62626            * @param {number}
62627            *            augend The first number to add.
62628            * @param {number}
62629            *            addend The second number to add.
62630            * @returns {number} Returns the sum.
62631            * @example
62632            *
62633            * _.add(6, 4); // => 10
62634            */
62635           function add(augend, addend) {
62636             return (+augend || 0) + (+addend || 0);
62637           }
62638
62639           /**
62640            * Calculates `n` rounded up to `precision`.
62641            *
62642            * @static
62643            * @memberOf _
62644            * @category Math
62645            * @param {number}
62646            *            n The number to round up.
62647            * @param {number}
62648            *            [precision=0] The precision to round up to.
62649            * @returns {number} Returns the rounded up number.
62650            * @example
62651            *
62652            * _.ceil(4.006); // => 5
62653            *
62654            * _.ceil(6.004, 2); // => 6.01
62655            *
62656            * _.ceil(6040, -2); // => 6100
62657            */
62658           var ceil = createRound('ceil');
62659
62660           /**
62661            * Calculates `n` rounded down to `precision`.
62662            *
62663            * @static
62664            * @memberOf _
62665            * @category Math
62666            * @param {number}
62667            *            n The number to round down.
62668            * @param {number}
62669            *            [precision=0] The precision to round down to.
62670            * @returns {number} Returns the rounded down number.
62671            * @example
62672            *
62673            * _.floor(4.006); // => 4
62674            *
62675            * _.floor(0.046, 2); // => 0.04
62676            *
62677            * _.floor(4060, -2); // => 4000
62678            */
62679           var floor = createRound('floor');
62680
62681           /**
62682            * Gets the maximum value of `collection`. If `collection` is empty or
62683            * falsey `-Infinity` is returned. If an iteratee function is provided it is
62684            * invoked for each value in `collection` to generate the criterion by which
62685            * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62686            * with three arguments: (value, index, collection).
62687            *
62688            * If a property name is provided for `iteratee` the created `_.property`
62689            * style callback returns the property value of the given element.
62690            *
62691            * If a value is also provided for `thisArg` the created `_.matchesProperty`
62692            * style callback returns `true` for elements that have a matching property
62693            * value, else `false`.
62694            *
62695            * If an object is provided for `iteratee` the created `_.matches` style
62696            * callback returns `true` for elements that have the properties of the
62697            * given object, else `false`.
62698            *
62699            * @static
62700            * @memberOf _
62701            * @category Math
62702            * @param {Array|Object|string}
62703            *            collection The collection to iterate over.
62704            * @param {Function|Object|string}
62705            *            [iteratee] The function invoked per iteration.
62706            * @param {*}
62707            *            [thisArg] The `this` binding of `iteratee`.
62708            * @returns {*} Returns the maximum value.
62709            * @example
62710            *
62711            * _.max([4, 2, 8, 6]); // => 8
62712            *
62713            * _.max([]); // => -Infinity
62714            *
62715            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62716            * 40 } ];
62717            *
62718            * _.max(users, function(chr) { return chr.age; }); // => { 'user': 'fred',
62719            * 'age': 40 }
62720            *  // using the `_.property` callback shorthand _.max(users, 'age'); // => {
62721            * 'user': 'fred', 'age': 40 }
62722            */
62723           var max = createExtremum(gt, NEGATIVE_INFINITY);
62724
62725           /**
62726            * Gets the minimum value of `collection`. If `collection` is empty or
62727            * falsey `Infinity` is returned. If an iteratee function is provided it is
62728            * invoked for each value in `collection` to generate the criterion by which
62729            * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62730            * with three arguments: (value, index, collection).
62731            *
62732            * If a property name is provided for `iteratee` the created `_.property`
62733            * style callback returns the property value of the given element.
62734            *
62735            * If a value is also provided for `thisArg` the created `_.matchesProperty`
62736            * style callback returns `true` for elements that have a matching property
62737            * value, else `false`.
62738            *
62739            * If an object is provided for `iteratee` the created `_.matches` style
62740            * callback returns `true` for elements that have the properties of the
62741            * given object, else `false`.
62742            *
62743            * @static
62744            * @memberOf _
62745            * @category Math
62746            * @param {Array|Object|string}
62747            *            collection The collection to iterate over.
62748            * @param {Function|Object|string}
62749            *            [iteratee] The function invoked per iteration.
62750            * @param {*}
62751            *            [thisArg] The `this` binding of `iteratee`.
62752            * @returns {*} Returns the minimum value.
62753            * @example
62754            *
62755            * _.min([4, 2, 8, 6]); // => 2
62756            *
62757            * _.min([]); // => Infinity
62758            *
62759            * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62760            * 40 } ];
62761            *
62762            * _.min(users, function(chr) { return chr.age; }); // => { 'user':
62763            * 'barney', 'age': 36 }
62764            *  // using the `_.property` callback shorthand _.min(users, 'age'); // => {
62765            * 'user': 'barney', 'age': 36 }
62766            */
62767           var min = createExtremum(lt, POSITIVE_INFINITY);
62768
62769           /**
62770            * Calculates `n` rounded to `precision`.
62771            *
62772            * @static
62773            * @memberOf _
62774            * @category Math
62775            * @param {number}
62776            *            n The number to round.
62777            * @param {number}
62778            *            [precision=0] The precision to round to.
62779            * @returns {number} Returns the rounded number.
62780            * @example
62781            *
62782            * _.round(4.006); // => 4
62783            *
62784            * _.round(4.006, 2); // => 4.01
62785            *
62786            * _.round(4060, -2); // => 4100
62787            */
62788           var round = createRound('round');
62789
62790           /**
62791            * Gets the sum of the values in `collection`.
62792            *
62793            * @static
62794            * @memberOf _
62795            * @category Math
62796            * @param {Array|Object|string}
62797            *            collection The collection to iterate over.
62798            * @param {Function|Object|string}
62799            *            [iteratee] The function invoked per iteration.
62800            * @param {*}
62801            *            [thisArg] The `this` binding of `iteratee`.
62802            * @returns {number} Returns the sum.
62803            * @example
62804            *
62805            * _.sum([4, 6]); // => 10
62806            *
62807            * _.sum({ 'a': 4, 'b': 6 }); // => 10
62808            *
62809            * var objects = [ { 'n': 4 }, { 'n': 6 } ];
62810            *
62811            * _.sum(objects, function(object) { return object.n; }); // => 10
62812            *  // using the `_.property` callback shorthand _.sum(objects, 'n'); // =>
62813            * 10
62814            */
62815           function sum(collection, iteratee, thisArg) {
62816             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
62817               iteratee = undefined;
62818             }
62819             iteratee = getCallback(iteratee, thisArg, 3);
62820             return iteratee.length == 1 ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee);
62821           }
62822
62823           /*------------------------------------------------------------------------*/
62824
62825           // Ensure wrappers are instances of `baseLodash`.
62826           lodash.prototype = baseLodash.prototype;
62827
62828           LodashWrapper.prototype = baseCreate(baseLodash.prototype);
62829           LodashWrapper.prototype.constructor = LodashWrapper;
62830
62831           LazyWrapper.prototype = baseCreate(baseLodash.prototype);
62832           LazyWrapper.prototype.constructor = LazyWrapper;
62833
62834           // Add functions to the `Map` cache.
62835           MapCache.prototype['delete'] = mapDelete;
62836           MapCache.prototype.get = mapGet;
62837           MapCache.prototype.has = mapHas;
62838           MapCache.prototype.set = mapSet;
62839
62840           // Add functions to the `Set` cache.
62841           SetCache.prototype.push = cachePush;
62842
62843           // Assign cache to `_.memoize`.
62844           memoize.Cache = MapCache;
62845
62846           // Add functions that return wrapped values when chaining.
62847           lodash.after = after;
62848           lodash.ary = ary;
62849           lodash.assign = assign;
62850           lodash.at = at;
62851           lodash.before = before;
62852           lodash.bind = bind;
62853           lodash.bindAll = bindAll;
62854           lodash.bindKey = bindKey;
62855           lodash.callback = callback;
62856           lodash.chain = chain;
62857           lodash.chunk = chunk;
62858           lodash.compact = compact;
62859           lodash.constant = constant;
62860           lodash.countBy = countBy;
62861           lodash.create = create;
62862           lodash.curry = curry;
62863           lodash.curryRight = curryRight;
62864           lodash.debounce = debounce;
62865           lodash.defaults = defaults;
62866           lodash.defaultsDeep = defaultsDeep;
62867           lodash.defer = defer;
62868           lodash.delay = delay;
62869           lodash.difference = difference;
62870           lodash.drop = drop;
62871           lodash.dropRight = dropRight;
62872           lodash.dropRightWhile = dropRightWhile;
62873           lodash.dropWhile = dropWhile;
62874           lodash.fill = fill;
62875           lodash.filter = filter;
62876           lodash.flatten = flatten;
62877           lodash.flattenDeep = flattenDeep;
62878           lodash.flow = flow;
62879           lodash.flowRight = flowRight;
62880           lodash.forEach = forEach;
62881           lodash.forEachRight = forEachRight;
62882           lodash.forIn = forIn;
62883           lodash.forInRight = forInRight;
62884           lodash.forOwn = forOwn;
62885           lodash.forOwnRight = forOwnRight;
62886           lodash.functions = functions;
62887           lodash.groupBy = groupBy;
62888           lodash.indexBy = indexBy;
62889           lodash.initial = initial;
62890           lodash.intersection = intersection;
62891           lodash.invert = invert;
62892           lodash.invoke = invoke;
62893           lodash.keys = keys;
62894           lodash.keysIn = keysIn;
62895           lodash.map = map;
62896           lodash.mapKeys = mapKeys;
62897           lodash.mapValues = mapValues;
62898           lodash.matches = matches;
62899           lodash.matchesProperty = matchesProperty;
62900           lodash.memoize = memoize;
62901           lodash.merge = merge;
62902           lodash.method = method;
62903           lodash.methodOf = methodOf;
62904           lodash.mixin = mixin;
62905           lodash.modArgs = modArgs;
62906           lodash.negate = negate;
62907           lodash.omit = omit;
62908           lodash.once = once;
62909           lodash.pairs = pairs;
62910           lodash.partial = partial;
62911           lodash.partialRight = partialRight;
62912           lodash.partition = partition;
62913           lodash.pick = pick;
62914           lodash.pluck = pluck;
62915           lodash.property = property;
62916           lodash.propertyOf = propertyOf;
62917           lodash.pull = pull;
62918           lodash.pullAt = pullAt;
62919           lodash.range = range;
62920           lodash.rearg = rearg;
62921           lodash.reject = reject;
62922           lodash.remove = remove;
62923           lodash.rest = rest;
62924           lodash.restParam = restParam;
62925           lodash.set = set;
62926           lodash.shuffle = shuffle;
62927           lodash.slice = slice;
62928           lodash.sortBy = sortBy;
62929           lodash.sortByAll = sortByAll;
62930           lodash.sortByOrder = sortByOrder;
62931           lodash.spread = spread;
62932           lodash.take = take;
62933           lodash.takeRight = takeRight;
62934           lodash.takeRightWhile = takeRightWhile;
62935           lodash.takeWhile = takeWhile;
62936           lodash.tap = tap;
62937           lodash.throttle = throttle;
62938           lodash.thru = thru;
62939           lodash.times = times;
62940           lodash.toArray = toArray;
62941           lodash.toPlainObject = toPlainObject;
62942           lodash.transform = transform;
62943           lodash.union = union;
62944           lodash.uniq = uniq;
62945           lodash.unzip = unzip;
62946           lodash.unzipWith = unzipWith;
62947           lodash.values = values;
62948           lodash.valuesIn = valuesIn;
62949           lodash.where = where;
62950           lodash.without = without;
62951           lodash.wrap = wrap;
62952           lodash.xor = xor;
62953           lodash.zip = zip;
62954           lodash.zipObject = zipObject;
62955           lodash.zipWith = zipWith;
62956
62957           // Add aliases.
62958           lodash.backflow = flowRight;
62959           lodash.collect = map;
62960           lodash.compose = flowRight;
62961           lodash.each = forEach;
62962           lodash.eachRight = forEachRight;
62963           lodash.extend = assign;
62964           lodash.iteratee = callback;
62965           lodash.methods = functions;
62966           lodash.object = zipObject;
62967           lodash.select = filter;
62968           lodash.tail = rest;
62969           lodash.unique = uniq;
62970
62971           // Add functions to `lodash.prototype`.
62972           mixin(lodash, lodash);
62973
62974           /*------------------------------------------------------------------------*/
62975
62976           // Add functions that return unwrapped values when chaining.
62977           lodash.add = add;
62978           lodash.attempt = attempt;
62979           lodash.camelCase = camelCase;
62980           lodash.capitalize = capitalize;
62981           lodash.ceil = ceil;
62982           lodash.clone = clone;
62983           lodash.cloneDeep = cloneDeep;
62984           lodash.deburr = deburr;
62985           lodash.endsWith = endsWith;
62986           lodash.escape = escape;
62987           lodash.escapeRegExp = escapeRegExp;
62988           lodash.every = every;
62989           lodash.find = find;
62990           lodash.findIndex = findIndex;
62991           lodash.findKey = findKey;
62992           lodash.findLast = findLast;
62993           lodash.findLastIndex = findLastIndex;
62994           lodash.findLastKey = findLastKey;
62995           lodash.findWhere = findWhere;
62996           lodash.first = first;
62997           lodash.floor = floor;
62998           lodash.get = get;
62999           lodash.gt = gt;
63000           lodash.gte = gte;
63001           lodash.has = has;
63002           lodash.identity = identity;
63003           lodash.includes = includes;
63004           lodash.indexOf = indexOf;
63005           lodash.inRange = inRange;
63006           lodash.isArguments = isArguments;
63007           lodash.isArray = isArray;
63008           lodash.isBoolean = isBoolean;
63009           lodash.isDate = isDate;
63010           lodash.isElement = isElement;
63011           lodash.isEmpty = isEmpty;
63012           lodash.isEqual = isEqual;
63013           lodash.isError = isError;
63014           lodash.isFinite = isFinite;
63015           lodash.isFunction = isFunction;
63016           lodash.isMatch = isMatch;
63017           lodash.isNaN = isNaN;
63018           lodash.isNative = isNative;
63019           lodash.isNull = isNull;
63020           lodash.isNumber = isNumber;
63021           lodash.isObject = isObject;
63022           lodash.isPlainObject = isPlainObject;
63023           lodash.isRegExp = isRegExp;
63024           lodash.isString = isString;
63025           lodash.isTypedArray = isTypedArray;
63026           lodash.isUndefined = isUndefined;
63027           lodash.kebabCase = kebabCase;
63028           lodash.last = last;
63029           lodash.lastIndexOf = lastIndexOf;
63030           lodash.lt = lt;
63031           lodash.lte = lte;
63032           lodash.max = max;
63033           lodash.min = min;
63034           lodash.noConflict = noConflict;
63035           lodash.noop = noop;
63036           lodash.now = now;
63037           lodash.pad = pad;
63038           lodash.padLeft = padLeft;
63039           lodash.padRight = padRight;
63040           lodash.parseInt = parseInt;
63041           lodash.random = random;
63042           lodash.reduce = reduce;
63043           lodash.reduceRight = reduceRight;
63044           lodash.repeat = repeat;
63045           lodash.result = result;
63046           lodash.round = round;
63047           lodash.runInContext = runInContext;
63048           lodash.size = size;
63049           lodash.snakeCase = snakeCase;
63050           lodash.some = some;
63051           lodash.sortedIndex = sortedIndex;
63052           lodash.sortedLastIndex = sortedLastIndex;
63053           lodash.startCase = startCase;
63054           lodash.startsWith = startsWith;
63055           lodash.sum = sum;
63056           lodash.template = template;
63057           lodash.trim = trim;
63058           lodash.trimLeft = trimLeft;
63059           lodash.trimRight = trimRight;
63060           lodash.trunc = trunc;
63061           lodash.unescape = unescape;
63062           lodash.uniqueId = uniqueId;
63063           lodash.words = words;
63064
63065           // Add aliases.
63066           lodash.all = every;
63067           lodash.any = some;
63068           lodash.contains = includes;
63069           lodash.eq = isEqual;
63070           lodash.detect = find;
63071           lodash.foldl = reduce;
63072           lodash.foldr = reduceRight;
63073           lodash.head = first;
63074           lodash.include = includes;
63075           lodash.inject = reduce;
63076
63077           mixin(lodash, (function() {
63078             var source = {};
63079             baseForOwn(lodash, function(func, methodName) {
63080               if (!lodash.prototype[methodName]) {
63081                 source[methodName] = func;
63082               }
63083             });
63084             return source;
63085           }()), false);
63086
63087           /*------------------------------------------------------------------------*/
63088
63089           // Add functions capable of returning wrapped and unwrapped values when
63090           // chaining.
63091           lodash.sample = sample;
63092
63093           lodash.prototype.sample = function(n) {
63094             if (!this.__chain__ && n == null) {
63095               return sample(this.value());
63096             }
63097             return this.thru(function(value) {
63098               return sample(value, n);
63099             });
63100           };
63101
63102           /*------------------------------------------------------------------------*/
63103
63104           /**
63105            * The semantic version number.
63106            *
63107            * @static
63108            * @memberOf _
63109            * @type string
63110            */
63111           lodash.VERSION = VERSION;
63112
63113           // Assign default placeholders.
63114           arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
63115             lodash[methodName].placeholder = lodash;
63116           });
63117
63118           // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
63119           arrayEach(['drop', 'take'], function(methodName, index) {
63120             LazyWrapper.prototype[methodName] = function(n) {
63121               var filtered = this.__filtered__;
63122               if (filtered && !index) {
63123                 return new LazyWrapper(this);
63124               }
63125               n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
63126
63127               var result = this.clone();
63128               if (filtered) {
63129                 result.__takeCount__ = nativeMin(result.__takeCount__, n);
63130               } else {
63131                 result.__views__.push({
63132                   'size': n,
63133                   'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
63134                 });
63135               }
63136               return result;
63137             };
63138
63139             LazyWrapper.prototype[methodName + 'Right'] = function(n) {
63140               return this.reverse()[methodName](n).reverse();
63141             };
63142           });
63143
63144           // Add `LazyWrapper` methods that accept an `iteratee` value.
63145           arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
63146             var type = index + 1,
63147               isFilter = type != LAZY_MAP_FLAG;
63148
63149             LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
63150               var result = this.clone();
63151               result.__iteratees__.push({
63152                 'iteratee': getCallback(iteratee, thisArg, 1),
63153                 'type': type
63154               });
63155               result.__filtered__ = result.__filtered__ || isFilter;
63156               return result;
63157             };
63158           });
63159
63160           // Add `LazyWrapper` methods for `_.first` and `_.last`.
63161           arrayEach(['first', 'last'], function(methodName, index) {
63162             var takeName = 'take' + (index ? 'Right' : '');
63163
63164             LazyWrapper.prototype[methodName] = function() {
63165               return this[takeName](1).value()[0];
63166             };
63167           });
63168
63169           // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
63170           arrayEach(['initial', 'rest'], function(methodName, index) {
63171             var dropName = 'drop' + (index ? '' : 'Right');
63172
63173             LazyWrapper.prototype[methodName] = function() {
63174               return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
63175             };
63176           });
63177
63178           // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
63179           arrayEach(['pluck', 'where'], function(methodName, index) {
63180             var operationName = index ? 'filter' : 'map',
63181               createCallback = index ? baseMatches : property;
63182
63183             LazyWrapper.prototype[methodName] = function(value) {
63184               return this[operationName](createCallback(value));
63185             };
63186           });
63187
63188           LazyWrapper.prototype.compact = function() {
63189             return this.filter(identity);
63190           };
63191
63192           LazyWrapper.prototype.reject = function(predicate, thisArg) {
63193             predicate = getCallback(predicate, thisArg, 1);
63194             return this.filter(function(value) {
63195               return !predicate(value);
63196             });
63197           };
63198
63199           LazyWrapper.prototype.slice = function(start, end) {
63200             start = start == null ? 0 : (+start || 0);
63201
63202             var result = this;
63203             if (result.__filtered__ && (start > 0 || end < 0)) {
63204               return new LazyWrapper(result);
63205             }
63206             if (start < 0) {
63207               result = result.takeRight(-start);
63208             } else if (start) {
63209               result = result.drop(start);
63210             }
63211             if (end !== undefined) {
63212               end = (+end || 0);
63213               result = end < 0 ? result.dropRight(-end) : result.take(end - start);
63214             }
63215             return result;
63216           };
63217
63218           LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
63219             return this.reverse().takeWhile(predicate, thisArg).reverse();
63220           };
63221
63222           LazyWrapper.prototype.toArray = function() {
63223             return this.take(POSITIVE_INFINITY);
63224           };
63225
63226           // Add `LazyWrapper` methods to `lodash.prototype`.
63227           baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63228             var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
63229               retUnwrapped = /^(?:first|last)$/.test(methodName),
63230               lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
63231
63232             if (!lodashFunc) {
63233               return;
63234             }
63235             lodash.prototype[methodName] = function() {
63236               var args = retUnwrapped ? [1] : arguments,
63237                 chainAll = this.__chain__,
63238                 value = this.__wrapped__,
63239                 isHybrid = !!this.__actions__.length,
63240                 isLazy = value instanceof LazyWrapper,
63241                 iteratee = args[0],
63242                 useLazy = isLazy || isArray(value);
63243
63244               if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
63245                 // Avoid lazy use if the iteratee has a "length" value other than
63246                 // `1`.
63247                 isLazy = useLazy = false;
63248               }
63249               var interceptor = function(value) {
63250                 return (retUnwrapped && chainAll) ? lodashFunc(value, 1)[0] : lodashFunc.apply(undefined, arrayPush([value], args));
63251               };
63252
63253               var action = {
63254                   'func': thru,
63255                   'args': [interceptor],
63256                   'thisArg': undefined
63257                 },
63258                 onlyLazy = isLazy && !isHybrid;
63259
63260               if (retUnwrapped && !chainAll) {
63261                 if (onlyLazy) {
63262                   value = value.clone();
63263                   value.__actions__.push(action);
63264                   return func.call(value);
63265                 }
63266                 return lodashFunc.call(undefined, this.value())[0];
63267               }
63268               if (!retUnwrapped && useLazy) {
63269                 value = onlyLazy ? value : new LazyWrapper(this);
63270                 var result = func.apply(value, args);
63271                 result.__actions__.push(action);
63272                 return new LodashWrapper(result, chainAll);
63273               }
63274               return this.thru(interceptor);
63275             };
63276           });
63277
63278           // Add `Array` and `String` methods to `lodash.prototype`.
63279           arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
63280             var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
63281               chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
63282               retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
63283
63284             lodash.prototype[methodName] = function() {
63285               var args = arguments;
63286               if (retUnwrapped && !this.__chain__) {
63287                 return func.apply(this.value(), args);
63288               }
63289               return this[chainName](function(value) {
63290                 return func.apply(value, args);
63291               });
63292             };
63293           });
63294
63295           // Map minified function names to their real names.
63296           baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63297             var lodashFunc = lodash[methodName];
63298             if (lodashFunc) {
63299               var key = lodashFunc.name,
63300                 names = realNames[key] || (realNames[key] = []);
63301
63302               names.push({
63303                 'name': methodName,
63304                 'func': lodashFunc
63305               });
63306             }
63307           });
63308
63309           realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
63310             'name': 'wrapper',
63311             'func': undefined
63312           }];
63313
63314           // Add functions to the lazy wrapper.
63315           LazyWrapper.prototype.clone = lazyClone;
63316           LazyWrapper.prototype.reverse = lazyReverse;
63317           LazyWrapper.prototype.value = lazyValue;
63318
63319           // Add chaining functions to the `lodash` wrapper.
63320           lodash.prototype.chain = wrapperChain;
63321           lodash.prototype.commit = wrapperCommit;
63322           lodash.prototype.concat = wrapperConcat;
63323           lodash.prototype.plant = wrapperPlant;
63324           lodash.prototype.reverse = wrapperReverse;
63325           lodash.prototype.toString = wrapperToString;
63326           lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
63327
63328           // Add function aliases to the `lodash` wrapper.
63329           lodash.prototype.collect = lodash.prototype.map;
63330           lodash.prototype.head = lodash.prototype.first;
63331           lodash.prototype.select = lodash.prototype.filter;
63332           lodash.prototype.tail = lodash.prototype.rest;
63333
63334           return lodash;
63335         }
63336
63337         /*--------------------------------------------------------------------------*/
63338
63339         // Export lodash.
63340         var _ = runInContext();
63341
63342         // Some AMD build optimizers like r.js check for condition patterns like the
63343         // following:
63344         if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
63345           // Expose lodash to the global object when an AMD loader is present to avoid
63346           // errors in cases where lodash is loaded by a script tag and not intended
63347           // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
63348           // more details.
63349           root._ = _;
63350
63351           // Define as an anonymous module so, through path mapping, it can be
63352           // referenced as the "underscore" module.
63353           define(function() {
63354             return _;
63355           });
63356         }
63357         // Check for `exports` after `define` in case a build optimizer adds an
63358         // `exports` object.
63359         else if (freeExports && freeModule) {
63360           // Export for Node.js or RingoJS.
63361           if (moduleExports) {
63362             (freeModule.exports = _)._ = _;
63363           }
63364           // Export for Rhino with CommonJS support.
63365           else {
63366             freeExports._ = _;
63367           }
63368         } else {
63369           // Export for a browser or Rhino.
63370           root._ = _;
63371         }
63372       }.call(this));
63373
63374     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63375   }, {}],
63376   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js": [function(require, module, exports) {
63377     var baseCreate = require('./baseCreate'),
63378       baseLodash = require('./baseLodash');
63379
63380     /** Used as references for `-Infinity` and `Infinity`. */
63381     var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
63382
63383     /**
63384      * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
63385      *
63386      * @private
63387      * @param {*}
63388      *            value The value to wrap.
63389      */
63390     function LazyWrapper(value) {
63391       this.__wrapped__ = value;
63392       this.__actions__ = [];
63393       this.__dir__ = 1;
63394       this.__filtered__ = false;
63395       this.__iteratees__ = [];
63396       this.__takeCount__ = POSITIVE_INFINITY;
63397       this.__views__ = [];
63398     }
63399
63400     LazyWrapper.prototype = baseCreate(baseLodash.prototype);
63401     LazyWrapper.prototype.constructor = LazyWrapper;
63402
63403     module.exports = LazyWrapper;
63404
63405   }, {
63406     "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63407     "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63408   }],
63409   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js": [function(require, module, exports) {
63410     var baseCreate = require('./baseCreate'),
63411       baseLodash = require('./baseLodash');
63412
63413     /**
63414      * The base constructor for creating `lodash` wrapper objects.
63415      *
63416      * @private
63417      * @param {*}
63418      *            value The value to wrap.
63419      * @param {boolean}
63420      *            [chainAll] Enable chaining for all wrapper methods.
63421      * @param {Array}
63422      *            [actions=[]] Actions to peform to resolve the unwrapped value.
63423      */
63424     function LodashWrapper(value, chainAll, actions) {
63425       this.__wrapped__ = value;
63426       this.__actions__ = actions || [];
63427       this.__chain__ = !!chainAll;
63428     }
63429
63430     LodashWrapper.prototype = baseCreate(baseLodash.prototype);
63431     LodashWrapper.prototype.constructor = LodashWrapper;
63432
63433     module.exports = LodashWrapper;
63434
63435   }, {
63436     "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63437     "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63438   }],
63439   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js": [function(require, module, exports) {
63440     (function(global) {
63441       var cachePush = require('./cachePush'),
63442         getNative = require('./getNative');
63443
63444       /** Native method references. */
63445       var Set = getNative(global, 'Set');
63446
63447       /*
63448        * Native method references for those with the same name as other `lodash`
63449        * methods.
63450        */
63451       var nativeCreate = getNative(Object, 'create');
63452
63453       /**
63454        *
63455        * Creates a cache object to store unique values.
63456        *
63457        * @private
63458        * @param {Array}
63459        *            [values] The values to cache.
63460        */
63461       function SetCache(values) {
63462         var length = values ? values.length : 0;
63463
63464         this.data = {
63465           'hash': nativeCreate(null),
63466           'set': new Set
63467         };
63468         while (length--) {
63469           this.push(values[length]);
63470         }
63471       }
63472
63473       // Add functions to the `Set` cache.
63474       SetCache.prototype.push = cachePush;
63475
63476       module.exports = SetCache;
63477
63478     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63479   }, {
63480     "./cachePush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js",
63481     "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
63482   }],
63483   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js": [function(require, module, exports) {
63484     /**
63485      * Copies the values of `source` to `array`.
63486      *
63487      * @private
63488      * @param {Array}
63489      *            source The array to copy values from.
63490      * @param {Array}
63491      *            [array=[]] The array to copy values to.
63492      * @returns {Array} Returns `array`.
63493      */
63494     function arrayCopy(source, array) {
63495       var index = -1,
63496         length = source.length;
63497
63498       array || (array = Array(length));
63499       while (++index < length) {
63500         array[index] = source[index];
63501       }
63502       return array;
63503     }
63504
63505     module.exports = arrayCopy;
63506
63507   }, {}],
63508   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js": [function(require, module, exports) {
63509     /**
63510      * A specialized version of `_.forEach` for arrays without support for callback
63511      * shorthands and `this` binding.
63512      *
63513      * @private
63514      * @param {Array}
63515      *            array The array to iterate over.
63516      * @param {Function}
63517      *            iteratee The function invoked per iteration.
63518      * @returns {Array} Returns `array`.
63519      */
63520     function arrayEach(array, iteratee) {
63521       var index = -1,
63522         length = array.length;
63523
63524       while (++index < length) {
63525         if (iteratee(array[index], index, array) === false) {
63526           break;
63527         }
63528       }
63529       return array;
63530     }
63531
63532     module.exports = arrayEach;
63533
63534   }, {}],
63535   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js": [function(require, module, exports) {
63536     /**
63537      * A specialized version of `_.every` for arrays without support for callback
63538      * shorthands and `this` binding.
63539      *
63540      * @private
63541      * @param {Array}
63542      *            array The array to iterate over.
63543      * @param {Function}
63544      *            predicate The function invoked per iteration.
63545      * @returns {boolean} Returns `true` if all elements pass the predicate check,
63546      *          else `false`.
63547      */
63548     function arrayEvery(array, predicate) {
63549       var index = -1,
63550         length = array.length;
63551
63552       while (++index < length) {
63553         if (!predicate(array[index], index, array)) {
63554           return false;
63555         }
63556       }
63557       return true;
63558     }
63559
63560     module.exports = arrayEvery;
63561
63562   }, {}],
63563   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js": [function(require, module, exports) {
63564     /**
63565      * A specialized version of `_.filter` for arrays without support for callback
63566      * shorthands and `this` binding.
63567      *
63568      * @private
63569      * @param {Array}
63570      *            array The array to iterate over.
63571      * @param {Function}
63572      *            predicate The function invoked per iteration.
63573      * @returns {Array} Returns the new filtered array.
63574      */
63575     function arrayFilter(array, predicate) {
63576       var index = -1,
63577         length = array.length,
63578         resIndex = -1,
63579         result = [];
63580
63581       while (++index < length) {
63582         var value = array[index];
63583         if (predicate(value, index, array)) {
63584           result[++resIndex] = value;
63585         }
63586       }
63587       return result;
63588     }
63589
63590     module.exports = arrayFilter;
63591
63592   }, {}],
63593   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js": [function(require, module, exports) {
63594     /**
63595      * A specialized version of `_.map` for arrays without support for callback
63596      * shorthands and `this` binding.
63597      *
63598      * @private
63599      * @param {Array}
63600      *            array The array to iterate over.
63601      * @param {Function}
63602      *            iteratee The function invoked per iteration.
63603      * @returns {Array} Returns the new mapped array.
63604      */
63605     function arrayMap(array, iteratee) {
63606       var index = -1,
63607         length = array.length,
63608         result = Array(length);
63609
63610       while (++index < length) {
63611         result[index] = iteratee(array[index], index, array);
63612       }
63613       return result;
63614     }
63615
63616     module.exports = arrayMap;
63617
63618   }, {}],
63619   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js": [function(require, module, exports) {
63620     /**
63621      * Appends the elements of `values` to `array`.
63622      *
63623      * @private
63624      * @param {Array}
63625      *            array The array to modify.
63626      * @param {Array}
63627      *            values The values to append.
63628      * @returns {Array} Returns `array`.
63629      */
63630     function arrayPush(array, values) {
63631       var index = -1,
63632         length = values.length,
63633         offset = array.length;
63634
63635       while (++index < length) {
63636         array[offset + index] = values[index];
63637       }
63638       return array;
63639     }
63640
63641     module.exports = arrayPush;
63642
63643   }, {}],
63644   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js": [function(require, module, exports) {
63645     /**
63646      * A specialized version of `_.reduce` for arrays without support for callback
63647      * shorthands and `this` binding.
63648      *
63649      * @private
63650      * @param {Array}
63651      *            array The array to iterate over.
63652      * @param {Function}
63653      *            iteratee The function invoked per iteration.
63654      * @param {*}
63655      *            [accumulator] The initial value.
63656      * @param {boolean}
63657      *            [initFromArray] Specify using the first element of `array` as the
63658      *            initial value.
63659      * @returns {*} Returns the accumulated value.
63660      */
63661     function arrayReduce(array, iteratee, accumulator, initFromArray) {
63662       var index = -1,
63663         length = array.length;
63664
63665       if (initFromArray && length) {
63666         accumulator = array[++index];
63667       }
63668       while (++index < length) {
63669         accumulator = iteratee(accumulator, array[index], index, array);
63670       }
63671       return accumulator;
63672     }
63673
63674     module.exports = arrayReduce;
63675
63676   }, {}],
63677   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js": [function(require, module, exports) {
63678     /**
63679      * A specialized version of `_.some` for arrays without support for callback
63680      * shorthands and `this` binding.
63681      *
63682      * @private
63683      * @param {Array}
63684      *            array The array to iterate over.
63685      * @param {Function}
63686      *            predicate The function invoked per iteration.
63687      * @returns {boolean} Returns `true` if any element passes the predicate check,
63688      *          else `false`.
63689      */
63690     function arraySome(array, predicate) {
63691       var index = -1,
63692         length = array.length;
63693
63694       while (++index < length) {
63695         if (predicate(array[index], index, array)) {
63696           return true;
63697         }
63698       }
63699       return false;
63700     }
63701
63702     module.exports = arraySome;
63703
63704   }, {}],
63705   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js": [function(require, module, exports) {
63706     var keys = require('../object/keys');
63707
63708     /**
63709      * A specialized version of `_.assign` for customizing assigned values without
63710      * support for argument juggling, multiple sources, and `this` binding
63711      * `customizer` functions.
63712      *
63713      * @private
63714      * @param {Object}
63715      *            object The destination object.
63716      * @param {Object}
63717      *            source The source object.
63718      * @param {Function}
63719      *            customizer The function to customize assigned values.
63720      * @returns {Object} Returns `object`.
63721      */
63722     function assignWith(object, source, customizer) {
63723       var index = -1,
63724         props = keys(source),
63725         length = props.length;
63726
63727       while (++index < length) {
63728         var key = props[index],
63729           value = object[key],
63730           result = customizer(value, source[key], key, object, source);
63731
63732         if ((result === result ? (result !== value) : (value === value)) ||
63733           (value === undefined && !(key in object))) {
63734           object[key] = result;
63735         }
63736       }
63737       return object;
63738     }
63739
63740     module.exports = assignWith;
63741
63742   }, {
63743     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
63744   }],
63745   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js": [function(require, module, exports) {
63746     var baseCopy = require('./baseCopy'),
63747       keys = require('../object/keys');
63748
63749     /**
63750      * The base implementation of `_.assign` without support for argument juggling,
63751      * multiple sources, and `customizer` functions.
63752      *
63753      * @private
63754      * @param {Object}
63755      *            object The destination object.
63756      * @param {Object}
63757      *            source The source object.
63758      * @returns {Object} Returns `object`.
63759      */
63760     function baseAssign(object, source) {
63761       return source == null ? object : baseCopy(source, keys(source), object);
63762     }
63763
63764     module.exports = baseAssign;
63765
63766   }, {
63767     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
63768     "./baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js"
63769   }],
63770   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js": [function(require, module, exports) {
63771     var baseMatches = require('./baseMatches'),
63772       baseMatchesProperty = require('./baseMatchesProperty'),
63773       bindCallback = require('./bindCallback'),
63774       identity = require('../utility/identity'),
63775       property = require('../utility/property');
63776
63777     /**
63778      * The base implementation of `_.callback` which supports specifying the number
63779      * of arguments to provide to `func`.
63780      *
63781      * @private
63782      * @param {*}
63783      *            [func=_.identity] The value to convert to a callback.
63784      * @param {*}
63785      *            [thisArg] The `this` binding of `func`.
63786      * @param {number}
63787      *            [argCount] The number of arguments to provide to `func`.
63788      * @returns {Function} Returns the callback.
63789      */
63790     function baseCallback(func, thisArg, argCount) {
63791       var type = typeof func;
63792       if (type == 'function') {
63793         return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
63794       }
63795       if (func == null) {
63796         return identity;
63797       }
63798       if (type == 'object') {
63799         return baseMatches(func);
63800       }
63801       return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
63802     }
63803
63804     module.exports = baseCallback;
63805
63806   }, {
63807     "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
63808     "../utility/property": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js",
63809     "./baseMatches": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js",
63810     "./baseMatchesProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js",
63811     "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
63812   }],
63813   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js": [function(require, module, exports) {
63814     /**
63815      * The base implementation of `compareAscending` which compares values and sorts
63816      * them in ascending order without guaranteeing a stable sort.
63817      *
63818      * @private
63819      * @param {*}
63820      *            value The value to compare.
63821      * @param {*}
63822      *            other The other value to compare.
63823      * @returns {number} Returns the sort order indicator for `value`.
63824      */
63825     function baseCompareAscending(value, other) {
63826       if (value !== other) {
63827         var valIsNull = value === null,
63828           valIsUndef = value === undefined,
63829           valIsReflexive = value === value;
63830
63831         var othIsNull = other === null,
63832           othIsUndef = other === undefined,
63833           othIsReflexive = other === other;
63834
63835         if ((value > other && !othIsNull) || !valIsReflexive ||
63836           (valIsNull && !othIsUndef && othIsReflexive) ||
63837           (valIsUndef && othIsReflexive)) {
63838           return 1;
63839         }
63840         if ((value < other && !valIsNull) || !othIsReflexive ||
63841           (othIsNull && !valIsUndef && valIsReflexive) ||
63842           (othIsUndef && valIsReflexive)) {
63843           return -1;
63844         }
63845       }
63846       return 0;
63847     }
63848
63849     module.exports = baseCompareAscending;
63850
63851   }, {}],
63852   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js": [function(require, module, exports) {
63853     /**
63854      * Copies properties of `source` to `object`.
63855      *
63856      * @private
63857      * @param {Object}
63858      *            source The object to copy properties from.
63859      * @param {Array}
63860      *            props The property names to copy.
63861      * @param {Object}
63862      *            [object={}] The object to copy properties to.
63863      * @returns {Object} Returns `object`.
63864      */
63865     function baseCopy(source, props, object) {
63866       object || (object = {});
63867
63868       var index = -1,
63869         length = props.length;
63870
63871       while (++index < length) {
63872         var key = props[index];
63873         object[key] = source[key];
63874       }
63875       return object;
63876     }
63877
63878     module.exports = baseCopy;
63879
63880   }, {}],
63881   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js": [function(require, module, exports) {
63882     var isObject = require('../lang/isObject');
63883
63884     /**
63885      * The base implementation of `_.create` without support for assigning
63886      * properties to the created object.
63887      *
63888      * @private
63889      * @param {Object}
63890      *            prototype The object to inherit from.
63891      * @returns {Object} Returns the new object.
63892      */
63893     var baseCreate = (function() {
63894       function object() {}
63895       return function(prototype) {
63896         if (isObject(prototype)) {
63897           object.prototype = prototype;
63898           var result = new object;
63899           object.prototype = undefined;
63900         }
63901         return result || {};
63902       };
63903     }());
63904
63905     module.exports = baseCreate;
63906
63907   }, {
63908     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
63909   }],
63910   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js": [function(require, module, exports) {
63911     /** Used as the `TypeError` message for "Functions" methods. */
63912     var FUNC_ERROR_TEXT = 'Expected a function';
63913
63914     /**
63915      * The base implementation of `_.delay` and `_.defer` which accepts an index of
63916      * where to slice the arguments to provide to `func`.
63917      *
63918      * @private
63919      * @param {Function}
63920      *            func The function to delay.
63921      * @param {number}
63922      *            wait The number of milliseconds to delay invocation.
63923      * @param {Object}
63924      *            args The arguments provide to `func`.
63925      * @returns {number} Returns the timer id.
63926      */
63927     function baseDelay(func, wait, args) {
63928       if (typeof func != 'function') {
63929         throw new TypeError(FUNC_ERROR_TEXT);
63930       }
63931       return setTimeout(function() {
63932         func.apply(undefined, args);
63933       }, wait);
63934     }
63935
63936     module.exports = baseDelay;
63937
63938   }, {}],
63939   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js": [function(require, module, exports) {
63940     var baseIndexOf = require('./baseIndexOf'),
63941       cacheIndexOf = require('./cacheIndexOf'),
63942       createCache = require('./createCache');
63943
63944     /** Used as the size to enable large array optimizations. */
63945     var LARGE_ARRAY_SIZE = 200;
63946
63947     /**
63948      * The base implementation of `_.difference` which accepts a single array of
63949      * values to exclude.
63950      *
63951      * @private
63952      * @param {Array}
63953      *            array The array to inspect.
63954      * @param {Array}
63955      *            values The values to exclude.
63956      * @returns {Array} Returns the new array of filtered values.
63957      */
63958     function baseDifference(array, values) {
63959       var length = array ? array.length : 0,
63960         result = [];
63961
63962       if (!length) {
63963         return result;
63964       }
63965       var index = -1,
63966         indexOf = baseIndexOf,
63967         isCommon = true,
63968         cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
63969         valuesLength = values.length;
63970
63971       if (cache) {
63972         indexOf = cacheIndexOf;
63973         isCommon = false;
63974         values = cache;
63975       }
63976       outer:
63977         while (++index < length) {
63978           var value = array[index];
63979
63980           if (isCommon && value === value) {
63981             var valuesIndex = valuesLength;
63982             while (valuesIndex--) {
63983               if (values[valuesIndex] === value) {
63984                 continue outer;
63985               }
63986             }
63987             result.push(value);
63988           } else if (indexOf(values, value, 0) < 0) {
63989             result.push(value);
63990           }
63991         }
63992       return result;
63993     }
63994
63995     module.exports = baseDifference;
63996
63997   }, {
63998     "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
63999     "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
64000     "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
64001   }],
64002   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js": [function(require, module, exports) {
64003     var baseForOwn = require('./baseForOwn'),
64004       createBaseEach = require('./createBaseEach');
64005
64006     /**
64007      * The base implementation of `_.forEach` without support for callback
64008      * shorthands and `this` binding.
64009      *
64010      * @private
64011      * @param {Array|Object|string}
64012      *            collection The collection to iterate over.
64013      * @param {Function}
64014      *            iteratee The function invoked per iteration.
64015      * @returns {Array|Object|string} Returns `collection`.
64016      */
64017     var baseEach = createBaseEach(baseForOwn);
64018
64019     module.exports = baseEach;
64020
64021   }, {
64022     "./baseForOwn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js",
64023     "./createBaseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js"
64024   }],
64025   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js": [function(require, module, exports) {
64026     var baseEach = require('./baseEach');
64027
64028     /**
64029      * The base implementation of `_.every` without support for callback shorthands
64030      * and `this` binding.
64031      *
64032      * @private
64033      * @param {Array|Object|string}
64034      *            collection The collection to iterate over.
64035      * @param {Function}
64036      *            predicate The function invoked per iteration.
64037      * @returns {boolean} Returns `true` if all elements pass the predicate check,
64038      *          else `false`
64039      */
64040     function baseEvery(collection, predicate) {
64041       var result = true;
64042       baseEach(collection, function(value, index, collection) {
64043         result = !!predicate(value, index, collection);
64044         return result;
64045       });
64046       return result;
64047     }
64048
64049     module.exports = baseEvery;
64050
64051   }, {
64052     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64053   }],
64054   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js": [function(require, module, exports) {
64055     var baseEach = require('./baseEach');
64056
64057     /**
64058      * The base implementation of `_.filter` without support for callback shorthands
64059      * and `this` binding.
64060      *
64061      * @private
64062      * @param {Array|Object|string}
64063      *            collection The collection to iterate over.
64064      * @param {Function}
64065      *            predicate The function invoked per iteration.
64066      * @returns {Array} Returns the new filtered array.
64067      */
64068     function baseFilter(collection, predicate) {
64069       var result = [];
64070       baseEach(collection, function(value, index, collection) {
64071         if (predicate(value, index, collection)) {
64072           result.push(value);
64073         }
64074       });
64075       return result;
64076     }
64077
64078     module.exports = baseFilter;
64079
64080   }, {
64081     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64082   }],
64083   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js": [function(require, module, exports) {
64084     /**
64085      * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
64086      * `_.findLastKey`, without support for callback shorthands and `this` binding,
64087      * which iterates over `collection` using the provided `eachFunc`.
64088      *
64089      * @private
64090      * @param {Array|Object|string}
64091      *            collection The collection to search.
64092      * @param {Function}
64093      *            predicate The function invoked per iteration.
64094      * @param {Function}
64095      *            eachFunc The function to iterate over `collection`.
64096      * @param {boolean}
64097      *            [retKey] Specify returning the key of the found element instead of
64098      *            the element itself.
64099      * @returns {*} Returns the found element or its key, else `undefined`.
64100      */
64101     function baseFind(collection, predicate, eachFunc, retKey) {
64102       var result;
64103       eachFunc(collection, function(value, key, collection) {
64104         if (predicate(value, key, collection)) {
64105           result = retKey ? key : value;
64106           return false;
64107         }
64108       });
64109       return result;
64110     }
64111
64112     module.exports = baseFind;
64113
64114   }, {}],
64115   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js": [function(require, module, exports) {
64116     /**
64117      * The base implementation of `_.findIndex` and `_.findLastIndex` without
64118      * support for callback shorthands and `this` binding.
64119      *
64120      * @private
64121      * @param {Array}
64122      *            array The array to search.
64123      * @param {Function}
64124      *            predicate The function invoked per iteration.
64125      * @param {boolean}
64126      *            [fromRight] Specify iterating from right to left.
64127      * @returns {number} Returns the index of the matched value, else `-1`.
64128      */
64129     function baseFindIndex(array, predicate, fromRight) {
64130       var length = array.length,
64131         index = fromRight ? length : -1;
64132
64133       while ((fromRight ? index-- : ++index < length)) {
64134         if (predicate(array[index], index, array)) {
64135           return index;
64136         }
64137       }
64138       return -1;
64139     }
64140
64141     module.exports = baseFindIndex;
64142
64143   }, {}],
64144   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js": [function(require, module, exports) {
64145     var arrayPush = require('./arrayPush'),
64146       isArguments = require('../lang/isArguments'),
64147       isArray = require('../lang/isArray'),
64148       isArrayLike = require('./isArrayLike'),
64149       isObjectLike = require('./isObjectLike');
64150
64151     /**
64152      * The base implementation of `_.flatten` with added support for restricting
64153      * flattening and specifying the start index.
64154      *
64155      * @private
64156      * @param {Array}
64157      *            array The array to flatten.
64158      * @param {boolean}
64159      *            [isDeep] Specify a deep flatten.
64160      * @param {boolean}
64161      *            [isStrict] Restrict flattening to arrays-like objects.
64162      * @param {Array}
64163      *            [result=[]] The initial result value.
64164      * @returns {Array} Returns the new flattened array.
64165      */
64166     function baseFlatten(array, isDeep, isStrict, result) {
64167       result || (result = []);
64168
64169       var index = -1,
64170         length = array.length;
64171
64172       while (++index < length) {
64173         var value = array[index];
64174         if (isObjectLike(value) && isArrayLike(value) &&
64175           (isStrict || isArray(value) || isArguments(value))) {
64176           if (isDeep) {
64177             // Recursively flatten arrays (susceptible to call stack limits).
64178             baseFlatten(value, isDeep, isStrict, result);
64179           } else {
64180             arrayPush(result, value);
64181           }
64182         } else if (!isStrict) {
64183           result[result.length] = value;
64184         }
64185       }
64186       return result;
64187     }
64188
64189     module.exports = baseFlatten;
64190
64191   }, {
64192     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64193     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64194     "./arrayPush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js",
64195     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64196     "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64197   }],
64198   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js": [function(require, module, exports) {
64199     var createBaseFor = require('./createBaseFor');
64200
64201     /**
64202      * The base implementation of `baseForIn` and `baseForOwn` which iterates over
64203      * `object` properties returned by `keysFunc` invoking `iteratee` for each
64204      * property. Iteratee functions may exit iteration early by explicitly returning
64205      * `false`.
64206      *
64207      * @private
64208      * @param {Object}
64209      *            object The object to iterate over.
64210      * @param {Function}
64211      *            iteratee The function invoked per iteration.
64212      * @param {Function}
64213      *            keysFunc The function to get the keys of `object`.
64214      * @returns {Object} Returns `object`.
64215      */
64216     var baseFor = createBaseFor();
64217
64218     module.exports = baseFor;
64219
64220   }, {
64221     "./createBaseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js"
64222   }],
64223   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js": [function(require, module, exports) {
64224     var baseFor = require('./baseFor'),
64225       keysIn = require('../object/keysIn');
64226
64227     /**
64228      * The base implementation of `_.forIn` without support for callback shorthands
64229      * and `this` binding.
64230      *
64231      * @private
64232      * @param {Object}
64233      *            object The object to iterate over.
64234      * @param {Function}
64235      *            iteratee The function invoked per iteration.
64236      * @returns {Object} Returns `object`.
64237      */
64238     function baseForIn(object, iteratee) {
64239       return baseFor(object, iteratee, keysIn);
64240     }
64241
64242     module.exports = baseForIn;
64243
64244   }, {
64245     "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
64246     "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64247   }],
64248   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js": [function(require, module, exports) {
64249     var baseFor = require('./baseFor'),
64250       keys = require('../object/keys');
64251
64252     /**
64253      * The base implementation of `_.forOwn` without support for callback shorthands
64254      * and `this` binding.
64255      *
64256      * @private
64257      * @param {Object}
64258      *            object The object to iterate over.
64259      * @param {Function}
64260      *            iteratee The function invoked per iteration.
64261      * @returns {Object} Returns `object`.
64262      */
64263     function baseForOwn(object, iteratee) {
64264       return baseFor(object, iteratee, keys);
64265     }
64266
64267     module.exports = baseForOwn;
64268
64269   }, {
64270     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64271     "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64272   }],
64273   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js": [function(require, module, exports) {
64274     var toObject = require('./toObject');
64275
64276     /**
64277      * The base implementation of `get` without support for string paths and default
64278      * values.
64279      *
64280      * @private
64281      * @param {Object}
64282      *            object The object to query.
64283      * @param {Array}
64284      *            path The path of the property to get.
64285      * @param {string}
64286      *            [pathKey] The key representation of path.
64287      * @returns {*} Returns the resolved value.
64288      */
64289     function baseGet(object, path, pathKey) {
64290       if (object == null) {
64291         return;
64292       }
64293       if (pathKey !== undefined && pathKey in toObject(object)) {
64294         path = [pathKey];
64295       }
64296       var index = 0,
64297         length = path.length;
64298
64299       while (object != null && index < length) {
64300         object = object[path[index++]];
64301       }
64302       return (index && index == length) ? object : undefined;
64303     }
64304
64305     module.exports = baseGet;
64306
64307   }, {
64308     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64309   }],
64310   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js": [function(require, module, exports) {
64311     var indexOfNaN = require('./indexOfNaN');
64312
64313     /**
64314      * The base implementation of `_.indexOf` without support for binary searches.
64315      *
64316      * @private
64317      * @param {Array}
64318      *            array The array to search.
64319      * @param {*}
64320      *            value The value to search for.
64321      * @param {number}
64322      *            fromIndex The index to search from.
64323      * @returns {number} Returns the index of the matched value, else `-1`.
64324      */
64325     function baseIndexOf(array, value, fromIndex) {
64326       if (value !== value) {
64327         return indexOfNaN(array, fromIndex);
64328       }
64329       var index = fromIndex - 1,
64330         length = array.length;
64331
64332       while (++index < length) {
64333         if (array[index] === value) {
64334           return index;
64335         }
64336       }
64337       return -1;
64338     }
64339
64340     module.exports = baseIndexOf;
64341
64342   }, {
64343     "./indexOfNaN": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js"
64344   }],
64345   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js": [function(require, module, exports) {
64346     var baseIsEqualDeep = require('./baseIsEqualDeep'),
64347       isObject = require('../lang/isObject'),
64348       isObjectLike = require('./isObjectLike');
64349
64350     /**
64351      * The base implementation of `_.isEqual` without support for `this` binding
64352      * `customizer` functions.
64353      *
64354      * @private
64355      * @param {*}
64356      *            value The value to compare.
64357      * @param {*}
64358      *            other The other value to compare.
64359      * @param {Function}
64360      *            [customizer] The function to customize comparing values.
64361      * @param {boolean}
64362      *            [isLoose] Specify performing partial comparisons.
64363      * @param {Array}
64364      *            [stackA] Tracks traversed `value` objects.
64365      * @param {Array}
64366      *            [stackB] Tracks traversed `other` objects.
64367      * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
64368      */
64369     function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
64370       if (value === other) {
64371         return true;
64372       }
64373       if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
64374         return value !== value && other !== other;
64375       }
64376       return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
64377     }
64378
64379     module.exports = baseIsEqual;
64380
64381   }, {
64382     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64383     "./baseIsEqualDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js",
64384     "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64385   }],
64386   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js": [function(require, module, exports) {
64387     var equalArrays = require('./equalArrays'),
64388       equalByTag = require('./equalByTag'),
64389       equalObjects = require('./equalObjects'),
64390       isArray = require('../lang/isArray'),
64391       isTypedArray = require('../lang/isTypedArray');
64392
64393     /** `Object#toString` result references. */
64394     var argsTag = '[object Arguments]',
64395       arrayTag = '[object Array]',
64396       objectTag = '[object Object]';
64397
64398     /** Used for native method references. */
64399     var objectProto = Object.prototype;
64400
64401     /** Used to check objects for own properties. */
64402     var hasOwnProperty = objectProto.hasOwnProperty;
64403
64404     /**
64405      * Used to resolve the
64406      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
64407      * of values.
64408      */
64409     var objToString = objectProto.toString;
64410
64411     /**
64412      * A specialized version of `baseIsEqual` for arrays and objects which performs
64413      * deep comparisons and tracks traversed objects enabling objects with circular
64414      * references to be compared.
64415      *
64416      * @private
64417      * @param {Object}
64418      *            object The object to compare.
64419      * @param {Object}
64420      *            other The other object to compare.
64421      * @param {Function}
64422      *            equalFunc The function to determine equivalents of values.
64423      * @param {Function}
64424      *            [customizer] The function to customize comparing objects.
64425      * @param {boolean}
64426      *            [isLoose] Specify performing partial comparisons.
64427      * @param {Array}
64428      *            [stackA=[]] Tracks traversed `value` objects.
64429      * @param {Array}
64430      *            [stackB=[]] Tracks traversed `other` objects.
64431      * @returns {boolean} Returns `true` if the objects are equivalent, else
64432      *          `false`.
64433      */
64434     function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
64435       var objIsArr = isArray(object),
64436         othIsArr = isArray(other),
64437         objTag = arrayTag,
64438         othTag = arrayTag;
64439
64440       if (!objIsArr) {
64441         objTag = objToString.call(object);
64442         if (objTag == argsTag) {
64443           objTag = objectTag;
64444         } else if (objTag != objectTag) {
64445           objIsArr = isTypedArray(object);
64446         }
64447       }
64448       if (!othIsArr) {
64449         othTag = objToString.call(other);
64450         if (othTag == argsTag) {
64451           othTag = objectTag;
64452         } else if (othTag != objectTag) {
64453           othIsArr = isTypedArray(other);
64454         }
64455       }
64456       var objIsObj = objTag == objectTag,
64457         othIsObj = othTag == objectTag,
64458         isSameTag = objTag == othTag;
64459
64460       if (isSameTag && !(objIsArr || objIsObj)) {
64461         return equalByTag(object, other, objTag);
64462       }
64463       if (!isLoose) {
64464         var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
64465           othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
64466
64467         if (objIsWrapped || othIsWrapped) {
64468           return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
64469         }
64470       }
64471       if (!isSameTag) {
64472         return false;
64473       }
64474       // Assume cyclic values are equal.
64475       // For more information on detecting circular references see
64476       // https://es5.github.io/#JO.
64477       stackA || (stackA = []);
64478       stackB || (stackB = []);
64479
64480       var length = stackA.length;
64481       while (length--) {
64482         if (stackA[length] == object) {
64483           return stackB[length] == other;
64484         }
64485       }
64486       // Add `object` and `other` to the stack of traversed objects.
64487       stackA.push(object);
64488       stackB.push(other);
64489
64490       var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
64491
64492       stackA.pop();
64493       stackB.pop();
64494
64495       return result;
64496     }
64497
64498     module.exports = baseIsEqualDeep;
64499
64500   }, {
64501     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64502     "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64503     "./equalArrays": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js",
64504     "./equalByTag": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js",
64505     "./equalObjects": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js"
64506   }],
64507   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js": [function(require, module, exports) {
64508     var baseIsEqual = require('./baseIsEqual'),
64509       toObject = require('./toObject');
64510
64511     /**
64512      * The base implementation of `_.isMatch` without support for callback
64513      * shorthands and `this` binding.
64514      *
64515      * @private
64516      * @param {Object}
64517      *            object The object to inspect.
64518      * @param {Array}
64519      *            matchData The propery names, values, and compare flags to match.
64520      * @param {Function}
64521      *            [customizer] The function to customize comparing objects.
64522      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
64523      */
64524     function baseIsMatch(object, matchData, customizer) {
64525       var index = matchData.length,
64526         length = index,
64527         noCustomizer = !customizer;
64528
64529       if (object == null) {
64530         return !length;
64531       }
64532       object = toObject(object);
64533       while (index--) {
64534         var data = matchData[index];
64535         if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
64536           return false;
64537         }
64538       }
64539       while (++index < length) {
64540         data = matchData[index];
64541         var key = data[0],
64542           objValue = object[key],
64543           srcValue = data[1];
64544
64545         if (noCustomizer && data[2]) {
64546           if (objValue === undefined && !(key in object)) {
64547             return false;
64548           }
64549         } else {
64550           var result = customizer ? customizer(objValue, srcValue, key) : undefined;
64551           if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
64552             return false;
64553           }
64554         }
64555       }
64556       return true;
64557     }
64558
64559     module.exports = baseIsMatch;
64560
64561   }, {
64562     "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64563     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64564   }],
64565   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js": [function(require, module, exports) {
64566     /**
64567      * The function whose prototype all chaining wrappers inherit from.
64568      *
64569      * @private
64570      */
64571     function baseLodash() {
64572       // No operation performed.
64573     }
64574
64575     module.exports = baseLodash;
64576
64577   }, {}],
64578   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js": [function(require, module, exports) {
64579     var baseEach = require('./baseEach'),
64580       isArrayLike = require('./isArrayLike');
64581
64582     /**
64583      * The base implementation of `_.map` without support for callback shorthands
64584      * and `this` binding.
64585      *
64586      * @private
64587      * @param {Array|Object|string}
64588      *            collection The collection to iterate over.
64589      * @param {Function}
64590      *            iteratee The function invoked per iteration.
64591      * @returns {Array} Returns the new mapped array.
64592      */
64593     function baseMap(collection, iteratee) {
64594       var index = -1,
64595         result = isArrayLike(collection) ? Array(collection.length) : [];
64596
64597       baseEach(collection, function(value, key, collection) {
64598         result[++index] = iteratee(value, key, collection);
64599       });
64600       return result;
64601     }
64602
64603     module.exports = baseMap;
64604
64605   }, {
64606     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
64607     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64608   }],
64609   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js": [function(require, module, exports) {
64610     var baseIsMatch = require('./baseIsMatch'),
64611       getMatchData = require('./getMatchData'),
64612       toObject = require('./toObject');
64613
64614     /**
64615      * The base implementation of `_.matches` which does not clone `source`.
64616      *
64617      * @private
64618      * @param {Object}
64619      *            source The object of property values to match.
64620      * @returns {Function} Returns the new function.
64621      */
64622     function baseMatches(source) {
64623       var matchData = getMatchData(source);
64624       if (matchData.length == 1 && matchData[0][2]) {
64625         var key = matchData[0][0],
64626           value = matchData[0][1];
64627
64628         return function(object) {
64629           if (object == null) {
64630             return false;
64631           }
64632           return object[key] === value && (value !== undefined || (key in toObject(object)));
64633         };
64634       }
64635       return function(object) {
64636         return baseIsMatch(object, matchData);
64637       };
64638     }
64639
64640     module.exports = baseMatches;
64641
64642   }, {
64643     "./baseIsMatch": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js",
64644     "./getMatchData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js",
64645     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64646   }],
64647   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js": [function(require, module, exports) {
64648     var baseGet = require('./baseGet'),
64649       baseIsEqual = require('./baseIsEqual'),
64650       baseSlice = require('./baseSlice'),
64651       isArray = require('../lang/isArray'),
64652       isKey = require('./isKey'),
64653       isStrictComparable = require('./isStrictComparable'),
64654       last = require('../array/last'),
64655       toObject = require('./toObject'),
64656       toPath = require('./toPath');
64657
64658     /**
64659      * The base implementation of `_.matchesProperty` which does not clone
64660      * `srcValue`.
64661      *
64662      * @private
64663      * @param {string}
64664      *            path The path of the property to get.
64665      * @param {*}
64666      *            srcValue The value to compare.
64667      * @returns {Function} Returns the new function.
64668      */
64669     function baseMatchesProperty(path, srcValue) {
64670       var isArr = isArray(path),
64671         isCommon = isKey(path) && isStrictComparable(srcValue),
64672         pathKey = (path + '');
64673
64674       path = toPath(path);
64675       return function(object) {
64676         if (object == null) {
64677           return false;
64678         }
64679         var key = pathKey;
64680         object = toObject(object);
64681         if ((isArr || !isCommon) && !(key in object)) {
64682           object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
64683           if (object == null) {
64684             return false;
64685           }
64686           key = last(path);
64687           object = toObject(object);
64688         }
64689         return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
64690       };
64691     }
64692
64693     module.exports = baseMatchesProperty;
64694
64695   }, {
64696     "../array/last": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js",
64697     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64698     "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64699     "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64700     "./baseSlice": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js",
64701     "./isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js",
64702     "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js",
64703     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
64704     "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64705   }],
64706   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js": [function(require, module, exports) {
64707     var arrayEach = require('./arrayEach'),
64708       baseMergeDeep = require('./baseMergeDeep'),
64709       isArray = require('../lang/isArray'),
64710       isArrayLike = require('./isArrayLike'),
64711       isObject = require('../lang/isObject'),
64712       isObjectLike = require('./isObjectLike'),
64713       isTypedArray = require('../lang/isTypedArray'),
64714       keys = require('../object/keys');
64715
64716     /**
64717      * The base implementation of `_.merge` without support for argument juggling,
64718      * multiple sources, and `this` binding `customizer` functions.
64719      *
64720      * @private
64721      * @param {Object}
64722      *            object The destination object.
64723      * @param {Object}
64724      *            source The source object.
64725      * @param {Function}
64726      *            [customizer] The function to customize merged values.
64727      * @param {Array}
64728      *            [stackA=[]] Tracks traversed source objects.
64729      * @param {Array}
64730      *            [stackB=[]] Associates values with source counterparts.
64731      * @returns {Object} Returns `object`.
64732      */
64733     function baseMerge(object, source, customizer, stackA, stackB) {
64734       if (!isObject(object)) {
64735         return object;
64736       }
64737       var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
64738         props = isSrcArr ? undefined : keys(source);
64739
64740       arrayEach(props || source, function(srcValue, key) {
64741         if (props) {
64742           key = srcValue;
64743           srcValue = source[key];
64744         }
64745         if (isObjectLike(srcValue)) {
64746           stackA || (stackA = []);
64747           stackB || (stackB = []);
64748           baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
64749         } else {
64750           var value = object[key],
64751             result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64752             isCommon = result === undefined;
64753
64754           if (isCommon) {
64755             result = srcValue;
64756           }
64757           if ((result !== undefined || (isSrcArr && !(key in object))) &&
64758             (isCommon || (result === result ? (result !== value) : (value === value)))) {
64759             object[key] = result;
64760           }
64761         }
64762       });
64763       return object;
64764     }
64765
64766     module.exports = baseMerge;
64767
64768   }, {
64769     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64770     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64771     "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64772     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64773     "./arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
64774     "./baseMergeDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js",
64775     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64776     "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64777   }],
64778   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js": [function(require, module, exports) {
64779     var arrayCopy = require('./arrayCopy'),
64780       isArguments = require('../lang/isArguments'),
64781       isArray = require('../lang/isArray'),
64782       isArrayLike = require('./isArrayLike'),
64783       isPlainObject = require('../lang/isPlainObject'),
64784       isTypedArray = require('../lang/isTypedArray'),
64785       toPlainObject = require('../lang/toPlainObject');
64786
64787     /**
64788      * A specialized version of `baseMerge` for arrays and objects which performs
64789      * deep merges and tracks traversed objects enabling objects with circular
64790      * references to be merged.
64791      *
64792      * @private
64793      * @param {Object}
64794      *            object The destination object.
64795      * @param {Object}
64796      *            source The source object.
64797      * @param {string}
64798      *            key The key of the value to merge.
64799      * @param {Function}
64800      *            mergeFunc The function to merge values.
64801      * @param {Function}
64802      *            [customizer] The function to customize merged values.
64803      * @param {Array}
64804      *            [stackA=[]] Tracks traversed source objects.
64805      * @param {Array}
64806      *            [stackB=[]] Associates values with source counterparts.
64807      * @returns {boolean} Returns `true` if the objects are equivalent, else
64808      *          `false`.
64809      */
64810     function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
64811       var length = stackA.length,
64812         srcValue = source[key];
64813
64814       while (length--) {
64815         if (stackA[length] == srcValue) {
64816           object[key] = stackB[length];
64817           return;
64818         }
64819       }
64820       var value = object[key],
64821         result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64822         isCommon = result === undefined;
64823
64824       if (isCommon) {
64825         result = srcValue;
64826         if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
64827           result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
64828         } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
64829           result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
64830         } else {
64831           isCommon = false;
64832         }
64833       }
64834       // Add the source value to the stack of traversed objects and associate
64835       // it with its merged value.
64836       stackA.push(srcValue);
64837       stackB.push(result);
64838
64839       if (isCommon) {
64840         // Recursively merge objects and arrays (susceptible to call stack limits).
64841         object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
64842       } else if (result === result ? (result !== value) : (value === value)) {
64843         object[key] = result;
64844       }
64845     }
64846
64847     module.exports = baseMergeDeep;
64848
64849   }, {
64850     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64851     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64852     "../lang/isPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js",
64853     "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64854     "../lang/toPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js",
64855     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
64856     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64857   }],
64858   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js": [function(require, module, exports) {
64859     /**
64860      * The base implementation of `_.property` without support for deep paths.
64861      *
64862      * @private
64863      * @param {string}
64864      *            key The key of the property to get.
64865      * @returns {Function} Returns the new function.
64866      */
64867     function baseProperty(key) {
64868       return function(object) {
64869         return object == null ? undefined : object[key];
64870       };
64871     }
64872
64873     module.exports = baseProperty;
64874
64875   }, {}],
64876   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js": [function(require, module, exports) {
64877     var baseGet = require('./baseGet'),
64878       toPath = require('./toPath');
64879
64880     /**
64881      * A specialized version of `baseProperty` which supports deep paths.
64882      *
64883      * @private
64884      * @param {Array|string}
64885      *            path The path of the property to get.
64886      * @returns {Function} Returns the new function.
64887      */
64888     function basePropertyDeep(path) {
64889       var pathKey = (path + '');
64890       path = toPath(path);
64891       return function(object) {
64892         return baseGet(object, path, pathKey);
64893       };
64894     }
64895
64896     module.exports = basePropertyDeep;
64897
64898   }, {
64899     "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64900     "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64901   }],
64902   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js": [function(require, module, exports) {
64903     /**
64904      * The base implementation of `_.reduce` and `_.reduceRight` without support for
64905      * callback shorthands and `this` binding, which iterates over `collection`
64906      * using the provided `eachFunc`.
64907      *
64908      * @private
64909      * @param {Array|Object|string}
64910      *            collection The collection to iterate over.
64911      * @param {Function}
64912      *            iteratee The function invoked per iteration.
64913      * @param {*}
64914      *            accumulator The initial value.
64915      * @param {boolean}
64916      *            initFromCollection Specify using the first or last element of
64917      *            `collection` as the initial value.
64918      * @param {Function}
64919      *            eachFunc The function to iterate over `collection`.
64920      * @returns {*} Returns the accumulated value.
64921      */
64922     function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
64923       eachFunc(collection, function(value, index, collection) {
64924         accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
64925       });
64926       return accumulator;
64927     }
64928
64929     module.exports = baseReduce;
64930
64931   }, {}],
64932   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js": [function(require, module, exports) {
64933     var identity = require('../utility/identity'),
64934       metaMap = require('./metaMap');
64935
64936     /**
64937      * The base implementation of `setData` without support for hot loop detection.
64938      *
64939      * @private
64940      * @param {Function}
64941      *            func The function to associate metadata with.
64942      * @param {*}
64943      *            data The metadata.
64944      * @returns {Function} Returns `func`.
64945      */
64946     var baseSetData = !metaMap ? identity : function(func, data) {
64947       metaMap.set(func, data);
64948       return func;
64949     };
64950
64951     module.exports = baseSetData;
64952
64953   }, {
64954     "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
64955     "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
64956   }],
64957   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js": [function(require, module, exports) {
64958     /**
64959      * The base implementation of `_.slice` without an iteratee call guard.
64960      *
64961      * @private
64962      * @param {Array}
64963      *            array The array to slice.
64964      * @param {number}
64965      *            [start=0] The start position.
64966      * @param {number}
64967      *            [end=array.length] The end position.
64968      * @returns {Array} Returns the slice of `array`.
64969      */
64970     function baseSlice(array, start, end) {
64971       var index = -1,
64972         length = array.length;
64973
64974       start = start == null ? 0 : (+start || 0);
64975       if (start < 0) {
64976         start = -start > length ? 0 : (length + start);
64977       }
64978       end = (end === undefined || end > length) ? length : (+end || 0);
64979       if (end < 0) {
64980         end += length;
64981       }
64982       length = start > end ? 0 : ((end - start) >>> 0);
64983       start >>>= 0;
64984
64985       var result = Array(length);
64986       while (++index < length) {
64987         result[index] = array[index + start];
64988       }
64989       return result;
64990     }
64991
64992     module.exports = baseSlice;
64993
64994   }, {}],
64995   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js": [function(require, module, exports) {
64996     var baseEach = require('./baseEach');
64997
64998     /**
64999      * The base implementation of `_.some` without support for callback shorthands
65000      * and `this` binding.
65001      *
65002      * @private
65003      * @param {Array|Object|string}
65004      *            collection The collection to iterate over.
65005      * @param {Function}
65006      *            predicate The function invoked per iteration.
65007      * @returns {boolean} Returns `true` if any element passes the predicate check,
65008      *          else `false`.
65009      */
65010     function baseSome(collection, predicate) {
65011       var result;
65012
65013       baseEach(collection, function(value, index, collection) {
65014         result = predicate(value, index, collection);
65015         return !result;
65016       });
65017       return !!result;
65018     }
65019
65020     module.exports = baseSome;
65021
65022   }, {
65023     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65024   }],
65025   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js": [function(require, module, exports) {
65026     /**
65027      * The base implementation of `_.sortBy` which uses `comparer` to define the
65028      * sort order of `array` and replaces criteria objects with their corresponding
65029      * values.
65030      *
65031      * @private
65032      * @param {Array}
65033      *            array The array to sort.
65034      * @param {Function}
65035      *            comparer The function to define sort order.
65036      * @returns {Array} Returns `array`.
65037      */
65038     function baseSortBy(array, comparer) {
65039       var length = array.length;
65040
65041       array.sort(comparer);
65042       while (length--) {
65043         array[length] = array[length].value;
65044       }
65045       return array;
65046     }
65047
65048     module.exports = baseSortBy;
65049
65050   }, {}],
65051   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js": [function(require, module, exports) {
65052     /**
65053      * Converts `value` to a string if it's not one. An empty string is returned for
65054      * `null` or `undefined` values.
65055      *
65056      * @private
65057      * @param {*}
65058      *            value The value to process.
65059      * @returns {string} Returns the string.
65060      */
65061     function baseToString(value) {
65062       return value == null ? '' : (value + '');
65063     }
65064
65065     module.exports = baseToString;
65066
65067   }, {}],
65068   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js": [function(require, module, exports) {
65069     var baseIndexOf = require('./baseIndexOf'),
65070       cacheIndexOf = require('./cacheIndexOf'),
65071       createCache = require('./createCache');
65072
65073     /** Used as the size to enable large array optimizations. */
65074     var LARGE_ARRAY_SIZE = 200;
65075
65076     /**
65077      * The base implementation of `_.uniq` without support for callback shorthands
65078      * and `this` binding.
65079      *
65080      * @private
65081      * @param {Array}
65082      *            array The array to inspect.
65083      * @param {Function}
65084      *            [iteratee] The function invoked per iteration.
65085      * @returns {Array} Returns the new duplicate free array.
65086      */
65087     function baseUniq(array, iteratee) {
65088       var index = -1,
65089         indexOf = baseIndexOf,
65090         length = array.length,
65091         isCommon = true,
65092         isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
65093         seen = isLarge ? createCache() : null,
65094         result = [];
65095
65096       if (seen) {
65097         indexOf = cacheIndexOf;
65098         isCommon = false;
65099       } else {
65100         isLarge = false;
65101         seen = iteratee ? [] : result;
65102       }
65103       outer:
65104         while (++index < length) {
65105           var value = array[index],
65106             computed = iteratee ? iteratee(value, index, array) : value;
65107
65108           if (isCommon && value === value) {
65109             var seenIndex = seen.length;
65110             while (seenIndex--) {
65111               if (seen[seenIndex] === computed) {
65112                 continue outer;
65113               }
65114             }
65115             if (iteratee) {
65116               seen.push(computed);
65117             }
65118             result.push(value);
65119           } else if (indexOf(seen, computed, 0) < 0) {
65120             if (iteratee || isLarge) {
65121               seen.push(computed);
65122             }
65123             result.push(value);
65124           }
65125         }
65126       return result;
65127     }
65128
65129     module.exports = baseUniq;
65130
65131   }, {
65132     "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
65133     "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
65134     "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
65135   }],
65136   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js": [function(require, module, exports) {
65137     /**
65138      * The base implementation of `_.values` and `_.valuesIn` which creates an array
65139      * of `object` property values corresponding to the property names of `props`.
65140      *
65141      * @private
65142      * @param {Object}
65143      *            object The object to query.
65144      * @param {Array}
65145      *            props The property names to get values for.
65146      * @returns {Object} Returns the array of property values.
65147      */
65148     function baseValues(object, props) {
65149       var index = -1,
65150         length = props.length,
65151         result = Array(length);
65152
65153       while (++index < length) {
65154         result[index] = object[props[index]];
65155       }
65156       return result;
65157     }
65158
65159     module.exports = baseValues;
65160
65161   }, {}],
65162   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js": [function(require, module, exports) {
65163     var identity = require('../utility/identity');
65164
65165     /**
65166      * A specialized version of `baseCallback` which only supports `this` binding
65167      * and specifying the number of arguments to provide to `func`.
65168      *
65169      * @private
65170      * @param {Function}
65171      *            func The function to bind.
65172      * @param {*}
65173      *            thisArg The `this` binding of `func`.
65174      * @param {number}
65175      *            [argCount] The number of arguments to provide to `func`.
65176      * @returns {Function} Returns the callback.
65177      */
65178     function bindCallback(func, thisArg, argCount) {
65179       if (typeof func != 'function') {
65180         return identity;
65181       }
65182       if (thisArg === undefined) {
65183         return func;
65184       }
65185       switch (argCount) {
65186         case 1:
65187           return function(value) {
65188             return func.call(thisArg, value);
65189           };
65190         case 3:
65191           return function(value, index, collection) {
65192             return func.call(thisArg, value, index, collection);
65193           };
65194         case 4:
65195           return function(accumulator, value, index, collection) {
65196             return func.call(thisArg, accumulator, value, index, collection);
65197           };
65198         case 5:
65199           return function(value, other, key, object, source) {
65200             return func.call(thisArg, value, other, key, object, source);
65201           };
65202       }
65203       return function() {
65204         return func.apply(thisArg, arguments);
65205       };
65206     }
65207
65208     module.exports = bindCallback;
65209
65210   }, {
65211     "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js"
65212   }],
65213   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js": [function(require, module, exports) {
65214     var isObject = require('../lang/isObject');
65215
65216     /**
65217      * Checks if `value` is in `cache` mimicking the return signature of `_.indexOf`
65218      * by returning `0` if the value is found, else `-1`.
65219      *
65220      * @private
65221      * @param {Object}
65222      *            cache The cache to search.
65223      * @param {*}
65224      *            value The value to search for.
65225      * @returns {number} Returns `0` if `value` is found, else `-1`.
65226      */
65227     function cacheIndexOf(cache, value) {
65228       var data = cache.data,
65229         result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
65230
65231       return result ? 0 : -1;
65232     }
65233
65234     module.exports = cacheIndexOf;
65235
65236   }, {
65237     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65238   }],
65239   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js": [function(require, module, exports) {
65240     var isObject = require('../lang/isObject');
65241
65242     /**
65243      * Adds `value` to the cache.
65244      *
65245      * @private
65246      * @name push
65247      * @memberOf SetCache
65248      * @param {*}
65249      *            value The value to cache.
65250      */
65251     function cachePush(value) {
65252       var data = this.data;
65253       if (typeof value == 'string' || isObject(value)) {
65254         data.set.add(value);
65255       } else {
65256         data.hash[value] = true;
65257       }
65258     }
65259
65260     module.exports = cachePush;
65261
65262   }, {
65263     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65264   }],
65265   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js": [function(require, module, exports) {
65266     var baseCompareAscending = require('./baseCompareAscending');
65267
65268     /**
65269      * Used by `_.sortBy` to compare transformed elements of a collection and stable
65270      * sort them in ascending order.
65271      *
65272      * @private
65273      * @param {Object}
65274      *            object The object to compare.
65275      * @param {Object}
65276      *            other The other object to compare.
65277      * @returns {number} Returns the sort order indicator for `object`.
65278      */
65279     function compareAscending(object, other) {
65280       return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
65281     }
65282
65283     module.exports = compareAscending;
65284
65285   }, {
65286     "./baseCompareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js"
65287   }],
65288   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js": [function(require, module, exports) {
65289     /*
65290      * Native method references for those with the same name as other `lodash`
65291      * methods.
65292      */
65293     var nativeMax = Math.max;
65294
65295     /**
65296      * Creates an array that is the composition of partially applied arguments,
65297      * placeholders, and provided arguments into a single array of arguments.
65298      *
65299      * @private
65300      * @param {Array|Object}
65301      *            args The provided arguments.
65302      * @param {Array}
65303      *            partials The arguments to prepend to those provided.
65304      * @param {Array}
65305      *            holders The `partials` placeholder indexes.
65306      * @returns {Array} Returns the new array of composed arguments.
65307      */
65308     function composeArgs(args, partials, holders) {
65309       var holdersLength = holders.length,
65310         argsIndex = -1,
65311         argsLength = nativeMax(args.length - holdersLength, 0),
65312         leftIndex = -1,
65313         leftLength = partials.length,
65314         result = Array(leftLength + argsLength);
65315
65316       while (++leftIndex < leftLength) {
65317         result[leftIndex] = partials[leftIndex];
65318       }
65319       while (++argsIndex < holdersLength) {
65320         result[holders[argsIndex]] = args[argsIndex];
65321       }
65322       while (argsLength--) {
65323         result[leftIndex++] = args[argsIndex++];
65324       }
65325       return result;
65326     }
65327
65328     module.exports = composeArgs;
65329
65330   }, {}],
65331   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js": [function(require, module, exports) {
65332     /*
65333      * Native method references for those with the same name as other `lodash`
65334      * methods.
65335      */
65336     var nativeMax = Math.max;
65337
65338     /**
65339      * This function is like `composeArgs` except that the arguments composition is
65340      * tailored for `_.partialRight`.
65341      *
65342      * @private
65343      * @param {Array|Object}
65344      *            args The provided arguments.
65345      * @param {Array}
65346      *            partials The arguments to append to those provided.
65347      * @param {Array}
65348      *            holders The `partials` placeholder indexes.
65349      * @returns {Array} Returns the new array of composed arguments.
65350      */
65351     function composeArgsRight(args, partials, holders) {
65352       var holdersIndex = -1,
65353         holdersLength = holders.length,
65354         argsIndex = -1,
65355         argsLength = nativeMax(args.length - holdersLength, 0),
65356         rightIndex = -1,
65357         rightLength = partials.length,
65358         result = Array(argsLength + rightLength);
65359
65360       while (++argsIndex < argsLength) {
65361         result[argsIndex] = args[argsIndex];
65362       }
65363       var offset = argsIndex;
65364       while (++rightIndex < rightLength) {
65365         result[offset + rightIndex] = partials[rightIndex];
65366       }
65367       while (++holdersIndex < holdersLength) {
65368         result[offset + holders[holdersIndex]] = args[argsIndex++];
65369       }
65370       return result;
65371     }
65372
65373     module.exports = composeArgsRight;
65374
65375   }, {}],
65376   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js": [function(require, module, exports) {
65377     var baseCallback = require('./baseCallback'),
65378       baseEach = require('./baseEach'),
65379       isArray = require('../lang/isArray');
65380
65381     /**
65382      * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
65383      *
65384      * @private
65385      * @param {Function}
65386      *            setter The function to set keys and values of the accumulator
65387      *            object.
65388      * @param {Function}
65389      *            [initializer] The function to initialize the accumulator object.
65390      * @returns {Function} Returns the new aggregator function.
65391      */
65392     function createAggregator(setter, initializer) {
65393       return function(collection, iteratee, thisArg) {
65394         var result = initializer ? initializer() : {};
65395         iteratee = baseCallback(iteratee, thisArg, 3);
65396
65397         if (isArray(collection)) {
65398           var index = -1,
65399             length = collection.length;
65400
65401           while (++index < length) {
65402             var value = collection[index];
65403             setter(result, value, iteratee(value, index, collection), collection);
65404           }
65405         } else {
65406           baseEach(collection, function(value, key, collection) {
65407             setter(result, value, iteratee(value, key, collection), collection);
65408           });
65409         }
65410         return result;
65411       };
65412     }
65413
65414     module.exports = createAggregator;
65415
65416   }, {
65417     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65418     "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65419     "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65420   }],
65421   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js": [function(require, module, exports) {
65422     var bindCallback = require('./bindCallback'),
65423       isIterateeCall = require('./isIterateeCall'),
65424       restParam = require('../function/restParam');
65425
65426     /**
65427      * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
65428      *
65429      * @private
65430      * @param {Function}
65431      *            assigner The function to assign values.
65432      * @returns {Function} Returns the new assigner function.
65433      */
65434     function createAssigner(assigner) {
65435       return restParam(function(object, sources) {
65436         var index = -1,
65437           length = object == null ? 0 : sources.length,
65438           customizer = length > 2 ? sources[length - 2] : undefined,
65439           guard = length > 2 ? sources[2] : undefined,
65440           thisArg = length > 1 ? sources[length - 1] : undefined;
65441
65442         if (typeof customizer == 'function') {
65443           customizer = bindCallback(customizer, thisArg, 5);
65444           length -= 2;
65445         } else {
65446           customizer = typeof thisArg == 'function' ? thisArg : undefined;
65447           length -= (customizer ? 1 : 0);
65448         }
65449         if (guard && isIterateeCall(sources[0], sources[1], guard)) {
65450           customizer = length < 3 ? undefined : customizer;
65451           length = 1;
65452         }
65453         while (++index < length) {
65454           var source = sources[index];
65455           if (source) {
65456             assigner(object, source, customizer);
65457           }
65458         }
65459         return object;
65460       });
65461     }
65462
65463     module.exports = createAssigner;
65464
65465   }, {
65466     "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
65467     "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
65468     "./isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
65469   }],
65470   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js": [function(require, module, exports) {
65471     var getLength = require('./getLength'),
65472       isLength = require('./isLength'),
65473       toObject = require('./toObject');
65474
65475     /**
65476      * Creates a `baseEach` or `baseEachRight` function.
65477      *
65478      * @private
65479      * @param {Function}
65480      *            eachFunc The function to iterate over a collection.
65481      * @param {boolean}
65482      *            [fromRight] Specify iterating from right to left.
65483      * @returns {Function} Returns the new base function.
65484      */
65485     function createBaseEach(eachFunc, fromRight) {
65486       return function(collection, iteratee) {
65487         var length = collection ? getLength(collection) : 0;
65488         if (!isLength(length)) {
65489           return eachFunc(collection, iteratee);
65490         }
65491         var index = fromRight ? length : -1,
65492           iterable = toObject(collection);
65493
65494         while ((fromRight ? index-- : ++index < length)) {
65495           if (iteratee(iterable[index], index, iterable) === false) {
65496             break;
65497           }
65498         }
65499         return collection;
65500       };
65501     }
65502
65503     module.exports = createBaseEach;
65504
65505   }, {
65506     "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
65507     "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
65508     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65509   }],
65510   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js": [function(require, module, exports) {
65511     var toObject = require('./toObject');
65512
65513     /**
65514      * Creates a base function for `_.forIn` or `_.forInRight`.
65515      *
65516      * @private
65517      * @param {boolean}
65518      *            [fromRight] Specify iterating from right to left.
65519      * @returns {Function} Returns the new base function.
65520      */
65521     function createBaseFor(fromRight) {
65522       return function(object, iteratee, keysFunc) {
65523         var iterable = toObject(object),
65524           props = keysFunc(object),
65525           length = props.length,
65526           index = fromRight ? length : -1;
65527
65528         while ((fromRight ? index-- : ++index < length)) {
65529           var key = props[index];
65530           if (iteratee(iterable[key], key, iterable) === false) {
65531             break;
65532           }
65533         }
65534         return object;
65535       };
65536     }
65537
65538     module.exports = createBaseFor;
65539
65540   }, {
65541     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65542   }],
65543   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js": [function(require, module, exports) {
65544     (function(global) {
65545       var createCtorWrapper = require('./createCtorWrapper');
65546
65547       /**
65548        * Creates a function that wraps `func` and invokes it with the `this` binding
65549        * of `thisArg`.
65550        *
65551        * @private
65552        * @param {Function}
65553        *            func The function to bind.
65554        * @param {*}
65555        *            [thisArg] The `this` binding of `func`.
65556        * @returns {Function} Returns the new bound function.
65557        */
65558       function createBindWrapper(func, thisArg) {
65559         var Ctor = createCtorWrapper(func);
65560
65561         function wrapper() {
65562           var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65563           return fn.apply(thisArg, arguments);
65564         }
65565         return wrapper;
65566       }
65567
65568       module.exports = createBindWrapper;
65569
65570     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65571   }, {
65572     "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65573   }],
65574   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js": [function(require, module, exports) {
65575     (function(global) {
65576       var SetCache = require('./SetCache'),
65577         getNative = require('./getNative');
65578
65579       /** Native method references. */
65580       var Set = getNative(global, 'Set');
65581
65582       /*
65583        * Native method references for those with the same name as other `lodash`
65584        * methods.
65585        */
65586       var nativeCreate = getNative(Object, 'create');
65587
65588       /**
65589        * Creates a `Set` cache object to optimize linear searches of large arrays.
65590        *
65591        * @private
65592        * @param {Array}
65593        *            [values] The values to cache.
65594        * @returns {null|Object} Returns the new cache object if `Set` is supported,
65595        *          else `null`.
65596        */
65597       function createCache(values) {
65598         return (nativeCreate && Set) ? new SetCache(values) : null;
65599       }
65600
65601       module.exports = createCache;
65602
65603     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65604   }, {
65605     "./SetCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js",
65606     "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
65607   }],
65608   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js": [function(require, module, exports) {
65609     var baseCreate = require('./baseCreate'),
65610       isObject = require('../lang/isObject');
65611
65612     /**
65613      * Creates a function that produces an instance of `Ctor` regardless of whether
65614      * it was invoked as part of a `new` expression or by `call` or `apply`.
65615      *
65616      * @private
65617      * @param {Function}
65618      *            Ctor The constructor to wrap.
65619      * @returns {Function} Returns the new wrapped function.
65620      */
65621     function createCtorWrapper(Ctor) {
65622       return function() {
65623         // Use a `switch` statement to work with class constructors.
65624         // See
65625         // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
65626         // for more details.
65627         var args = arguments;
65628         switch (args.length) {
65629           case 0:
65630             return new Ctor;
65631           case 1:
65632             return new Ctor(args[0]);
65633           case 2:
65634             return new Ctor(args[0], args[1]);
65635           case 3:
65636             return new Ctor(args[0], args[1], args[2]);
65637           case 4:
65638             return new Ctor(args[0], args[1], args[2], args[3]);
65639           case 5:
65640             return new Ctor(args[0], args[1], args[2], args[3], args[4]);
65641           case 6:
65642             return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
65643           case 7:
65644             return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
65645         }
65646         var thisBinding = baseCreate(Ctor.prototype),
65647           result = Ctor.apply(thisBinding, args);
65648
65649         // Mimic the constructor's `return` behavior.
65650         // See https://es5.github.io/#x13.2.2 for more details.
65651         return isObject(result) ? result : thisBinding;
65652       };
65653     }
65654
65655     module.exports = createCtorWrapper;
65656
65657   }, {
65658     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
65659     "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js"
65660   }],
65661   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js": [function(require, module, exports) {
65662     var baseCallback = require('./baseCallback'),
65663       baseFind = require('./baseFind'),
65664       baseFindIndex = require('./baseFindIndex'),
65665       isArray = require('../lang/isArray');
65666
65667     /**
65668      * Creates a `_.find` or `_.findLast` function.
65669      *
65670      * @private
65671      * @param {Function}
65672      *            eachFunc The function to iterate over a collection.
65673      * @param {boolean}
65674      *            [fromRight] Specify iterating from right to left.
65675      * @returns {Function} Returns the new find function.
65676      */
65677     function createFind(eachFunc, fromRight) {
65678       return function(collection, predicate, thisArg) {
65679         predicate = baseCallback(predicate, thisArg, 3);
65680         if (isArray(collection)) {
65681           var index = baseFindIndex(collection, predicate, fromRight);
65682           return index > -1 ? collection[index] : undefined;
65683         }
65684         return baseFind(collection, predicate, eachFunc);
65685       };
65686     }
65687
65688     module.exports = createFind;
65689
65690   }, {
65691     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65692     "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65693     "./baseFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js",
65694     "./baseFindIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js"
65695   }],
65696   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js": [function(require, module, exports) {
65697     var bindCallback = require('./bindCallback'),
65698       isArray = require('../lang/isArray');
65699
65700     /**
65701      * Creates a function for `_.forEach` or `_.forEachRight`.
65702      *
65703      * @private
65704      * @param {Function}
65705      *            arrayFunc The function to iterate over an array.
65706      * @param {Function}
65707      *            eachFunc The function to iterate over a collection.
65708      * @returns {Function} Returns the new each function.
65709      */
65710     function createForEach(arrayFunc, eachFunc) {
65711       return function(collection, iteratee, thisArg) {
65712         return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
65713       };
65714     }
65715
65716     module.exports = createForEach;
65717
65718   }, {
65719     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65720     "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
65721   }],
65722   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js": [function(require, module, exports) {
65723     (function(global) {
65724       var arrayCopy = require('./arrayCopy'),
65725         composeArgs = require('./composeArgs'),
65726         composeArgsRight = require('./composeArgsRight'),
65727         createCtorWrapper = require('./createCtorWrapper'),
65728         isLaziable = require('./isLaziable'),
65729         reorder = require('./reorder'),
65730         replaceHolders = require('./replaceHolders'),
65731         setData = require('./setData');
65732
65733       /** Used to compose bitmasks for wrapper metadata. */
65734       var BIND_FLAG = 1,
65735         BIND_KEY_FLAG = 2,
65736         CURRY_BOUND_FLAG = 4,
65737         CURRY_FLAG = 8,
65738         CURRY_RIGHT_FLAG = 16,
65739         PARTIAL_FLAG = 32,
65740         PARTIAL_RIGHT_FLAG = 64,
65741         ARY_FLAG = 128;
65742
65743       /*
65744        * Native method references for those with the same name as other `lodash`
65745        * methods.
65746        */
65747       var nativeMax = Math.max;
65748
65749       /**
65750        * Creates a function that wraps `func` and invokes it with optional `this`
65751        * binding of, partial application, and currying.
65752        *
65753        * @private
65754        * @param {Function|string}
65755        *            func The function or method name to reference.
65756        * @param {number}
65757        *            bitmask The bitmask of flags. See `createWrapper` for more
65758        *            details.
65759        * @param {*}
65760        *            [thisArg] The `this` binding of `func`.
65761        * @param {Array}
65762        *            [partials] The arguments to prepend to those provided to the new
65763        *            function.
65764        * @param {Array}
65765        *            [holders] The `partials` placeholder indexes.
65766        * @param {Array}
65767        *            [partialsRight] The arguments to append to those provided to the
65768        *            new function.
65769        * @param {Array}
65770        *            [holdersRight] The `partialsRight` placeholder indexes.
65771        * @param {Array}
65772        *            [argPos] The argument positions of the new function.
65773        * @param {number}
65774        *            [ary] The arity cap of `func`.
65775        * @param {number}
65776        *            [arity] The arity of `func`.
65777        * @returns {Function} Returns the new wrapped function.
65778        */
65779       function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
65780         var isAry = bitmask & ARY_FLAG,
65781           isBind = bitmask & BIND_FLAG,
65782           isBindKey = bitmask & BIND_KEY_FLAG,
65783           isCurry = bitmask & CURRY_FLAG,
65784           isCurryBound = bitmask & CURRY_BOUND_FLAG,
65785           isCurryRight = bitmask & CURRY_RIGHT_FLAG,
65786           Ctor = isBindKey ? undefined : createCtorWrapper(func);
65787
65788         function wrapper() {
65789           // Avoid `arguments` object use disqualifying optimizations by
65790           // converting it to an array before providing it to other functions.
65791           var length = arguments.length,
65792             index = length,
65793             args = Array(length);
65794
65795           while (index--) {
65796             args[index] = arguments[index];
65797           }
65798           if (partials) {
65799             args = composeArgs(args, partials, holders);
65800           }
65801           if (partialsRight) {
65802             args = composeArgsRight(args, partialsRight, holdersRight);
65803           }
65804           if (isCurry || isCurryRight) {
65805             var placeholder = wrapper.placeholder,
65806               argsHolders = replaceHolders(args, placeholder);
65807
65808             length -= argsHolders.length;
65809             if (length < arity) {
65810               var newArgPos = argPos ? arrayCopy(argPos) : undefined,
65811                 newArity = nativeMax(arity - length, 0),
65812                 newsHolders = isCurry ? argsHolders : undefined,
65813                 newHoldersRight = isCurry ? undefined : argsHolders,
65814                 newPartials = isCurry ? args : undefined,
65815                 newPartialsRight = isCurry ? undefined : args;
65816
65817               bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
65818               bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
65819
65820               if (!isCurryBound) {
65821                 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
65822               }
65823               var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
65824                 result = createHybridWrapper.apply(undefined, newData);
65825
65826               if (isLaziable(func)) {
65827                 setData(result, newData);
65828               }
65829               result.placeholder = placeholder;
65830               return result;
65831             }
65832           }
65833           var thisBinding = isBind ? thisArg : this,
65834             fn = isBindKey ? thisBinding[func] : func;
65835
65836           if (argPos) {
65837             args = reorder(args, argPos);
65838           }
65839           if (isAry && ary < args.length) {
65840             args.length = ary;
65841           }
65842           if (this && this !== global && this instanceof wrapper) {
65843             fn = Ctor || createCtorWrapper(func);
65844           }
65845           return fn.apply(thisBinding, args);
65846         }
65847         return wrapper;
65848       }
65849
65850       module.exports = createHybridWrapper;
65851
65852     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65853   }, {
65854     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
65855     "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
65856     "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
65857     "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js",
65858     "./isLaziable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js",
65859     "./reorder": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js",
65860     "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
65861     "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65862   }],
65863   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js": [function(require, module, exports) {
65864     (function(global) {
65865       var createCtorWrapper = require('./createCtorWrapper');
65866
65867       /** Used to compose bitmasks for wrapper metadata. */
65868       var BIND_FLAG = 1;
65869
65870       /**
65871        * Creates a function that wraps `func` and invokes it with the optional `this`
65872        * binding of `thisArg` and the `partials` prepended to those provided to the
65873        * wrapper.
65874        *
65875        * @private
65876        * @param {Function}
65877        *            func The function to partially apply arguments to.
65878        * @param {number}
65879        *            bitmask The bitmask of flags. See `createWrapper` for more
65880        *            details.
65881        * @param {*}
65882        *            thisArg The `this` binding of `func`.
65883        * @param {Array}
65884        *            partials The arguments to prepend to those provided to the new
65885        *            function.
65886        * @returns {Function} Returns the new bound function.
65887        */
65888       function createPartialWrapper(func, bitmask, thisArg, partials) {
65889         var isBind = bitmask & BIND_FLAG,
65890           Ctor = createCtorWrapper(func);
65891
65892         function wrapper() {
65893           // Avoid `arguments` object use disqualifying optimizations by
65894           // converting it to an array before providing it `func`.
65895           var argsIndex = -1,
65896             argsLength = arguments.length,
65897             leftIndex = -1,
65898             leftLength = partials.length,
65899             args = Array(leftLength + argsLength);
65900
65901           while (++leftIndex < leftLength) {
65902             args[leftIndex] = partials[leftIndex];
65903           }
65904           while (argsLength--) {
65905             args[leftIndex++] = arguments[++argsIndex];
65906           }
65907           var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65908           return fn.apply(isBind ? thisArg : this, args);
65909         }
65910         return wrapper;
65911       }
65912
65913       module.exports = createPartialWrapper;
65914
65915     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65916   }, {
65917     "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65918   }],
65919   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js": [function(require, module, exports) {
65920     var baseCallback = require('./baseCallback'),
65921       baseReduce = require('./baseReduce'),
65922       isArray = require('../lang/isArray');
65923
65924     /**
65925      * Creates a function for `_.reduce` or `_.reduceRight`.
65926      *
65927      * @private
65928      * @param {Function}
65929      *            arrayFunc The function to iterate over an array.
65930      * @param {Function}
65931      *            eachFunc The function to iterate over a collection.
65932      * @returns {Function} Returns the new each function.
65933      */
65934     function createReduce(arrayFunc, eachFunc) {
65935       return function(collection, iteratee, accumulator, thisArg) {
65936         var initFromArray = arguments.length < 3;
65937         return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
65938       };
65939     }
65940
65941     module.exports = createReduce;
65942
65943   }, {
65944     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65945     "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65946     "./baseReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js"
65947   }],
65948   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js": [function(require, module, exports) {
65949     var baseSetData = require('./baseSetData'),
65950       createBindWrapper = require('./createBindWrapper'),
65951       createHybridWrapper = require('./createHybridWrapper'),
65952       createPartialWrapper = require('./createPartialWrapper'),
65953       getData = require('./getData'),
65954       mergeData = require('./mergeData'),
65955       setData = require('./setData');
65956
65957     /** Used to compose bitmasks for wrapper metadata. */
65958     var BIND_FLAG = 1,
65959       BIND_KEY_FLAG = 2,
65960       PARTIAL_FLAG = 32,
65961       PARTIAL_RIGHT_FLAG = 64;
65962
65963     /** Used as the `TypeError` message for "Functions" methods. */
65964     var FUNC_ERROR_TEXT = 'Expected a function';
65965
65966     /*
65967      * Native method references for those with the same name as other `lodash`
65968      * methods.
65969      */
65970     var nativeMax = Math.max;
65971
65972     /**
65973      * Creates a function that either curries or invokes `func` with optional `this`
65974      * binding and partially applied arguments.
65975      *
65976      * @private
65977      * @param {Function|string}
65978      *            func The function or method name to reference.
65979      * @param {number}
65980      *            bitmask The bitmask of flags. The bitmask may be composed of the
65981      *            following flags: 1 - `_.bind` 2 - `_.bindKey` 4 - `_.curry` or
65982      *            `_.curryRight` of a bound function 8 - `_.curry` 16 -
65983      *            `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
65984      *            `_.rearg` 256 - `_.ary`
65985      * @param {*}
65986      *            [thisArg] The `this` binding of `func`.
65987      * @param {Array}
65988      *            [partials] The arguments to be partially applied.
65989      * @param {Array}
65990      *            [holders] The `partials` placeholder indexes.
65991      * @param {Array}
65992      *            [argPos] The argument positions of the new function.
65993      * @param {number}
65994      *            [ary] The arity cap of `func`.
65995      * @param {number}
65996      *            [arity] The arity of `func`.
65997      * @returns {Function} Returns the new wrapped function.
65998      */
65999     function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
66000       var isBindKey = bitmask & BIND_KEY_FLAG;
66001       if (!isBindKey && typeof func != 'function') {
66002         throw new TypeError(FUNC_ERROR_TEXT);
66003       }
66004       var length = partials ? partials.length : 0;
66005       if (!length) {
66006         bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
66007         partials = holders = undefined;
66008       }
66009       length -= (holders ? holders.length : 0);
66010       if (bitmask & PARTIAL_RIGHT_FLAG) {
66011         var partialsRight = partials,
66012           holdersRight = holders;
66013
66014         partials = holders = undefined;
66015       }
66016       var data = isBindKey ? undefined : getData(func),
66017         newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
66018
66019       if (data) {
66020         mergeData(newData, data);
66021         bitmask = newData[1];
66022         arity = newData[9];
66023       }
66024       newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
66025
66026       if (bitmask == BIND_FLAG) {
66027         var result = createBindWrapper(newData[0], newData[2]);
66028       } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
66029         result = createPartialWrapper.apply(undefined, newData);
66030       } else {
66031         result = createHybridWrapper.apply(undefined, newData);
66032       }
66033       var setter = data ? baseSetData : setData;
66034       return setter(result, newData);
66035     }
66036
66037     module.exports = createWrapper;
66038
66039   }, {
66040     "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js",
66041     "./createBindWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js",
66042     "./createHybridWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js",
66043     "./createPartialWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js",
66044     "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66045     "./mergeData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js",
66046     "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
66047   }],
66048   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js": [function(require, module, exports) {
66049     var arraySome = require('./arraySome');
66050
66051     /**
66052      * A specialized version of `baseIsEqualDeep` for arrays with support for
66053      * partial deep comparisons.
66054      *
66055      * @private
66056      * @param {Array}
66057      *            array The array to compare.
66058      * @param {Array}
66059      *            other The other array to compare.
66060      * @param {Function}
66061      *            equalFunc The function to determine equivalents of values.
66062      * @param {Function}
66063      *            [customizer] The function to customize comparing arrays.
66064      * @param {boolean}
66065      *            [isLoose] Specify performing partial comparisons.
66066      * @param {Array}
66067      *            [stackA] Tracks traversed `value` objects.
66068      * @param {Array}
66069      *            [stackB] Tracks traversed `other` objects.
66070      * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
66071      */
66072     function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
66073       var index = -1,
66074         arrLength = array.length,
66075         othLength = other.length;
66076
66077       if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
66078         return false;
66079       }
66080       // Ignore non-index properties.
66081       while (++index < arrLength) {
66082         var arrValue = array[index],
66083           othValue = other[index],
66084           result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
66085
66086         if (result !== undefined) {
66087           if (result) {
66088             continue;
66089           }
66090           return false;
66091         }
66092         // Recursively compare arrays (susceptible to call stack limits).
66093         if (isLoose) {
66094           if (!arraySome(other, function(othValue) {
66095               return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
66096             })) {
66097             return false;
66098           }
66099         } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
66100           return false;
66101         }
66102       }
66103       return true;
66104     }
66105
66106     module.exports = equalArrays;
66107
66108   }, {
66109     "./arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js"
66110   }],
66111   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js": [function(require, module, exports) {
66112     /** `Object#toString` result references. */
66113     var boolTag = '[object Boolean]',
66114       dateTag = '[object Date]',
66115       errorTag = '[object Error]',
66116       numberTag = '[object Number]',
66117       regexpTag = '[object RegExp]',
66118       stringTag = '[object String]';
66119
66120     /**
66121      * A specialized version of `baseIsEqualDeep` for comparing objects of the same
66122      * `toStringTag`.
66123      *
66124      * **Note:** This function only supports comparing values with tags of
66125      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
66126      *
66127      * @private
66128      * @param {Object}
66129      *            object The object to compare.
66130      * @param {Object}
66131      *            other The other object to compare.
66132      * @param {string}
66133      *            tag The `toStringTag` of the objects to compare.
66134      * @returns {boolean} Returns `true` if the objects are equivalent, else
66135      *          `false`.
66136      */
66137     function equalByTag(object, other, tag) {
66138       switch (tag) {
66139         case boolTag:
66140         case dateTag:
66141           // Coerce dates and booleans to numbers, dates to milliseconds and
66142           // booleans
66143           // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
66144           return +object == +other;
66145
66146         case errorTag:
66147           return object.name == other.name && object.message == other.message;
66148
66149         case numberTag:
66150           // Treat `NaN` vs. `NaN` as equal.
66151           return (object != +object) ? other != +other : object == +other;
66152
66153         case regexpTag:
66154         case stringTag:
66155           // Coerce regexes to strings and treat strings primitives and string
66156           // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
66157           // details.
66158           return object == (other + '');
66159       }
66160       return false;
66161     }
66162
66163     module.exports = equalByTag;
66164
66165   }, {}],
66166   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js": [function(require, module, exports) {
66167     var keys = require('../object/keys');
66168
66169     /** Used for native method references. */
66170     var objectProto = Object.prototype;
66171
66172     /** Used to check objects for own properties. */
66173     var hasOwnProperty = objectProto.hasOwnProperty;
66174
66175     /**
66176      * A specialized version of `baseIsEqualDeep` for objects with support for
66177      * partial deep comparisons.
66178      *
66179      * @private
66180      * @param {Object}
66181      *            object The object to compare.
66182      * @param {Object}
66183      *            other The other object to compare.
66184      * @param {Function}
66185      *            equalFunc The function to determine equivalents of values.
66186      * @param {Function}
66187      *            [customizer] The function to customize comparing values.
66188      * @param {boolean}
66189      *            [isLoose] Specify performing partial comparisons.
66190      * @param {Array}
66191      *            [stackA] Tracks traversed `value` objects.
66192      * @param {Array}
66193      *            [stackB] Tracks traversed `other` objects.
66194      * @returns {boolean} Returns `true` if the objects are equivalent, else
66195      *          `false`.
66196      */
66197     function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
66198       var objProps = keys(object),
66199         objLength = objProps.length,
66200         othProps = keys(other),
66201         othLength = othProps.length;
66202
66203       if (objLength != othLength && !isLoose) {
66204         return false;
66205       }
66206       var index = objLength;
66207       while (index--) {
66208         var key = objProps[index];
66209         if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
66210           return false;
66211         }
66212       }
66213       var skipCtor = isLoose;
66214       while (++index < objLength) {
66215         key = objProps[index];
66216         var objValue = object[key],
66217           othValue = other[key],
66218           result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
66219
66220         // Recursively compare objects (susceptible to call stack limits).
66221         if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
66222           return false;
66223         }
66224         skipCtor || (skipCtor = key == 'constructor');
66225       }
66226       if (!skipCtor) {
66227         var objCtor = object.constructor,
66228           othCtor = other.constructor;
66229
66230         // Non `Object` object instances with different constructors are not equal.
66231         if (objCtor != othCtor &&
66232           ('constructor' in object && 'constructor' in other) &&
66233           !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
66234             typeof othCtor == 'function' && othCtor instanceof othCtor)) {
66235           return false;
66236         }
66237       }
66238       return true;
66239     }
66240
66241     module.exports = equalObjects;
66242
66243   }, {
66244     "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
66245   }],
66246   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js": [function(require, module, exports) {
66247     var metaMap = require('./metaMap'),
66248       noop = require('../utility/noop');
66249
66250     /**
66251      * Gets metadata for `func`.
66252      *
66253      * @private
66254      * @param {Function}
66255      *            func The function to query.
66256      * @returns {*} Returns the metadata for `func`.
66257      */
66258     var getData = !metaMap ? noop : function(func) {
66259       return metaMap.get(func);
66260     };
66261
66262     module.exports = getData;
66263
66264   }, {
66265     "../utility/noop": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js",
66266     "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
66267   }],
66268   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js": [function(require, module, exports) {
66269     var realNames = require('./realNames');
66270
66271     /**
66272      * Gets the name of `func`.
66273      *
66274      * @private
66275      * @param {Function}
66276      *            func The function to query.
66277      * @returns {string} Returns the function name.
66278      */
66279     function getFuncName(func) {
66280       var result = (func.name + ''),
66281         array = realNames[result],
66282         length = array ? array.length : 0;
66283
66284       while (length--) {
66285         var data = array[length],
66286           otherFunc = data.func;
66287         if (otherFunc == null || otherFunc == func) {
66288           return data.name;
66289         }
66290       }
66291       return result;
66292     }
66293
66294     module.exports = getFuncName;
66295
66296   }, {
66297     "./realNames": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js"
66298   }],
66299   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js": [function(require, module, exports) {
66300     var baseProperty = require('./baseProperty');
66301
66302     /**
66303      * Gets the "length" property value of `object`.
66304      *
66305      * **Note:** This function is used to avoid a [JIT
66306      * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari on
66307      * at least iOS 8.1-8.3 ARM64.
66308      *
66309      * @private
66310      * @param {Object}
66311      *            object The object to query.
66312      * @returns {*} Returns the "length" value.
66313      */
66314     var getLength = baseProperty('length');
66315
66316     module.exports = getLength;
66317
66318   }, {
66319     "./baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js"
66320   }],
66321   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js": [function(require, module, exports) {
66322     var isStrictComparable = require('./isStrictComparable'),
66323       pairs = require('../object/pairs');
66324
66325     /**
66326      * Gets the propery names, values, and compare flags of `object`.
66327      *
66328      * @private
66329      * @param {Object}
66330      *            object The object to query.
66331      * @returns {Array} Returns the match data of `object`.
66332      */
66333     function getMatchData(object) {
66334       var result = pairs(object),
66335         length = result.length;
66336
66337       while (length--) {
66338         result[length][2] = isStrictComparable(result[length][1]);
66339       }
66340       return result;
66341     }
66342
66343     module.exports = getMatchData;
66344
66345   }, {
66346     "../object/pairs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js",
66347     "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js"
66348   }],
66349   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js": [function(require, module, exports) {
66350     var isNative = require('../lang/isNative');
66351
66352     /**
66353      * Gets the native function at `key` of `object`.
66354      *
66355      * @private
66356      * @param {Object}
66357      *            object The object to query.
66358      * @param {string}
66359      *            key The key of the method to get.
66360      * @returns {*} Returns the function if it's native, else `undefined`.
66361      */
66362     function getNative(object, key) {
66363       var value = object == null ? undefined : object[key];
66364       return isNative(value) ? value : undefined;
66365     }
66366
66367     module.exports = getNative;
66368
66369   }, {
66370     "../lang/isNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js"
66371   }],
66372   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js": [function(require, module, exports) {
66373     /**
66374      * Gets the index at which the first occurrence of `NaN` is found in `array`.
66375      *
66376      * @private
66377      * @param {Array}
66378      *            array The array to search.
66379      * @param {number}
66380      *            fromIndex The index to search from.
66381      * @param {boolean}
66382      *            [fromRight] Specify iterating from right to left.
66383      * @returns {number} Returns the index of the matched `NaN`, else `-1`.
66384      */
66385     function indexOfNaN(array, fromIndex, fromRight) {
66386       var length = array.length,
66387         index = fromIndex + (fromRight ? 0 : -1);
66388
66389       while ((fromRight ? index-- : ++index < length)) {
66390         var other = array[index];
66391         if (other !== other) {
66392           return index;
66393         }
66394       }
66395       return -1;
66396     }
66397
66398     module.exports = indexOfNaN;
66399
66400   }, {}],
66401   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js": [function(require, module, exports) {
66402     var getLength = require('./getLength'),
66403       isLength = require('./isLength');
66404
66405     /**
66406      * Checks if `value` is array-like.
66407      *
66408      * @private
66409      * @param {*}
66410      *            value The value to check.
66411      * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
66412      */
66413     function isArrayLike(value) {
66414       return value != null && isLength(getLength(value));
66415     }
66416
66417     module.exports = isArrayLike;
66418
66419   }, {
66420     "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
66421     "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66422   }],
66423   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js": [function(require, module, exports) {
66424     /** Used to detect unsigned integer values. */
66425     var reIsUint = /^\d+$/;
66426
66427     /**
66428      * Used as the [maximum
66429      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66430      * of an array-like value.
66431      */
66432     var MAX_SAFE_INTEGER = 9007199254740991;
66433
66434     /**
66435      * Checks if `value` is a valid array-like index.
66436      *
66437      * @private
66438      * @param {*}
66439      *            value The value to check.
66440      * @param {number}
66441      *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
66442      * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
66443      */
66444     function isIndex(value, length) {
66445       value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
66446       length = length == null ? MAX_SAFE_INTEGER : length;
66447       return value > -1 && value % 1 == 0 && value < length;
66448     }
66449
66450     module.exports = isIndex;
66451
66452   }, {}],
66453   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js": [function(require, module, exports) {
66454     var isArrayLike = require('./isArrayLike'),
66455       isIndex = require('./isIndex'),
66456       isObject = require('../lang/isObject');
66457
66458     /**
66459      * Checks if the provided arguments are from an iteratee call.
66460      *
66461      * @private
66462      * @param {*}
66463      *            value The potential iteratee value argument.
66464      * @param {*}
66465      *            index The potential iteratee index or key argument.
66466      * @param {*}
66467      *            object The potential iteratee object argument.
66468      * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
66469      *          else `false`.
66470      */
66471     function isIterateeCall(value, index, object) {
66472       if (!isObject(object)) {
66473         return false;
66474       }
66475       var type = typeof index;
66476       if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
66477         var other = object[index];
66478         return value === value ? (value === other) : (other !== other);
66479       }
66480       return false;
66481     }
66482
66483     module.exports = isIterateeCall;
66484
66485   }, {
66486     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
66487     "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66488     "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66489   }],
66490   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js": [function(require, module, exports) {
66491     var isArray = require('../lang/isArray'),
66492       toObject = require('./toObject');
66493
66494     /** Used to match property names within property paths. */
66495     var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
66496       reIsPlainProp = /^\w*$/;
66497
66498     /**
66499      * Checks if `value` is a property name and not a property path.
66500      *
66501      * @private
66502      * @param {*}
66503      *            value The value to check.
66504      * @param {Object}
66505      *            [object] The object to query keys on.
66506      * @returns {boolean} Returns `true` if `value` is a property name, else
66507      *          `false`.
66508      */
66509     function isKey(value, object) {
66510       var type = typeof value;
66511       if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
66512         return true;
66513       }
66514       if (isArray(value)) {
66515         return false;
66516       }
66517       var result = !reIsDeepProp.test(value);
66518       return result || (object != null && value in toObject(object));
66519     }
66520
66521     module.exports = isKey;
66522
66523   }, {
66524     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66525     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66526   }],
66527   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js": [function(require, module, exports) {
66528     var LazyWrapper = require('./LazyWrapper'),
66529       getData = require('./getData'),
66530       getFuncName = require('./getFuncName'),
66531       lodash = require('../chain/lodash');
66532
66533     /**
66534      * Checks if `func` has a lazy counterpart.
66535      *
66536      * @private
66537      * @param {Function}
66538      *            func The function to check.
66539      * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
66540      *          `false`.
66541      */
66542     function isLaziable(func) {
66543       var funcName = getFuncName(func),
66544         other = lodash[funcName];
66545
66546       if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
66547         return false;
66548       }
66549       if (func === other) {
66550         return true;
66551       }
66552       var data = getData(other);
66553       return !!data && func === data[0];
66554     }
66555
66556     module.exports = isLaziable;
66557
66558   }, {
66559     "../chain/lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js",
66560     "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66561     "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66562     "./getFuncName": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js"
66563   }],
66564   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js": [function(require, module, exports) {
66565     /**
66566      * Used as the [maximum
66567      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66568      * of an array-like value.
66569      */
66570     var MAX_SAFE_INTEGER = 9007199254740991;
66571
66572     /**
66573      * Checks if `value` is a valid array-like length.
66574      *
66575      * **Note:** This function is based on
66576      * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
66577      *
66578      * @private
66579      * @param {*}
66580      *            value The value to check.
66581      * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
66582      */
66583     function isLength(value) {
66584       return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
66585     }
66586
66587     module.exports = isLength;
66588
66589   }, {}],
66590   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js": [function(require, module, exports) {
66591     /**
66592      * Checks if `value` is object-like.
66593      *
66594      * @private
66595      * @param {*}
66596      *            value The value to check.
66597      * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
66598      */
66599     function isObjectLike(value) {
66600       return !!value && typeof value == 'object';
66601     }
66602
66603     module.exports = isObjectLike;
66604
66605   }, {}],
66606   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js": [function(require, module, exports) {
66607     var isObject = require('../lang/isObject');
66608
66609     /**
66610      * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
66611      *
66612      * @private
66613      * @param {*}
66614      *            value The value to check.
66615      * @returns {boolean} Returns `true` if `value` if suitable for strict equality
66616      *          comparisons, else `false`.
66617      */
66618     function isStrictComparable(value) {
66619       return value === value && !isObject(value);
66620     }
66621
66622     module.exports = isStrictComparable;
66623
66624   }, {
66625     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66626   }],
66627   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js": [function(require, module, exports) {
66628     var arrayCopy = require('./arrayCopy'),
66629       composeArgs = require('./composeArgs'),
66630       composeArgsRight = require('./composeArgsRight'),
66631       replaceHolders = require('./replaceHolders');
66632
66633     /** Used to compose bitmasks for wrapper metadata. */
66634     var BIND_FLAG = 1,
66635       CURRY_BOUND_FLAG = 4,
66636       CURRY_FLAG = 8,
66637       ARY_FLAG = 128,
66638       REARG_FLAG = 256;
66639
66640     /** Used as the internal argument placeholder. */
66641     var PLACEHOLDER = '__lodash_placeholder__';
66642
66643     /*
66644      * Native method references for those with the same name as other `lodash`
66645      * methods.
66646      */
66647     var nativeMin = Math.min;
66648
66649     /**
66650      * Merges the function metadata of `source` into `data`.
66651      *
66652      * Merging metadata reduces the number of wrappers required to invoke a
66653      * function. This is possible because methods like `_.bind`, `_.curry`, and
66654      * `_.partial` may be applied regardless of execution order. Methods like
66655      * `_.ary` and `_.rearg` augment function arguments, making the order in which
66656      * they are executed important, preventing the merging of metadata. However, we
66657      * make an exception for a safe common case where curried functions have `_.ary`
66658      * and or `_.rearg` applied.
66659      *
66660      * @private
66661      * @param {Array}
66662      *            data The destination metadata.
66663      * @param {Array}
66664      *            source The source metadata.
66665      * @returns {Array} Returns `data`.
66666      */
66667     function mergeData(data, source) {
66668       var bitmask = data[1],
66669         srcBitmask = source[1],
66670         newBitmask = bitmask | srcBitmask,
66671         isCommon = newBitmask < ARY_FLAG;
66672
66673       var isCombo =
66674         (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
66675         (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
66676         (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
66677
66678       // Exit early if metadata can't be merged.
66679       if (!(isCommon || isCombo)) {
66680         return data;
66681       }
66682       // Use source `thisArg` if available.
66683       if (srcBitmask & BIND_FLAG) {
66684         data[2] = source[2];
66685         // Set when currying a bound function.
66686         newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
66687       }
66688       // Compose partial arguments.
66689       var value = source[3];
66690       if (value) {
66691         var partials = data[3];
66692         data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
66693         data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
66694       }
66695       // Compose partial right arguments.
66696       value = source[5];
66697       if (value) {
66698         partials = data[5];
66699         data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
66700         data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
66701       }
66702       // Use source `argPos` if available.
66703       value = source[7];
66704       if (value) {
66705         data[7] = arrayCopy(value);
66706       }
66707       // Use source `ary` if it's smaller.
66708       if (srcBitmask & ARY_FLAG) {
66709         data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
66710       }
66711       // Use source `arity` if one is not provided.
66712       if (data[9] == null) {
66713         data[9] = source[9];
66714       }
66715       // Use source `func` and merge bitmasks.
66716       data[0] = source[0];
66717       data[1] = newBitmask;
66718
66719       return data;
66720     }
66721
66722     module.exports = mergeData;
66723
66724   }, {
66725     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66726     "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
66727     "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
66728     "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js"
66729   }],
66730   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js": [function(require, module, exports) {
66731     (function(global) {
66732       var getNative = require('./getNative');
66733
66734       /** Native method references. */
66735       var WeakMap = getNative(global, 'WeakMap');
66736
66737       /** Used to store function metadata. */
66738       var metaMap = WeakMap && new WeakMap;
66739
66740       module.exports = metaMap;
66741
66742     }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
66743   }, {
66744     "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
66745   }],
66746   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js": [function(require, module, exports) {
66747     var toObject = require('./toObject');
66748
66749     /**
66750      * A specialized version of `_.pick` which picks `object` properties specified
66751      * by `props`.
66752      *
66753      * @private
66754      * @param {Object}
66755      *            object The source object.
66756      * @param {string[]}
66757      *            props The property names to pick.
66758      * @returns {Object} Returns the new object.
66759      */
66760     function pickByArray(object, props) {
66761       object = toObject(object);
66762
66763       var index = -1,
66764         length = props.length,
66765         result = {};
66766
66767       while (++index < length) {
66768         var key = props[index];
66769         if (key in object) {
66770           result[key] = object[key];
66771         }
66772       }
66773       return result;
66774     }
66775
66776     module.exports = pickByArray;
66777
66778   }, {
66779     "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66780   }],
66781   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js": [function(require, module, exports) {
66782     var baseForIn = require('./baseForIn');
66783
66784     /**
66785      * A specialized version of `_.pick` which picks `object` properties `predicate`
66786      * returns truthy for.
66787      *
66788      * @private
66789      * @param {Object}
66790      *            object The source object.
66791      * @param {Function}
66792      *            predicate The function invoked per iteration.
66793      * @returns {Object} Returns the new object.
66794      */
66795     function pickByCallback(object, predicate) {
66796       var result = {};
66797       baseForIn(object, function(value, key, object) {
66798         if (predicate(value, key, object)) {
66799           result[key] = value;
66800         }
66801       });
66802       return result;
66803     }
66804
66805     module.exports = pickByCallback;
66806
66807   }, {
66808     "./baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js"
66809   }],
66810   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js": [function(require, module, exports) {
66811     /** Used to lookup unminified function names. */
66812     var realNames = {};
66813
66814     module.exports = realNames;
66815
66816   }, {}],
66817   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js": [function(require, module, exports) {
66818     var arrayCopy = require('./arrayCopy'),
66819       isIndex = require('./isIndex');
66820
66821     /*
66822      * Native method references for those with the same name as other `lodash`
66823      * methods.
66824      */
66825     var nativeMin = Math.min;
66826
66827     /**
66828      * Reorder `array` according to the specified indexes where the element at the
66829      * first index is assigned as the first element, the element at the second index
66830      * is assigned as the second element, and so on.
66831      *
66832      * @private
66833      * @param {Array}
66834      *            array The array to reorder.
66835      * @param {Array}
66836      *            indexes The arranged array indexes.
66837      * @returns {Array} Returns `array`.
66838      */
66839     function reorder(array, indexes) {
66840       var arrLength = array.length,
66841         length = nativeMin(indexes.length, arrLength),
66842         oldArray = arrayCopy(array);
66843
66844       while (length--) {
66845         var index = indexes[length];
66846         array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
66847       }
66848       return array;
66849     }
66850
66851     module.exports = reorder;
66852
66853   }, {
66854     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66855     "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66856   }],
66857   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js": [function(require, module, exports) {
66858     /** Used as the internal argument placeholder. */
66859     var PLACEHOLDER = '__lodash_placeholder__';
66860
66861     /**
66862      * Replaces all `placeholder` elements in `array` with an internal placeholder
66863      * and returns an array of their indexes.
66864      *
66865      * @private
66866      * @param {Array}
66867      *            array The array to modify.
66868      * @param {*}
66869      *            placeholder The placeholder to replace.
66870      * @returns {Array} Returns the new array of placeholder indexes.
66871      */
66872     function replaceHolders(array, placeholder) {
66873       var index = -1,
66874         length = array.length,
66875         resIndex = -1,
66876         result = [];
66877
66878       while (++index < length) {
66879         if (array[index] === placeholder) {
66880           array[index] = PLACEHOLDER;
66881           result[++resIndex] = index;
66882         }
66883       }
66884       return result;
66885     }
66886
66887     module.exports = replaceHolders;
66888
66889   }, {}],
66890   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js": [function(require, module, exports) {
66891     var baseSetData = require('./baseSetData'),
66892       now = require('../date/now');
66893
66894     /** Used to detect when a function becomes hot. */
66895     var HOT_COUNT = 150,
66896       HOT_SPAN = 16;
66897
66898     /**
66899      * Sets metadata for `func`.
66900      *
66901      * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
66902      * period of time, it will trip its breaker and transition to an identity
66903      * function to avoid garbage collection pauses in V8. See [V8 issue
66904      * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more details.
66905      *
66906      * @private
66907      * @param {Function}
66908      *            func The function to associate metadata with.
66909      * @param {*}
66910      *            data The metadata.
66911      * @returns {Function} Returns `func`.
66912      */
66913     var setData = (function() {
66914       var count = 0,
66915         lastCalled = 0;
66916
66917       return function(key, value) {
66918         var stamp = now(),
66919           remaining = HOT_SPAN - (stamp - lastCalled);
66920
66921         lastCalled = stamp;
66922         if (remaining > 0) {
66923           if (++count >= HOT_COUNT) {
66924             return key;
66925           }
66926         } else {
66927           count = 0;
66928         }
66929         return baseSetData(key, value);
66930       };
66931     }());
66932
66933     module.exports = setData;
66934
66935   }, {
66936     "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
66937     "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js"
66938   }],
66939   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js": [function(require, module, exports) {
66940     var isArguments = require('../lang/isArguments'),
66941       isArray = require('../lang/isArray'),
66942       isIndex = require('./isIndex'),
66943       isLength = require('./isLength'),
66944       keysIn = require('../object/keysIn');
66945
66946     /** Used for native method references. */
66947     var objectProto = Object.prototype;
66948
66949     /** Used to check objects for own properties. */
66950     var hasOwnProperty = objectProto.hasOwnProperty;
66951
66952     /**
66953      * A fallback implementation of `Object.keys` which creates an array of the own
66954      * enumerable property names of `object`.
66955      *
66956      * @private
66957      * @param {Object}
66958      *            object The object to query.
66959      * @returns {Array} Returns the array of property names.
66960      */
66961     function shimKeys(object) {
66962       var props = keysIn(object),
66963         propsLength = props.length,
66964         length = propsLength && object.length;
66965
66966       var allowIndexes = !!length && isLength(length) &&
66967         (isArray(object) || isArguments(object));
66968
66969       var index = -1,
66970         result = [];
66971
66972       while (++index < propsLength) {
66973         var key = props[index];
66974         if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
66975           result.push(key);
66976         }
66977       }
66978       return result;
66979     }
66980
66981     module.exports = shimKeys;
66982
66983   }, {
66984     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
66985     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66986     "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
66987     "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
66988     "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66989   }],
66990   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js": [function(require, module, exports) {
66991     /**
66992      * An implementation of `_.uniq` optimized for sorted arrays without support for
66993      * callback shorthands and `this` binding.
66994      *
66995      * @private
66996      * @param {Array}
66997      *            array The array to inspect.
66998      * @param {Function}
66999      *            [iteratee] The function invoked per iteration.
67000      * @returns {Array} Returns the new duplicate free array.
67001      */
67002     function sortedUniq(array, iteratee) {
67003       var seen,
67004         index = -1,
67005         length = array.length,
67006         resIndex = -1,
67007         result = [];
67008
67009       while (++index < length) {
67010         var value = array[index],
67011           computed = iteratee ? iteratee(value, index, array) : value;
67012
67013         if (!index || seen !== computed) {
67014           seen = computed;
67015           result[++resIndex] = value;
67016         }
67017       }
67018       return result;
67019     }
67020
67021     module.exports = sortedUniq;
67022
67023   }, {}],
67024   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js": [function(require, module, exports) {
67025     var isObject = require('../lang/isObject');
67026
67027     /**
67028      * Converts `value` to an object if it's not one.
67029      *
67030      * @private
67031      * @param {*}
67032      *            value The value to process.
67033      * @returns {Object} Returns the object.
67034      */
67035     function toObject(value) {
67036       return isObject(value) ? value : Object(value);
67037     }
67038
67039     module.exports = toObject;
67040
67041   }, {
67042     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67043   }],
67044   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js": [function(require, module, exports) {
67045     var baseToString = require('./baseToString'),
67046       isArray = require('../lang/isArray');
67047
67048     /** Used to match property names within property paths. */
67049     var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
67050
67051     /** Used to match backslashes in property paths. */
67052     var reEscapeChar = /\\(\\)?/g;
67053
67054     /**
67055      * Converts `value` to property path array if it's not one.
67056      *
67057      * @private
67058      * @param {*}
67059      *            value The value to process.
67060      * @returns {Array} Returns the property path array.
67061      */
67062     function toPath(value) {
67063       if (isArray(value)) {
67064         return value;
67065       }
67066       var result = [];
67067       baseToString(value).replace(rePropName, function(match, number, quote, string) {
67068         result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
67069       });
67070       return result;
67071     }
67072
67073     module.exports = toPath;
67074
67075   }, {
67076     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67077     "./baseToString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js"
67078   }],
67079   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js": [function(require, module, exports) {
67080     var LazyWrapper = require('./LazyWrapper'),
67081       LodashWrapper = require('./LodashWrapper'),
67082       arrayCopy = require('./arrayCopy');
67083
67084     /**
67085      * Creates a clone of `wrapper`.
67086      *
67087      * @private
67088      * @param {Object}
67089      *            wrapper The wrapper to clone.
67090      * @returns {Object} Returns the cloned wrapper.
67091      */
67092     function wrapperClone(wrapper) {
67093       return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
67094     }
67095
67096     module.exports = wrapperClone;
67097
67098   }, {
67099     "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
67100     "./LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
67101     "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js"
67102   }],
67103   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js": [function(require, module, exports) {
67104     var isArrayLike = require('../internal/isArrayLike'),
67105       isObjectLike = require('../internal/isObjectLike');
67106
67107     /** Used for native method references. */
67108     var objectProto = Object.prototype;
67109
67110     /** Used to check objects for own properties. */
67111     var hasOwnProperty = objectProto.hasOwnProperty;
67112
67113     /** Native method references. */
67114     var propertyIsEnumerable = objectProto.propertyIsEnumerable;
67115
67116     /**
67117      * Checks if `value` is classified as an `arguments` object.
67118      *
67119      * @static
67120      * @memberOf _
67121      * @category Lang
67122      * @param {*}
67123      *            value The value to check.
67124      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67125      *          `false`.
67126      * @example
67127      *
67128      * _.isArguments(function() { return arguments; }()); // => true
67129      *
67130      * _.isArguments([1, 2, 3]); // => false
67131      */
67132     function isArguments(value) {
67133       return isObjectLike(value) && isArrayLike(value) &&
67134         hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
67135     }
67136
67137     module.exports = isArguments;
67138
67139   }, {
67140     "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67141     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67142   }],
67143   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js": [function(require, module, exports) {
67144     var getNative = require('../internal/getNative'),
67145       isLength = require('../internal/isLength'),
67146       isObjectLike = require('../internal/isObjectLike');
67147
67148     /** `Object#toString` result references. */
67149     var arrayTag = '[object Array]';
67150
67151     /** Used for native method references. */
67152     var objectProto = Object.prototype;
67153
67154     /**
67155      * Used to resolve the
67156      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67157      * of values.
67158      */
67159     var objToString = objectProto.toString;
67160
67161     /*
67162      * Native method references for those with the same name as other `lodash`
67163      * methods.
67164      */
67165     var nativeIsArray = getNative(Array, 'isArray');
67166
67167     /**
67168      * Checks if `value` is classified as an `Array` object.
67169      *
67170      * @static
67171      * @memberOf _
67172      * @category Lang
67173      * @param {*}
67174      *            value The value to check.
67175      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67176      *          `false`.
67177      * @example
67178      *
67179      * _.isArray([1, 2, 3]); // => true
67180      *
67181      * _.isArray(function() { return arguments; }()); // => false
67182      */
67183     var isArray = nativeIsArray || function(value) {
67184       return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
67185     };
67186
67187     module.exports = isArray;
67188
67189   }, {
67190     "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67191     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67192     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67193   }],
67194   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js": [function(require, module, exports) {
67195     var isObject = require('./isObject');
67196
67197     /** `Object#toString` result references. */
67198     var funcTag = '[object Function]';
67199
67200     /** Used for native method references. */
67201     var objectProto = Object.prototype;
67202
67203     /**
67204      * Used to resolve the
67205      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67206      * of values.
67207      */
67208     var objToString = objectProto.toString;
67209
67210     /**
67211      * Checks if `value` is classified as a `Function` object.
67212      *
67213      * @static
67214      * @memberOf _
67215      * @category Lang
67216      * @param {*}
67217      *            value The value to check.
67218      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67219      *          `false`.
67220      * @example
67221      *
67222      * _.isFunction(_); // => true
67223      *
67224      * _.isFunction(/abc/); // => false
67225      */
67226     function isFunction(value) {
67227       // The use of `Object#toString` avoids issues with the `typeof` operator
67228       // in older versions of Chrome and Safari which return 'function' for
67229       // regexes
67230       // and Safari 8 which returns 'object' for typed array constructors.
67231       return isObject(value) && objToString.call(value) == funcTag;
67232     }
67233
67234     module.exports = isFunction;
67235
67236   }, {
67237     "./isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67238   }],
67239   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js": [function(require, module, exports) {
67240     var isFunction = require('./isFunction'),
67241       isObjectLike = require('../internal/isObjectLike');
67242
67243     /** Used to detect host constructors (Safari > 5). */
67244     var reIsHostCtor = /^\[object .+?Constructor\]$/;
67245
67246     /** Used for native method references. */
67247     var objectProto = Object.prototype;
67248
67249     /** Used to resolve the decompiled source of functions. */
67250     var fnToString = Function.prototype.toString;
67251
67252     /** Used to check objects for own properties. */
67253     var hasOwnProperty = objectProto.hasOwnProperty;
67254
67255     /** Used to detect if a method is native. */
67256     var reIsNative = RegExp('^' +
67257       fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
67258       .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
67259     );
67260
67261     /**
67262      * Checks if `value` is a native function.
67263      *
67264      * @static
67265      * @memberOf _
67266      * @category Lang
67267      * @param {*}
67268      *            value The value to check.
67269      * @returns {boolean} Returns `true` if `value` is a native function, else
67270      *          `false`.
67271      * @example
67272      *
67273      * _.isNative(Array.prototype.push); // => true
67274      *
67275      * _.isNative(_); // => false
67276      */
67277     function isNative(value) {
67278       if (value == null) {
67279         return false;
67280       }
67281       if (isFunction(value)) {
67282         return reIsNative.test(fnToString.call(value));
67283       }
67284       return isObjectLike(value) && reIsHostCtor.test(value);
67285     }
67286
67287     module.exports = isNative;
67288
67289   }, {
67290     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67291     "./isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
67292   }],
67293   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js": [function(require, module, exports) {
67294     var isObjectLike = require('../internal/isObjectLike');
67295
67296     /** `Object#toString` result references. */
67297     var numberTag = '[object Number]';
67298
67299     /** Used for native method references. */
67300     var objectProto = Object.prototype;
67301
67302     /**
67303      * Used to resolve the
67304      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67305      * of values.
67306      */
67307     var objToString = objectProto.toString;
67308
67309     /**
67310      * Checks if `value` is classified as a `Number` primitive or object.
67311      *
67312      * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
67313      * as numbers, use the `_.isFinite` method.
67314      *
67315      * @static
67316      * @memberOf _
67317      * @category Lang
67318      * @param {*}
67319      *            value The value to check.
67320      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67321      *          `false`.
67322      * @example
67323      *
67324      * _.isNumber(8.4); // => true
67325      *
67326      * _.isNumber(NaN); // => true
67327      *
67328      * _.isNumber('8.4'); // => false
67329      */
67330     function isNumber(value) {
67331       return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
67332     }
67333
67334     module.exports = isNumber;
67335
67336   }, {
67337     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67338   }],
67339   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js": [function(require, module, exports) {
67340     /**
67341      * Checks if `value` is the [language type](https://es5.github.io/#x8) of
67342      * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
67343      * `new String('')`)
67344      *
67345      * @static
67346      * @memberOf _
67347      * @category Lang
67348      * @param {*}
67349      *            value The value to check.
67350      * @returns {boolean} Returns `true` if `value` is an object, else `false`.
67351      * @example
67352      *
67353      * _.isObject({}); // => true
67354      *
67355      * _.isObject([1, 2, 3]); // => true
67356      *
67357      * _.isObject(1); // => false
67358      */
67359     function isObject(value) {
67360       // Avoid a V8 JIT bug in Chrome 19-20.
67361       // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
67362       var type = typeof value;
67363       return !!value && (type == 'object' || type == 'function');
67364     }
67365
67366     module.exports = isObject;
67367
67368   }, {}],
67369   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js": [function(require, module, exports) {
67370     var baseForIn = require('../internal/baseForIn'),
67371       isArguments = require('./isArguments'),
67372       isObjectLike = require('../internal/isObjectLike');
67373
67374     /** `Object#toString` result references. */
67375     var objectTag = '[object Object]';
67376
67377     /** Used for native method references. */
67378     var objectProto = Object.prototype;
67379
67380     /** Used to check objects for own properties. */
67381     var hasOwnProperty = objectProto.hasOwnProperty;
67382
67383     /**
67384      * Used to resolve the
67385      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67386      * of values.
67387      */
67388     var objToString = objectProto.toString;
67389
67390     /**
67391      * Checks if `value` is a plain object, that is, an object created by the
67392      * `Object` constructor or one with a `[[Prototype]]` of `null`.
67393      *
67394      * **Note:** This method assumes objects created by the `Object` constructor
67395      * have no inherited enumerable properties.
67396      *
67397      * @static
67398      * @memberOf _
67399      * @category Lang
67400      * @param {*}
67401      *            value The value to check.
67402      * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
67403      * @example
67404      *
67405      * function Foo() { this.a = 1; }
67406      *
67407      * _.isPlainObject(new Foo); // => false
67408      *
67409      * _.isPlainObject([1, 2, 3]); // => false
67410      *
67411      * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
67412      *
67413      * _.isPlainObject(Object.create(null)); // => true
67414      */
67415     function isPlainObject(value) {
67416       var Ctor;
67417
67418       // Exit early for non `Object` objects.
67419       if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
67420         (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
67421         return false;
67422       }
67423       // IE < 9 iterates inherited properties before own properties. If the first
67424       // iterated property is an object's own property then there are no inherited
67425       // enumerable properties.
67426       var result;
67427       // In most environments an object's own properties are iterated before
67428       // its inherited properties. If the last iterated property is an object's
67429       // own property then there are no inherited enumerable properties.
67430       baseForIn(value, function(subValue, key) {
67431         result = key;
67432       });
67433       return result === undefined || hasOwnProperty.call(value, result);
67434     }
67435
67436     module.exports = isPlainObject;
67437
67438   }, {
67439     "../internal/baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js",
67440     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67441     "./isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js"
67442   }],
67443   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js": [function(require, module, exports) {
67444     var isObjectLike = require('../internal/isObjectLike');
67445
67446     /** `Object#toString` result references. */
67447     var stringTag = '[object String]';
67448
67449     /** Used for native method references. */
67450     var objectProto = Object.prototype;
67451
67452     /**
67453      * Used to resolve the
67454      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67455      * of values.
67456      */
67457     var objToString = objectProto.toString;
67458
67459     /**
67460      * Checks if `value` is classified as a `String` primitive or object.
67461      *
67462      * @static
67463      * @memberOf _
67464      * @category Lang
67465      * @param {*}
67466      *            value The value to check.
67467      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67468      *          `false`.
67469      * @example
67470      *
67471      * _.isString('abc'); // => true
67472      *
67473      * _.isString(1); // => false
67474      */
67475     function isString(value) {
67476       return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
67477     }
67478
67479     module.exports = isString;
67480
67481   }, {
67482     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67483   }],
67484   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js": [function(require, module, exports) {
67485     var isLength = require('../internal/isLength'),
67486       isObjectLike = require('../internal/isObjectLike');
67487
67488     /** `Object#toString` result references. */
67489     var argsTag = '[object Arguments]',
67490       arrayTag = '[object Array]',
67491       boolTag = '[object Boolean]',
67492       dateTag = '[object Date]',
67493       errorTag = '[object Error]',
67494       funcTag = '[object Function]',
67495       mapTag = '[object Map]',
67496       numberTag = '[object Number]',
67497       objectTag = '[object Object]',
67498       regexpTag = '[object RegExp]',
67499       setTag = '[object Set]',
67500       stringTag = '[object String]',
67501       weakMapTag = '[object WeakMap]';
67502
67503     var arrayBufferTag = '[object ArrayBuffer]',
67504       float32Tag = '[object Float32Array]',
67505       float64Tag = '[object Float64Array]',
67506       int8Tag = '[object Int8Array]',
67507       int16Tag = '[object Int16Array]',
67508       int32Tag = '[object Int32Array]',
67509       uint8Tag = '[object Uint8Array]',
67510       uint8ClampedTag = '[object Uint8ClampedArray]',
67511       uint16Tag = '[object Uint16Array]',
67512       uint32Tag = '[object Uint32Array]';
67513
67514     /** Used to identify `toStringTag` values of typed arrays. */
67515     var typedArrayTags = {};
67516     typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
67517       typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
67518       typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
67519       typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
67520       typedArrayTags[uint32Tag] = true;
67521     typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
67522       typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
67523       typedArrayTags[dateTag] = typedArrayTags[errorTag] =
67524       typedArrayTags[funcTag] = typedArrayTags[mapTag] =
67525       typedArrayTags[numberTag] = typedArrayTags[objectTag] =
67526       typedArrayTags[regexpTag] = typedArrayTags[setTag] =
67527       typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
67528
67529     /** Used for native method references. */
67530     var objectProto = Object.prototype;
67531
67532     /**
67533      * Used to resolve the
67534      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67535      * of values.
67536      */
67537     var objToString = objectProto.toString;
67538
67539     /**
67540      * Checks if `value` is classified as a typed array.
67541      *
67542      * @static
67543      * @memberOf _
67544      * @category Lang
67545      * @param {*}
67546      *            value The value to check.
67547      * @returns {boolean} Returns `true` if `value` is correctly classified, else
67548      *          `false`.
67549      * @example
67550      *
67551      * _.isTypedArray(new Uint8Array); // => true
67552      *
67553      * _.isTypedArray([]); // => false
67554      */
67555     function isTypedArray(value) {
67556       return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
67557     }
67558
67559     module.exports = isTypedArray;
67560
67561   }, {
67562     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67563     "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67564   }],
67565   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js": [function(require, module, exports) {
67566     var baseCopy = require('../internal/baseCopy'),
67567       keysIn = require('../object/keysIn');
67568
67569     /**
67570      * Converts `value` to a plain object flattening inherited enumerable properties
67571      * of `value` to own properties of the plain object.
67572      *
67573      * @static
67574      * @memberOf _
67575      * @category Lang
67576      * @param {*}
67577      *            value The value to convert.
67578      * @returns {Object} Returns the converted plain object.
67579      * @example
67580      *
67581      * function Foo() { this.b = 2; }
67582      *
67583      * Foo.prototype.c = 3;
67584      *
67585      * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
67586      *
67587      * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c':
67588      * 3 }
67589      */
67590     function toPlainObject(value) {
67591       return baseCopy(value, keysIn(value));
67592     }
67593
67594     module.exports = toPlainObject;
67595
67596   }, {
67597     "../internal/baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js",
67598     "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67599   }],
67600   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js": [function(require, module, exports) {
67601     var assignWith = require('../internal/assignWith'),
67602       baseAssign = require('../internal/baseAssign'),
67603       createAssigner = require('../internal/createAssigner');
67604
67605     /**
67606      * Assigns own enumerable properties of source object(s) to the destination
67607      * object. Subsequent sources overwrite property assignments of previous
67608      * sources. If `customizer` is provided it's invoked to produce the assigned
67609      * values. The `customizer` is bound to `thisArg` and invoked with five
67610      * arguments: (objectValue, sourceValue, key, object, source).
67611      *
67612      * **Note:** This method mutates `object` and is based on
67613      * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
67614      *
67615      * @static
67616      * @memberOf _
67617      * @alias extend
67618      * @category Object
67619      * @param {Object}
67620      *            object The destination object.
67621      * @param {...Object}
67622      *            [sources] The source objects.
67623      * @param {Function}
67624      *            [customizer] The function to customize assigned values.
67625      * @param {*}
67626      *            [thisArg] The `this` binding of `customizer`.
67627      * @returns {Object} Returns `object`.
67628      * @example
67629      *
67630      * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
67631      * 'user': 'fred', 'age': 40 }
67632      *  // using a customizer callback var defaults = _.partialRight(_.assign,
67633      * function(value, other) { return _.isUndefined(value) ? other : value; });
67634      *
67635      * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
67636      * 'user': 'barney', 'age': 36 }
67637      */
67638     var assign = createAssigner(function(object, source, customizer) {
67639       return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
67640     });
67641
67642     module.exports = assign;
67643
67644   }, {
67645     "../internal/assignWith": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js",
67646     "../internal/baseAssign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js",
67647     "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67648   }],
67649   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js": [function(require, module, exports) {
67650     var getNative = require('../internal/getNative'),
67651       isArrayLike = require('../internal/isArrayLike'),
67652       isObject = require('../lang/isObject'),
67653       shimKeys = require('../internal/shimKeys');
67654
67655     /*
67656      * Native method references for those with the same name as other `lodash`
67657      * methods.
67658      */
67659     var nativeKeys = getNative(Object, 'keys');
67660
67661     /**
67662      * Creates an array of the own enumerable property names of `object`.
67663      *
67664      * **Note:** Non-object values are coerced to objects. See the [ES
67665      * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for more
67666      * details.
67667      *
67668      * @static
67669      * @memberOf _
67670      * @category Object
67671      * @param {Object}
67672      *            object The object to query.
67673      * @returns {Array} Returns the array of property names.
67674      * @example
67675      *
67676      * function Foo() { this.a = 1; this.b = 2; }
67677      *
67678      * Foo.prototype.c = 3;
67679      *
67680      * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
67681      *
67682      * _.keys('hi'); // => ['0', '1']
67683      */
67684     var keys = !nativeKeys ? shimKeys : function(object) {
67685       var Ctor = object == null ? undefined : object.constructor;
67686       if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
67687         (typeof object != 'function' && isArrayLike(object))) {
67688         return shimKeys(object);
67689       }
67690       return isObject(object) ? nativeKeys(object) : [];
67691     };
67692
67693     module.exports = keys;
67694
67695   }, {
67696     "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67697     "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67698     "../internal/shimKeys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js",
67699     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67700   }],
67701   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js": [function(require, module, exports) {
67702     var isArguments = require('../lang/isArguments'),
67703       isArray = require('../lang/isArray'),
67704       isIndex = require('../internal/isIndex'),
67705       isLength = require('../internal/isLength'),
67706       isObject = require('../lang/isObject');
67707
67708     /** Used for native method references. */
67709     var objectProto = Object.prototype;
67710
67711     /** Used to check objects for own properties. */
67712     var hasOwnProperty = objectProto.hasOwnProperty;
67713
67714     /**
67715      * Creates an array of the own and inherited enumerable property names of
67716      * `object`.
67717      *
67718      * **Note:** Non-object values are coerced to objects.
67719      *
67720      * @static
67721      * @memberOf _
67722      * @category Object
67723      * @param {Object}
67724      *            object The object to query.
67725      * @returns {Array} Returns the array of property names.
67726      * @example
67727      *
67728      * function Foo() { this.a = 1; this.b = 2; }
67729      *
67730      * Foo.prototype.c = 3;
67731      *
67732      * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed)
67733      */
67734     function keysIn(object) {
67735       if (object == null) {
67736         return [];
67737       }
67738       if (!isObject(object)) {
67739         object = Object(object);
67740       }
67741       var length = object.length;
67742       length = (length && isLength(length) &&
67743         (isArray(object) || isArguments(object)) && length) || 0;
67744
67745       var Ctor = object.constructor,
67746         index = -1,
67747         isProto = typeof Ctor == 'function' && Ctor.prototype === object,
67748         result = Array(length),
67749         skipIndexes = length > 0;
67750
67751       while (++index < length) {
67752         result[index] = (index + '');
67753       }
67754       for (var key in object) {
67755         if (!(skipIndexes && isIndex(key, length)) &&
67756           !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
67757           result.push(key);
67758         }
67759       }
67760       return result;
67761     }
67762
67763     module.exports = keysIn;
67764
67765   }, {
67766     "../internal/isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
67767     "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67768     "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
67769     "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67770     "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67771   }],
67772   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js": [function(require, module, exports) {
67773     var baseMerge = require('../internal/baseMerge'),
67774       createAssigner = require('../internal/createAssigner');
67775
67776     /**
67777      * Recursively merges own enumerable properties of the source object(s), that
67778      * don't resolve to `undefined` into the destination object. Subsequent sources
67779      * overwrite property assignments of previous sources. If `customizer` is
67780      * provided it's invoked to produce the merged values of the destination and
67781      * source properties. If `customizer` returns `undefined` merging is handled by
67782      * the method instead. The `customizer` is bound to `thisArg` and invoked with
67783      * five arguments: (objectValue, sourceValue, key, object, source).
67784      *
67785      * @static
67786      * @memberOf _
67787      * @category Object
67788      * @param {Object}
67789      *            object The destination object.
67790      * @param {...Object}
67791      *            [sources] The source objects.
67792      * @param {Function}
67793      *            [customizer] The function to customize assigned values.
67794      * @param {*}
67795      *            [thisArg] The `this` binding of `customizer`.
67796      * @returns {Object} Returns `object`.
67797      * @example
67798      *
67799      * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
67800      *
67801      * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
67802      *
67803      * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
67804      * 'user': 'fred', 'age': 40 }] }
67805      *  // using a customizer callback var object = { 'fruits': ['apple'],
67806      * 'vegetables': ['beet'] };
67807      *
67808      * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
67809      *
67810      * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
67811      * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
67812      * ['beet', 'carrot'] }
67813      */
67814     var merge = createAssigner(baseMerge);
67815
67816     module.exports = merge;
67817
67818   }, {
67819     "../internal/baseMerge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js",
67820     "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67821   }],
67822   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js": [function(require, module, exports) {
67823     var arrayMap = require('../internal/arrayMap'),
67824       baseDifference = require('../internal/baseDifference'),
67825       baseFlatten = require('../internal/baseFlatten'),
67826       bindCallback = require('../internal/bindCallback'),
67827       keysIn = require('./keysIn'),
67828       pickByArray = require('../internal/pickByArray'),
67829       pickByCallback = require('../internal/pickByCallback'),
67830       restParam = require('../function/restParam');
67831
67832     /**
67833      * The opposite of `_.pick`; this method creates an object composed of the own
67834      * and inherited enumerable properties of `object` that are not omitted.
67835      *
67836      * @static
67837      * @memberOf _
67838      * @category Object
67839      * @param {Object}
67840      *            object The source object.
67841      * @param {Function|...(string|string[])}
67842      *            [predicate] The function invoked per iteration or property names
67843      *            to omit, specified as individual property names or arrays of
67844      *            property names.
67845      * @param {*}
67846      *            [thisArg] The `this` binding of `predicate`.
67847      * @returns {Object} Returns the new object.
67848      * @example
67849      *
67850      * var object = { 'user': 'fred', 'age': 40 };
67851      *
67852      * _.omit(object, 'age'); // => { 'user': 'fred' }
67853      *
67854      * _.omit(object, _.isNumber); // => { 'user': 'fred' }
67855      */
67856     var omit = restParam(function(object, props) {
67857       if (object == null) {
67858         return {};
67859       }
67860       if (typeof props[0] != 'function') {
67861         var props = arrayMap(baseFlatten(props), String);
67862         return pickByArray(object, baseDifference(keysIn(object), props));
67863       }
67864       var predicate = bindCallback(props[0], props[1], 3);
67865       return pickByCallback(object, function(value, key, object) {
67866         return !predicate(value, key, object);
67867       });
67868     });
67869
67870     module.exports = omit;
67871
67872   }, {
67873     "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67874     "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
67875     "../internal/baseDifference": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js",
67876     "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67877     "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67878     "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67879     "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js",
67880     "./keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67881   }],
67882   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js": [function(require, module, exports) {
67883     var keys = require('./keys'),
67884       toObject = require('../internal/toObject');
67885
67886     /**
67887      * Creates a two dimensional array of the key-value pairs for `object`, e.g.
67888      * `[[key1, value1], [key2, value2]]`.
67889      *
67890      * @static
67891      * @memberOf _
67892      * @category Object
67893      * @param {Object}
67894      *            object The object to query.
67895      * @returns {Array} Returns the new array of key-value pairs.
67896      * @example
67897      *
67898      * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred', 40]]
67899      * (iteration order is not guaranteed)
67900      */
67901     function pairs(object) {
67902       object = toObject(object);
67903
67904       var index = -1,
67905         props = keys(object),
67906         length = props.length,
67907         result = Array(length);
67908
67909       while (++index < length) {
67910         var key = props[index];
67911         result[index] = [key, object[key]];
67912       }
67913       return result;
67914     }
67915
67916     module.exports = pairs;
67917
67918   }, {
67919     "../internal/toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
67920     "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67921   }],
67922   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js": [function(require, module, exports) {
67923     var baseFlatten = require('../internal/baseFlatten'),
67924       bindCallback = require('../internal/bindCallback'),
67925       pickByArray = require('../internal/pickByArray'),
67926       pickByCallback = require('../internal/pickByCallback'),
67927       restParam = require('../function/restParam');
67928
67929     /**
67930      * Creates an object composed of the picked `object` properties. Property names
67931      * may be specified as individual arguments or as arrays of property names. If
67932      * `predicate` is provided it's invoked for each property of `object` picking
67933      * the properties `predicate` returns truthy for. The predicate is bound to
67934      * `thisArg` and invoked with three arguments: (value, key, object).
67935      *
67936      * @static
67937      * @memberOf _
67938      * @category Object
67939      * @param {Object}
67940      *            object The source object.
67941      * @param {Function|...(string|string[])}
67942      *            [predicate] The function invoked per iteration or property names
67943      *            to pick, specified as individual property names or arrays of
67944      *            property names.
67945      * @param {*}
67946      *            [thisArg] The `this` binding of `predicate`.
67947      * @returns {Object} Returns the new object.
67948      * @example
67949      *
67950      * var object = { 'user': 'fred', 'age': 40 };
67951      *
67952      * _.pick(object, 'user'); // => { 'user': 'fred' }
67953      *
67954      * _.pick(object, _.isString); // => { 'user': 'fred' }
67955      */
67956     var pick = restParam(function(object, props) {
67957       if (object == null) {
67958         return {};
67959       }
67960       return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
67961     });
67962
67963     module.exports = pick;
67964
67965   }, {
67966     "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67967     "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67968     "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67969     "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67970     "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js"
67971   }],
67972   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js": [function(require, module, exports) {
67973     var baseValues = require('../internal/baseValues'),
67974       keys = require('./keys');
67975
67976     /**
67977      * Creates an array of the own enumerable property values of `object`.
67978      *
67979      * **Note:** Non-object values are coerced to objects.
67980      *
67981      * @static
67982      * @memberOf _
67983      * @category Object
67984      * @param {Object}
67985      *            object The object to query.
67986      * @returns {Array} Returns the array of property values.
67987      * @example
67988      *
67989      * function Foo() { this.a = 1; this.b = 2; }
67990      *
67991      * Foo.prototype.c = 3;
67992      *
67993      * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
67994      *
67995      * _.values('hi'); // => ['h', 'i']
67996      */
67997     function values(object) {
67998       return baseValues(object, keys(object));
67999     }
68000
68001     module.exports = values;
68002
68003   }, {
68004     "../internal/baseValues": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js",
68005     "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
68006   }],
68007   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js": [function(require, module, exports) {
68008     /**
68009      * This method returns the first argument provided to it.
68010      *
68011      * @static
68012      * @memberOf _
68013      * @category Utility
68014      * @param {*}
68015      *            value Any value.
68016      * @returns {*} Returns `value`.
68017      * @example
68018      *
68019      * var object = { 'user': 'fred' };
68020      *
68021      * _.identity(object) === object; // => true
68022      */
68023     function identity(value) {
68024       return value;
68025     }
68026
68027     module.exports = identity;
68028
68029   }, {}],
68030   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js": [function(require, module, exports) {
68031     /**
68032      * A no-operation function that returns `undefined` regardless of the arguments
68033      * it receives.
68034      *
68035      * @static
68036      * @memberOf _
68037      * @category Utility
68038      * @example
68039      *
68040      * var object = { 'user': 'fred' };
68041      *
68042      * _.noop(object) === undefined; // => true
68043      */
68044     function noop() {
68045       // No operation performed.
68046     }
68047
68048     module.exports = noop;
68049
68050   }, {}],
68051   "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js": [function(require, module, exports) {
68052     var baseProperty = require('../internal/baseProperty'),
68053       basePropertyDeep = require('../internal/basePropertyDeep'),
68054       isKey = require('../internal/isKey');
68055
68056     /**
68057      * Creates a function that returns the property value at `path` on a given
68058      * object.
68059      *
68060      * @static
68061      * @memberOf _
68062      * @category Utility
68063      * @param {Array|string}
68064      *            path The path of the property to get.
68065      * @returns {Function} Returns the new function.
68066      * @example
68067      *
68068      * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
68069      *
68070      * _.map(objects, _.property('a.b.c')); // => [2, 1]
68071      *
68072      * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // => [1,
68073      * 2]
68074      */
68075     function property(path) {
68076       return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
68077     }
68078
68079     module.exports = property;
68080
68081   }, {
68082     "../internal/baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js",
68083     "../internal/basePropertyDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js",
68084     "../internal/isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js"
68085   }]
68086 }, {}, ["\\bpmn-js-examples-master\\modeler\\app\\index.js"]);