aboutsummaryrefslogtreecommitdiffstats
path: root/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/bower_components/bpmn-js/dist/bpmn-modeler.js.map
blob: b3d93bd5257b96a8eb51d6d0d7b8745f6de62948 (plain)
1
{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","lib/Modeler.js","lib/Viewer.js","lib/core/index.js","lib/draw/BpmnRenderer.js","lib/draw/PathMap.js","lib/draw/index.js","lib/features/context-pad/ContextPadProvider.js","lib/features/context-pad/index.js","lib/features/keyboard/BpmnKeyBindings.js","lib/features/keyboard/index.js","lib/features/label-editing/LabelEditingProvider.js","lib/features/label-editing/LabelUtil.js","lib/features/label-editing/cmd/UpdateLabelHandler.js","lib/features/label-editing/index.js","lib/features/modeling/BpmnFactory.js","lib/features/modeling/BpmnLayouter.js","lib/features/modeling/BpmnUpdater.js","lib/features/modeling/ElementFactory.js","lib/features/modeling/LabelSupport.js","lib/features/modeling/Modeling.js","lib/features/modeling/ModelingUtil.js","lib/features/modeling/behavior/AppendBehavior.js","lib/features/modeling/behavior/CreateBehavior.js","lib/features/modeling/behavior/DropBehavior.js","lib/features/modeling/behavior/ModelingFeedback.js","lib/features/modeling/behavior/RemoveBehavior.js","lib/features/modeling/behavior/index.js","lib/features/modeling/cmd/UpdateCanvasRootHandler.js","lib/features/modeling/cmd/UpdatePropertiesHandler.js","lib/features/modeling/index.js","lib/features/modeling/rules/BpmnRules.js","lib/features/modeling/rules/index.js","lib/features/palette/PaletteProvider.js","lib/features/palette/index.js","lib/features/replace/BpmnReplace.js","lib/features/replace/ReplaceOptions.js","lib/features/replace/index.js","lib/features/snapping/BpmnSnapping.js","lib/features/snapping/index.js","lib/import/BpmnImporter.js","lib/import/BpmnTreeWalker.js","lib/import/Importer.js","lib/import/Util.js","lib/import/index.js","lib/util/DiUtil.js","lib/util/LabelUtil.js","lib/util/ModelUtil.js","node_modules/bpmn-moddle/index.js","node_modules/bpmn-moddle/lib/bpmn-moddle.js","node_modules/bpmn-moddle/lib/id-support.js","node_modules/bpmn-moddle/lib/simple.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/common.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/reader.js","node_modules/bpmn-moddle/node_modules/moddle-xml/lib/writer.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/sax/lib/sax.js","node_modules/bpmn-moddle/node_modules/moddle-xml/node_modules/tiny-stack/lib/tiny-stack.js","node_modules/bpmn-moddle/node_modules/moddle/index.js","node_modules/bpmn-moddle/node_modules/moddle/lib/base.js","node_modules/bpmn-moddle/node_modules/moddle/lib/descriptor-builder.js","node_modules/bpmn-moddle/node_modules/moddle/lib/factory.js","node_modules/bpmn-moddle/node_modules/moddle/lib/moddle.js","node_modules/bpmn-moddle/node_modules/moddle/lib/ns.js","node_modules/bpmn-moddle/node_modules/moddle/lib/properties.js","node_modules/bpmn-moddle/node_modules/moddle/lib/registry.js","node_modules/bpmn-moddle/node_modules/moddle/lib/types.js","node_modules/bpmn-moddle/resources/bpmn/json/bpmn.json","node_modules/bpmn-moddle/resources/bpmn/json/bpmndi.json","node_modules/bpmn-moddle/resources/bpmn/json/dc.json","node_modules/bpmn-moddle/resources/bpmn/json/di.json","node_modules/diagram-js-direct-editing/index.js","node_modules/diagram-js-direct-editing/lib/DirectEditing.js","node_modules/diagram-js-direct-editing/lib/TextBox.js","node_modules/diagram-js/index.js","node_modules/diagram-js/lib/Diagram.js","node_modules/diagram-js/lib/command/CommandInterceptor.js","node_modules/diagram-js/lib/command/CommandStack.js","node_modules/diagram-js/lib/command/index.js","node_modules/diagram-js/lib/core/Canvas.js","node_modules/diagram-js/lib/core/ElementFactory.js","node_modules/diagram-js/lib/core/ElementRegistry.js","node_modules/diagram-js/lib/core/EventBus.js","node_modules/diagram-js/lib/core/GraphicsFactory.js","node_modules/diagram-js/lib/core/index.js","node_modules/diagram-js/lib/draw/Renderer.js","node_modules/diagram-js/lib/draw/Styles.js","node_modules/diagram-js/lib/draw/index.js","node_modules/diagram-js/lib/features/bendpoints/BendpointMove.js","node_modules/diagram-js/lib/features/bendpoints/BendpointSnapping.js","node_modules/diagram-js/lib/features/bendpoints/Bendpoints.js","node_modules/diagram-js/lib/features/bendpoints/Util.js","node_modules/diagram-js/lib/features/bendpoints/index.js","node_modules/diagram-js/lib/features/change-support/ChangeSupport.js","node_modules/diagram-js/lib/features/change-support/index.js","node_modules/diagram-js/lib/features/connect/Connect.js","node_modules/diagram-js/lib/features/connect/index.js","node_modules/diagram-js/lib/features/context-pad/ContextPad.js","node_modules/diagram-js/lib/features/context-pad/index.js","node_modules/diagram-js/lib/features/create/Create.js","node_modules/diagram-js/lib/features/create/index.js","node_modules/diagram-js/lib/features/dragging/Dragging.js","node_modules/diagram-js/lib/features/dragging/index.js","node_modules/diagram-js/lib/features/interaction-events/InteractionEvents.js","node_modules/diagram-js/lib/features/interaction-events/index.js","node_modules/diagram-js/lib/features/keyboard/Keyboard.js","node_modules/diagram-js/lib/features/keyboard/index.js","node_modules/diagram-js/lib/features/lasso-tool/LassoTool.js","node_modules/diagram-js/lib/features/lasso-tool/index.js","node_modules/diagram-js/lib/features/modeling/Modeling.js","node_modules/diagram-js/lib/features/modeling/cmd/AppendShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/CreateConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/CreateLabelHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/CreateShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/DeleteConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/DeleteElementsHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/DeleteShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/LayoutConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/MoveConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/MoveShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/MoveShapesHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/NoopHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/ReconnectConnectionHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/ReplaceShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/ResizeShapeHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/SpaceToolHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/UpdateAnchorsHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/UpdateWaypointsHandler.js","node_modules/diagram-js/lib/features/modeling/cmd/helper/MoveHelper.js","node_modules/diagram-js/lib/features/modeling/index.js","node_modules/diagram-js/lib/features/move/Move.js","node_modules/diagram-js/lib/features/move/MoveVisuals.js","node_modules/diagram-js/lib/features/move/index.js","node_modules/diagram-js/lib/features/outline/Outline.js","node_modules/diagram-js/lib/features/outline/index.js","node_modules/diagram-js/lib/features/overlays/Overlays.js","node_modules/diagram-js/lib/features/overlays/index.js","node_modules/diagram-js/lib/features/palette/Palette.js","node_modules/diagram-js/lib/features/palette/index.js","node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js","node_modules/diagram-js/lib/features/popup-menu/index.js","node_modules/diagram-js/lib/features/replace/Replace.js","node_modules/diagram-js/lib/features/replace/index.js","node_modules/diagram-js/lib/features/resize/Resize.js","node_modules/diagram-js/lib/features/resize/ResizeUtil.js","node_modules/diagram-js/lib/features/resize/index.js","node_modules/diagram-js/lib/features/rules/RuleProvider.js","node_modules/diagram-js/lib/features/rules/Rules.js","node_modules/diagram-js/lib/features/rules/index.js","node_modules/diagram-js/lib/features/selection/Selection.js","node_modules/diagram-js/lib/features/selection/SelectionBehavior.js","node_modules/diagram-js/lib/features/selection/SelectionVisuals.js","node_modules/diagram-js/lib/features/selection/index.js","node_modules/diagram-js/lib/features/snapping/SnapContext.js","node_modules/diagram-js/lib/features/snapping/SnapUtil.js","node_modules/diagram-js/lib/features/snapping/Snapping.js","node_modules/diagram-js/lib/features/space-tool/SpaceTool.js","node_modules/diagram-js/lib/features/space-tool/SpaceToolVisuals.js","node_modules/diagram-js/lib/features/space-tool/SpaceUtil.js","node_modules/diagram-js/lib/features/space-tool/index.js","node_modules/diagram-js/lib/features/tooltips/Tooltips.js","node_modules/diagram-js/lib/features/tooltips/index.js","node_modules/diagram-js/lib/features/touch/TouchFix.js","node_modules/diagram-js/lib/features/touch/TouchInteractionEvents.js","node_modules/diagram-js/lib/features/touch/index.js","node_modules/diagram-js/lib/layout/BaseLayouter.js","node_modules/diagram-js/lib/layout/CroppingConnectionDocking.js","node_modules/diagram-js/lib/layout/LayoutUtil.js","node_modules/diagram-js/lib/layout/ManhattanLayout.js","node_modules/diagram-js/lib/model/index.js","node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js","node_modules/diagram-js/lib/navigation/movecanvas/index.js","node_modules/diagram-js/lib/navigation/touch/index.js","node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js","node_modules/diagram-js/lib/navigation/zoomscroll/index.js","node_modules/diagram-js/lib/util/ClickTrap.js","node_modules/diagram-js/lib/util/Collections.js","node_modules/diagram-js/lib/util/Cursor.js","node_modules/diagram-js/lib/util/Elements.js","node_modules/diagram-js/lib/util/Event.js","node_modules/diagram-js/lib/util/Geometry.js","node_modules/diagram-js/lib/util/GraphicsUtil.js","node_modules/diagram-js/lib/util/IdGenerator.js","node_modules/diagram-js/lib/util/Mouse.js","node_modules/diagram-js/lib/util/Platform.js","node_modules/diagram-js/lib/util/Text.js","node_modules/diagram-js/node_modules/eve/eve.js","node_modules/diagram-js/node_modules/hammerjs/hammer.js","node_modules/diagram-js/node_modules/snapsvg/dist/snap.svg.js","node_modules/diagram-js/vendor/snapsvg.js","node_modules/didi/lib/annotation.js","node_modules/didi/lib/index.js","node_modules/didi/lib/injector.js","node_modules/didi/lib/module.js","node_modules/ids/index.js","node_modules/ids/node_modules/hat/index.js","node_modules/inherits/inherits_browser.js","node_modules/lodash/array/flatten.js","node_modules/lodash/array/last.js","node_modules/lodash/array/uniq.js","node_modules/lodash/array/unique.js","node_modules/lodash/chain/lodash.js","node_modules/lodash/collection/every.js","node_modules/lodash/collection/filter.js","node_modules/lodash/collection/find.js","node_modules/lodash/collection/forEach.js","node_modules/lodash/collection/groupBy.js","node_modules/lodash/collection/includes.js","node_modules/lodash/collection/map.js","node_modules/lodash/collection/reduce.js","node_modules/lodash/collection/size.js","node_modules/lodash/collection/some.js","node_modules/lodash/collection/sortBy.js","node_modules/lodash/date/now.js","node_modules/lodash/function/bind.js","node_modules/lodash/function/debounce.js","node_modules/lodash/function/defer.js","node_modules/lodash/function/restParam.js","node_modules/lodash/internal/LazyWrapper.js","node_modules/lodash/internal/LodashWrapper.js","node_modules/lodash/internal/SetCache.js","node_modules/lodash/internal/arrayCopy.js","node_modules/lodash/internal/arrayEach.js","node_modules/lodash/internal/arrayEvery.js","node_modules/lodash/internal/arrayFilter.js","node_modules/lodash/internal/arrayMap.js","node_modules/lodash/internal/arrayReduce.js","node_modules/lodash/internal/arraySome.js","node_modules/lodash/internal/assignWith.js","node_modules/lodash/internal/baseAssign.js","node_modules/lodash/internal/baseCallback.js","node_modules/lodash/internal/baseCompareAscending.js","node_modules/lodash/internal/baseCopy.js","node_modules/lodash/internal/baseCreate.js","node_modules/lodash/internal/baseDelay.js","node_modules/lodash/internal/baseDifference.js","node_modules/lodash/internal/baseEach.js","node_modules/lodash/internal/baseEvery.js","node_modules/lodash/internal/baseFilter.js","node_modules/lodash/internal/baseFind.js","node_modules/lodash/internal/baseFindIndex.js","node_modules/lodash/internal/baseFlatten.js","node_modules/lodash/internal/baseFor.js","node_modules/lodash/internal/baseForIn.js","node_modules/lodash/internal/baseForOwn.js","node_modules/lodash/internal/baseGet.js","node_modules/lodash/internal/baseIndexOf.js","node_modules/lodash/internal/baseIsEqual.js","node_modules/lodash/internal/baseIsEqualDeep.js","node_modules/lodash/internal/baseIsFunction.js","node_modules/lodash/internal/baseIsMatch.js","node_modules/lodash/internal/baseLodash.js","node_modules/lodash/internal/baseMap.js","node_modules/lodash/internal/baseMatches.js","node_modules/lodash/internal/baseMatchesProperty.js","node_modules/lodash/internal/baseMerge.js","node_modules/lodash/internal/baseMergeDeep.js","node_modules/lodash/internal/baseProperty.js","node_modules/lodash/internal/basePropertyDeep.js","node_modules/lodash/internal/baseReduce.js","node_modules/lodash/internal/baseSetData.js","node_modules/lodash/internal/baseSlice.js","node_modules/lodash/internal/baseSome.js","node_modules/lodash/internal/baseSortBy.js","node_modules/lodash/internal/baseToString.js","node_modules/lodash/internal/baseUniq.js","node_modules/lodash/internal/baseValues.js","node_modules/lodash/internal/bindCallback.js","node_modules/lodash/internal/cacheIndexOf.js","node_modules/lodash/internal/cachePush.js","node_modules/lodash/internal/compareAscending.js","node_modules/lodash/internal/composeArgs.js","node_modules/lodash/internal/composeArgsRight.js","node_modules/lodash/internal/createAggregator.js","node_modules/lodash/internal/createAssigner.js","node_modules/lodash/internal/createBaseEach.js","node_modules/lodash/internal/createBaseFor.js","node_modules/lodash/internal/createBindWrapper.js","node_modules/lodash/internal/createCache.js","node_modules/lodash/internal/createCtorWrapper.js","node_modules/lodash/internal/createFind.js","node_modules/lodash/internal/createForEach.js","node_modules/lodash/internal/createHybridWrapper.js","node_modules/lodash/internal/createPartialWrapper.js","node_modules/lodash/internal/createReduce.js","node_modules/lodash/internal/createWrapper.js","node_modules/lodash/internal/equalArrays.js","node_modules/lodash/internal/equalByTag.js","node_modules/lodash/internal/equalObjects.js","node_modules/lodash/internal/getData.js","node_modules/lodash/internal/getFuncName.js","node_modules/lodash/internal/getLength.js","node_modules/lodash/internal/getSymbols.js","node_modules/lodash/internal/indexOfNaN.js","node_modules/lodash/internal/isArrayLike.js","node_modules/lodash/internal/isIndex.js","node_modules/lodash/internal/isIterateeCall.js","node_modules/lodash/internal/isKey.js","node_modules/lodash/internal/isLaziable.js","node_modules/lodash/internal/isLength.js","node_modules/lodash/internal/isObjectLike.js","node_modules/lodash/internal/isStrictComparable.js","node_modules/lodash/internal/mergeData.js","node_modules/lodash/internal/metaMap.js","node_modules/lodash/internal/pickByArray.js","node_modules/lodash/internal/pickByCallback.js","node_modules/lodash/internal/realNames.js","node_modules/lodash/internal/reorder.js","node_modules/lodash/internal/replaceHolders.js","node_modules/lodash/internal/setData.js","node_modules/lodash/internal/shimIsPlainObject.js","node_modules/lodash/internal/shimKeys.js","node_modules/lodash/internal/sortedUniq.js","node_modules/lodash/internal/toObject.js","node_modules/lodash/internal/toPath.js","node_modules/lodash/internal/wrapperClone.js","node_modules/lodash/lang/isArguments.js","node_modules/lodash/lang/isArray.js","node_modules/lodash/lang/isFunction.js","node_modules/lodash/lang/isNative.js","node_modules/lodash/lang/isNumber.js","node_modules/lodash/lang/isObject.js","node_modules/lodash/lang/isPlainObject.js","node_modules/lodash/lang/isString.js","node_modules/lodash/lang/isTypedArray.js","node_modules/lodash/lang/toPlainObject.js","node_modules/lodash/object/assign.js","node_modules/lodash/object/keys.js","node_modules/lodash/object/keysIn.js","node_modules/lodash/object/merge.js","node_modules/lodash/object/omit.js","node_modules/lodash/object/pick.js","node_modules/lodash/object/values.js","node_modules/lodash/string/escapeRegExp.js","node_modules/lodash/support.js","node_modules/lodash/utility/constant.js","node_modules/lodash/utility/identity.js","node_modules/lodash/utility/noop.js","node_modules/lodash/utility/property.js","node_modules/min-dom/lib/attr.js","node_modules/min-dom/lib/classes.js","node_modules/min-dom/lib/clear.js","node_modules/min-dom/lib/closest.js","node_modules/min-dom/lib/delegate.js","node_modules/min-dom/lib/domify.js","node_modules/min-dom/lib/event.js","node_modules/min-dom/lib/matches.js","node_modules/min-dom/lib/query.js","node_modules/min-dom/lib/remove.js","node_modules/min-dom/node_modules/component-classes/index.js","node_modules/min-dom/node_modules/component-classes/node_modules/component-indexof/index.js","node_modules/min-dom/node_modules/component-closest/index.js","node_modules/min-dom/node_modules/component-delegate/index.js","node_modules/min-dom/node_modules/component-event/index.js","node_modules/min-dom/node_modules/component-matches-selector/index.js","node_modules/min-dom/node_modules/component-query/index.js","node_modules/min-dom/node_modules/domify/index.js","node_modules/object-refs/index.js","node_modules/object-refs/lib/collection.js","node_modules/object-refs/lib/refs.js"],"names":[],"mappings":";;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChWA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/lDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrcA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpQA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACl4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt0FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvNA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzcA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7RA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7OA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxfA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjXA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxUA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpGA;AACA;AACA;AACA;;ACHA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9FA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;ACAA;;ACAA;;ACAA;;ACAA;;ACAA;;ACAA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","'use strict';\n\nvar inherits = require(195);\n\nvar IdSupport = require(50),\n    Ids = require(193);\n\nvar Viewer = require(2);\n\nvar initialDiagram =\n  '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' +\n  '<bpmn:definitions xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ' +\n                    'xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" ' +\n                    'xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" ' +\n                    'xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" ' +\n                    'targetNamespace=\"http://bpmn.io/schema/bpmn\" ' +\n                    'id=\"Definitions_1\">' +\n    '<bpmn:process id=\"Process_1\" isExecutable=\"false\">' +\n      '<bpmn:startEvent id=\"StartEvent_1\"/>' +\n    '</bpmn: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=\"173.0\" y=\"102.0\"/>' +\n        '</bpmndi:BPMNShape>' +\n      '</bpmndi:BPMNPlane>' +\n    '</bpmndi:BPMNDiagram>' +\n  '</bpmn:definitions>';\n\n\n/**\n * A modeler for BPMN 2.0 diagrams.\n *\n *\n * ## Extending the Modeler\n *\n * In order to extend the viewer pass extension modules to bootstrap via the\n * `additionalModules` option. An extension module is an object that exposes\n * named services.\n *\n * The following example depicts the integration of a simple\n * logging component that integrates with interaction events:\n *\n *\n * ```javascript\n *\n * // logging component\n * function InteractionLogger(eventBus) {\n *   eventBus.on('element.hover', function(event) {\n *     console.log()\n *   })\n * }\n *\n * InteractionLogger.$inject = [ 'eventBus' ]; // minification save\n *\n * // extension module\n * var extensionModule = {\n *   __init__: [ 'interactionLogger' ],\n *   interactionLogger: [ 'type', InteractionLogger ]\n * };\n *\n * // extend the viewer\n * var bpmnModeler = new Modeler({ additionalModules: [ extensionModule ] });\n * bpmnModeler.importXML(...);\n * ```\n *\n *\n * ## Customizing / Replacing Components\n *\n * You can replace individual diagram components by redefining them in override modules.\n * This works for all components, including those defined in the core.\n *\n * Pass in override modules via the `options.additionalModules` flag like this:\n *\n * ```javascript\n * function CustomContextPadProvider(contextPad) {\n *\n *   contextPad.registerProvider(this);\n *\n *   this.getContextPadEntries = function(element) {\n *     // no entries, effectively disable the context pad\n *     return {};\n *   };\n * }\n *\n * CustomContextPadProvider.$inject = [ 'contextPad' ];\n *\n * var overrideModule = {\n *   contextPadProvider: [ 'type', CustomContextPadProvider ]\n * };\n *\n * var bpmnModeler = new Modeler({ additionalModules: [ overrideModule ]});\n * ```\n *\n * @param {Object} [options] configuration options to pass to the viewer\n * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.\n * @param {String|Number} [options.width] the width of the viewer\n * @param {String|Number} [options.height] the height of the viewer\n * @param {Object} [options.moddleExtensions] extension packages to provide\n * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules\n * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules\n */\nfunction Modeler(options) {\n  Viewer.call(this, options);\n}\n\ninherits(Modeler, Viewer);\n\nModeler.prototype.createDiagram = function(done) {\n  return this.importXML(initialDiagram, done);\n};\n\nModeler.prototype.createModdle = function() {\n  var moddle = Viewer.prototype.createModdle.call(this);\n\n  IdSupport.extend(moddle, new Ids([ 32, 36, 1 ]));\n\n  return moddle;\n};\n\n\nModeler.prototype._interactionModules = [\n  // non-modeling components\n  require(14),\n  require(173),\n  require(170),\n  require(171)\n];\n\nModeler.prototype._modelingModules = [\n  // modeling components\n  require(131),\n  require(91),\n  require(144),\n  require(158),\n  require(107),\n  require(10),\n  require(39),\n  require(30),\n  require(8),\n  require(34)\n];\n\n\n// modules the modeler is composed of\n//\n// - viewer modules\n// - interaction modules\n// - modeling modules\n\nModeler.prototype._modules = [].concat(\n  Modeler.prototype._modules,\n  Modeler.prototype._interactionModules,\n  Modeler.prototype._modelingModules);\n\n\nmodule.exports = Modeler;\n","'use strict';\n\nvar assign = require(325),\n    omit = require(329),\n    isString = require(322),\n    isNumber = require(319);\n\nvar domify = require(343),\n    domQuery = require(346),\n    domRemove = require(347);\n\nvar Diagram = require(73),\n    BpmnModdle = require(48);\n\nvar Importer = require(42);\n\n\nfunction initListeners(diagram, listeners) {\n  var events = diagram.get('eventBus');\n\n  listeners.forEach(function(l) {\n    events.on(l.event, l.handler);\n  });\n}\n\nfunction checkValidationError(err) {\n\n  // check if we can help the user by indicating wrong BPMN 2.0 xml\n  // (in case he or the exporting tool did not get that right)\n\n  var pattern = /unparsable content <([^>]+)> detected([/s/S]*)$/;\n  var match = pattern.exec(err.message);\n\n  if (match) {\n    err.message =\n      'unparsable content <' + match[1] + '> detected; ' +\n      'this may indicate an invalid BPMN 2.0 diagram file' + match[2];\n  }\n\n  return err;\n}\n\nvar DEFAULT_OPTIONS = {\n  width: '100%',\n  height: '100%',\n  position: 'relative',\n  container: 'body'\n};\n\n\n/**\n * Ensure the passed argument is a proper unit (defaulting to px)\n */\nfunction ensureUnit(val) {\n  return val + (isNumber(val) ? 'px' : '');\n}\n\n/**\n * A viewer for BPMN 2.0 diagrams.\n *\n * Have a look at {@link NavigatedViewer} or {@link Modeler} for bundles that include\n * additional features.\n *\n *\n * ## Extending the Viewer\n *\n * In order to extend the viewer pass extension modules to bootstrap via the\n * `additionalModules` option. An extension module is an object that exposes\n * named services.\n *\n * The following example depicts the integration of a simple\n * logging component that integrates with interaction events:\n *\n *\n * ```javascript\n *\n * // logging component\n * function InteractionLogger(eventBus) {\n *   eventBus.on('element.hover', function(event) {\n *     console.log()\n *   })\n * }\n *\n * InteractionLogger.$inject = [ 'eventBus' ]; // minification save\n *\n * // extension module\n * var extensionModule = {\n *   __init__: [ 'interactionLogger' ],\n *   interactionLogger: [ 'type', InteractionLogger ]\n * };\n *\n * // extend the viewer\n * var bpmnViewer = new Viewer({ additionalModules: [ extensionModule ] });\n * bpmnViewer.importXML(...);\n * ```\n *\n * @param {Object} [options] configuration options to pass to the viewer\n * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body.\n * @param {String|Number} [options.width] the width of the viewer\n * @param {String|Number} [options.height] the height of the viewer\n * @param {Object} [options.moddleExtensions] extension packages to provide\n * @param {Array<didi.Module>} [options.modules] a list of modules to override the default modules\n * @param {Array<didi.Module>} [options.additionalModules] a list of modules to use with the default modules\n */\nfunction Viewer(options) {\n\n  this.options = options = assign({}, DEFAULT_OPTIONS, options || {});\n\n  var parent = options.container;\n\n  // support jquery element\n  // unwrap it if passed\n  if (parent.get) {\n    parent = parent.get(0);\n  }\n\n  // support selector\n  if (isString(parent)) {\n    parent = domQuery(parent);\n  }\n\n  var container = this.container = domify('<div class=\"bjs-container\"></div>');\n  parent.appendChild(container);\n\n  assign(container.style, {\n    width: ensureUnit(options.width),\n    height: ensureUnit(options.height),\n    position: options.position\n  });\n\n  /**\n   * The code in the <project-logo></project-logo> area\n   * must not be changed, see http://bpmn.io/license for more information\n   *\n   * <project-logo>\n   */\n\n  /* jshint -W101 */\n\n  // inlined ../resources/bpmnjs.png\n  var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC';\n\n  /* jshint +W101 */\n\n  var linkMarkup =\n        '<a href=\"http://bpmn.io\" ' +\n           'target=\"_blank\" ' +\n           'class=\"bjs-powered-by\" ' +\n           'title=\"Powered by bpmn.io\" ' +\n           'style=\"position: absolute; bottom: 15px; right: 15px; z-index: 100\">' +\n            '<img src=\"data:image/png;base64,' + logoData + '\">' +\n        '</a>';\n\n  container.appendChild(domify(linkMarkup));\n\n  /* </project-logo> */\n}\n\nViewer.prototype.importXML = function(xml, done) {\n\n  var self = this;\n\n  this.moddle = this.createModdle();\n\n  this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {\n\n    if (err) {\n      err = checkValidationError(err);\n      return done(err);\n    }\n\n    var parseWarnings = context.warnings;\n\n    self.importDefinitions(definitions, function(err, importWarnings) {\n      if (err) {\n        return done(err);\n      }\n\n      done(null, parseWarnings.concat(importWarnings || []));\n    });\n  });\n};\n\nViewer.prototype.saveXML = function(options, done) {\n\n  if (!done) {\n    done = options;\n    options = {};\n  }\n\n  var definitions = this.definitions;\n\n  if (!definitions) {\n    return done(new Error('no definitions loaded'));\n  }\n\n  this.moddle.toXML(definitions, options, done);\n};\n\nViewer.prototype.createModdle = function() {\n  return new BpmnModdle(this.options.moddleExtensions);\n};\n\nViewer.prototype.saveSVG = function(options, done) {\n\n  if (!done) {\n    done = options;\n    options = {};\n  }\n\n  var canvas = this.get('canvas');\n\n  var contentNode = canvas.getDefaultLayer(),\n      defsNode = canvas._svg.select('defs');\n\n  var contents = contentNode.innerSVG(),\n      defs = (defsNode && defsNode.outerSVG()) || '';\n\n  var bbox = contentNode.getBBox();\n\n  var svg =\n    '<?xml version=\"1.0\" encoding=\"utf-8\"?>/n' +\n    '<!-- created with bpmn-js / http://bpmn.io -->/n' +\n    '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">/n' +\n    '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ' +\n         'width=\"' + bbox.width + '\" height=\"' + bbox.height + '\" ' +\n         'viewBox=\"' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '\" version=\"1.1\">' +\n      defs + contents +\n    '</svg>';\n\n  done(null, svg);\n};\n\nViewer.prototype.get = function(name) {\n\n  if (!this.diagram) {\n    throw new Error('no diagram loaded');\n  }\n\n  return this.diagram.get(name);\n};\n\nViewer.prototype.invoke = function(fn) {\n\n  if (!this.diagram) {\n    throw new Error('no diagram loaded');\n  }\n\n  return this.diagram.invoke(fn);\n};\n\nViewer.prototype.importDefinitions = function(definitions, done) {\n\n  // use try/catch to not swallow synchronous exceptions\n  // that may be raised during model parsing\n  try {\n    if (this.diagram) {\n      this.clear();\n    }\n\n    this.definitions = definitions;\n\n    var diagram = this.diagram = this._createDiagram(this.options);\n\n    this._init(diagram);\n\n    Importer.importBpmnDiagram(diagram, definitions, done);\n  } catch (e) {\n    done(e);\n  }\n};\n\nViewer.prototype._init = function(diagram) {\n  initListeners(diagram, this.__listeners || []);\n};\n\nViewer.prototype._createDiagram = function(options) {\n\n  var modules = [].concat(options.modules || this.getModules(), options.additionalModules || []);\n\n  // add self as an available service\n  modules.unshift({\n    bpmnjs: [ 'value', this ],\n    moddle: [ 'value', this.moddle ]\n  });\n\n  options = omit(options, 'additionalModules');\n\n  options = assign(options, {\n    canvas: { container: this.container },\n    modules: modules\n  });\n\n  return new Diagram(options);\n};\n\n\nViewer.prototype.getModules = function() {\n  return this._modules;\n};\n\n/**\n * Remove all drawn elements from the viewer.\n *\n * After calling this method the viewer can still\n * be reused for opening another diagram.\n */\nViewer.prototype.clear = function() {\n  var diagram = this.diagram;\n\n  if (diagram) {\n    diagram.destroy();\n  }\n};\n\n/**\n * Destroy the viewer instance and remove all its remainders\n * from the document tree.\n */\nViewer.prototype.destroy = function() {\n  // clear underlying diagram\n  this.clear();\n\n  // remove container\n  domRemove(this.container);\n};\n\n/**\n * Register an event listener on the viewer\n *\n * @param {String} event\n * @param {Function} handler\n */\nViewer.prototype.on = function(event, handler) {\n  var diagram = this.diagram,\n      listeners = this.__listeners = this.__listeners || [];\n\n  listeners.push({ event: event, handler: handler });\n\n  if (diagram) {\n    diagram.get('eventBus').on(event, handler);\n  }\n};\n\n// modules the viewer is composed of\nViewer.prototype._modules = [\n  require(3),\n  require(151),\n  require(135)\n];\n\nmodule.exports = Viewer;\n","module.exports = {\n  __depends__: [\n    require(6),\n    require(44)\n  ]\n};","'use strict';\n\nvar inherits = require(195),\n    isArray = require(316),\n    isObject = require(320),\n    assign = require(325),\n    forEach = require(204),\n    every = require(201),\n    includes = require(206),\n    some = require(210);\n\nvar DefaultRenderer = require(84),\n    TextUtil = require(184),\n    DiUtil = require(45);\n\nvar createLine = DefaultRenderer.createLine;\n\n\nfunction BpmnRenderer(events, styles, pathMap) {\n\n  DefaultRenderer.call(this, styles);\n\n  var TASK_BORDER_RADIUS = 10;\n  var INNER_OUTER_DIST = 3;\n\n  var LABEL_STYLE = {\n    fontFamily: 'Arial, sans-serif',\n    fontSize: '12px'\n  };\n\n  var textUtil = new TextUtil({\n    style: LABEL_STYLE,\n    size: { width: 100 }\n  });\n\n  var markers = {};\n\n  function addMarker(id, element) {\n    markers[id] = element;\n  }\n\n  function marker(id) {\n    return markers[id];\n  }\n\n  function initMarkers(svg) {\n\n    function createMarker(id, options) {\n      var attrs = assign({\n        fill: 'black',\n        strokeWidth: 1,\n        strokeLinecap: 'round',\n        strokeDasharray: 'none'\n      }, options.attrs);\n\n      var ref = options.ref || { x: 0, y: 0 };\n\n      var scale = options.scale || 1;\n\n      // fix for safari / chrome / firefox bug not correctly\n      // resetting stroke dash array\n      if (attrs.strokeDasharray === 'none') {\n        attrs.strokeDasharray = [10000, 1];\n      }\n\n      var marker = options.element\n                     .attr(attrs)\n                     .marker(0, 0, 20, 20, ref.x, ref.y)\n                     .attr({\n                       markerWidth: 20 * scale,\n                       markerHeight: 20 * scale\n                     });\n\n      return addMarker(id, marker);\n    }\n\n\n    createMarker('sequenceflow-end', {\n      element: svg.path('M 1 5 L 11 10 L 1 15 Z'),\n      ref: { x: 11, y: 10 },\n      scale: 0.5\n    });\n\n    createMarker('messageflow-start', {\n      element: svg.circle(6, 6, 3.5),\n      attrs: {\n        fill: 'white',\n        stroke: 'black'\n      },\n      ref: { x: 6, y: 6 }\n    });\n\n    createMarker('messageflow-end', {\n      element: svg.path('m 1 5 l 0 -3 l 7 3 l -7 3 z'),\n      attrs: {\n        fill: 'white',\n        stroke: 'black',\n        strokeLinecap: 'butt'\n      },\n      ref: { x: 8.5, y: 5 }\n    });\n\n    createMarker('data-association-end', {\n      element: svg.path('M 1 5 L 11 10 L 1 15'),\n      attrs: {\n        fill: 'white',\n        stroke: 'black'\n      },\n      ref: { x: 11, y: 10 },\n      scale: 0.5\n    });\n\n    createMarker('conditional-flow-marker', {\n      element: svg.path('M 0 10 L 8 6 L 16 10 L 8 14 Z'),\n      attrs: {\n        fill: 'white',\n        stroke: 'black'\n      },\n      ref: { x: -1, y: 10 },\n      scale: 0.5\n    });\n\n    createMarker('conditional-default-flow-marker', {\n      element: svg.path('M 1 4 L 5 16'),\n      attrs: {\n        stroke: 'black'\n      },\n      ref: { x: -5, y: 10 },\n      scale: 0.5\n    });\n  }\n\n  function computeStyle(custom, traits, defaultStyles) {\n    if (!isArray(traits)) {\n      defaultStyles = traits;\n      traits = [];\n    }\n\n    return styles.style(traits || [], assign(defaultStyles, custom || {}));\n  }\n\n  function drawCircle(p, width, height, offset, attrs) {\n\n    if (isObject(offset)) {\n      attrs = offset;\n      offset = 0;\n    }\n\n    offset = offset || 0;\n\n    attrs = computeStyle(attrs, {\n      stroke: 'black',\n      strokeWidth: 2,\n      fill: 'white'\n    });\n\n    var cx = width / 2,\n        cy = height / 2;\n\n    return p.circle(cx, cy, Math.round((width + height) / 4 - offset)).attr(attrs);\n  }\n\n  function drawRect(p, width, height, r, offset, attrs) {\n\n    if (isObject(offset)) {\n      attrs = offset;\n      offset = 0;\n    }\n\n    offset = offset || 0;\n\n    attrs = computeStyle(attrs, {\n      stroke: 'black',\n      strokeWidth: 2,\n      fill: 'white'\n    });\n\n    return p.rect(offset, offset, width - offset * 2, height - offset * 2, r).attr(attrs);\n  }\n\n  function drawDiamond(p, width, height, attrs) {\n\n    var x_2 = width / 2;\n    var y_2 = height / 2;\n\n    var points = [x_2, 0, width, y_2, x_2, height, 0, y_2 ];\n\n    attrs = computeStyle(attrs, {\n      stroke: 'black',\n      strokeWidth: 2,\n      fill: 'white'\n    });\n\n    return p.polygon(points).attr(attrs);\n  }\n\n  function drawLine(p, waypoints, attrs) {\n    attrs = computeStyle(attrs, [ 'no-fill' ], {\n      stroke: 'black',\n      strokeWidth: 2,\n      fill: 'none'\n    });\n\n    return createLine(waypoints, attrs).appendTo(p);\n  }\n\n  function drawPath(p, d, attrs) {\n\n    attrs = computeStyle(attrs, [ 'no-fill' ], {\n      strokeWidth: 2,\n      stroke: 'black'\n    });\n\n    return p.path(d).attr(attrs);\n  }\n\n  function as(type) {\n    return function(p, element) {\n      return handlers[type](p, element);\n    };\n  }\n\n  function renderer(type) {\n    return handlers[type];\n  }\n\n  function renderEventContent(element, p) {\n\n    var event = getSemantic(element);\n    var isThrowing = isThrowEvent(event);\n\n    if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {\n      return renderer('bpmn:MessageEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {\n      return renderer('bpmn:TimerEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {\n      return renderer('bpmn:ConditionalEventDefinition')(p, element);\n    }\n\n    if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {\n      return renderer('bpmn:SignalEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n      isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: false })) {\n      return renderer('bpmn:MultipleEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:CancelEventDefinition') &&\n      isTypedEvent(event, 'bpmn:TerminateEventDefinition', { parallelMultiple: true })) {\n      return renderer('bpmn:ParallelMultipleEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {\n      return renderer('bpmn:EscalationEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {\n      return renderer('bpmn:LinkEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {\n      return renderer('bpmn:ErrorEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {\n      return renderer('bpmn:CancelEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {\n      return renderer('bpmn:CompensateEventDefinition')(p, element, isThrowing);\n    }\n\n    if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {\n      return renderer('bpmn:TerminateEventDefinition')(p, element, isThrowing);\n    }\n\n    return null;\n  }\n\n  function renderLabel(p, label, options) {\n    return textUtil.createText(p, label || '', options).addClass('djs-label');\n  }\n\n  function renderEmbeddedLabel(p, element, align) {\n    var semantic = getSemantic(element);\n    return renderLabel(p, semantic.name, { box: element, align: align, padding: 5 });\n  }\n\n  function renderExternalLabel(p, element, align) {\n    var semantic = getSemantic(element);\n\n    if (!semantic.name) {\n      element.hidden = true;\n    }\n\n    return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });\n  }\n\n  function renderLaneLabel(p, text, element) {\n    var textBox = renderLabel(p, text, {\n      box: { height: 30, width: element.height },\n      align: 'center-middle'\n    });\n\n    var top = -1 * element.height;\n    textBox.transform(\n      'rotate(270) ' +\n      'translate(' + top + ',' + 0 + ')'\n    );\n  }\n\n  function createPathFromConnection(connection) {\n    var waypoints = connection.waypoints;\n\n    var pathData = 'm  ' + waypoints[0].x + ',' + waypoints[0].y;\n    for (var i = 1; i < waypoints.length; i++) {\n      pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';\n    }\n    return pathData;\n  }\n\n  var handlers = {\n    'bpmn:Event': function(p, element, attrs) {\n      return drawCircle(p, element.width, element.height,  attrs);\n    },\n    'bpmn:StartEvent': function(p, element) {\n      var attrs = {};\n      var semantic = getSemantic(element);\n\n      if (!semantic.isInterrupting) {\n        attrs = {\n          strokeDasharray: '6',\n          strokeLinecap: 'round'\n        };\n      }\n\n      var circle = renderer('bpmn:Event')(p, element, attrs);\n\n      renderEventContent(element, p);\n\n      return circle;\n    },\n    'bpmn:MessageEventDefinition': function(p, element, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {\n        xScaleFactor: 0.9,\n        yScaleFactor: 0.9,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.235,\n          my: 0.315\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'white';\n      var stroke = isThrowing ? 'white' : 'black';\n\n      var messagePath = drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill,\n        stroke: stroke\n      });\n\n      return messagePath;\n    },\n    'bpmn:TimerEventDefinition': function(p, element) {\n\n      var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {\n        strokeWidth: 2\n      });\n\n      var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {\n        xScaleFactor: 0.75,\n        yScaleFactor: 0.75,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.5,\n          my: 0.5\n        }\n      });\n\n      drawPath(p, pathData, {\n        strokeWidth: 2,\n        strokeLinecap: 'square'\n      });\n\n      for(var i = 0;i < 12;i++) {\n\n        var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {\n          xScaleFactor: 0.75,\n          yScaleFactor: 0.75,\n          containerWidth: element.width,\n          containerHeight: element.height,\n          position: {\n            mx: 0.5,\n            my: 0.5\n          }\n        });\n\n        var width = element.width / 2;\n        var height = element.height / 2;\n\n        drawPath(p, linePathData, {\n          strokeWidth: 1,\n          strokeLinecap: 'square',\n          transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'\n        });\n      }\n\n      return circle;\n    },\n    'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.5,\n          my: 0.555\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      });\n    },\n    'bpmn:ConditionalEventDefinition': function(p, event) {\n      var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.5,\n          my: 0.222\n        }\n      });\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1\n      });\n    },\n    'bpmn:LinkEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_LINK', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.57,\n          my: 0.263\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      });\n    },\n    'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_ERROR', {\n        xScaleFactor: 1.1,\n        yScaleFactor: 1.1,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.2,\n          my: 0.722\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      });\n    },\n    'bpmn:CancelEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {\n        xScaleFactor: 1.0,\n        yScaleFactor: 1.0,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.638,\n          my: -0.055\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      }).transform('rotate(45)');\n    },\n    'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.201,\n          my: 0.472\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      });\n    },\n    'bpmn:SignalEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {\n        xScaleFactor: 0.9,\n        yScaleFactor: 0.9,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.5,\n          my: 0.2\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      });\n    },\n    'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {\n      var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {\n        xScaleFactor: 1.1,\n        yScaleFactor: 1.1,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.222,\n          my: 0.36\n        }\n      });\n\n      var fill = isThrowing ? 'black' : 'none';\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: fill\n      });\n    },\n    'bpmn:ParallelMultipleEventDefinition': function(p, event) {\n      var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {\n        xScaleFactor: 1.2,\n        yScaleFactor: 1.2,\n        containerWidth: event.width,\n        containerHeight: event.height,\n        position: {\n          mx: 0.458,\n          my: 0.194\n        }\n      });\n\n      return drawPath(p, pathData, {\n        strokeWidth: 1\n      });\n    },\n    'bpmn:EndEvent': function(p, element) {\n      var circle = renderer('bpmn:Event')(p, element, {\n        strokeWidth: 4\n      });\n\n      renderEventContent(element, p, true);\n\n      return circle;\n    },\n    'bpmn:TerminateEventDefinition': function(p, element) {\n      var circle = drawCircle(p, element.width, element.height, 8, {\n        strokeWidth: 4,\n        fill: 'black'\n      });\n\n      return circle;\n    },\n    'bpmn:IntermediateEvent': function(p, element) {\n      var outer = renderer('bpmn:Event')(p, element, { strokeWidth: 1 });\n      /* inner */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, { strokeWidth: 1, fill: 'none' });\n\n      renderEventContent(element, p);\n\n      return outer;\n    },\n    'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),\n    'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),\n\n    'bpmn:Activity': function(p, element, attrs) {\n      return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);\n    },\n\n    'bpmn:Task': function(p, element, attrs) {\n      var rect = renderer('bpmn:Activity')(p, element, attrs);\n      renderEmbeddedLabel(p, element, 'center-middle');\n      attachTaskMarkers(p, element);\n      return rect;\n    },\n    'bpmn:ServiceTask': function(p, element) {\n      var task = renderer('bpmn:Task')(p, element);\n\n      var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n        abspos: {\n          x: 12,\n          y: 18\n        }\n      });\n\n      /* service bg */ drawPath(p, pathDataBG, {\n        strokeWidth: 1,\n        fill: 'none'\n      });\n\n      var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {\n        abspos: {\n          x: 17.2,\n          y: 18\n        }\n      });\n\n      /* service fill */ drawPath(p, fillPathData, {\n        strokeWidth: 0,\n        stroke: 'none',\n        fill: 'white'\n      });\n\n      var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {\n        abspos: {\n          x: 17,\n          y: 22\n        }\n      });\n\n      /* service */ drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: 'white'\n      });\n\n      return task;\n    },\n    'bpmn:UserTask': function(p, element) {\n      var task = renderer('bpmn:Task')(p, element);\n\n      var x = 15;\n      var y = 12;\n\n      var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {\n        abspos: {\n          x: x,\n          y: y\n        }\n      });\n\n      /* user path */ drawPath(p, pathData, {\n        strokeWidth: 0.5,\n        fill: 'none'\n      });\n\n      var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {\n        abspos: {\n          x: x,\n          y: y\n        }\n      });\n\n      /* user2 path */ drawPath(p, pathData2, {\n        strokeWidth: 0.5,\n        fill: 'none'\n      });\n\n      var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {\n        abspos: {\n          x: x,\n          y: y\n        }\n      });\n\n      /* user3 path */ drawPath(p, pathData3, {\n        strokeWidth: 0.5,\n        fill: 'black'\n      });\n\n      return task;\n    },\n    'bpmn:ManualTask': function(p, element) {\n      var task = renderer('bpmn:Task')(p, element);\n\n      var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {\n        abspos: {\n          x: 17,\n          y: 15\n        }\n      });\n\n      /* manual path */ drawPath(p, pathData, {\n        strokeWidth: 0.25,\n        fill: 'white',\n        stroke: 'black'\n      });\n\n      return task;\n    },\n    'bpmn:SendTask': function(p, element) {\n      var task = renderer('bpmn:Task')(p, element);\n\n      var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: 21,\n        containerHeight: 14,\n        position: {\n          mx: 0.285,\n          my: 0.357\n        }\n      });\n\n      /* send path */ drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: 'black',\n        stroke: 'white'\n      });\n\n      return task;\n    },\n    'bpmn:ReceiveTask' : function(p, element) {\n      var semantic = getSemantic(element);\n\n      var task = renderer('bpmn:Task')(p, element);\n      var pathData;\n\n      if (semantic.instantiate) {\n        drawCircle(p, 28, 28, 20 * 0.22, { strokeWidth: 1 });\n\n        pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {\n          abspos: {\n            x: 7.77,\n            y: 9.52\n          }\n        });\n      } else {\n\n        pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {\n          xScaleFactor: 0.9,\n          yScaleFactor: 0.9,\n          containerWidth: 21,\n          containerHeight: 14,\n          position: {\n            mx: 0.3,\n            my: 0.4\n          }\n        });\n      }\n\n      /* receive path */ drawPath(p, pathData, {\n        strokeWidth: 1\n      });\n\n      return task;\n    },\n    'bpmn:ScriptTask': function(p, element) {\n      var task = renderer('bpmn:Task')(p, element);\n\n      var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {\n        abspos: {\n          x: 15,\n          y: 20\n        }\n      });\n\n      /* script path */ drawPath(p, pathData, {\n        strokeWidth: 1\n      });\n\n      return task;\n    },\n    'bpmn:BusinessRuleTask': function(p, element) {\n      var task = renderer('bpmn:Task')(p, element);\n\n      var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {\n        abspos: {\n          x: 8,\n          y: 8\n        }\n      });\n\n      var businessHeaderPath = drawPath(p, headerPathData);\n      businessHeaderPath.attr({\n        strokeWidth: 1,\n        fill: 'AAA'\n      });\n\n      var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {\n        abspos: {\n          x: 8,\n          y: 8\n        }\n      });\n\n      var businessPath = drawPath(p, headerData);\n      businessPath.attr({\n        strokeWidth: 1\n      });\n\n      return task;\n    },\n    'bpmn:SubProcess': function(p, element, attrs) {\n      var rect = renderer('bpmn:Activity')(p, element, attrs);\n\n      var semantic = getSemantic(element);\n\n      var expanded = DiUtil.isExpanded(semantic);\n\n      var isEventSubProcess = !!semantic.triggeredByEvent;\n      if (isEventSubProcess) {\n        rect.attr({\n          strokeDasharray: '1,2'\n        });\n      }\n\n      renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');\n\n      if (expanded) {\n        attachTaskMarkers(p, element);\n      } else {\n        attachTaskMarkers(p, element, ['SubProcessMarker']);\n      }\n\n      return rect;\n    },\n    'bpmn:AdHocSubProcess': function(p, element) {\n      return renderer('bpmn:SubProcess')(p, element);\n    },\n    'bpmn:Transaction': function(p, element) {\n      var outer = renderer('bpmn:SubProcess')(p, element);\n\n      var innerAttrs = styles.style([ 'no-fill', 'no-events' ]);\n\n      /* inner path */ drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);\n\n      return outer;\n    },\n    'bpmn:CallActivity': function(p, element) {\n      return renderer('bpmn:Task')(p, element, {\n        strokeWidth: 5\n      });\n    },\n    'bpmn:Participant': function(p, element) {\n\n      var lane = renderer('bpmn:Lane')(p, element, {\n        fill: 'White'\n      });\n\n      var expandedPool = DiUtil.isExpanded(element);\n\n      if (expandedPool) {\n        drawLine(p, [\n          { x: 30, y: 0 },\n          { x: 30, y: element.height }\n        ]);\n        var text = getSemantic(element).name;\n        renderLaneLabel(p, text, element);\n      } else {\n        // Collapsed pool draw text inline\n        var text2 = getSemantic(element).name;\n        renderLabel(p, text2, { box: element, align: 'center-middle' });\n      }\n\n      var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);\n\n      if(participantMultiplicity) {\n        renderer('ParticipantMultiplicityMarker')(p, element);\n      }\n\n      return lane;\n    },\n    'bpmn:Lane': function(p, element, attrs) {\n      var rect = drawRect(p, element.width, element.height, 0, attrs || {\n        fill: 'none'\n      });\n\n      var semantic = getSemantic(element);\n\n      if (semantic.$type === 'bpmn:Lane') {\n        var text = semantic.name;\n        renderLaneLabel(p, text, element);\n      }\n\n      return rect;\n    },\n    'bpmn:InclusiveGateway': function(p, element) {\n      var diamond = drawDiamond(p, element.width, element.height);\n\n        /* circle path */\n        drawCircle(p, element.width, element.height, element.height * 0.24, {\n        strokeWidth: 2.5,\n        fill: 'none'\n      });\n\n      return diamond;\n    },\n    'bpmn:ExclusiveGateway': function(p, element) {\n      var diamond = drawDiamond(p, element.width, element.height);\n\n      var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {\n        xScaleFactor: 0.4,\n        yScaleFactor: 0.4,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.32,\n          my: 0.3\n        }\n      });\n\n      if (!!(getDi(element).isMarkerVisible)) {\n        drawPath(p, pathData, {\n          strokeWidth: 1,\n          fill: 'black'\n        });\n      }\n\n      return diamond;\n    },\n    'bpmn:ComplexGateway': function(p, element) {\n      var diamond = drawDiamond(p, element.width, element.height);\n\n      var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {\n        xScaleFactor: 0.5,\n        yScaleFactor:0.5,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.46,\n          my: 0.26\n        }\n      });\n\n      /* complex path */ drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: 'black'\n      });\n\n      return diamond;\n    },\n    'bpmn:ParallelGateway': function(p, element) {\n      var diamond = drawDiamond(p, element.width, element.height);\n\n      var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n        xScaleFactor: 0.6,\n        yScaleFactor:0.6,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.46,\n          my: 0.2\n        }\n      });\n\n      /* parallel path */ drawPath(p, pathData, {\n        strokeWidth: 1,\n        fill: 'black'\n      });\n\n      return diamond;\n    },\n    'bpmn:EventBasedGateway': function(p, element) {\n\n      var semantic = getSemantic(element);\n\n      var diamond = drawDiamond(p, element.width, element.height);\n\n      /* outer circle path */ drawCircle(p, element.width, element.height, element.height * 0.20, {\n        strokeWidth: 1,\n        fill: 'none'\n      });\n\n      var type = semantic.eventGatewayType;\n      var instantiate = !!semantic.instantiate;\n\n      function drawEvent() {\n\n        var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {\n          xScaleFactor: 0.18,\n          yScaleFactor: 0.18,\n          containerWidth: element.width,\n          containerHeight: element.height,\n          position: {\n            mx: 0.36,\n            my: 0.44\n          }\n        });\n\n        /* event path */ drawPath(p, pathData, {\n          strokeWidth: 2,\n          fill: 'none'\n        });\n      }\n\n      if (type === 'Parallel') {\n\n        var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {\n          xScaleFactor: 0.4,\n          yScaleFactor:0.4,\n          containerWidth: element.width,\n          containerHeight: element.height,\n          position: {\n            mx: 0.474,\n            my: 0.296\n          }\n        });\n\n        var parallelPath = drawPath(p, pathData);\n        parallelPath.attr({\n          strokeWidth: 1,\n          fill: 'none'\n        });\n      } else if (type === 'Exclusive') {\n\n        if (!instantiate) {\n          var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);\n          innerCircle.attr({\n            strokeWidth: 1,\n            fill: 'none'\n          });\n        }\n\n        drawEvent();\n      }\n\n\n      return diamond;\n    },\n    'bpmn:Gateway': function(p, element) {\n      return drawDiamond(p, element.width, element.height);\n    },\n    'bpmn:SequenceFlow': function(p, element) {\n      var pathData = createPathFromConnection(element);\n      var path = drawPath(p, pathData, {\n        strokeLinejoin: 'round',\n        markerEnd: marker('sequenceflow-end')\n      });\n\n      var sequenceFlow = getSemantic(element);\n      var source = element.source.businessObject;\n\n      // conditional flow marker\n      if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {\n        path.attr({\n          markerStart: marker('conditional-flow-marker')\n        });\n      }\n\n      // default marker\n      if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {\n        path.attr({\n          markerStart: marker('conditional-default-flow-marker')\n        });\n      }\n\n      return path;\n    },\n    'bpmn:Association': function(p, element, attrs) {\n\n      attrs = assign({\n        strokeDasharray: '1,6',\n        strokeLinecap: 'round',\n        strokeLinejoin: 'round'\n      }, attrs || {});\n\n      // TODO(nre): style according to directed state\n      return drawLine(p, element.waypoints, attrs);\n    },\n    'bpmn:DataInputAssociation': function(p, element) {\n      return renderer('bpmn:Association')(p, element, {\n        markerEnd: marker('data-association-end')\n      });\n    },\n    'bpmn:DataOutputAssociation': function(p, element) {\n      return renderer('bpmn:Association')(p, element, {\n        markerEnd: marker('data-association-end')\n      });\n    },\n    'bpmn:MessageFlow': function(p, element) {\n\n      var semantic = getSemantic(element),\n          di = getDi(element);\n\n      var pathData = createPathFromConnection(element);\n      var path = drawPath(p, pathData, {\n        markerEnd: marker('messageflow-end'),\n        markerStart: marker('messageflow-start'),\n        strokeDasharray: '10, 12',\n        strokeLinecap: 'round',\n        strokeLinejoin: 'round',\n        strokeWidth: '1.5px'\n      });\n\n      if (semantic.messageRef) {\n        var midPoint = path.getPointAtLength(path.getTotalLength() / 2);\n\n        var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {\n          abspos: {\n            x: midPoint.x,\n            y: midPoint.y\n          }\n        });\n\n        var messageAttrs = { strokeWidth: 1 };\n\n        if (di.messageVisibleKind === 'initiating') {\n          messageAttrs.fill = 'white';\n          messageAttrs.stroke = 'black';\n        } else {\n          messageAttrs.fill = '#888';\n          messageAttrs.stroke = 'white';\n        }\n\n        drawPath(p, markerPathData, messageAttrs);\n      }\n\n      return path;\n    },\n    'bpmn:DataObject': function(p, element) {\n      var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.474,\n          my: 0.296\n        }\n      });\n\n      var elementObject = drawPath(p, pathData, { fill: 'white' });\n\n      var semantic = getSemantic(element);\n\n      if (isCollection(semantic)) {\n        renderDataItemCollection(p, element);\n      }\n\n      return elementObject;\n    },\n    'bpmn:DataObjectReference': as('bpmn:DataObject'),\n    'bpmn:DataInput': function(p, element) {\n\n      var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n      // page\n      var elementObject = renderer('bpmn:DataObject')(p, element);\n\n      /* input arrow path */ drawPath(p, arrowPathData, { strokeWidth: 1 });\n\n      return elementObject;\n    },\n    'bpmn:DataOutput': function(p, element) {\n      var arrowPathData = pathMap.getRawPath('DATA_ARROW');\n\n      // page\n      var elementObject = renderer('bpmn:DataObject')(p, element);\n\n      /* output arrow path */ drawPath(p, arrowPathData, {\n        strokeWidth: 1,\n        fill: 'black'\n      });\n\n      return elementObject;\n    },\n    'bpmn:DataStoreReference': function(p, element) {\n      var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0,\n          my: 0.133\n        }\n      });\n\n      var elementStore = drawPath(p, DATA_STORE_PATH, {\n        strokeWidth: 2,\n        fill: 'white'\n      });\n\n      return elementStore;\n    },\n    'bpmn:BoundaryEvent': function(p, element) {\n\n      var semantic = getSemantic(element),\n          cancel = semantic.cancelActivity;\n\n      var attrs = {\n        strokeLinecap: 'round',\n        strokeWidth: 1\n      };\n\n      if (!cancel) {\n        attrs.strokeDasharray = '6';\n      }\n\n      var outer = renderer('bpmn:Event')(p, element, attrs);\n      /* inner path */ drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);\n\n      renderEventContent(element, p);\n\n      return outer;\n    },\n    'bpmn:Group': function(p, element) {\n      return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {\n        strokeWidth: 1,\n        strokeDasharray: '8,3,1,3',\n        fill: 'none',\n        pointerEvents: 'none'\n      });\n    },\n    'label': function(p, element) {\n      return renderExternalLabel(p, element, '');\n    },\n    'bpmn:TextAnnotation': function(p, element) {\n      var style = {\n        'fill': 'none',\n        'stroke': 'none'\n      };\n      var textElement = drawRect(p, element.width, element.height, 0, 0, style);\n      var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: 0.0,\n          my: 0.0\n        }\n      });\n      drawPath(p, textPathData);\n\n      var text = getSemantic(element).text || '';\n      renderLabel(p, text, { box: element, align: 'left-middle', padding: 5 });\n\n      return textElement;\n    },\n    'ParticipantMultiplicityMarker': function(p, element) {\n      var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: ((element.width / 2) / element.width),\n          my: (element.height - 15) / element.height\n        }\n      });\n\n      drawPath(p, subProcessPath);\n    },\n    'SubProcessMarker': function(p, element) {\n      var markerRect = drawRect(p, 14, 14, 0, {\n        strokeWidth: 1\n      });\n\n      // Process marker is placed in the middle of the box\n      // therefore fixed values can be used here\n      markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');\n\n      var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {\n        xScaleFactor: 1.5,\n        yScaleFactor: 1.5,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: (element.width / 2 - 7.5) / element.width,\n          my: (element.height - 20) / element.height\n        }\n      });\n\n      drawPath(p, subProcessPath);\n    },\n    'ParallelMarker': function(p, element, position) {\n      var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: ((element.width / 2 + position.parallel) / element.width),\n          my: (element.height - 20) / element.height\n        }\n      });\n      drawPath(p, subProcessPath);\n    },\n    'SequentialMarker': function(p, element, position) {\n      var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: ((element.width / 2 + position.seq) / element.width),\n          my: (element.height - 19) / element.height\n        }\n      });\n      drawPath(p, sequentialPath);\n    },\n    'CompensationMarker': function(p, element, position) {\n      var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: ((element.width / 2 + position.compensation) / element.width),\n          my: (element.height - 13) / element.height\n        }\n      });\n      drawPath(p, compensationPath, { strokeWidth: 1 });\n    },\n    'LoopMarker': function(p, element, position) {\n      var loopPath = pathMap.getScaledPath('MARKER_LOOP', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: ((element.width / 2 + position.loop) / element.width),\n          my: (element.height - 7) / element.height\n        }\n      });\n\n      drawPath(p, loopPath, {\n        strokeWidth: 1,\n        fill: 'none',\n        strokeLinecap: 'round',\n        strokeMiterlimit: 0.5\n      });\n    },\n    'AdhocMarker': function(p, element, position) {\n      var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {\n        xScaleFactor: 1,\n        yScaleFactor: 1,\n        containerWidth: element.width,\n        containerHeight: element.height,\n        position: {\n          mx: ((element.width / 2 + position.adhoc) / element.width),\n          my: (element.height - 15) / element.height\n        }\n      });\n\n      drawPath(p, loopPath, {\n        strokeWidth: 1,\n        fill: 'black'\n      });\n    }\n  };\n\n  function attachTaskMarkers(p, element, taskMarkers) {\n    var obj = getSemantic(element);\n\n    var subprocess = includes(taskMarkers, 'SubProcessMarker');\n    var position;\n\n    if (subprocess) {\n      position = {\n        seq: -21,\n        parallel: -22,\n        compensation: -42,\n        loop: -18,\n        adhoc: 10\n      };\n    } else {\n      position = {\n        seq: -3,\n        parallel: -6,\n        compensation: -27,\n        loop: 0,\n        adhoc: 10\n      };\n    }\n\n    forEach(taskMarkers, function(marker) {\n      renderer(marker)(p, element, position);\n    });\n\n    if (obj.$type === 'bpmn:AdHocSubProcess') {\n      renderer('AdhocMarker')(p, element, position);\n    }\n    if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {\n      renderer('LoopMarker')(p, element, position);\n      return;\n    }\n    if (obj.loopCharacteristics &&\n      obj.loopCharacteristics.isSequential !== undefined &&\n      !obj.loopCharacteristics.isSequential) {\n      renderer('ParallelMarker')(p, element, position);\n    }\n    if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {\n      renderer('SequentialMarker')(p, element, position);\n    }\n    if (!!obj.isForCompensation) {\n      renderer('CompensationMarker')(p, element, position);\n    }\n  }\n\n  function drawShape(parent, element) {\n    var type = element.type;\n    var h = handlers[type];\n\n    /* jshint -W040 */\n    if (!h) {\n      return DefaultRenderer.prototype.drawShape.apply(this, [ parent, element ]);\n    } else {\n      return h(parent, element);\n    }\n  }\n\n  function drawConnection(parent, element) {\n    var type = element.type;\n    var h = handlers[type];\n\n    /* jshint -W040 */\n    if (!h) {\n      return DefaultRenderer.prototype.drawConnection.apply(this, [ parent, element ]);\n    } else {\n      return h(parent, element);\n    }\n  }\n\n  function renderDataItemCollection(p, element) {\n\n    var yPosition = (element.height - 16) / element.height;\n\n    var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {\n      xScaleFactor: 1,\n      yScaleFactor: 1,\n      containerWidth: element.width,\n      containerHeight: element.height,\n      position: {\n        mx: 0.451,\n        my: yPosition\n      }\n    });\n\n    /* collection path */ drawPath(p, pathData, {\n      strokeWidth: 2\n    });\n  }\n\n  function isCollection(element, filter) {\n    return element.isCollection ||\n           (element.elementObjectRef && element.elementObjectRef.isCollection);\n  }\n\n  function getDi(element) {\n    return element.businessObject.di;\n  }\n\n  function getSemantic(element) {\n    return element.businessObject;\n  }\n\n  /**\n   * Checks if eventDefinition of the given element matches with semantic type.\n   *\n   * @return {boolean} true if element is of the given semantic type\n   */\n  function isTypedEvent(event, eventDefinitionType, filter) {\n\n    function matches(definition, filter) {\n      return every(filter, function(val, key) {\n\n        // we want a == conversion here, to be able to catch\n        // undefined == false and friends\n        /* jshint -W116 */\n        return definition[key] == val;\n      });\n    }\n\n    return some(event.eventDefinitions, function(definition) {\n      return definition.$type === eventDefinitionType && matches(event, filter);\n    });\n  }\n\n  function isThrowEvent(event) {\n    return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');\n  }\n\n\n  /////// cropping path customizations /////////////////////////\n\n  function componentsToPath(elements) {\n    return elements.join(',').replace(/,?([A-z]),?/g, '$1');\n  }\n\n  function getCirclePath(shape) {\n\n    var cx = shape.x + shape.width / 2,\n        cy = shape.y + shape.height / 2,\n        radius = shape.width / 2;\n\n    var circlePath = [\n        ['M', cx, cy],\n        ['m', 0, -radius],\n        ['a', radius, radius, 0, 1, 1, 0, 2 * radius],\n        ['a', radius, radius, 0, 1, 1, 0, -2 * radius],\n        ['z']\n    ];\n\n    return componentsToPath(circlePath);\n  }\n\n  function getRoundRectPath(shape) {\n\n    var radius = TASK_BORDER_RADIUS,\n        x = shape.x,\n        y = shape.y,\n        width = shape.width,\n        height = shape.height;\n\n    var roundRectPath = [\n      ['M', x + radius, y],\n      ['l', width - radius * 2, 0],\n      ['a', radius, radius, 0, 0, 1, radius, radius],\n      ['l', 0, height - radius * 2],\n      ['a', radius, radius, 0, 0, 1, -radius, radius],\n      ['l', radius * 2 - width, 0],\n      ['a', radius, radius, 0, 0, 1, -radius, -radius],\n      ['l', 0, radius * 2 - height],\n      ['a', radius, radius, 0, 0, 1, radius, -radius],\n      ['z']\n    ];\n\n    return componentsToPath(roundRectPath);\n  }\n\n  function getDiamondPath(shape) {\n\n    var width = shape.width,\n        height = shape.height,\n        x = shape.x,\n        y = shape.y,\n        halfWidth = width / 2,\n        halfHeight = height / 2;\n\n    var diamondPath = [\n      ['M', x + halfWidth, y],\n      ['l', halfWidth, halfHeight],\n      ['l', -halfWidth, halfHeight],\n      ['l', -halfWidth, -halfHeight],\n      ['z']\n    ];\n\n    return componentsToPath(diamondPath);\n  }\n\n  function getRectPath(shape) {\n    var x = shape.x,\n        y = shape.y,\n        width = shape.width,\n        height = shape.height;\n\n    var rectPath = [\n      ['M', x, y],\n      ['l', width, 0],\n      ['l', 0, height],\n      ['l', -width, 0],\n      ['z']\n    ];\n\n    return componentsToPath(rectPath);\n  }\n\n  function getShapePath(element) {\n    var obj = getSemantic(element);\n\n    if (obj.$instanceOf('bpmn:Event')) {\n      return getCirclePath(element);\n    }\n\n    if (obj.$instanceOf('bpmn:Activity')) {\n      return getRoundRectPath(element);\n    }\n\n    if (obj.$instanceOf('bpmn:Gateway')) {\n      return getDiamondPath(element);\n    }\n\n    return getRectPath(element);\n  }\n\n\n  // hook onto canvas init event to initialize\n  // connection start/end markers on svg\n  events.on('canvas.init', function(event) {\n    initMarkers(event.svg);\n  });\n\n  this.drawShape = drawShape;\n  this.drawConnection = drawConnection;\n\n  this.getShapePath = getShapePath;\n}\n\ninherits(BpmnRenderer, DefaultRenderer);\n\n\nBpmnRenderer.$inject = [ 'eventBus', 'styles', 'pathMap' ];\n\nmodule.exports = BpmnRenderer;\n","'use strict';\n\nvar Snap = require(188);\n\n/**\n * Map containing SVG paths needed by BpmnRenderer.\n */\n\nfunction PathMap() {\n\n  /**\n   * Contains a map of path elements\n   *\n   * <h1>Path definition</h1>\n   * A parameterized path is defined like this:\n   * <pre>\n   * 'GATEWAY_PARALLEL': {\n   *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n          '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n   *   height: 17.5,\n   *   width:  17.5,\n   *   heightElements: [2.5, 7.5],\n   *   widthElements: [2.5, 7.5]\n   * }\n   * </pre>\n   * <p>It's important to specify a correct <b>height and width</b> for the path as the scaling\n   * is based on the ratio between the specified height and width in this object and the\n   * height and width that is set as scale target (Note x,y coordinates will be scaled with\n   * individual ratios).</p>\n   * <p>The '<b>heightElements</b>' and '<b>widthElements</b>' array must contain the values that will be scaled.\n   * The scaling is based on the computed ratios.\n   * Coordinates on the y axis should be in the <b>heightElement</b>'s array, they will be scaled using\n   * the computed ratio coefficient.\n   * In the parameterized path the scaled values can be accessed through the 'e' object in {} brackets.\n   *   <ul>\n   *    <li>The values for the y axis can be accessed in the path string using {e.y0}, {e.y1}, ....</li>\n   *    <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</li>\n   *   </ul>\n   *   The numbers x0, x1 respectively y0, y1, ... map to the corresponding array index.\n   * </p>\n   */\n  this.pathMap = {\n    'EVENT_MESSAGE': {\n      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}',\n      height: 36,\n      width:  36,\n      heightElements: [6, 14],\n      widthElements: [10.5, 21]\n    },\n    'EVENT_SIGNAL': {\n      d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',\n      height: 36,\n      width: 36,\n      heightElements: [18],\n      widthElements: [10, 20]\n    },\n    'EVENT_ESCALATION': {\n      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} ' +\n        '{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',\n      height: 36,\n      width: 36,\n      heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],\n      widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]\n    },\n    'EVENT_CONDITIONAL': {\n      d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +\n         'M {e.x2},{e.y3} l {e.x0},0 ' +\n         'M {e.x2},{e.y4} l {e.x0},0 ' +\n         'M {e.x2},{e.y5} l {e.x0},0 ' +\n         'M {e.x2},{e.y6} l {e.x0},0 ' +\n         'M {e.x2},{e.y7} l {e.x0},0 ' +\n         'M {e.x2},{e.y8} l {e.x0},0 ',\n      height: 36,\n      width:  36,\n      heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],\n      widthElements:  [10.5, 14.5, 12.5]\n    },\n    'EVENT_LINK': {\n      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',\n      height: 36,\n      width: 36,\n      heightElements: [4.4375, 6.75, 7.8125],\n      widthElements: [9.84375, 13.5]\n    },\n    'EVENT_ERROR': {\n      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',\n      height: 36,\n      width: 36,\n      heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],\n      widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]\n    },\n    'EVENT_CANCEL_45': {\n      d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n        '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n      height: 36,\n      width: 36,\n      heightElements: [4.75, 8.5],\n      widthElements: [4.75, 8.5]\n    },\n    'EVENT_COMPENSATION': {\n      d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',\n      height: 36,\n      width: 36,\n      heightElements: [5, 10],\n      widthElements: [10]\n    },\n    'EVENT_TIMER_WH': {\n      d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',\n      height: 36,\n      width:  36,\n      heightElements: [10, 2],\n      widthElements: [3, 7]\n    },\n    'EVENT_TIMER_LINE': {\n      d:  'M {mx},{my} ' +\n          'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',\n      height: 36,\n      width:  36,\n      heightElements: [10, 3],\n      widthElements: [0, 0]\n    },\n    'EVENT_MULTIPLE': {\n      d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',\n      height: 36,\n      width:  36,\n      heightElements: [6.28099, 12.56199],\n      widthElements: [3.1405, 9.42149, 12.56198]\n    },\n    'EVENT_PARALLEL_MULTIPLE': {\n      d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +\n        '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',\n      height: 36,\n      width:  36,\n      heightElements: [2.56228, 7.68683],\n      widthElements: [2.56228, 7.68683]\n    },\n    'GATEWAY_EXCLUSIVE': {\n      d:'m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +\n                    '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +\n                    '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',\n      height: 17.5,\n      width:  17.5,\n      heightElements: [8.5, 6.5312, -6.5312, -8.5],\n      widthElements:  [6.5, -6.5, 3, -3, 5, -5]\n    },\n    'GATEWAY_PARALLEL': {\n      d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +\n        '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',\n      height: 30,\n      width:  30,\n      heightElements: [5, 12.5],\n      widthElements: [5, 12.5]\n    },\n    'GATEWAY_EVENT_BASED': {\n      d:'m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',\n      height: 11,\n      width:  11,\n      heightElements: [-6, 6, 12, -12],\n      widthElements: [9, -3, -12]\n    },\n    'GATEWAY_COMPLEX': {\n      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} ' +\n        '{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} ' +\n        '{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} ' +\n        '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',\n      height: 17.125,\n      width:  17.125,\n      heightElements: [4.875, 3.4375, 2.125, 3],\n      widthElements: [3.4375, 2.125, 4.875, 3]\n    },\n    'DATA_OBJECT_PATH': {\n      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',\n      height: 61,\n      width:  51,\n      heightElements: [10, 50, 60],\n      widthElements: [10, 40, 50, 60]\n    },\n    'DATA_OBJECT_COLLECTION_PATH': {\n      d:'m {mx}, {my} ' +\n        'm  0 15  l 0 -15 ' +\n        'm  4 15  l 0 -15 ' +\n        'm  4 15  l 0 -15 ',\n      height: 61,\n      width:  51,\n      heightElements: [12],\n      widthElements: [1, 6, 12, 15]\n    },\n    'DATA_ARROW': {\n      d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',\n      height: 61,\n      width:  51,\n      heightElements: [],\n      widthElements: []\n    },\n    'DATA_STORE': {\n      d:'m  {mx},{my} ' +\n        'l  0,{e.y2} ' +\n        'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +\n        'l  0,-{e.y2} ' +\n        'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +\n        'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +\n        'm  -{e.x2},{e.y0}' +\n        'c  {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +\n        'm  -{e.x2},{e.y0}' +\n        'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0',\n      height: 61,\n      width:  61,\n      heightElements: [7, 10, 45],\n      widthElements:  [2, 58, 60]\n    },\n    'TEXT_ANNOTATION': {\n      d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',\n      height: 30,\n      width: 10,\n      heightElements: [30],\n      widthElements: [10]\n    },\n    'MARKER_SUB_PROCESS': {\n      d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',\n      height: 10,\n      width: 10,\n      heightElements: [],\n      widthElements: []\n    },\n    'MARKER_PARALLEL': {\n      d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',\n      height: 10,\n      width: 10,\n      heightElements: [],\n      widthElements: []\n    },\n    'MARKER_SEQUENTIAL': {\n      d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',\n      height: 10,\n      width: 10,\n      heightElements: [],\n      widthElements: []\n    },\n    'MARKER_COMPENSATION': {\n      d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',\n      height: 10,\n      width: 21,\n      heightElements: [],\n      widthElements: []\n    },\n    'MARKER_LOOP': {\n      d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +\n        '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +\n        '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +\n        'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',\n      height: 13.9,\n      width: 13.7,\n      heightElements: [],\n      widthElements: []\n    },\n    'MARKER_ADHOC': {\n      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 ' +\n        '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +\n        '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 ' +\n        '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +\n        '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',\n      height: 4,\n      width: 15,\n      heightElements: [],\n      widthElements: []\n    },\n    'TASK_TYPE_SEND': {\n      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}',\n      height: 14,\n      width:  21,\n      heightElements: [6, 14],\n      widthElements: [10.5, 21]\n    },\n    'TASK_TYPE_SCRIPT': {\n      d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +\n        'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +\n        'm -7,-12 l 5,0 ' +\n        'm -4.5,3 l 4.5,0 ' +\n        'm -3,3 l 5,0' +\n        'm -4,3 l 5,0',\n      height: 15,\n      width:  12.6,\n      heightElements: [6, 14],\n      widthElements: [10.5, 21]\n    },\n    'TASK_TYPE_USER_1': {\n      d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +\n        '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +\n        '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +\n        'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +\n        'm -8,6 l 0,5.5 m 11,0 l 0,-5'\n    },\n    'TASK_TYPE_USER_2': {\n      d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +\n        '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '\n    },\n    'TASK_TYPE_USER_3': {\n      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 ' +\n        '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +\n        '-4.20799998,3.36699999 -4.20699998,4.34799999 z'\n    },\n    'TASK_TYPE_MANUAL': {\n      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 ' +\n        '-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 ' +\n        '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 ' +\n        '-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 ' +\n        '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 ' +\n        '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +\n        '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +\n        '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +\n        '-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 ' +\n        '-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 ' +\n        '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 ' +\n        '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'\n    },\n    'TASK_TYPE_INSTANTIATING_SEND': {\n      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'\n    },\n    'TASK_TYPE_SERVICE': {\n      d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +\n        '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +\n        '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +\n        'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +\n        '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +\n        '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +\n        '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 ' +\n        '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +\n        'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +\n        'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +\n        '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +\n        'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +\n        'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n        '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n        '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n    },\n    'TASK_TYPE_SERVICE_FILL': {\n      d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +\n        '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +\n        '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'\n    },\n    'TASK_TYPE_BUSINESS_RULE_HEADER': {\n      d: 'm {mx},{my} 0,4 20,0 0,-4 z'\n    },\n    'TASK_TYPE_BUSINESS_RULE_MAIN': {\n      d: 'm {mx},{my} 0,12 20,0 0,-12 z' +\n        'm 0,8 l 20,0 ' +\n        'm -13,-4 l 0,8'\n    },\n    'MESSAGE_FLOW_MARKER': {\n      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'\n    }\n  };\n\n  this.getRawPath = function getRawPath(pathId) {\n    return this.pathMap[pathId].d;\n  };\n\n  /**\n   * Scales the path to the given height and width.\n   * <h1>Use case</h1>\n   * <p>Use case is to scale the content of elements (event, gateways) based\n   * on the element bounding box's size.\n   * </p>\n   * <h1>Why not transform</h1>\n   * <p>Scaling a path with transform() will also scale the stroke and IE does not support\n   * the option 'non-scaling-stroke' to prevent this.\n   * Also there are use cases where only some parts of a path should be\n   * scaled.</p>\n   *\n   * @param {String} pathId The ID of the path.\n   * @param {Object} param <p>\n   *   Example param object scales the path to 60% size of the container (data.width, data.height).\n   *   <pre>\n   *   {\n   *     xScaleFactor: 0.6,\n   *     yScaleFactor:0.6,\n   *     containerWidth: data.width,\n   *     containerHeight: data.height,\n   *     position: {\n   *       mx: 0.46,\n   *       my: 0.2,\n   *     }\n   *   }\n   *   </pre>\n   *   <ul>\n   *    <li>targetpathwidth = xScaleFactor * containerWidth</li>\n   *    <li>targetpathheight = yScaleFactor * containerHeight</li>\n   *    <li>Position is used to set the starting coordinate of the path. M is computed:\n    *    <ul>\n    *      <li>position.x * containerWidth</li>\n    *      <li>position.y * containerHeight</li>\n    *    </ul>\n    *    Center of the container <pre> position: {\n   *       mx: 0.5,\n   *       my: 0.5,\n   *     }</pre>\n   *     Upper left corner of the container\n   *     <pre> position: {\n   *       mx: 0.0,\n   *       my: 0.0,\n   *     }</pre>\n   *    </li>\n   *   </ul>\n   * </p>\n   *\n   */\n  this.getScaledPath = function getScaledPath(pathId, param) {\n    var rawPath = this.pathMap[pathId];\n\n    // positioning\n    // compute the start point of the path\n    var mx, my;\n\n    if(!!param.abspos) {\n      mx = param.abspos.x;\n      my = param.abspos.y;\n    } else {\n      mx = param.containerWidth * param.position.mx;\n      my = param.containerHeight * param.position.my;\n    }\n\n    var coordinates = {}; //map for the scaled coordinates\n    if(param.position) {\n\n      // path\n      var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;\n      var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;\n\n\n      //Apply height ratio\n      for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {\n        coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;\n      }\n\n      //Apply width ratio\n      for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {\n        coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;\n      }\n    }\n\n    //Apply value to raw path\n    var path = Snap.format(\n      rawPath.d, {\n        mx: mx,\n        my: my,\n        e: coordinates\n      }\n    );\n    return path;\n  };\n}\n\nmodule.exports = PathMap;\n","module.exports = {\n  renderer: [ 'type', require(4) ],\n  pathMap: [ 'type', require(5) ]\n};","'use strict';\n\n\nvar assign = require(325),\n    forEach = require(204);\n\n\n/**\n * A provider for BPMN 2.0 elements context pad\n */\nfunction ContextPadProvider(contextPad, modeling, elementFactory,\n                            connect, create, bpmnReplace,\n                            canvas) {\n\n  contextPad.registerProvider(this);\n\n  this._contextPad = contextPad;\n\n  this._modeling = modeling;\n\n  this._elementFactory = elementFactory;\n  this._connect = connect;\n  this._create = create;\n  this._bpmnReplace = bpmnReplace;\n  this._canvas  = canvas;\n}\n\nContextPadProvider.$inject = [\n  'contextPad',\n  'modeling',\n  'elementFactory',\n  'connect',\n  'create',\n  'bpmnReplace',\n  'canvas'\n];\n\nContextPadProvider.prototype.getContextPadEntries = function(element) {\n\n  var contextPad = this._contextPad,\n      modeling = this._modeling,\n\n      elementFactory = this._elementFactory,\n      connect = this._connect,\n      create = this._create,\n      bpmnReplace = this._bpmnReplace,\n      canvas = this._canvas;\n\n  var actions = {};\n\n  if (element.type === 'label') {\n    return actions;\n  }\n\n  var bpmnElement = element.businessObject;\n\n  function startConnect(event, element, autoActivate) {\n    connect.start(event, element, autoActivate);\n  }\n\n  function removeElement(e) {\n    if (element.waypoints) {\n      modeling.removeConnection(element);\n    } else {\n      modeling.removeShape(element);\n    }\n  }\n\n  function getReplaceMenuPosition(element) {\n\n    var Y_OFFSET = 5;\n\n    var diagramContainer = canvas.getContainer(),\n        pad = contextPad.getPad(element).html;\n\n    var diagramRect = diagramContainer.getBoundingClientRect(),\n        padRect = pad.getBoundingClientRect();\n\n    var top = padRect.top - diagramRect.top;\n    var left = padRect.left - diagramRect.left;\n\n    var pos = {\n      x: left,\n      y: top + padRect.height + Y_OFFSET\n    };\n\n    return pos;\n  }\n\n\n  function appendAction(type, className, options) {\n\n    function appendListener(event, element) {\n\n      var shape = elementFactory.createShape(assign({ type: type }, options));\n      create.start(event, shape, element);\n    }\n\n    var shortType = type.replace(/^bpmn/:/, '');\n\n    return {\n      group: 'model',\n      className: className,\n      title: 'Append ' + shortType,\n      action: {\n        dragstart: appendListener,\n        click: appendListener\n      }\n    };\n  }\n\n  if (bpmnElement.$instanceOf('bpmn:FlowNode')) {\n\n    if (!bpmnElement.$instanceOf('bpmn:EndEvent') &&\n        !bpmnElement.$instanceOf('bpmn:EventBasedGateway') &&\n        !isEventType(bpmnElement, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition')) {\n\n      assign(actions, {\n        'append.end-event': appendAction('bpmn:EndEvent', 'icon-end-event-none'),\n        'append.gateway': appendAction('bpmn:ExclusiveGateway', 'icon-gateway-xor'),\n        'append.append-task': appendAction('bpmn:Task', 'icon-task'),\n        'append.intermediate-event': appendAction('bpmn:IntermediateThrowEvent',\n                                                  'icon-intermediate-event-none')\n      });\n    }\n\n    if (bpmnElement.$instanceOf('bpmn:EventBasedGateway')) {\n\n      assign(actions, {\n        'append.receive-task': appendAction('bpmn:ReceiveTask', 'icon-receive-task'),\n        'append.message-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n                                                  'icon-intermediate-event-catch-message',\n                                                  { _eventDefinitionType: 'bpmn:MessageEventDefinition'}),\n        'append.timer-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n                                                  'icon-intermediate-event-catch-timer',\n                                                  { _eventDefinitionType: 'bpmn:TimerEventDefinition'}),\n        'append.condtion-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n                                                  'icon-intermediate-event-catch-condition',\n                                                  { _eventDefinitionType: 'bpmn:ConditionalEventDefinition'}),\n        'append.signal-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',\n                                                  'icon-intermediate-event-catch-signal',\n                                                  { _eventDefinitionType: 'bpmn:SignalEventDefinition'})\n      });\n    }\n\n\n    // Replace menu entry\n    if (!bpmnElement.$instanceOf('bpmn:SubProcess')) {\n      assign(actions, {\n        'replace': {\n          group: 'edit',\n          className: 'icon-screw-wrench',\n          title: 'Change type',\n          action: {\n            click: function(event, element) {\n              bpmnReplace.openChooser(getReplaceMenuPosition(element), element);\n            }\n          }\n        }\n      });\n    }\n  }\n\n  if (bpmnElement.$instanceOf('bpmn:FlowNode') ||\n      bpmnElement.$instanceOf('bpmn:InteractionNode')) {\n\n    assign(actions, {\n      'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),\n\n      'connect': {\n        group: 'connect',\n        className: 'icon-connection-multi',\n        title: 'Connect using Sequence/MessageFlow',\n        action: {\n          click: startConnect,\n          dragstart: startConnect\n        }\n      }\n    });\n  }\n\n  // Delete Element Entry\n  assign(actions, {\n    'delete': {\n      group: 'edit',\n      className: 'icon-trash',\n      title: 'Remove',\n      action: {\n        click: removeElement,\n        dragstart: removeElement\n      }\n    }\n  });\n\n  return actions;\n};\n\nfunction isEventType(eventBo, type, definition) {\n\n  var isType = eventBo.$instanceOf(type);\n  var isDefinition = false;\n\n  var definitions = eventBo.eventDefinitions || [];\n  forEach(definitions, function(def) {\n    if (def.$type === definition) {\n      isDefinition = true;\n    }\n  });\n\n  return isType && isDefinition;\n}\n\n\nmodule.exports = ContextPadProvider;\n","module.exports = {\n  __depends__: [\n    require(70),\n    require(97),\n    require(151),\n    require(95),\n    require(99),\n    require(37)\n  ],\n  __init__: [ 'contextPadProvider' ],\n  contextPadProvider: [ 'type', require(7) ]\n};","'use strict';\n\n\nfunction BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {\n\n  keyboard.addListener(function(key, modifiers) {\n\n    if (keyboard.hasModifier(modifiers)) {\n      return;\n    }\n\n    // S -> activate space tool\n    if (key === 83) {\n      spaceTool.activateSelection();\n\n      return true;\n    }\n\n    // L -> activate lasso tool\n    if (key === 108) {\n      lassoTool.activateSelection();\n\n      return true;\n    }\n\n    var currentSelection = selection.get();\n\n    // E -> activate direct editing\n    if (key === 69) {\n      if (currentSelection.length) {\n        directEditing.activate(currentSelection[0]);\n      }\n\n      return true;\n    }\n  });\n}\n\nBpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection' ];\n\nmodule.exports = BpmnKeyBindings;","module.exports = {\n  __depends__: [\n    require(105)\n  ],\n  __init__: [ 'bpmnKeyBindings' ],\n  bpmnKeyBindings: [ 'type', require(9) ]\n};","'use strict';\n\nvar UpdateLabelHandler = require(13);\n\nvar LabelUtil = require(12);\n\nvar is = require(47).is,\n    isExpanded = require(45).isExpanded;\n\n\nvar MIN_BOUNDS = {\n  width: 150,\n  height: 50\n};\n\n\nfunction LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {\n\n  directEditing.registerProvider(this);\n  commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);\n\n  // listen to dblclick on non-root elements\n  eventBus.on('element.dblclick', function(event) {\n    directEditing.activate(event.element);\n  });\n\n  // complete on followup canvas operation\n  eventBus.on([ 'element.mousedown', 'drag.activate', 'canvas.viewbox.changed' ], function(event) {\n    directEditing.complete();\n  });\n\n  // cancel on command stack changes\n  eventBus.on([ 'commandStack.changed' ], function() {\n    directEditing.cancel();\n  });\n\n\n  // activate direct editing for activities and text annotations\n\n\n  if ('ontouchstart' in document.documentElement) {\n    // we deactivate automatic label editing on mobile devices\n    // as it breaks the user interaction workflow\n\n    // TODO(nre): we should temporarily focus the edited element here\n    // and release the focused viewport after the direct edit operation is finished\n  } else {\n    eventBus.on('create.end', 500, function(e) {\n\n      var element = e.shape,\n          canExecute = e.context.canExecute;\n\n      if (!canExecute) {\n        return;\n      }\n\n      if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||\n          (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {\n\n        directEditing.activate(element);\n      }\n    });\n  }\n\n  this._canvas = canvas;\n  this._commandStack = commandStack;\n}\n\nLabelEditingProvider.$inject = [ 'eventBus', 'canvas', 'directEditing', 'commandStack', 'injector' ];\n\nmodule.exports = LabelEditingProvider;\n\n\nLabelEditingProvider.prototype.activate = function(element) {\n\n  var text = LabelUtil.getLabel(element);\n\n  if (text === undefined) {\n    return;\n  }\n\n  var bbox = this.getEditingBBox(element);\n\n  // adjust for expanded pools AND lanes\n  if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {\n\n    bbox.width = MIN_BOUNDS.width;\n    bbox.height = MIN_BOUNDS.height;\n\n    bbox.x = bbox.x + 10 - bbox.width / 2;\n    bbox.y = bbox.mid.y - bbox.height / 2;\n  }\n\n  // adjust for expanded sub processes\n  if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {\n\n    bbox.height = MIN_BOUNDS.height;\n\n    bbox.x = bbox.mid.x - bbox.width / 2;\n    bbox.y = bbox.y + 10 - bbox.height / 2;\n  }\n\n  return { bounds: bbox, text: text };\n};\n\n\nLabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {\n\n  var target = element.label || element;\n\n  var bbox = this._canvas.getAbsoluteBBox(target);\n\n  var mid = {\n    x: bbox.x + bbox.width / 2,\n    y: bbox.y + bbox.height / 2\n  };\n\n  // external label\n  if (target.labelTarget) {\n    bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);\n    bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);\n\n    bbox.x = mid.x - bbox.width / 2;\n  }\n\n  bbox.mid = mid;\n\n  return bbox;\n};\n\n\nLabelEditingProvider.prototype.update = function(element, newLabel) {\n  this._commandStack.execute('element.updateLabel', {\n    element: element,\n    newLabel: newLabel\n  });\n};","'use strict';\n\nfunction getLabelAttr(semantic) {\n  if (semantic.$instanceOf('bpmn:FlowElement') ||\n      semantic.$instanceOf('bpmn:Participant') ||\n      semantic.$instanceOf('bpmn:Lane') ||\n      semantic.$instanceOf('bpmn:SequenceFlow') ||\n      semantic.$instanceOf('bpmn:MessageFlow')) {\n    return 'name';\n  }\n\n  if (semantic.$instanceOf('bpmn:TextAnnotation')) {\n    return 'text';\n  }\n}\n\nmodule.exports.getLabel = function(element) {\n  var semantic = element.businessObject,\n      attr = getLabelAttr(semantic);\n\n  if (attr) {\n    return semantic[attr] || '';\n  }\n};\n\n\nmodule.exports.setLabel = function(element, text) {\n  var semantic = element.businessObject,\n      attr = getLabelAttr(semantic);\n\n  if (attr) {\n    semantic[attr] = text;\n  }\n\n  var label = element.label || element;\n\n  // show label\n  label.hidden = false;\n\n  return label;\n};","'use strict';\n\nvar LabelUtil = require(12);\n\n\n/**\n * A handler that updates the text of a BPMN element.\n *\n * @param {EventBus} eventBus\n */\nfunction UpdateTextHandler(eventBus) {\n\n  function setText(element, text) {\n    var label = LabelUtil.setLabel(element, text);\n\n    eventBus.fire('element.changed', { element: label });\n  }\n\n  function execute(ctx) {\n    ctx.oldLabel = LabelUtil.getLabel(ctx.element);\n    return setText(ctx.element, ctx.newLabel);\n  }\n\n  function revert(ctx) {\n    return setText(ctx.element, ctx.oldLabel);\n  }\n\n\n  function canExecute(ctx) {\n    return true;\n  }\n\n  // API\n\n  this.execute = execute;\n  this.revert = revert;\n\n  this.canExecute = canExecute;\n}\n\n\nUpdateTextHandler.$inject = [ 'eventBus' ];\n\nmodule.exports = UpdateTextHandler;","module.exports = {\n  __depends__: [\n    require(77),\n    require(93),\n    require(70)\n  ],\n  __init__: [ 'labelEditingProvider' ],\n  labelEditingProvider: [ 'type', require(11) ]\n};","'use strict';\n\nvar map = require(207),\n    assign = require(325),\n    pick = require(330);\n\n\nfunction BpmnFactory(moddle) {\n  this._model = moddle;\n}\n\nBpmnFactory.$inject = [ 'moddle' ];\n\n\nBpmnFactory.prototype._needsId = function(element) {\n  return element.$instanceOf('bpmn:RootElement') ||\n         element.$instanceOf('bpmn:FlowElement') ||\n         element.$instanceOf('bpmn:MessageFlow') ||\n         element.$instanceOf('bpmn:Artifact') ||\n         element.$instanceOf('bpmn:Participant') ||\n         element.$instanceOf('bpmn:Process') ||\n         element.$instanceOf('bpmn:Collaboration') ||\n         element.$instanceOf('bpmndi:BPMNShape') ||\n         element.$instanceOf('bpmndi:BPMNEdge') ||\n         element.$instanceOf('bpmndi:BPMNDiagram') ||\n         element.$instanceOf('bpmndi:BPMNPlane');\n};\n\nBpmnFactory.prototype._ensureId = function(element) {\n\n  // generate semantic ids for elements\n  // bpmn:SequenceFlow -> SequenceFlow_ID\n  var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';\n\n  if (!element.id && this._needsId(element)) {\n    element.id = this._model.ids.nextPrefixed(prefix, element);\n  }\n};\n\n\nBpmnFactory.prototype.create = function(type, attrs) {\n  var element = this._model.create(type, attrs || {});\n\n  this._ensureId(element);\n\n  return element;\n};\n\n\nBpmnFactory.prototype.createDiLabel = function() {\n  return this.create('bpmndi:BPMNLabel', {\n    bounds: this.createDiBounds()\n  });\n};\n\n\nBpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {\n\n  return this.create('bpmndi:BPMNShape', assign({\n    bpmnElement: semantic,\n    bounds: this.createDiBounds(bounds)\n  }, attrs));\n};\n\n\nBpmnFactory.prototype.createDiBounds = function(bounds) {\n  return this.create('dc:Bounds', bounds);\n};\n\n\nBpmnFactory.prototype.createDiWaypoints = function(waypoints) {\n  return map(waypoints, function(pos) {\n    return this.createDiWaypoint(pos);\n  }, this);\n};\n\nBpmnFactory.prototype.createDiWaypoint = function(point) {\n  return this.create('dc:Point', pick(point, [ 'x', 'y' ]));\n};\n\n\nBpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {\n  return this.create('bpmndi:BPMNEdge', assign({\n    bpmnElement: semantic\n  }, attrs));\n};\n\nBpmnFactory.prototype.createDiPlane = function(semantic) {\n  return this.create('bpmndi:BPMNPlane', {\n    bpmnElement: semantic\n  });\n};\n\nmodule.exports = BpmnFactory;\n","'use strict';\n\nvar inherits = require(195);\n\nvar assign = require(325);\n\nvar BaseLayouter = require(164),\n    LayoutUtil = require(166),\n    ManhattanLayout = require(167);\n\nvar is = require(47).is;\n\n\nfunction BpmnLayouter() {}\n\ninherits(BpmnLayouter, BaseLayouter);\n\nmodule.exports = BpmnLayouter;\n\n\nfunction getAttachment(waypoints, idx, shape) {\n  var point = waypoints && waypoints[idx];\n\n  return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);\n}\n\n\nBpmnLayouter.prototype.layoutConnection = function(connection, hints) {\n  var source = connection.source,\n      target = connection.target,\n      waypoints = connection.waypoints,\n      start,\n      end;\n\n  var layoutManhattan,\n      updatedWaypoints;\n\n  start = getAttachment(waypoints, 0, source);\n  end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);\n\n  // manhattan layout sequence / message flows\n  if (is(connection, 'bpmn:MessageFlow')) {\n    layoutManhattan = {\n      preferStraight: true,\n      preferVertical: true\n    };\n  }\n\n  if (is(connection, 'bpmn:SequenceFlow')) {\n    layoutManhattan = {};\n  }\n\n  if (layoutManhattan) {\n\n    layoutManhattan = assign(layoutManhattan, hints);\n\n    updatedWaypoints =\n      ManhattanLayout.repairConnection(\n        source, target, start, end,\n        waypoints,\n        layoutManhattan);\n  }\n\n  return updatedWaypoints || [ start, end ];\n};","'use strict';\n\nvar assign = require(325),\n    forEach = require(204),\n    inherits = require(195);\n\nvar Collections = require(175),\n    Model = require(168);\n\nvar CommandInterceptor = require(75);\n\n\n/**\n * A handler responsible for updating the underlying BPMN 2.0 XML + DI\n * once changes on the diagram happen\n */\nfunction BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {\n\n  CommandInterceptor.call(this, eventBus);\n\n  this._bpmnFactory = bpmnFactory;\n\n  var self = this;\n\n\n\n  ////// connection cropping /////////////////////////\n\n  // crop connection ends during create/update\n  function cropConnection(e) {\n    var context = e.context,\n        connection;\n\n    if (!context.cropped) {\n      connection = context.connection;\n      connection.waypoints = connectionDocking.getCroppedWaypoints(connection);\n      context.cropped = true;\n    }\n  }\n\n  this.executed([\n    'connection.layout',\n    'connection.create',\n    'connection.reconnectEnd',\n    'connection.reconnectStart'\n  ], cropConnection);\n\n  this.reverted([ 'connection.layout' ], function(e) {\n    delete e.context.cropped;\n  });\n\n\n\n  ////// BPMN + DI update /////////////////////////\n\n\n  // update parent\n  function updateParent(e) {\n    self.updateParent(e.context.shape || e.context.connection);\n  }\n\n  this.executed([ 'shape.move',\n                  'shape.create',\n                  'shape.delete',\n                  'connection.create',\n                  'connection.move',\n                  'connection.delete' ], updateParent);\n  this.reverted([ 'shape.move',\n                  'shape.create',\n                  'shape.delete',\n                  'connection.create',\n                  'connection.move',\n                  'connection.delete' ], updateParent);\n\n  /*\n   * ## Updating Parent\n   *\n   * When morphing a Process into a Collaboration or vice-versa, \n   * make sure that both the *semantic* and *di* parent of each element\n   * is updated.\n   *\n   */\n  function updateRoot(event) {\n    var context = event.context,\n        oldRoot = context.oldRoot,\n        children = oldRoot.children;\n\n    forEach(children, function(child) {\n      self.updateParent(child);\n    });\n  }\n\n  this.executed([ 'canvas.updateRoot' ], updateRoot);\n  this.reverted([ 'canvas.updateRoot' ], updateRoot);\n\n\n  // update bounds\n  function updateBounds(e) {\n    self.updateBounds(e.context.shape);\n  }\n\n  this.executed([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);\n  this.reverted([ 'shape.move', 'shape.create', 'shape.resize' ], updateBounds);\n\n\n  // attach / detach connection\n  function updateConnection(e) {\n    self.updateConnection(e.context.connection);\n  }\n\n  this.executed([\n    'connection.create',\n    'connection.move',\n    'connection.delete',\n    'connection.reconnectEnd',\n    'connection.reconnectStart'\n  ], updateConnection);\n\n  this.reverted([\n    'connection.create',\n    'connection.move',\n    'connection.delete',\n    'connection.reconnectEnd',\n    'connection.reconnectStart'\n  ], updateConnection);\n\n\n  // update waypoints\n  function updateConnectionWaypoints(e) {\n    self.updateConnectionWaypoints(e.context.connection);\n  }\n\n  this.executed([\n    'connection.layout',\n    'connection.move',\n    'connection.updateWaypoints',\n    'connection.reconnectEnd',\n    'connection.reconnectStart'\n  ], updateConnectionWaypoints);\n\n  this.reverted([\n    'connection.layout',\n    'connection.move',\n    'connection.updateWaypoints',\n    'connection.reconnectEnd',\n    'connection.reconnectStart'\n  ], updateConnectionWaypoints);\n}\n\ninherits(BpmnUpdater, CommandInterceptor);\n\nmodule.exports = BpmnUpdater;\n\nBpmnUpdater.$inject = [ 'eventBus', 'bpmnFactory', 'connectionDocking'];\n\n\n/////// implementation //////////////////////////////////\n\n\nBpmnUpdater.prototype.updateParent = function(element) {\n\n  // do not update BPMN 2.0 label parent\n  if (element instanceof Model.Label) {\n    return;\n  }\n\n  var parentShape = element.parent;\n\n  var businessObject = element.businessObject,\n      parentBusinessObject = parentShape && parentShape.businessObject,\n      parentDi = parentBusinessObject && parentBusinessObject.di;\n\n  this.updateSemanticParent(businessObject, parentBusinessObject);\n\n  this.updateDiParent(businessObject.di, parentDi);\n};\n\n\nBpmnUpdater.prototype.updateBounds = function(shape) {\n\n  var di = shape.businessObject.di;\n\n  var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;\n\n  assign(bounds, {\n    x: shape.x,\n    y: shape.y,\n    width: shape.width,\n    height: shape.height\n  });\n};\n\n\nBpmnUpdater.prototype.updateDiParent = function(di, parentDi) {\n\n  if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {\n    parentDi = parentDi.$parent;\n  }\n\n  if (di.$parent === parentDi) {\n    return;\n  }\n\n  var planeElements = (parentDi || di.$parent).get('planeElement');\n\n  if (parentDi) {\n    planeElements.push(di);\n    di.$parent = parentDi;\n  } else {\n    Collections.remove(planeElements, di);\n    di.$parent = null;\n  }\n};\n\nfunction getDefinitions(element) {\n  while (element && !element.$instanceOf('bpmn:Definitions')) {\n    element = element.$parent;\n  }\n\n  return element;\n}\n\nBpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {\n\n  var containment;\n\n  if (businessObject.$parent === newParent) {\n    return;\n  }\n\n  if (businessObject.$instanceOf('bpmn:FlowElement')) {\n\n    if (newParent && newParent.$instanceOf('bpmn:Participant')) {\n      newParent = newParent.processRef;\n    }\n\n    containment = 'flowElements';\n\n  } else\n\n  if (businessObject.$instanceOf('bpmn:Artifact')) {\n\n    while (newParent &&\n           !newParent.$instanceOf('bpmn:Process') &&\n           !newParent.$instanceOf('bpmn:SubProcess') &&\n           !newParent.$instanceOf('bpmn:Collaboration')) {\n\n      if (newParent.$instanceOf('bpmn:Participant')) {\n        newParent = newParent.processRef;\n        break;\n      } else {\n        newParent = newParent.$parent;\n      }\n    }\n\n    containment = 'artifacts';\n  } else\n\n  if (businessObject.$instanceOf('bpmn:MessageFlow')) {\n    containment = 'messageFlows';\n\n  } else\n\n  if (businessObject.$instanceOf('bpmn:Participant')) {\n    containment = 'participants';\n\n    // make sure the participants process is properly attached / detached\n    // from the XML document\n\n    var process = businessObject.processRef,\n        definitions;\n\n    if (process) {\n      definitions = getDefinitions(businessObject.$parent || newParent);\n\n      if (businessObject.$parent) {\n        Collections.remove(definitions.get('rootElements'), process);\n        process.$parent = null;\n      }\n\n      if (newParent) {\n        Collections.add(definitions.get('rootElements'), process);\n        process.$parent = definitions;\n      }\n    }\n  }\n\n  if (!containment) {\n    throw new Error('no parent for ', businessObject, newParent);\n  }\n\n  var children;\n\n  if (businessObject.$parent) {\n    // remove from old parent\n    children = businessObject.$parent.get(containment);\n    Collections.remove(children, businessObject);\n  }\n\n  if (!newParent) {\n    businessObject.$parent = null;\n  } else {\n    // add to new parent\n    children = newParent.get(containment);\n    children.push(businessObject);\n    businessObject.$parent = newParent;\n  }\n};\n\n\nBpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {\n\n  connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));\n};\n\n\nBpmnUpdater.prototype.updateConnection = function(connection) {\n\n  var businessObject = connection.businessObject,\n      newSource = connection.source && connection.source.businessObject,\n      newTarget = connection.target && connection.target.businessObject;\n\n  var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');\n\n  if (businessObject.sourceRef !== newSource) {\n    if (inverseSet) {\n      Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);\n\n      if (newSource) {\n        newSource.get('outgoing').push(businessObject);\n      }\n    }\n\n    businessObject.sourceRef = newSource;\n  }\n  if (businessObject.targetRef !== newTarget) {\n    if (inverseSet) {\n      Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);\n\n      if (newTarget) {\n        newTarget.get('incoming').push(businessObject);\n      }\n    }\n\n    businessObject.targetRef = newTarget;\n  }\n\n  businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));\n};\n\n\n/////// helpers /////////////////////////////////////////\n\nBpmnUpdater.prototype._getLabel = function(di) {\n  if (!di.label) {\n    di.label = this._bpmnFactory.createDiLabel();\n  }\n\n  return di.label;\n};","'use strict';\n\nvar assign = require(325),\n    inherits = require(195);\n\nvar BaseElementFactory = require(79),\n    LabelUtil = require(46);\n\n\n/**\n * A bpmn-aware factory for diagram-js shapes\n */\nfunction ElementFactory(bpmnFactory, moddle) {\n  BaseElementFactory.call(this);\n\n  this._bpmnFactory = bpmnFactory;\n  this._moddle = moddle;\n}\n\ninherits(ElementFactory, BaseElementFactory);\n\n\nElementFactory.$inject = [ 'bpmnFactory', 'moddle' ];\n\nmodule.exports = ElementFactory;\n\nElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;\n\nElementFactory.prototype.create = function(elementType, attrs) {\n\n  // no special magic for labels,\n  // we assume their businessObjects have already been created\n  // and wired via attrs\n  if (elementType === 'label') {\n    return this.baseCreate(elementType, assign({ type: 'label' }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));\n  }\n\n  attrs = attrs || {};\n\n  var businessObject = attrs.businessObject,\n      size;\n\n  if (!businessObject) {\n    if (!attrs.type) {\n      throw new Error('no shape type specified');\n    }\n\n    businessObject = this._bpmnFactory.create(attrs.type);\n  }\n\n  if (!businessObject.di) {\n    if (elementType === 'root') {\n      businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {\n        id: businessObject.id + '_di'\n      });\n    } else\n    if (elementType === 'connection') {\n      businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {\n        id: businessObject.id + '_di'\n      });\n    } else {\n      businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {\n        id: businessObject.id + '_di'\n      });\n    }\n  }\n\n if (!!attrs.isExpanded) {\n   businessObject.di.isExpanded = attrs.isExpanded;\n }\n\n if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {\n   businessObject.di.isMarkerVisible = true;\n }\n\n if (attrs._eventDefinitionType) {\n   var eventDefinitions = businessObject.get('eventDefinitions') || [],\n       newEventDefinition = this._moddle.create(attrs._eventDefinitionType);\n\n   eventDefinitions.push(newEventDefinition);\n   businessObject.eventDefinitions = eventDefinitions;\n }\n\n size = this._getDefaultSize(businessObject);\n\n attrs = assign({\n   businessObject: businessObject,\n   id: businessObject.id\n }, size, attrs);\n\n return this.baseCreate(elementType, attrs);\n};\n\n\nElementFactory.prototype._getDefaultSize = function(semantic) {\n\n  if (semantic.$instanceOf('bpmn:SubProcess')) {\n    var isExpanded = semantic.di.isExpanded === true;\n\n    if (isExpanded) {\n      return { width: 350, height: 200 };\n    } else {\n      return { width: 100, height: 80 };\n    }\n  }\n\n  if (semantic.$instanceOf('bpmn:Task')) {\n    return { width: 100, height: 80 };\n  }\n\n  if (semantic.$instanceOf('bpmn:Gateway')) {\n    return { width: 50, height: 50 };\n  }\n\n  if (semantic.$instanceOf('bpmn:Event')) {\n    return { width: 36, height: 36 };\n  }\n\n  if (semantic.$instanceOf('bpmn:Participant')) {\n    return { width: 600, height: 250 };\n  }\n\n  return { width: 100, height: 80 };\n};\n\n\nElementFactory.prototype.createParticipantShape = function(collapsed) {\n\n  var participantShape = this.createShape({ type: 'bpmn:Participant' });\n\n  if (!collapsed) {\n    participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');\n  }\n\n  return participantShape;\n};","'use strict';\n\nvar assign = require(325),\n    forEach = require(204);\n\nvar LabelUtil = require(46);\n\nvar hasExternalLabel = LabelUtil.hasExternalLabel,\n    getExternalLabelMid = LabelUtil.getExternalLabelMid;\n\n\nfunction LabelSupport(eventBus, modeling, bpmnFactory) {\n\n  // create external labels on shape creation\n\n  eventBus.on([\n    'commandStack.shape.create.postExecute',\n    'commandStack.connection.create.postExecute'\n  ], function(e) {\n    var context = e.context;\n\n    var element = context.shape || context.connection,\n        businessObject = element.businessObject;\n\n    var position;\n\n    if (hasExternalLabel(businessObject)) {\n      position = getExternalLabelMid(element);\n      modeling.createLabel(element, position, {\n        id: businessObject.id + '_label',\n        businessObject: businessObject\n      });\n    }\n  });\n\n\n  // indicate label is dragged during move\n\n  // we need to add labels to the list of selected\n  // shapes before the visuals get drawn.\n  //\n  // Hence this awesome magic number.\n  //\n  eventBus.on('shape.move.start', function(e) {\n\n    var context = e.context,\n        shapes = context.shapes;\n\n    var labels = [];\n\n    forEach(shapes, function(element) {\n      var label = element.label;\n\n      if (label && !label.hidden && context.shapes.indexOf(label) === -1) {\n        labels.push(label);\n      }\n    });\n\n    forEach(labels, function(label) {\n      shapes.push(label);\n    });\n  });\n\n\n  // move labels with shapes\n\n  eventBus.on([\n    'commandStack.shapes.move.postExecute'\n  ], function(e) {\n\n    var context = e.context,\n        closure = context.closure,\n        enclosedElements = closure.enclosedElements;\n\n    // ensure we move all labels with their respective elements\n    // if they have not been moved already\n\n    forEach(enclosedElements, function(e) {\n      if (e.label && !enclosedElements[e.label.id]) {\n        modeling.moveShape(e.label, context.delta, e.parent);\n      }\n    });\n  });\n\n\n  // update di information on label movement and creation\n\n  eventBus.on([\n    'commandStack.label.create.executed',\n    'commandStack.shape.moved.executed'\n  ], function(e) {\n\n    var element = e.context.shape,\n        businessObject = element.businessObject,\n        di = businessObject.di;\n\n    // we want to trigger on real labels only\n    if (!element.labelTarget) {\n      return;\n    }\n\n    if (!di.label) {\n      di.label = bpmnFactory.create('bpmndi:BPMNLabel', {\n        bounds: bpmnFactory.create('dc:Bounds')\n      });\n    }\n\n    assign(di.label.bounds, {\n      x: element.x,\n      y: element.y,\n      width: element.width,\n      height: element.height\n    });\n  });\n}\n\nLabelSupport.$inject = [ 'eventBus', 'modeling', 'bpmnFactory' ];\n\nmodule.exports = LabelSupport;\n","'use strict';\n\nvar inherits = require(195);\n\nvar BaseModeling = require(108);\n\nvar UpdatePropertiesHandler = require(29),\n    UpdateCanvasRootHandler = require(28);\n\n\n/**\n * BPMN 2.0 modeling features activator\n *\n * @param {EventBus} eventBus\n * @param {ElementFactory} elementFactory\n * @param {CommandStack} commandStack\n * @param {BpmnRules} bpmnRules\n */\nfunction Modeling(eventBus, elementFactory, commandStack, bpmnRules) {\n  BaseModeling.call(this, eventBus, elementFactory, commandStack);\n\n  this._bpmnRules = bpmnRules;\n}\n\ninherits(Modeling, BaseModeling);\n\nModeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack', 'bpmnRules' ];\n\nmodule.exports = Modeling;\n\n\nModeling.prototype.getHandlers = function() {\n  var handlers = BaseModeling.prototype.getHandlers.call(this);\n\n  handlers['element.updateProperties'] = UpdatePropertiesHandler;\n  handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;\n\n  return handlers;\n};\n\n\nModeling.prototype.updateLabel = function(element, newLabel) {\n  this._commandStack.execute('element.updateLabel', {\n    element: element,\n    newLabel: newLabel\n  });\n};\n\n\nvar getSharedParent = require(21).getSharedParent;\n\nModeling.prototype.connect = function(source, target, attrs) {\n\n  var bpmnRules = this._bpmnRules;\n\n  if (!attrs) {\n    if (bpmnRules.canConnectMessageFlow(source, target)) {\n      attrs = {\n        type: 'bpmn:MessageFlow'\n      };\n    } else\n    if (bpmnRules.canConnectSequenceFlow(source, target)) {\n      attrs = {\n        type: 'bpmn:SequenceFlow'\n      };\n    } else {\n      attrs = {\n        type: 'bpmn:Association'\n      };\n    }\n  }\n\n  return this.createConnection(source, target, attrs, getSharedParent(source, target));\n};\n\n\nModeling.prototype.updateProperties = function(element, properties) {\n  this._commandStack.execute('element.updateProperties', {\n    element: element,\n    properties: properties\n  });\n};\n\n\n/**\n * Transform the current diagram into a collaboration.\n *\n * @return {djs.model.Root} the new root element\n */\nModeling.prototype.makeCollaboration = function() {\n\n  var collaborationElement = this._create('root', {\n    type: 'bpmn:Collaboration'\n  });\n\n  var context = {\n    newRoot: collaborationElement\n  };\n\n  this._commandStack.execute('canvas.updateRoot', context);\n\n  return collaborationElement;\n};\n\n/**\n * Transform the current diagram into a process.\n *\n * @return {djs.model.Root} the new root element\n */\nModeling.prototype.makeProcess = function() {\n\n  var processElement = this._create('root', {\n    type: 'bpmn:Process'\n  });\n\n  var context = {\n    newRoot: processElement\n  };\n\n  this._commandStack.execute('canvas.updateRoot', context);\n};","'use strict';\n\nvar find = require(203);\n\n\nfunction getParents(element) {\n\n  var parents = [];\n\n  while (element) {\n    element = element.parent;\n\n    if (element) {\n      parents.push(element);\n    }\n  }\n\n  return parents;\n}\n\nmodule.exports.getParents = getParents;\n\n\nfunction getSharedParent(a, b) {\n\n  var parentsA = getParents(a),\n      parentsB = getParents(b);\n\n  return find(parentsA, function(parent) {\n    return parentsB.indexOf(parent) !== -1;\n  });\n}\n\nmodule.exports.getSharedParent = getSharedParent;","'use strict';\n\nvar inherits = require(195);\n\nvar is = require(47).is;\n\nvar CommandInterceptor = require(75);\n\n\nfunction AppendBehavior(eventBus, elementFactory, bpmnRules) {\n\n  CommandInterceptor.call(this, eventBus);\n\n  // assign correct shape position unless already set\n\n  this.preExecute('shape.append', function(context) {\n\n    var source = context.source,\n        shape = context.shape;\n\n    if (!context.position) {\n\n      if (is(shape, 'bpmn:TextAnnotation')) {\n        context.position = {\n          x: source.x + source.width / 2 + 75,\n          y: source.y - (50) - shape.height / 2\n        };\n      } else {\n        context.position = {\n          x: source.x + source.width + 80 + shape.width / 2,\n          y: source.y + source.height / 2\n        };\n      }\n    }\n  }, true);\n}\n\n\nAppendBehavior.$inject = [ 'eventBus', 'elementFactory', 'bpmnRules' ];\n\ninherits(AppendBehavior, CommandInterceptor);\n\nmodule.exports = AppendBehavior;","'use strict';\n\nvar inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\nvar is = require(47).is;\n\n/**\n * BPMN specific create behavior\n */\nfunction CreateBehavior(eventBus, modeling) {\n\n  CommandInterceptor.call(this, eventBus);\n\n\n  /**\n   * morph process into collaboration before adding\n   * participant onto collaboration\n   */\n\n  this.preExecute('shape.create', function(context) {\n\n    var parent = context.parent,\n        shape = context.shape,\n        position = context.position;\n\n    if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {\n\n      // this is going to detach the process root\n      // and set the returned collaboration element\n      // as the new root element\n      var collaborationElement = modeling.makeCollaboration();\n\n      // monkey patch the create context\n      // so that the participant is being dropped\n      // onto the new collaboration root instead\n      context.position = position;\n      context.parent = collaborationElement;\n\n      context.processRoot = parent;\n    }\n  }, true);\n\n  this.execute('shape.create', function(context) {\n\n    var processRoot = context.processRoot,\n        shape = context.shape;\n\n    if (processRoot) {\n      context.oldProcessRef = shape.businessObject.processRef;\n\n      // assign the participant processRef\n      shape.businessObject.processRef = processRoot.businessObject;\n    }\n  }, true);\n\n  this.revert('shape.create', function(context) {\n    var processRoot = context.processRoot,\n        shape = context.shape;\n\n    if (processRoot) {\n      // assign the participant processRef\n      shape.businessObject.processRef = context.oldProcessRef;\n    }\n  }, true);\n\n  this.postExecute('shape.create', function(context) {\n\n    var processRoot = context.processRoot,\n        shape = context.shape;\n\n    if (processRoot) {\n      // process root is already detached at this point\n      var processChildren = processRoot.children.slice();\n      modeling.moveShapes(processChildren, { x: 0, y: 0 }, shape);\n    }\n  }, true);\n\n}\n\nCreateBehavior.$inject = [ 'eventBus', 'modeling' ];\n\ninherits(CreateBehavior, CommandInterceptor);\n\nmodule.exports = CreateBehavior;","'use strict';\n\nvar forEach = require(204),\n    inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\nvar is = require(47).is,\n    getSharedParent = require(21).getSharedParent;\n\n\nfunction DropBehavior(eventBus, modeling, bpmnRules) {\n\n  CommandInterceptor.call(this, eventBus);\n\n  // remove sequence flows that should not be allowed\n  // after a move operation\n\n  this.postExecute('shapes.move', function(context) {\n\n    var closure = context.closure,\n        allConnections = closure.allConnections;\n\n    forEach(allConnections, function(c) {\n\n      var source = c.source,\n          target = c.target;\n\n      var replacementType,\n          remove;\n\n      /**\n       * Check if incoming or outgoing connections\n       * can stay or could be substituted with an\n       * appropriate replacement.\n       *\n       * This holds true for SequenceFlow <> MessageFlow.\n       */\n\n      if (is(c, 'bpmn:SequenceFlow')) {\n        if (!bpmnRules.canConnectSequenceFlow(source, target)) {\n          remove = true;\n        }\n\n        if (bpmnRules.canConnectMessageFlow(source, target)) {\n          replacementType = 'bpmn:MessageFlow';\n        }\n      }\n\n      // transform message flows into sequence flows, if possible\n\n      if (is(c, 'bpmn:MessageFlow')) {\n\n        if (!bpmnRules.canConnectMessageFlow(source, target)) {\n          remove = true;\n        }\n\n        if (bpmnRules.canConnectSequenceFlow(source, target)) {\n          replacementType = 'bpmn:SequenceFlow';\n        }\n      }\n\n      if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {\n        remove = true;\n      }\n\n\n      // remove invalid connection\n      if (remove) {\n        modeling.removeConnection(c);\n      }\n\n      // replace SequenceFlow <> MessageFlow\n\n      if (replacementType) {\n        modeling.createConnection(source, target, {\n          type: replacementType,\n          waypoints: c.waypoints.slice()\n        }, getSharedParent(source, target));\n      }\n    });\n  }, true);\n}\n\ninherits(DropBehavior, CommandInterceptor);\n\nDropBehavior.$inject = [ 'eventBus', 'modeling', 'bpmnRules' ];\n\nmodule.exports = DropBehavior;","'use strict';\n\nvar is = require(47).is;\n\n\nfunction ModelingFeedback(eventBus, tooltips) {\n\n  function showError(position, message) {\n    tooltips.add({\n      position: {\n        x: position.x + 5,\n        y: position.y + 5\n      },\n      type: 'error',\n      timeout: 2000,\n      html: '<div>' + message + '</div>'\n    });\n  }\n\n  eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) {\n\n    var context = event.context,\n        shape = context.shape,\n        target = context.target;\n\n    if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {\n      showError(event, 'flow elements must be children of pools/participants');\n    }\n  });\n\n}\n\n\nModelingFeedback.$inject = [ 'eventBus', 'tooltips' ];\n\nmodule.exports = ModelingFeedback;","'use strict';\n\nvar inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\nvar is = require(47).is;\n\n\n/**\n * BPMN specific remove behavior\n */\nfunction RemoveBehavior(eventBus, modeling) {\n\n  CommandInterceptor.call(this, eventBus);\n\n\n  /**\n   * morph collaboration diagram into process diagram\n   * after the last participant has been removed\n   */\n\n  this.preExecute('shape.delete', function(context) {\n\n    var shape = context.shape,\n        parent = shape.parent;\n\n    // activate the behavior if the shape to be removed\n    // is a participant\n    if (is(shape, 'bpmn:Participant')) {\n      context.collaborationRoot = parent;\n    }\n  }, true);\n\n  this.postExecute('shape.delete', function(context) {\n\n    var collaborationRoot = context.collaborationRoot;\n\n    if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {\n      // replace empty collaboration with process diagram\n      modeling.makeProcess();\n    }\n  }, true);\n\n}\n\nRemoveBehavior.$inject = [ 'eventBus', 'modeling' ];\n\ninherits(RemoveBehavior, CommandInterceptor);\n\nmodule.exports = RemoveBehavior;","module.exports = {\n  __init__: [\n    'appendBehavior',\n    'createBehavior',\n    'dropBehavior',\n    'removeBehavior',\n    'modelingFeedback'\n  ],\n  appendBehavior: [ 'type', require(22) ],\n  dropBehavior: [ 'type', require(24) ],\n  createBehavior: [ 'type', require(23) ],\n  removeBehavior: [ 'type', require(26) ],\n  modelingFeedback: [ 'type', require(25) ]\n};","'use strict';\n\nvar Collections = require(175);\n\n\nfunction UpdateCanvasRootHandler(canvas, modeling) {\n  this._canvas = canvas;\n  this._modeling = modeling;\n}\n\nUpdateCanvasRootHandler.$inject = [ 'canvas', 'modeling' ];\n\nmodule.exports = UpdateCanvasRootHandler;\n\n\nUpdateCanvasRootHandler.prototype.execute = function(context) {\n\n  var canvas = this._canvas;\n\n  var newRoot = context.newRoot,\n      newRootBusinessObject = newRoot.businessObject,\n      oldRoot = canvas.getRootElement(),\n      oldRootBusinessObject = oldRoot.businessObject,\n      bpmnDefinitions = oldRootBusinessObject.$parent,\n      diPlane = oldRootBusinessObject.di;\n\n  // (1) replace process old <> new root\n  canvas.setRootElement(newRoot, true);\n\n  // (2) update root elements\n  Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);\n  newRootBusinessObject.$parent = bpmnDefinitions;\n\n  Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);\n  oldRootBusinessObject.$parent = null;\n\n  // (3) wire di\n  oldRootBusinessObject.di = null;\n\n  diPlane.bpmnElement = newRootBusinessObject;\n  newRootBusinessObject.di = diPlane;\n\n  context.oldRoot = oldRoot;\n};\n\n\nUpdateCanvasRootHandler.prototype.revert = function(context) {\n\n  var canvas = this._canvas;\n\n  var newRoot = context.newRoot,\n      newRootBusinessObject = newRoot.businessObject,\n      oldRoot = context.oldRoot,\n      oldRootBusinessObject = oldRoot.businessObject,\n      bpmnDefinitions = newRootBusinessObject.$parent,\n      diPlane = newRootBusinessObject.di;\n\n  // (1) replace process old <> new root\n  canvas.setRootElement(oldRoot, true);\n\n  // (2) update root elements\n  Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);\n  newRootBusinessObject.$parent = null;\n\n  Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);\n  oldRootBusinessObject.$parent = bpmnDefinitions;\n\n  // (3) wire di\n  newRootBusinessObject.di = null;\n\n  diPlane.bpmnElement = oldRootBusinessObject;\n  oldRootBusinessObject.di = diPlane;\n};","'use strict';\n\nvar assign = require(325),\n    pick = require(330),\n    keys = require(326);\n\nvar DEFAULT_FLOW = 'default',\n    NAME = 'name',\n    ID = 'id';\n\n\n/**\n * A handler that implements a BPMN 2.0 property update.\n *\n * This should be used to set simple properties on elements with\n * an underlying BPMN business object.\n *\n * Use respective diagram-js provided handlers if you would\n * like to perform automated modeling.\n */\nfunction UpdatePropertiesHandler(elementRegistry) {\n  this._elementRegistry = elementRegistry;\n}\n\nUpdatePropertiesHandler.$inject = [ 'elementRegistry' ];\n\nmodule.exports = UpdatePropertiesHandler;\n\n\n////// api /////////////////////////////////////////////\n\n/**\n * Updates a BPMN element with a list of new properties\n *\n * @param {Object} context\n * @param {djs.model.Base} context.element the element to update\n * @param {Object} context.properties a list of properties to set on the element's\n *                                    businessObject (the BPMN model element)\n *\n * @return {Array<djs.mode.Base>} the updated element\n */\nUpdatePropertiesHandler.prototype.execute = function(context) {\n\n  var element = context.element,\n      changed = [ element ];\n\n  if (!element) {\n    throw new Error('element required');\n  }\n\n  var elementRegistry = this._elementRegistry;\n\n  var businessObject = element.businessObject,\n      properties = context.properties,\n      oldProperties = context.oldProperties || pick(businessObject, keys(properties));\n\n  if (ID in properties) {\n    elementRegistry.updateId(element, properties[ID]);\n  }\n\n  // correctly indicate visual changes on default flow updates\n  if (DEFAULT_FLOW in properties) {\n\n    if (properties[DEFAULT_FLOW]) {\n      changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));\n    }\n\n    if (businessObject[DEFAULT_FLOW]) {\n      changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));\n    }\n  }\n\n  if (NAME in properties && element.label) {\n    changed.push(element.label);\n  }\n\n  // update properties\n  assign(businessObject, properties);\n\n\n  // store old values\n  context.oldProperties = oldProperties;\n  context.changed = changed;\n\n  // indicate changed on objects affected by the update\n  return changed;\n};\n\n/**\n * Reverts the update on a BPMN elements properties.\n *\n * @param  {Object} context\n *\n * @return {djs.mode.Base} the updated element\n */\nUpdatePropertiesHandler.prototype.revert = function(context) {\n\n  var element = context.element,\n      oldProperties = context.oldProperties,\n      businessObject = element.businessObject,\n      elementRegistry = this._elementRegistry;\n\n  assign(businessObject, context.oldProperties);\n\n  if (ID in oldProperties) {\n    elementRegistry.updateId(element, oldProperties[ID]);\n  }\n\n  return context.changed;\n};","module.exports = {\n  __init__: [ 'modeling', 'bpmnUpdater', 'labelSupport' ],\n  __depends__: [\n    require(14),\n    require(32),\n    require(27),\n    require(77),\n    require(160),\n    require(93)\n  ],\n  bpmnFactory: [ 'type', require(15) ],\n  bpmnUpdater: [ 'type', require(17) ],\n  elementFactory: [ 'type', require(18) ],\n  modeling: [ 'type', require(20) ],\n  labelSupport: [ 'type', require(19) ],\n  layouter: [ 'type', require(16) ],\n  connectionDocking: [ 'type', require(165) ]\n};\n","'use strict';\n\nvar groupBy = require(205),\n    size = require(209),\n    find = require(203),\n    inherits = require(195);\n\nvar getParents = require(21).getParents,\n    is = require(47).is,\n    getBusinessObject = require(47).getBusinessObject,\n    isExpanded = require(45).isExpanded;\n\n\nvar RuleProvider = require(145);\n\n/**\n * BPMN specific modeling rule\n */\nfunction BpmnRules(eventBus) {\n  RuleProvider.call(this, eventBus);\n}\n\ninherits(BpmnRules, RuleProvider);\n\nBpmnRules.$inject = [ 'eventBus' ];\n\nmodule.exports = BpmnRules;\n\nBpmnRules.prototype.init = function() {\n\n  this.addRule('connection.create', function(context) {\n    var source = context.source,\n        target = context.target;\n\n    return canConnect(source, target);\n  });\n\n  this.addRule('connection.reconnectStart', function(context) {\n\n    var connection = context.connection,\n        source = context.hover || context.source,\n        target = connection.target;\n\n    return canConnect(source, target, connection);\n  });\n\n  this.addRule('connection.reconnectEnd', function(context) {\n\n    var connection = context.connection,\n        source = connection.source,\n        target = context.hover || context.target;\n\n    return canConnect(source, target, connection);\n  });\n\n  this.addRule('connection.updateWaypoints', function(context) {\n    // OK! but visually ignore\n    return null;\n  });\n\n  this.addRule('shape.resize', function(context) {\n\n    var shape = context.shape,\n        newBounds = context.newBounds;\n\n    return canResize(shape, newBounds);\n  });\n\n  this.addRule('shapes.move', function(context) {\n\n    var target = context.newParent,\n        shapes = context.shapes;\n\n    return canMove(shapes, target);\n  });\n\n  this.addRule([ 'shape.create', 'shape.append' ], function(context) {\n    var target = context.parent,\n        shape = context.shape,\n        source = context.source;\n\n    return canCreate(shape, target, source);\n  });\n\n};\n\nBpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;\n\nBpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;\n\nBpmnRules.prototype.canConnectAssociation = canConnectAssociation;\n\nBpmnRules.prototype.canMove = canMove;\n\nBpmnRules.prototype.canDrop = canDrop;\n\nBpmnRules.prototype.canCreate = canCreate;\n\nBpmnRules.prototype.canConnect = canConnect;\n\nBpmnRules.prototype.canResize = canResize;\n\n/**\n * Utility functions for rule checking\n */\n\nfunction nonExistantOrLabel(element) {\n  return !element || isLabel(element);\n}\n\nfunction isSame(a, b) {\n  return a === b;\n}\n\nfunction getOrganizationalParent(element) {\n\n  var bo = getBusinessObject(element);\n\n  while (bo && !is(bo, 'bpmn:Process')) {\n    if (is(bo, 'bpmn:Participant')) {\n      return bo.processRef || bo;\n    }\n\n    bo = bo.$parent;\n  }\n\n  return bo;\n}\n\nfunction isSameOrganization(a, b) {\n  var parentA = getOrganizationalParent(a),\n      parentB = getOrganizationalParent(b);\n\n  return parentA === parentB;\n}\n\nfunction isMessageFlowSource(element) {\n  return is(element, 'bpmn:InteractionNode') && (\n            !is(element, 'bpmn:Event') || (\n              is(element, 'bpmn:ThrowEvent') &&\n              hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')\n            )\n  );\n}\n\nfunction isMessageFlowTarget(element) {\n  return is(element, 'bpmn:InteractionNode') && (\n            !is(element, 'bpmn:Event') || (\n              is(element, 'bpmn:CatchEvent') &&\n              hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')\n            )\n  );\n}\n\nfunction getScopeParent(element) {\n\n  var bo = getBusinessObject(element);\n\n  if (is(bo, 'bpmn:Participant')) {\n    return null;\n  }\n\n  while (bo) {\n    bo = bo.$parent;\n\n    if (is(bo, 'bpmn:FlowElementsContainer')) {\n      return bo;\n    }\n  }\n\n  return bo;\n}\n\nfunction isSameScope(a, b) {\n  var scopeParentA = getScopeParent(a),\n      scopeParentB = getScopeParent(b);\n\n  return scopeParentA && (scopeParentA === scopeParentB);\n}\n\nfunction hasEventDefinition(element, eventDefinition) {\n  var bo = getBusinessObject(element);\n\n  return !!find(bo.eventDefinitions || [], function(definition) {\n    return is(definition, eventDefinition);\n  });\n}\n\nfunction hasEventDefinitionOrNone(element, eventDefinition) {\n  var bo = getBusinessObject(element);\n\n  return (bo.eventDefinitions || []).every(function(definition) {\n    return is(definition, eventDefinition);\n  });\n}\n\nfunction isSequenceFlowSource(element) {\n  return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(\n            is(element, 'bpmn:IntermediateThrowEvent') &&\n            hasEventDefinition(element, 'bpmn:LinkEventDefinition')\n  );\n}\n\nfunction isSequenceFlowTarget(element) {\n  return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(\n            is(element, 'bpmn:IntermediateCatchEvent') &&\n            hasEventDefinition(element, 'bpmn:LinkEventDefinition')\n  );\n}\n\nfunction isEventBasedTarget(element) {\n  return is(element, 'bpmn:ReceiveTask') || (\n         is(element, 'bpmn:IntermediateCatchEvent') && (\n           hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||\n           hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||\n           hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||\n           hasEventDefinition(element, 'bpmn:SignalEventDefinition')\n         )\n  );\n}\n\nfunction isLabel(element) {\n  return element.labelTarget;\n}\n\nfunction isConnection(element) {\n  return element.waypoints;\n}\n\nfunction isParent(possibleParent, element) {\n  var allParents = getParents(element);\n  return allParents.indexOf(possibleParent) !== -1;\n}\n\nfunction canConnect(source, target, connection) {\n\n  if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {\n    return null;\n  }\n\n  // See https://github.com/bpmn-io/bpmn-js/issues/178\n  // as a workround we disallow connections with same\n  // target and source element.\n  // This rule must be removed if a auto layout for this\n  // connections is implemented.\n  if (isSame(source, target)) {\n    return false;\n  }\n\n  if (canConnectMessageFlow(source, target) ||\n      canConnectSequenceFlow(source, target)) {\n\n    return true;\n  }\n\n  if (is(connection, 'bpmn:Association')) {\n    return canConnectAssociation(source, target);\n  }\n\n  return false;\n}\n\n/**\n * Can an element be dropped into the target element\n *\n * @return {Boolean}\n */\nfunction canDrop(element, target) {\n\n  // can move labels everywhere\n  if (isLabel(element) && !isConnection(target)) {\n    return true;\n  }\n\n  // allow to create new participants on\n  // on existing collaboration and process diagrams\n  if (is(element, 'bpmn:Participant')) {\n    return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');\n  }\n\n  // drop flow elements onto flow element containers\n  // and participants\n  if (is(element, 'bpmn:FlowElement')) {\n    if (is(target, 'bpmn:FlowElementsContainer')) {\n      return isExpanded(target) !== false;\n    }\n\n    return is(target, 'bpmn:Participant');\n  }\n\n  if (is(element, 'bpmn:Artifact')) {\n    return is(target, 'bpmn:Collaboration') ||\n           is(target, 'bpmn:Participant') ||\n           is(target, 'bpmn:Process');\n  }\n\n  if (is(element, 'bpmn:MessageFlow')) {\n    return is(target, 'bpmn:Collaboration');\n  }\n\n  return false;\n}\n\nfunction canMove(elements, target) {\n\n  // only move if they have the same parent\n  var sameParent = size(groupBy(elements, function(s) { return s.parent && s.parent.id; })) === 1;\n\n  if (!sameParent) {\n    return false;\n  }\n\n  if (!target) {\n    return true;\n  }\n\n  return elements.every(function(element) {\n    return canDrop(element, target);\n  });\n}\n\nfunction canCreate(shape, target, source) {\n\n  if (!target) {\n    return false;\n  }\n\n  if (isLabel(target)) {\n    return null;\n  }\n\n  if (isSame(source, target)) {\n    return false;\n  }\n\n  // ensure we do not drop the element\n  // into source\n  if (source && isParent(source, target)) {\n    return false;\n  }\n\n  return canDrop(shape, target);\n}\n\nfunction canResize(shape, newBounds) {\n  if (is(shape, 'bpmn:SubProcess')) {\n    return isExpanded(shape) && (\n          !newBounds || (newBounds.width >= 100 && newBounds.height >= 80)\n    );\n  }\n\n  if (is(shape, 'bpmn:Participant')) {\n    return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);\n  }\n\n  if (is(shape, 'bpmn:TextAnnotation')) {\n    return true;\n  }\n\n  return false;\n}\n\nfunction canConnectAssociation(source, target) {\n\n  // do not connect connections\n  if (isConnection(source) || isConnection(target)) {\n    return false;\n  }\n\n  // connect if different parent\n  return !isParent(target, source) &&\n         !isParent(source, target);\n}\n\nfunction canConnectMessageFlow(source, target) {\n\n  return isMessageFlowSource(source) &&\n         isMessageFlowTarget(target) &&\n        !isSameOrganization(source, target);\n}\n\nfunction canConnectSequenceFlow(source, target) {\n\n  return isSequenceFlowSource(source) &&\n         isSequenceFlowTarget(target) &&\n         isSameScope(source, target) &&\n         !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));\n}","module.exports = {\n  __depends__: [\n    require(147)\n  ],\n  __init__: [ 'bpmnRules' ],\n  bpmnRules: [ 'type', require(31) ]\n};\n","'use strict';\n\nvar assign = require(325);\n\n/**\n * A palette provider for BPMN 2.0 elements.\n */\nfunction PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {\n\n  this._create = create;\n  this._elementFactory = elementFactory;\n  this._spaceTool = spaceTool;\n  this._lassoTool = lassoTool;\n\n  palette.registerProvider(this);\n}\n\nmodule.exports = PaletteProvider;\n\nPaletteProvider.$inject = [ 'palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool' ];\n\n\nPaletteProvider.prototype.getPaletteEntries = function(element) {\n\n  var actions  = {},\n      create = this._create,\n      elementFactory = this._elementFactory,\n      spaceTool = this._spaceTool,\n      lassoTool = this._lassoTool;\n\n\n  function createAction(type, group, className, title, options) {\n\n    function createListener(event) {\n      var shape = elementFactory.createShape(assign({ type: type }, options));\n\n      if (options) {\n        shape.businessObject.di.isExpanded = options.isExpanded;\n      }\n\n      create.start(event, shape);\n    }\n\n    var shortType = type.replace(/^bpmn/:/, '');\n\n    return {\n      group: group,\n      className: className,\n      title: title || 'Create ' + shortType,\n      action: {\n        dragstart: createListener,\n        click: createListener\n      }\n    };\n  }\n\n  function createParticipant(event, collapsed) {\n    create.start(event, elementFactory.createParticipantShape(collapsed));\n  }\n\n  assign(actions, {\n    'lasso-tool': {\n      group: 'tools',\n      className: 'icon-lasso-tool',\n      title: 'Activate the lasso tool',\n      action: {\n        click: function(event) {\n          lassoTool.activateSelection(event);\n        }\n      }\n    },\n    'space-tool': {\n      group: 'tools',\n      className: 'icon-space-tool',\n      title: 'Activate the create/remove space tool',\n      action: {\n        click: function(event) {\n          spaceTool.activateSelection(event);\n        }\n      }\n    },\n    'tool-separator': {\n      group: 'tools',\n      separator: true\n    },\n    'create.start-event': createAction(\n      'bpmn:StartEvent', 'event', 'icon-start-event-none'\n    ),\n    'create.intermediate-event': createAction(\n      'bpmn:IntermediateThrowEvent', 'event', 'icon-intermediate-event-none'\n    ),\n    'create.end-event': createAction(\n      'bpmn:EndEvent', 'event', 'icon-end-event-none'\n    ),\n    'create.exclusive-gateway': createAction(\n      'bpmn:ExclusiveGateway', 'gateway', 'icon-gateway-xor'\n    ),\n    'create.task': createAction(\n      'bpmn:Task', 'activity', 'icon-task'\n    ),\n    'create.subprocess-collapsed': createAction(\n      'bpmn:SubProcess', 'activity', 'icon-subprocess-collapsed', 'Create collapsed Sub Process',\n      { isExpanded: false }\n    ),\n    'create.subprocess-expanded': createAction(\n      'bpmn:SubProcess', 'activity', 'icon-subprocess-expanded', 'Create expanded SubProcess',\n      { isExpanded: true }\n    ),\n    'create.participant-expanded': {\n      group: 'collaboration',\n      className: 'icon-participant',\n      title: 'Create Pool/Participant',\n      action: {\n        dragstart: createParticipant,\n        click: createParticipant\n      }\n    }\n  });\n\n  return actions;\n};\n","module.exports = {\n  __depends__: [\n    require(137),\n    require(99)\n  ],\n  __init__: [ 'paletteProvider' ],\n  paletteProvider: [ 'type', require(33) ]\n};\n","'use strict';\n\nvar  forEach = require(204),\n     filter = require(202);\n\nvar REPLACE_OPTIONS = require(36);\n\nvar startEventReplace =  REPLACE_OPTIONS.START_EVENT,\n    intermediateEventReplace =  REPLACE_OPTIONS.INTERMEDIATE_EVENT,\n    endEventReplace =  REPLACE_OPTIONS.END_EVENT,\n    gatewayReplace =  REPLACE_OPTIONS.GATEWAY,\n    taskReplace =  REPLACE_OPTIONS.TASK;\n\n\n/**\n * A replace menu provider that gives users the controls to choose\n * and replace BPMN elements with each other.\n *\n * @param {BpmnFactory} bpmnFactory\n * @param {Moddle} moddle\n * @param {PopupMenu} popupMenu\n * @param {Replace} replace\n */\nfunction BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {\n\n  /**\n   * Prepares a new business object for the replacement element\n   * and triggers the replace operation.\n   *\n   * @param  {djs.model.Base} element\n   * @param  {Object} target\n   * @return {djs.model.Base} the newly created element\n   */\n  function replaceElement(element, target) {\n\n    var type = target.type,\n        oldBusinessObject = element.businessObject,\n        businessObject = bpmnFactory.create(type);\n\n    var newElement = {\n      type: type,\n      businessObject: businessObject\n    };\n\n    // initialize custom BPMN extensions\n\n    if (target.eventDefinition) {\n      var eventDefinitions = businessObject.get('eventDefinitions'),\n          eventDefinition = moddle.create(target.eventDefinition);\n\n      eventDefinitions.push(eventDefinition);\n    }\n\n    if (target.instantiate !== undefined) {\n      businessObject.instantiate = target.instantiate;\n    }\n\n    if (target.eventGatewayType !== undefined) {\n      businessObject.eventGatewayType = target.eventGatewayType;\n    }\n\n    // copy size (for activities only)\n    if (oldBusinessObject.$instanceOf('bpmn:Activity')) {\n\n      // TODO: need also to respect min/max Size\n\n      newElement.width = element.width;\n      newElement.height = element.height;\n    }\n\n    // TODO: copy other elligable properties from old business object\n    businessObject.name = oldBusinessObject.name;\n\n    newElement = replace.replaceElement(element, newElement);\n\n    selection.select(newElement);\n\n    return newElement;\n  }\n\n\n  function getReplaceOptions(element) {\n\n    var menuEntries = [];\n    var businessObject = element.businessObject;\n\n    if (businessObject.$instanceOf('bpmn:StartEvent')) {\n      addEntries(startEventReplace, filterEvents);\n    } else\n\n    if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||\n        businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {\n\n      addEntries(intermediateEventReplace, filterEvents);\n    } else\n\n    if (businessObject.$instanceOf('bpmn:EndEvent')) {\n\n      addEntries(endEventReplace, filterEvents);\n    } else\n\n    if (businessObject.$instanceOf('bpmn:Gateway')) {\n\n      addEntries(gatewayReplace, function(entry) {\n\n        return entry.target.type  !== businessObject.$type;\n      });\n    } else\n\n    if (businessObject.$instanceOf('bpmn:FlowNode')) {\n      addEntries(taskReplace, function(entry) {\n        return entry.target.type  !== businessObject.$type;\n      });\n    }\n\n    function filterEvents(entry) {\n\n      var target = entry.target;\n\n      var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;\n      var isEventDefinitionEqual = target.eventDefinition == eventDefinition;\n      var isEventTypeEqual =  businessObject.$type == target.type;\n\n      return ((!isEventDefinitionEqual && isEventTypeEqual) ||\n              !isEventTypeEqual) ||\n              !(isEventDefinitionEqual && isEventTypeEqual);\n    }\n\n    function addEntries(entries, filterFun) {\n      // Filter selected type from the array\n      var filteredEntries = filter(entries, filterFun);\n\n      // Add entries to replace menu\n      forEach(filteredEntries, function(definition) {\n\n        var entry = addMenuEntry(definition);\n        menuEntries.push(entry);\n      });\n    }\n\n    function addMenuEntry(definition) {\n\n      return {\n        label: definition.label,\n        className: definition.className,\n        action: {\n          name: definition.actionName,\n          handler: function() {\n            replaceElement(element, definition.target);\n          }\n        }\n      };\n    }\n\n    return menuEntries;\n  }\n\n\n  // API\n\n  this.openChooser = function(position, element) {\n    var entries = this.getReplaceOptions(element);\n\n    popupMenu.open('replace-menu', position, entries);\n  };\n\n  this.getReplaceOptions = getReplaceOptions;\n\n  this.replaceElement = replaceElement;\n}\n\nBpmnReplace.$inject = [ 'bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection' ];\n\nmodule.exports = BpmnReplace;","'use strict';\n\nmodule.exports.START_EVENT = [\n  {\n    label: 'Start Event',\n    actionName: 'replace-with-none-start',\n    className: 'icon-start-event-none',\n    target: {\n      type: 'bpmn:StartEvent'\n    }\n  },\n  {\n    label: 'Intermediate Throw Event',\n    actionName: 'replace-with-intermediate-throwing',\n    className: 'icon-intermediate-event-none',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent'\n    }\n  },\n  {\n    label: 'End Event',\n    actionName: 'replace-with-message-end',\n    className: 'icon-end-event-none',\n    target: {\n      type: 'bpmn:EndEvent'\n    }\n  },\n  {\n    label: 'Message Start Event',\n    actionName: 'replace-with-message-start',\n    className: 'icon-start-event-message',\n    target: {\n      type: 'bpmn:StartEvent',\n      eventDefinition: 'bpmn:MessageEventDefinition'\n    }\n  },\n  {\n    label: 'Timer Start Event',\n    actionName: 'replace-with-timer-start',\n    className: 'icon-start-event-timer',\n    target: {\n      type: 'bpmn:StartEvent',\n      eventDefinition: 'bpmn:TimerEventDefinition'\n    }\n  },\n  {\n    label: 'Conditional Start Event',\n    actionName: 'replace-with-conditional-start',\n    className: 'icon-start-event-condition',\n    target: {\n      type: 'bpmn:StartEvent',\n      eventDefinition: 'bpmn:ConditionalEventDefinition'\n    }\n  },\n  {\n    label: 'Signal Start Event',\n    actionName: 'replace-with-signal-start',\n    className: 'icon-start-event-signal',\n    target: {\n      type: 'bpmn:StartEvent',\n      eventDefinition: 'bpmn:SignalEventDefinition'\n    }\n  }\n];\n\nmodule.exports.INTERMEDIATE_EVENT = [\n  {\n    label: 'Start Event',\n    actionName: 'replace-with-none-start',\n    className: 'icon-start-event-none',\n    target: {\n      type: 'bpmn:StartEvent'\n    }\n  },\n  {\n    label: 'Intermediate Throw Event',\n    actionName: 'replace-with-message-intermediate-throw',\n    className: 'icon-intermediate-event-none',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent'\n    }\n  },\n  {\n    label: 'End Event',\n    actionName: 'replace-with-message-end',\n    className: 'icon-end-event-none',\n    target: {\n      type: 'bpmn:EndEvent'\n    }\n  },\n  {\n    label: 'Message Intermediate Catch Event',\n    actionName: 'replace-with-intermediate-catch',\n    className: 'icon-intermediate-event-catch-message',\n    target: {\n      type: 'bpmn:IntermediateCatchEvent',\n      eventDefinition: 'bpmn:MessageEventDefinition'\n    }\n  },\n  {\n    label: 'Message Intermediate Throw Event',\n    actionName: 'replace-with-intermediate-throw',\n    className: 'icon-intermediate-event-throw-message',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent',\n      eventDefinition: 'bpmn:MessageEventDefinition'\n    }\n  },\n  {\n    label: 'Timer Intermediate Catch Event',\n    actionName: 'replace-with-timer-intermediate-catch',\n    className: 'icon-intermediate-event-catch-timer',\n    target: {\n      type: 'bpmn:IntermediateCatchEvent',\n      eventDefinition: 'bpmn:TimerEventDefinition'\n    }\n  },\n  {\n    label: 'Escalation Intermediate Catch Event',\n    actionName: 'replace-with-escalation-catch',\n    className: 'icon-intermediate-event-catch-escalation',\n    target: {\n      type: 'bpmn:IntermediateCatchEvent',\n      eventDefinition: 'bpmn:EscalationEventDefinition'\n    }\n  },\n  {\n    label: 'Conditional Intermediate Catch Event',\n    actionName: 'replace-with-conditional-intermediate-catch',\n    className: 'icon-intermediate-event-catch-condition',\n    target: {\n      type: 'bpmn:IntermediateCatchEvent',\n      eventDefinition: 'bpmn:ConditionalEventDefinition'\n    }\n  },\n  {\n    label: 'Link Intermediate Catch Event',\n    actionName: 'replace-with-link-intermediate-catch',\n    className: 'icon-intermediate-event-catch-link',\n    target: {\n      type: 'bpmn:IntermediateCatchEvent',\n      eventDefinition: 'bpmn:LinkEventDefinition'\n    }\n  },\n  {\n    label: 'Link Intermediate Throw Event',\n    actionName: 'replace-with-link-intermediate-throw',\n    className: 'icon-intermediate-event-throw-link',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent',\n      eventDefinition: 'bpmn:LinkEventDefinition'\n    }\n  },\n  {\n    label: 'Compensation Intermediate Throw Event',\n    actionName: 'replace-with-compensation-intermediate-throw',\n    className: 'icon-intermediate-event-throw-compensation',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent',\n      eventDefinition: 'bpmn:CompensateEventDefinition'\n    }\n  },\n  {\n    label: 'Signal Throw Catch Event',\n    actionName: 'replace-with-throw-intermediate-catch',\n    className: 'icon-intermediate-event-catch-signal',\n    target: {\n      type: 'bpmn:IntermediateCatchEvent',\n      eventDefinition: 'bpmn:SignalEventDefinition'\n    }\n  },\n  {\n    label: 'Signal Intermediate Throw Event',\n    actionName: 'replace-with-signal-intermediate-throw',\n    className: 'icon-intermediate-event-throw-signal',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent',\n      eventDefinition: 'bpmn:SignalEventDefinition'\n    }\n  }\n];\n\nmodule.exports.END_EVENT = [\n  {\n    label: 'Start Event',\n    actionName: 'replace-with-none-start',\n    className: 'icon-start-event-none',\n    target: {\n      type: 'bpmn:StartEvent'\n    }\n  },\n  {\n    label: 'Intermediate Throw Event',\n    actionName: 'replace-with-message-intermediate-throw',\n    className: 'icon-intermediate-event-none',\n    target: {\n      type: 'bpmn:IntermediateThrowEvent'\n    }\n  },\n  {\n    label: 'End Event',\n    actionName: 'replace-with-none-end',\n    className: 'icon-end-event-none',\n    target: {\n      type: 'bpmn:EndEvent'\n    }\n  },\n  {\n    label: 'Message End Event',\n    actionName: 'replace-with-message-end',\n    className: 'icon-end-event-message',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:MessageEventDefinition'\n    }\n  },\n  {\n    label: 'Escalation End Event',\n    actionName: 'replace-with-escalation-end',\n    className: 'icon-end-event-escalation',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:EscalationEventDefinition'\n    }\n  },\n  {\n    label: 'Error End Event',\n    actionName: 'replace-with-error-end',\n    className: 'icon-end-event-error',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:ErrorEventDefinition'\n    }\n  },\n  {\n    label: 'Cancel End Event',\n    actionName: 'replace-with-cancel-end',\n    className: 'icon-end-event-cancel',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:CancelEventDefinition'\n    }\n  },\n  {\n    label: 'Compensation End Event',\n    actionName: 'replace-with-compensation-end',\n    className: 'icon-end-event-compensation',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:CompensateEventDefinition'\n    }\n  },\n  {\n    label: 'Signal End Event',\n    actionName: 'replace-with-signal-end',\n    className: 'icon-end-event-signal',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:SignalEventDefinition'\n    }\n  },\n  {\n    label: 'Terminate End Event',\n    actionName: 'replace-with-terminate-end',\n    className: 'icon-end-event-terminate',\n    target: {\n      type: 'bpmn:EndEvent',\n      eventDefinition: 'bpmn:TerminateEventDefinition'\n    }\n  }\n];\n\nmodule.exports.GATEWAY = [\n  {\n    label: 'Exclusive Gateway',\n    actionName: 'replace-with-exclusive-gateway',\n    className: 'icon-gateway-xor',\n    target: {\n      type: 'bpmn:ExclusiveGateway'\n    }\n  },\n  {\n    label: 'Parallel Gateway',\n    actionName: 'replace-with-parallel-gateway',\n    className: 'icon-gateway-parallel',\n    target: {\n      type: 'bpmn:ParallelGateway'\n    }\n  },\n  {\n    label: 'Inclusive Gateway',\n    actionName: 'replace-with-inclusive-gateway',\n    className: 'icon-gateway-or',\n    target: {\n      type: 'bpmn:InclusiveGateway'\n    }\n  },\n  {\n    label: 'Complex Gateway',\n    actionName: 'replace-with-complex-gateway',\n    className: 'icon-gateway-complex',\n    target: {\n      type: 'bpmn:ComplexGateway'\n    }\n  },\n  {\n    label: 'Event based Gateway',\n    actionName: 'replace-with-event-based-gateway',\n    className: 'icon-gateway-eventbased',\n    target: {\n      type: 'bpmn:EventBasedGateway',\n      instantiate: false,\n      eventGatewayType: 'Exclusive'\n    }\n  }\n  // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194\n  // {\n  //   label: 'Event based instantiating Gateway',\n  //   actionName: 'replace-with-exclusive-event-based-gateway',\n  //   className: 'icon-exclusive-event-based',\n  //   target: {\n  //     type: 'bpmn:EventBasedGateway'\n  //   },\n  //   options: {\n  //     businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }\n  //   }\n  // },\n  // {\n  //   label: 'Parallel Event based instantiating Gateway',\n  //   actionName: 'replace-with-parallel-event-based-instantiate-gateway',\n  //   className: 'icon-parallel-event-based-instantiate-gateway',\n  //   target: {\n  //     type: 'bpmn:EventBasedGateway'\n  //   },\n  //   options: {\n  //     businessObject: { instantiate: true, eventGatewayType: 'Parallel' }\n  //   }\n  // }\n];\n\n\nmodule.exports.TASK = [\n  {\n    label: 'Task',\n    actionName: 'replace-with-task',\n    className: 'icon-task',\n    target: {\n      type: 'bpmn:Task'\n    }\n  },\n  {\n    label: 'Send Task',\n    actionName: 'replace-with-send-task',\n    className: 'icon-send',\n    target: {\n      type: 'bpmn:SendTask'\n    }\n  },\n  {\n    label: 'Receive Task',\n    actionName: 'replace-with-receive-task',\n    className: 'icon-receive',\n    target: {\n      type: 'bpmn:ReceiveTask'\n    }\n  },\n  {\n    label: 'User Task',\n    actionName: 'replace-with-user-task',\n    className: 'icon-user',\n    target: {\n      type: 'bpmn:UserTask'\n    }\n  },\n  {\n    label: 'Manual Task',\n    actionName: 'replace-with-manual-task',\n    className: 'icon-manual',\n    target: {\n      type: 'bpmn:ManualTask'\n    }\n  },\n  {\n    label: 'Business Rule Task',\n    actionName: 'replace-with-rule-task',\n    className: 'icon-business-rule',\n    target: {\n      type: 'bpmn:BusinessRuleTask'\n    }\n  },\n  {\n    label: 'Service Task',\n    actionName: 'replace-with-service-task',\n    className: 'icon-service',\n    target: {\n      type: 'bpmn:ServiceTask'\n    }\n  },\n  {\n    label: 'Script Task',\n    actionName: 'replace-with-script-task',\n    className: 'icon-script',\n    target: {\n      type: 'bpmn:ScriptTask'\n    }\n  }\n];","module.exports = {\n  __depends__: [\n    require(139),\n    require(141),\n    require(151)\n  ],\n  bpmnReplace: [ 'type', require(35) ]\n};","'use strict';\n\nvar inherits = require(195);\n\nvar forEach = require(204);\n\nvar getBoundingBox = require(177).getBBox;\nvar is = require(21).is;\n\nvar Snapping = require(154),\n    SnapUtil = require(153);\n\nvar is = require(47).is;\n\nvar mid = SnapUtil.mid,\n    topLeft = SnapUtil.topLeft,\n    bottomRight = SnapUtil.bottomRight;\n\nvar round = Math.round;\n\n\n/**\n * BPMN specific snapping functionality\n *\n *  * snap on process elements if a pool is created inside a\n *    process diagram\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nfunction BpmnSnapping(eventBus, canvas) {\n\n  // instantiate super\n  Snapping.call(this, eventBus, canvas);\n\n\n  /**\n   * Drop participant on process <> process elements snapping\n   */\n\n  function initParticipantSnapping(context, shape, elements) {\n\n    if (!elements.length) {\n      return;\n    }\n\n    var snapBox = getBoundingBox(elements.filter(function(e) {\n      return !e.labelTarget && !e.waypoints;\n    }));\n\n    snapBox.x -= 50;\n    snapBox.y -= 20;\n    snapBox.width += 70;\n    snapBox.height += 40;\n\n    // adjust shape height to include bounding box\n    shape.width = Math.max(shape.width, snapBox.width);\n    shape.height = Math.max(shape.height, snapBox.height);\n\n    context.participantSnapBox = snapBox;\n  }\n\n  function snapParticipant(snapBox, shape, event) {\n\n    var shapeHalfWidth = shape.width / 2 - 30,\n        shapeHalfHeight = shape.height / 2;\n\n    var currentTopLeft = {\n      x: event.x - shapeHalfWidth - 30,\n      y: event.y - shapeHalfHeight\n    };\n\n    var currentBottomRight = {\n      x: event.x + shapeHalfWidth + 30,\n      y: event.y + shapeHalfHeight\n    };\n\n    var snapTopLeft = snapBox,\n        snapBottomRight = bottomRight(snapBox);\n\n    if (currentTopLeft.x >= snapTopLeft.x) {\n      event.x = snapTopLeft.x + 30 + shapeHalfWidth;\n      event.snapped = true;\n    } else\n    if (currentBottomRight.x <= snapBottomRight.x) {\n      event.x = snapBottomRight.x - 30 - shapeHalfWidth;\n      event.snapped = true;\n    }\n\n    if (currentTopLeft.y >= snapTopLeft.y) {\n      event.y = snapTopLeft.y + shapeHalfHeight;\n      event.snapped = true;\n    } else\n    if (currentBottomRight.y <= snapBottomRight.y) {\n      event.y = snapBottomRight.y - shapeHalfHeight;\n      event.snapped = true;\n    }\n  }\n\n  eventBus.on('create.start', function(event) {\n\n    var context = event.context,\n        shape = context.shape,\n        rootElement = canvas.getRootElement();\n\n    // snap participant around existing elements (if any)\n    if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {\n\n      initParticipantSnapping(context, shape, rootElement.children);\n    }\n  });\n\n  eventBus.on([ 'create.move', 'create.end' ], 1500, function(event) {\n\n    var context = event.context,\n        shape = context.shape,\n        participantSnapBox = context.participantSnapBox;\n\n    if (!event.snapped && participantSnapBox) {\n      snapParticipant(participantSnapBox, shape, event);\n    }\n  });\n\n  eventBus.on('resize.start', 1500, function(event) {\n    var context = event.context,\n        shape = context.shape;\n\n    if (is(shape, 'bpmn:SubProcess')) {\n        context.minDimensions = { width: 140, height: 120 };\n    }\n\n    if (is(shape, 'bpmn:Participant')) {\n        context.minDimensions = { width: 400, height: 200 };\n    }\n\n    if (is(shape, 'bpmn:TextAnnotation')) {\n      context.minDimensions = { width: 50, height: 50 };\n    }\n  });\n  \n}\n\ninherits(BpmnSnapping, Snapping);\n\nBpmnSnapping.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = BpmnSnapping;\n\n\nBpmnSnapping.prototype.initSnap = function(event) {\n\n  var context = event.context,\n      shape = context.shape,\n      shapeMid,\n      shapeBounds,\n      shapeTopLeft,\n      shapeBottomRight,\n      snapContext;\n\n\n  snapContext = Snapping.prototype.initSnap.call(this, event);\n\n  if (is(shape, 'bpmn:Participant')) {\n    // assign higher priority for outer snaps on participants\n    snapContext.setSnapLocations([ 'top-left', 'bottom-right', 'mid' ]);\n  }\n\n\n  if (shape) {\n\n    shapeMid = mid(shape, event);\n\n    shapeBounds = {\n      width: shape.width,\n      height: shape.height,\n      x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,\n      y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,\n    };\n\n    shapeTopLeft = topLeft(shapeBounds);\n    shapeBottomRight = bottomRight(shapeBounds);\n\n    snapContext.setSnapOrigin('top-left', {\n      x: shapeTopLeft.x - event.x,\n      y: shapeTopLeft.y - event.y\n    });\n\n    snapContext.setSnapOrigin('bottom-right', {\n      x: shapeBottomRight.x - event.x,\n      y: shapeBottomRight.y - event.y\n    });\n\n\n    forEach(shape.outgoing, function(c) {\n      var docking = c.waypoints[0];\n\n      docking = docking.original || docking;\n\n      snapContext.setSnapOrigin(c.id + '-docking', {\n        x: docking.x - event.x,\n        y: docking.y - event.y\n      });\n    });\n\n    forEach(shape.incoming, function(c) {\n      var docking = c.waypoints[c.waypoints.length - 1];\n\n      docking = docking.original || docking;\n\n      snapContext.setSnapOrigin(c.id + '-docking', {\n        x: docking.x - event.x,\n        y: docking.y - event.y\n      });\n    });\n\n  }\n\n  var source = context.source;\n\n  if (source) {\n    snapContext.addDefaultSnap('mid', mid(source));\n  }\n};\n\n\nBpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {\n\n  var siblings = this.getSiblings(shape, target);\n\n\n  forEach(siblings, function(s) {\n    snapPoints.add('mid', mid(s));\n\n    if (is(s, 'bpmn:Participant')) {\n      snapPoints.add('top-left', topLeft(s));\n      snapPoints.add('bottom-right', bottomRight(s));\n    }\n  });\n\n  forEach(shape.incoming, function(c) {\n\n    if (siblings.indexOf(c.source) === -1) {\n      snapPoints.add('mid', mid(c.source));\n\n      var docking = c.waypoints[0];\n      snapPoints.add(c.id + '-docking', docking.original || docking);\n    }\n  });\n\n\n  forEach(shape.outgoing, function(c) {\n\n    if (siblings.indexOf(c.target) === -1) {\n      snapPoints.add('mid', mid(c.target));\n\n      var docking = c.waypoints[c.waypoints.length - 1];\n      snapPoints.add(c.id + '-docking', docking.original || docking);\n    }\n  });\n\n};","module.exports = {\n  __init__: [ 'snapping' ],\n  snapping: [ 'type', require(38) ]\n};","'use strict';\n\nvar assign = require(325),\n    map = require(207);\n\nvar LabelUtil = require(46);\n\nvar hasExternalLabel = LabelUtil.hasExternalLabel,\n    getExternalLabelBounds = LabelUtil.getExternalLabelBounds,\n    isExpanded = require(45).isExpanded,\n    elementToString = require(43).elementToString;\n\n\nfunction elementData(semantic, attrs) {\n  return assign({\n    id: semantic.id,\n    type: semantic.$type,\n    businessObject: semantic\n  }, attrs);\n}\n\nfunction collectWaypoints(waypoints) {\n  return map(waypoints, function(p) {\n    return { x: p.x, y: p.y };\n  });\n}\n\n\n/**\n * An importer that adds bpmn elements to the canvas\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementFactory} elementFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {\n  this._eventBus = eventBus;\n  this._canvas = canvas;\n\n  this._elementFactory = elementFactory;\n  this._elementRegistry = elementRegistry;\n}\n\nBpmnImporter.$inject = [ 'eventBus', 'canvas', 'elementFactory', 'elementRegistry' ];\n\nmodule.exports = BpmnImporter;\n\n\n/**\n * Add bpmn element (semantic) to the canvas onto the\n * specified parent shape.\n */\nBpmnImporter.prototype.add = function(semantic, parentElement) {\n\n  var di = semantic.di,\n      element;\n\n  // ROOT ELEMENT\n  // handle the special case that we deal with a\n  // invisible root element (process or collaboration)\n  if (di.$instanceOf('bpmndi:BPMNPlane')) {\n\n    // add a virtual element (not being drawn)\n    element = this._elementFactory.createRoot(elementData(semantic));\n\n    this._canvas.setRootElement(element);\n  }\n\n  // SHAPE\n  else if (di.$instanceOf('bpmndi:BPMNShape')) {\n\n    var collapsed = !isExpanded(semantic);\n    var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);\n\n    var bounds = semantic.di.bounds;\n\n    element = this._elementFactory.createShape(elementData(semantic, {\n      collapsed: collapsed,\n      hidden: hidden,\n      x: Math.round(bounds.x),\n      y: Math.round(bounds.y),\n      width: Math.round(bounds.width),\n      height: Math.round(bounds.height)\n    }));\n\n    this._canvas.addShape(element, parentElement);\n  }\n\n  // CONNECTION\n  else if (di.$instanceOf('bpmndi:BPMNEdge')) {\n\n    var source = this._getSource(semantic),\n        target = this._getTarget(semantic);\n\n    element = this._elementFactory.createConnection(elementData(semantic, {\n      source: source,\n      target: target,\n      waypoints: collectWaypoints(semantic.di.waypoint)\n    }));\n\n    this._canvas.addConnection(element, parentElement);\n  } else {\n    throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));\n  }\n\n  // (optional) LABEL\n  if (hasExternalLabel(semantic)) {\n    this.addLabel(semantic, element);\n  }\n\n\n  this._eventBus.fire('bpmnElement.added', { element: element });\n\n  return element;\n};\n\n\n/**\n * add label for an element\n */\nBpmnImporter.prototype.addLabel = function(semantic, element) {\n  var bounds = getExternalLabelBounds(semantic, element);\n\n  var label = this._elementFactory.createLabel(elementData(semantic, {\n    id: semantic.id + '_label',\n    labelTarget: element,\n    type: 'label',\n    hidden: element.hidden,\n    x: Math.round(bounds.x),\n    y: Math.round(bounds.y),\n    width: Math.round(bounds.width),\n    height: Math.round(bounds.height)\n  }));\n\n  return this._canvas.addShape(label, element.parent);\n};\n\n/**\n * Return the drawn connection end based on the given side.\n *\n * @throws {Error} if the end is not yet drawn\n */\nBpmnImporter.prototype._getEnd = function(semantic, side) {\n\n  var element,\n      refSemantic,\n      type = semantic.$type;\n\n  refSemantic = semantic[side + 'Ref'];\n\n  // handle mysterious isMany DataAssociation#sourceRef\n  if (side === 'source' && type === 'bpmn:DataInputAssociation') {\n    refSemantic = refSemantic && refSemantic[0];\n  }\n\n  // fix source / target for DataInputAssociation / DataOutputAssociation\n  if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||\n      side === 'target' && type === 'bpmn:DataInputAssociation') {\n\n    refSemantic = semantic.$parent;\n  }\n\n  element = refSemantic && this._getElement(refSemantic);\n\n  if (element) {\n    return element;\n  }\n\n  if (refSemantic) {\n    throw new Error(\n      'element ' + elementToString(refSemantic) + ' referenced by ' +\n      elementToString(semantic) + '#' + side + 'Ref not yet drawn');\n  } else {\n    throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');\n  }\n};\n\nBpmnImporter.prototype._getSource = function(semantic) {\n  return this._getEnd(semantic, 'source');\n};\n\nBpmnImporter.prototype._getTarget = function(semantic) {\n  return this._getEnd(semantic, 'target');\n};\n\n\nBpmnImporter.prototype._getElement = function(semantic) {\n  return this._elementRegistry.get(semantic.id);\n};\n","'use strict';\n\nvar filter = require(202),\n    find = require(203),\n    forEach = require(204);\n\nvar Refs = require(356);\n\nvar elementToString = require(43).elementToString;\n\nvar diRefs = new Refs({ name: 'bpmnElement', enumerable: true }, { name: 'di' });\n\n/**\n * Returns true if an element has the given meta-model type\n *\n * @param  {ModdleElement}  element\n * @param  {String}         type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n  return element.$instanceOf(type);\n}\n\n\n/**\n * Find a suitable display candidate for definitions where the DI does not\n * correctly specify one.\n */\nfunction findDisplayCandidate(definitions) {\n  return find(definitions.rootElements, function(e) {\n    return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');\n  });\n}\n\n\nfunction BpmnTreeWalker(handler) {\n\n  // list of containers already walked\n  var handledProcesses = [];\n\n  // list of elements to handle deferred to ensure\n  // prerequisites are drawn\n  var deferred = [];\n\n  ///// Helpers /////////////////////////////////\n\n  function contextual(fn, ctx) {\n    return function(e) {\n      fn(e, ctx);\n    };\n  }\n\n  function visit(element, ctx) {\n\n    var gfx = element.gfx;\n\n    // avoid multiple rendering of elements\n    if (gfx) {\n      throw new Error('already rendered ' + elementToString(element));\n    }\n\n    // call handler\n    return handler.element(element, ctx);\n  }\n\n  function visitRoot(element, diagram) {\n    return handler.root(element, diagram);\n  }\n\n  function visitIfDi(element, ctx) {\n    try {\n      return element.di && visit(element, ctx);\n    } catch (e) {\n      logError(e.message, { element: element, error: e });\n\n      console.error('failed to import ' + elementToString(element));\n      console.error(e);\n    }\n  }\n\n  function logError(message, context) {\n    handler.error(message, context);\n  }\n\n  ////// DI handling ////////////////////////////\n\n  function registerDi(di) {\n    var bpmnElement = di.bpmnElement;\n\n    if (bpmnElement) {\n      if (bpmnElement.di) {\n        logError('multiple DI elements defined for ' + elementToString(bpmnElement), { element: bpmnElement });\n      } else {\n        diRefs.bind(bpmnElement, 'di');\n        bpmnElement.di = di;\n      }\n    } else {\n      logError('no bpmnElement referenced in ' + elementToString(di), { element: di });\n    }\n  }\n\n  function handleDiagram(diagram) {\n    handlePlane(diagram.plane);\n  }\n\n  function handlePlane(plane) {\n    registerDi(plane);\n\n    forEach(plane.planeElement, handlePlaneElement);\n  }\n\n  function handlePlaneElement(planeElement) {\n    registerDi(planeElement);\n  }\n\n\n  ////// Semantic handling //////////////////////\n\n  function handleDefinitions(definitions, diagram) {\n    // make sure we walk the correct bpmnElement\n\n    var diagrams = definitions.diagrams;\n\n    if (diagram && diagrams.indexOf(diagram) === -1) {\n      throw new Error('diagram not part of bpmn:Definitions');\n    }\n\n    if (!diagram && diagrams && diagrams.length) {\n      diagram = diagrams[0];\n    }\n\n    // no diagram -> nothing to import\n    if (!diagram) {\n      return;\n    }\n\n    // load DI from selected diagram only\n    handleDiagram(diagram);\n\n\n    var plane = diagram.plane;\n\n    if (!plane) {\n      throw new Error('no plane for ' + elementToString(diagram));\n    }\n\n\n    var rootElement = plane.bpmnElement;\n\n    // ensure we default to a suitable display candidate (process or collaboration),\n    // even if non is specified in DI\n    if (!rootElement) {\n      rootElement = findDisplayCandidate(definitions);\n\n      if (!rootElement) {\n        return logError('no process or collaboration present to display');\n      } else {\n\n        logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));\n\n        // correct DI on the fly\n        plane.bpmnElement = rootElement;\n        registerDi(plane);\n      }\n    }\n\n\n    var ctx = visitRoot(rootElement, plane);\n\n    if (is(rootElement, 'bpmn:Process')) {\n      handleProcess(rootElement, ctx);\n    } else if (is(rootElement, 'bpmn:Collaboration')) {\n      handleCollaboration(rootElement, ctx);\n\n      // force drawing of everything not yet drawn that is part of the target DI\n      handleUnhandledProcesses(definitions.rootElements, ctx);\n    } else {\n      throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));\n    }\n\n    // handle all deferred elements\n    handleDeferred(deferred);\n  }\n\n  function handleDeferred(deferred) {\n    forEach(deferred, function(d) { d(); });\n  }\n\n  function handleProcess(process, context) {\n    handleFlowElementsContainer(process, context);\n    handleIoSpecification(process.ioSpecification, context);\n\n    handleArtifacts(process.artifacts, context);\n\n    // log process handled\n    handledProcesses.push(process);\n  }\n\n  function handleUnhandledProcesses(rootElements) {\n\n    // walk through all processes that have not yet been drawn and draw them\n    // if they contain lanes with DI information.\n    // we do this to pass the free-floating lane test cases in the MIWG test suite\n    var processes = filter(rootElements, function(e) {\n      return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;\n    });\n\n    processes.forEach(contextual(handleProcess));\n  }\n\n  function handleMessageFlow(messageFlow, context) {\n    visitIfDi(messageFlow, context);\n  }\n\n  function handleMessageFlows(messageFlows, context) {\n    forEach(messageFlows, contextual(handleMessageFlow, context));\n  }\n\n  function handleDataAssociation(association, context) {\n    visitIfDi(association, context);\n  }\n\n  function handleDataInput(dataInput, context) {\n    visitIfDi(dataInput, context);\n  }\n\n  function handleDataOutput(dataOutput, context) {\n    visitIfDi(dataOutput, context);\n  }\n\n  function handleArtifact(artifact, context) {\n\n    // bpmn:TextAnnotation\n    // bpmn:Group\n    // bpmn:Association\n\n    visitIfDi(artifact, context);\n  }\n\n  function handleArtifacts(artifacts, context) {\n\n    forEach(artifacts, function(e) {\n      if (is(e, 'bpmn:Association')) {\n        deferred.push(function() {\n          handleArtifact(e, context);\n        });\n      } else {\n        handleArtifact(e, context);\n      }\n    });\n  }\n\n  function handleIoSpecification(ioSpecification, context) {\n\n    if (!ioSpecification) {\n      return;\n    }\n\n    forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));\n    forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));\n  }\n\n  function handleSubProcess(subProcess, context) {\n    handleFlowElementsContainer(subProcess, context);\n    handleArtifacts(subProcess.artifacts, context);\n  }\n\n  function handleFlowNode(flowNode, context) {\n    var childCtx = visitIfDi(flowNode, context);\n\n    if (is(flowNode, 'bpmn:SubProcess')) {\n      handleSubProcess(flowNode, childCtx || context);\n    }\n  }\n\n  function handleSequenceFlow(sequenceFlow, context) {\n    visitIfDi(sequenceFlow, context);\n  }\n\n  function handleDataElement(dataObject, context) {\n    visitIfDi(dataObject, context);\n  }\n\n  function handleBoundaryEvent(dataObject, context) {\n    visitIfDi(dataObject, context);\n  }\n\n  function handleLane(lane, context) {\n    var newContext = visitIfDi(lane, context);\n\n    if (lane.childLaneSet) {\n      handleLaneSet(lane.childLaneSet, newContext || context);\n    } else {\n      var filterList = filter(lane.flowNodeRef, function(e) {\n        return e.$type !== 'bpmn:BoundaryEvent';\n      });\n      handleFlowElements(filterList, newContext || context);\n    }\n  }\n\n  function handleLaneSet(laneSet, context) {\n    forEach(laneSet.lanes, contextual(handleLane, context));\n  }\n\n  function handleLaneSets(laneSets, context) {\n    forEach(laneSets, contextual(handleLaneSet, context));\n  }\n\n  function handleFlowElementsContainer(container, context) {\n\n    if (container.laneSets) {\n      handleLaneSets(container.laneSets, context);\n      handleNonFlowNodes(container.flowElements);\n    } else {\n      handleFlowElements(container.flowElements, context);\n    }\n  }\n\n  function handleNonFlowNodes(flowElements, context) {\n    forEach(flowElements, function(e) {\n      if (is(e, 'bpmn:SequenceFlow')) {\n        deferred.push(function() {\n          handleSequenceFlow(e, context);\n        });\n      } else if (is(e, 'bpmn:BoundaryEvent')) {\n        deferred.unshift(function() {\n          handleBoundaryEvent(e, context);\n        });\n      } else if (is(e, 'bpmn:DataObject')) {\n        // SKIP (assume correct referencing via DataObjectReference)\n      } else if (is(e, 'bpmn:DataStoreReference')) {\n        handleDataElement(e, context);\n      } else if (is(e, 'bpmn:DataObjectReference')) {\n        handleDataElement(e, context);\n      }\n    });\n  }\n\n  function handleFlowElements(flowElements, context) {\n    forEach(flowElements, function(e) {\n      if (is(e, 'bpmn:SequenceFlow')) {\n        deferred.push(function() {\n          handleSequenceFlow(e, context);\n        });\n      } else if (is(e, 'bpmn:BoundaryEvent')) {\n        deferred.unshift(function() {\n          handleBoundaryEvent(e, context);\n        });\n      } else if (is(e, 'bpmn:FlowNode')) {\n        handleFlowNode(e, context);\n\n        if (is(e, 'bpmn:Activity')) {\n\n          handleIoSpecification(e.ioSpecification, context);\n\n          // defer handling of associations\n          deferred.push(function() {\n            forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));\n            forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));\n          });\n        }\n      } else if (is(e, 'bpmn:DataObject')) {\n        // SKIP (assume correct referencing via DataObjectReference)\n      } else if (is(e, 'bpmn:DataStoreReference')) {\n        handleDataElement(e, context);\n      } else if (is(e, 'bpmn:DataObjectReference')) {\n        handleDataElement(e, context);\n      } else {\n        logError(\n          'unrecognized flowElement ' + elementToString(e) + ' in context ' +\n          (context ? elementToString(context.businessObject) : null),\n          { element: e, context: context });\n      }\n    });\n  }\n\n  function handleParticipant(participant, context) {\n    var newCtx = visitIfDi(participant, context);\n\n    var process = participant.processRef;\n    if (process) {\n      handleProcess(process, newCtx || context);\n    }\n  }\n\n  function handleCollaboration(collaboration) {\n\n    forEach(collaboration.participants, contextual(handleParticipant));\n\n    handleArtifacts(collaboration.artifacts);\n\n    // handle message flows latest in the process\n    deferred.push(function() {\n      handleMessageFlows(collaboration.messageFlows);\n    });\n  }\n\n\n  ///// API ////////////////////////////////\n\n  return {\n    handleDefinitions: handleDefinitions\n  };\n}\n\nmodule.exports = BpmnTreeWalker;","'use strict';\n\nvar BpmnTreeWalker = require(41);\n\n\n/**\n * Import the definitions into a diagram.\n *\n * Errors and warnings are reported through the specified callback.\n *\n * @param  {Diagram} diagram\n * @param  {ModdleElement} definitions\n * @param  {Function} done the callback, invoked with (err, [ warning ]) once the import is done\n */\nfunction importBpmnDiagram(diagram, definitions, done) {\n\n  var importer = diagram.get('bpmnImporter'),\n      eventBus = diagram.get('eventBus');\n\n  var error,\n      warnings = [];\n\n  function parse(definitions) {\n\n    var visitor = {\n\n      root: function(element) {\n        return importer.add(element);\n      },\n\n      element: function(element, parentShape) {\n        return importer.add(element, parentShape);\n      },\n\n      error: function(message, context) {\n        warnings.push({ message: message, context: context });\n      }\n    };\n\n    var walker = new BpmnTreeWalker(visitor);\n\n    // import\n    walker.handleDefinitions(definitions);\n  }\n\n  eventBus.fire('import.start');\n\n  try {\n    parse(definitions);\n  } catch (e) {\n    error = e;\n  }\n\n  eventBus.fire(error ? 'import.error' : 'import.success', { error: error, warnings: warnings });\n  done(error, warnings);\n}\n\nmodule.exports.importBpmnDiagram = importBpmnDiagram;","'use strict';\n\nmodule.exports.elementToString = function(e) {\n  if (!e) {\n    return '<null>';\n  }\n\n  return '<' + e.$type + (e.id ? ' id=\"' + e.id : '') + '\" />';\n};","module.exports = {\n  bpmnImporter: [ 'type', require(40) ]\n};","'use strict';\n\nvar is = require(47).is,\n    getBusinessObject = require(47).getBusinessObject;\n\nmodule.exports.isExpanded = function(element) {\n\n  if (is(element, 'bpmn:CallActivity')) {\n    return false;\n  }\n\n  if (is(element, 'bpmn:SubProcess')) {\n    return getBusinessObject(element).di.isExpanded;\n  }\n\n  if (is(element, 'bpmn:Participant')) {\n    return !!getBusinessObject(element).processRef;\n  }\n\n  return true;\n};\n","'use strict';\n\nvar assign = require(325);\n\n\nvar DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {\n  width: 90,\n  height: 20\n};\n\n\n/**\n * Returns true if the given semantic has an external label\n *\n * @param {BpmnElement} semantic\n * @return {Boolean} true if has label\n */\nmodule.exports.hasExternalLabel = function(semantic) {\n\n  return semantic.$instanceOf('bpmn:Event') ||\n         semantic.$instanceOf('bpmn:Gateway') ||\n         semantic.$instanceOf('bpmn:DataStoreReference') ||\n         semantic.$instanceOf('bpmn:DataObjectReference') ||\n         semantic.$instanceOf('bpmn:SequenceFlow') ||\n         semantic.$instanceOf('bpmn:MessageFlow');\n};\n\n\n/**\n * Get the middle of a number of waypoints\n *\n * @param  {Array<Point>} waypoints\n * @return {Point} the mid point\n */\nvar getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {\n\n  var mid = waypoints.length / 2 - 1;\n\n  var first = waypoints[Math.floor(mid)];\n  var second = waypoints[Math.ceil(mid + 0.01)];\n\n  return {\n    x: first.x + (second.x - first.x) / 2,\n    y: first.y + (second.y - first.y) / 2\n  };\n};\n\n\nvar getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {\n\n  if (element.waypoints) {\n    return getWaypointsMid(element.waypoints);\n  } else {\n    return {\n      x: element.x + element.width / 2,\n      y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2\n    };\n  }\n};\n\n/**\n * Returns the bounds of an elements label, parsed from the elements DI or\n * generated from its bounds.\n *\n * @param {BpmnElement} semantic\n * @param {djs.model.Base} element\n */\nmodule.exports.getExternalLabelBounds = function(semantic, element) {\n\n  var mid,\n      size,\n      bounds,\n      di = semantic.di,\n      label = di.label;\n\n  if (label && label.bounds) {\n    bounds = label.bounds;\n\n    size = {\n      width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),\n      height: bounds.height\n    };\n\n    mid = {\n      x: bounds.x + bounds.width / 2,\n      y: bounds.y + bounds.height / 2\n    };\n  } else {\n\n    mid = getExternalLabelMid(element);\n\n    size = DEFAULT_LABEL_SIZE;\n  }\n\n  return assign({\n    x: mid.x - size.width / 2,\n    y: mid.y - size.height / 2\n  }, size);\n};","'use strict';\n\n/**\n * Is an element of the given BPMN type?\n *\n * @param  {djs.model.Base|ModdleElement} element\n * @param  {String} type\n *\n * @return {Boolean}\n */\nfunction is(element, type) {\n  var bo = getBusinessObject(element);\n\n  return bo && bo.$instanceOf(type);\n}\n\nmodule.exports.is = is;\n\n\n/**\n * Return the business object for a given element.\n *\n * @param  {djs.model.Base|ModdleElement} element\n *\n * @return {ModdleElement}\n */\nfunction getBusinessObject(element) {\n  return (element && element.businessObject) || element;\n}\n\nmodule.exports.getBusinessObject = getBusinessObject;\n","module.exports = require(51);","'use strict';\n\nvar isString = require(322),\n    isFunction = require(317),\n    assign = require(325);\n\nvar Moddle = require(57),\n    XmlReader = require(53),\n    XmlWriter = require(54);\n\n/**\n * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.\n *\n * @class BpmnModdle\n * @extends Moddle\n *\n * @param {Object|Array} packages to use for instantiating the model\n * @param {Object} [options] additional options to pass over\n */\nfunction BpmnModdle(packages, options) {\n  Moddle.call(this, packages, options);\n}\n\nBpmnModdle.prototype = Object.create(Moddle.prototype);\n\nmodule.exports = BpmnModdle;\n\n\n/**\n * Instantiates a BPMN model tree from a given xml string.\n *\n * @param {String}   xmlStr\n * @param {String}   [typeName='bpmn:Definitions'] name of the root element\n * @param {Object}   [options]  options to pass to the underlying reader\n * @param {Function} done       callback that is invoked with (err, result, parseContext)\n *                              once the import completes\n */\nBpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {\n\n  if (!isString(typeName)) {\n    done = options;\n    options = typeName;\n    typeName = 'bpmn:Definitions';\n  }\n\n  if (isFunction(options)) {\n    done = options;\n    options = {};\n  }\n\n  var reader = new XmlReader(assign({ model: this, lax: true }, options));\n  var rootHandler = reader.handler(typeName);\n\n  reader.fromXML(xmlStr, rootHandler, done);\n};\n\n\n/**\n * Serializes a BPMN 2.0 object tree to XML.\n *\n * @param {String}   element    the root element, typically an instance of `bpmn:Definitions`\n * @param {Object}   [options]  to pass to the underlying writer\n * @param {Function} done       callback invoked with (err, xmlStr) once the import completes\n */\nBpmnModdle.prototype.toXML = function(element, options, done) {\n\n  if (isFunction(options)) {\n    done = options;\n    options = {};\n  }\n\n  var writer = new XmlWriter(options);\n  try {\n    var result = writer.toXML(element);\n    done(null, result);\n  } catch (e) {\n    done(e);\n  }\n};\n","'use strict';\n\nvar ID_PATTERN = /^(.*:)?id$/;\n\n/**\n * Extends the bpmn instance with id support.\n *\n * @example\n *\n * var moddle, ids;\n *\n * require('id-support').extend(moddle, ids);\n *\n * moddle.ids.next(); // create a next id\n * moddle.ids; // ids instance\n *\n * // claims id as used\n * moddle.create('foo:Bar', { id: 'fooobar1' });\n *\n *\n * @param  {Moddle} model\n * @param  {Ids} ids\n *\n * @return {Moddle} the extended moddle instance\n */\nmodule.exports.extend = function(model, ids) {\n\n  var set = model.properties.set;\n\n  // do not reinitialize setter\n  // unless it is already initialized\n  if (!model.ids) {\n\n    model.properties.set = function(target, property, value) {\n\n      // ensure we log used ids once they are assigned\n      // to model elements\n      if (ID_PATTERN.test(property)) {\n\n        var assigned = model.ids.assigned(value);\n        if (assigned && assigned !== target) {\n          throw new Error('id <' + value + '> already used');\n        }\n\n        model.ids.claim(value, target);\n      }\n\n      set.call(this, target, property, value);\n    };\n  }\n\n  model.ids = ids;\n\n  return model;\n};","'use strict';\n\nvar assign = require(325);\n\nvar BpmnModdle = require(49);\n\nvar packages = {\n  bpmn: require(66),\n  bpmndi: require(67),\n  dc: require(68),\n  di: require(69)\n};\n\nmodule.exports = function(additionalPackages, options) {\n  return new BpmnModdle(assign({}, packages, additionalPackages), options);\n};","'use strict';\n\nfunction capitalize(string) {\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nfunction lower(string) {\n  return string.charAt(0).toLowerCase() + string.slice(1);\n}\n\nfunction hasLowerCaseAlias(pkg) {\n  return pkg.xml && pkg.xml.tagAlias === 'lowerCase';\n}\n\n\nmodule.exports.aliasToName = function(alias, pkg) {\n  if (hasLowerCaseAlias(pkg)) {\n    return capitalize(alias);\n  } else {\n    return alias;\n  }\n};\n\nmodule.exports.nameToAlias = function(name, pkg) {\n  if (hasLowerCaseAlias(pkg)) {\n    return lower(name);\n  } else {\n    return name;\n  }\n};\n\nmodule.exports.DEFAULT_NS_MAP = {\n  'xsi': 'http://www.w3.org/2001/XMLSchema-instance'\n};\n\nmodule.exports.XSI_TYPE = 'xsi:type';","'use strict';\n\nvar reduce = require(208),\n    forEach = require(204),\n    find = require(203),\n    assign = require(325),\n    defer = require(215);\n\nvar Stack = require(56),\n    SaxParser = require(55).parser,\n    Moddle = require(57),\n    parseNameNs = require(62).parseName,\n    Types = require(65),\n    coerceType = Types.coerceType,\n    isSimpleType = Types.isSimple,\n    common = require(52),\n    XSI_TYPE = common.XSI_TYPE,\n    XSI_URI = common.DEFAULT_NS_MAP.xsi,\n    aliasToName = common.aliasToName;\n\nfunction parseNodeAttributes(node) {\n  var nodeAttrs = node.attributes;\n\n  return reduce(nodeAttrs, function(result, v, k) {\n    var name, ns;\n\n    if (!v.local) {\n      name = v.prefix;\n    } else {\n      ns = parseNameNs(v.name, v.prefix);\n      name = ns.name;\n    }\n\n    result[name] = v.value;\n    return result;\n  }, {});\n}\n\nfunction normalizeType(node, attr, model) {\n  var nameNs = parseNameNs(attr.value);\n\n  var uri = node.ns[nameNs.prefix || ''],\n      localName = nameNs.localName,\n      pkg = uri && model.getPackage(uri),\n      typePrefix;\n\n  if (pkg) {\n    typePrefix = pkg.xml && pkg.xml.typePrefix;\n\n    if (typePrefix && localName.indexOf(typePrefix) === 0) {\n      localName = localName.slice(typePrefix.length);\n    }\n\n    attr.value = pkg.prefix + ':' + localName;\n  }\n}\n\n/**\n * Normalizes namespaces for a node given an optional default namespace and a\n * number of mappings from uris to default prefixes.\n *\n * @param  {XmlNode} node\n * @param  {Model} model the model containing all registered namespaces\n * @param  {Uri} defaultNsUri\n */\nfunction normalizeNamespaces(node, model, defaultNsUri) {\n  var uri, prefix;\n\n  uri = node.uri || defaultNsUri;\n\n  if (uri) {\n    var pkg = model.getPackage(uri);\n\n    if (pkg) {\n      prefix = pkg.prefix;\n    } else {\n      prefix = node.prefix;\n    }\n\n    node.prefix = prefix;\n    node.uri = uri;\n  }\n\n  forEach(node.attributes, function(attr) {\n\n    // normalize xsi:type attributes because the\n    // assigned type may or may not be namespace prefixed\n    if (attr.uri === XSI_URI && attr.local === 'type') {\n      normalizeType(node, attr, model);\n    }\n\n    normalizeNamespaces(attr, model, null);\n  });\n}\n\n\n/**\n * A parse context.\n *\n * @class\n *\n * @param {Object} options\n * @param {ElementHandler} options.parseRoot the root handler for parsing a document\n * @param {boolean} [options.lax=false] whether or not to ignore invalid elements\n */\nfunction Context(options) {\n\n  /**\n   * @property {ElementHandler} parseRoot\n   */\n\n  /**\n   * @property {Boolean} lax\n   */\n\n  assign(this, options);\n\n  var elementsById = this.elementsById = {};\n  var references = this.references = [];\n  var warnings = this.warnings = [];\n\n  this.addReference = function(reference) {\n    references.push(reference);\n  };\n\n  this.addElement = function(id, element) {\n\n    if (!id || !element) {\n      throw new Error('[xml-reader] id or ctx must not be null');\n    }\n\n    elementsById[id] = element;\n  };\n\n  this.addWarning = function (w) {\n    warnings.push(w);\n  };\n}\n\nfunction BaseHandler() {}\n\nBaseHandler.prototype.handleEnd = function() {};\nBaseHandler.prototype.handleText = function() {};\nBaseHandler.prototype.handleNode = function() {};\n\n\n/**\n * A simple pass through handler that does nothing except for\n * ignoring all input it receives.\n *\n * This is used to ignore unknown elements and\n * attributes.\n */\nfunction NoopHandler() { }\n\nNoopHandler.prototype = new BaseHandler();\n\nNoopHandler.prototype.handleNode = function() {\n  return this;\n};\n\nfunction BodyHandler() {}\n\nBodyHandler.prototype = new BaseHandler();\n\nBodyHandler.prototype.handleText = function(text) {\n  this.body = (this.body || '') + text;\n};\n\nfunction ReferenceHandler(property, context) {\n  this.property = property;\n  this.context = context;\n}\n\nReferenceHandler.prototype = new BodyHandler();\n\nReferenceHandler.prototype.handleNode = function(node) {\n\n  if (this.element) {\n    throw new Error('expected no sub nodes');\n  } else {\n    this.element = this.createReference(node);\n  }\n\n  return this;\n};\n\nReferenceHandler.prototype.handleEnd = function() {\n  this.element.id = this.body;\n};\n\nReferenceHandler.prototype.createReference = function() {\n  return {\n    property: this.property.ns.name,\n    id: ''\n  };\n};\n\nfunction ValueHandler(propertyDesc, element) {\n  this.element = element;\n  this.propertyDesc = propertyDesc;\n}\n\nValueHandler.prototype = new BodyHandler();\n\nValueHandler.prototype.handleEnd = function() {\n\n  var value = this.body,\n      element = this.element,\n      propertyDesc = this.propertyDesc;\n\n  value = coerceType(propertyDesc.type, value);\n\n  if (propertyDesc.isMany) {\n    element.get(propertyDesc.name).push(value);\n  } else {\n    element.set(propertyDesc.name, value);\n  }\n};\n\n\nfunction BaseElementHandler() {}\n\nBaseElementHandler.prototype = Object.create(BodyHandler.prototype);\n\nBaseElementHandler.prototype.handleNode = function(node) {\n  var parser = this,\n      element = this.element,\n      id;\n\n  if (!element) {\n    element = this.element = this.createElement(node);\n    id = element.id;\n\n    if (id) {\n      this.context.addElement(id, element);\n    }\n  } else {\n    parser = this.handleChild(node);\n  }\n\n  return parser;\n};\n\n/**\n * @class XMLReader.ElementHandler\n *\n */\nfunction ElementHandler(model, type, context) {\n  this.model = model;\n  this.type = model.getType(type);\n  this.context = context;\n}\n\nElementHandler.prototype = new BaseElementHandler();\n\nElementHandler.prototype.addReference = function(reference) {\n  this.context.addReference(reference);\n};\n\nElementHandler.prototype.handleEnd = function() {\n\n  var value = this.body,\n      element = this.element,\n      descriptor = element.$descriptor,\n      bodyProperty = descriptor.bodyProperty;\n\n  if (bodyProperty && value !== undefined) {\n    value = coerceType(bodyProperty.type, value);\n    element.set(bodyProperty.name, value);\n  }\n};\n\n/**\n * Create an instance of the model from the given node.\n *\n * @param  {Element} node the xml node\n */\nElementHandler.prototype.createElement = function(node) {\n  var attributes = parseNodeAttributes(node),\n      Type = this.type,\n      descriptor = Type.$descriptor,\n      context = this.context,\n      instance = new Type({});\n\n  forEach(attributes, function(value, name) {\n\n    var prop = descriptor.propertiesByName[name];\n\n    if (prop && prop.isReference) {\n      context.addReference({\n        element: instance,\n        property: prop.ns.name,\n        id: value\n      });\n    } else {\n      if (prop) {\n        value = coerceType(prop.type, value);\n      }\n\n      instance.set(name, value);\n    }\n  });\n\n  return instance;\n};\n\nElementHandler.prototype.getPropertyForNode = function(node) {\n\n  var nameNs = parseNameNs(node.local, node.prefix);\n\n  var type = this.type,\n      model = this.model,\n      descriptor = type.$descriptor;\n\n  var propertyName = nameNs.name,\n      property = descriptor.propertiesByName[propertyName],\n      elementTypeName,\n      elementType,\n      typeAnnotation;\n\n  // search for properties by name first\n\n  if (property) {\n\n    if (property.serialize === XSI_TYPE) {\n      typeAnnotation = node.attributes[XSI_TYPE];\n\n      // xsi type is optional, if it does not exists the\n      // default type is assumed\n      if (typeAnnotation) {\n\n        elementTypeName = typeAnnotation.value;\n\n        // TODO: extract real name from attribute\n        elementType = model.getType(elementTypeName);\n\n        return assign({}, property, { effectiveType: elementType.$descriptor.name });\n      }\n    }\n\n    // search for properties by name first\n    return property;\n  }\n\n\n  var pkg = model.getPackage(nameNs.prefix);\n\n  if (pkg) {\n    elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);\n    elementType = model.getType(elementTypeName);\n\n    // search for collection members later\n    property = find(descriptor.properties, function(p) {\n      return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);\n    });\n\n    if (property) {\n      return assign({}, property, { effectiveType: elementType.$descriptor.name });\n    }\n  } else {\n    // parse unknown element (maybe extension)\n    property = find(descriptor.properties, function(p) {\n      return !p.isReference && !p.isAttribute && p.type === 'Element';\n    });\n\n    if (property) {\n      return property;\n    }\n  }\n\n  throw new Error('unrecognized element <' + nameNs.name + '>');\n};\n\nElementHandler.prototype.toString = function() {\n  return 'ElementDescriptor[' + this.type.$descriptor.name + ']';\n};\n\nElementHandler.prototype.valueHandler = function(propertyDesc, element) {\n  return new ValueHandler(propertyDesc, element);\n};\n\nElementHandler.prototype.referenceHandler = function(propertyDesc) {\n  return new ReferenceHandler(propertyDesc, this.context);\n};\n\nElementHandler.prototype.handler = function(type) {\n  if (type === 'Element') {\n    return new GenericElementHandler(this.model, type, this.context);\n  } else {\n    return new ElementHandler(this.model, type, this.context);\n  }\n};\n\n/**\n * Handle the child element parsing\n *\n * @param  {Element} node the xml node\n */\nElementHandler.prototype.handleChild = function(node) {\n  var propertyDesc, type, element, childHandler;\n\n  propertyDesc = this.getPropertyForNode(node);\n  element = this.element;\n\n  type = propertyDesc.effectiveType || propertyDesc.type;\n\n  if (isSimpleType(type)) {\n    return this.valueHandler(propertyDesc, element);\n  }\n\n  if (propertyDesc.isReference) {\n    childHandler = this.referenceHandler(propertyDesc).handleNode(node);\n  } else {\n    childHandler = this.handler(type).handleNode(node);\n  }\n\n  var newElement = childHandler.element;\n\n  // child handles may decide to skip elements\n  // by not returning anything\n  if (newElement !== undefined) {\n\n    if (propertyDesc.isMany) {\n      element.get(propertyDesc.name).push(newElement);\n    } else {\n      element.set(propertyDesc.name, newElement);\n    }\n\n    if (propertyDesc.isReference) {\n      assign(newElement, {\n        element: element\n      });\n\n      this.context.addReference(newElement);\n    } else {\n      // establish child -> parent relationship\n      newElement.$parent = element;\n    }\n  }\n\n  return childHandler;\n};\n\n\nfunction GenericElementHandler(model, type, context) {\n  this.model = model;\n  this.context = context;\n}\n\nGenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);\n\nGenericElementHandler.prototype.createElement = function(node) {\n\n  var name = node.name,\n      prefix = node.prefix,\n      uri = node.ns[prefix],\n      attributes = node.attributes;\n\n  return this.model.createAny(name, uri, attributes);\n};\n\nGenericElementHandler.prototype.handleChild = function(node) {\n\n  var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),\n      element = this.element;\n\n  var newElement = handler.element,\n      children;\n\n  if (newElement !== undefined) {\n    children = element.$children = element.$children || [];\n    children.push(newElement);\n\n    // establish child -> parent relationship\n    newElement.$parent = element;\n  }\n\n  return handler;\n};\n\nGenericElementHandler.prototype.handleText = function(text) {\n  this.body = this.body || '' + text;\n};\n\nGenericElementHandler.prototype.handleEnd = function() {\n  if (this.body) {\n    this.element.$body = this.body;\n  }\n};\n\n/**\n * A reader for a meta-model\n *\n * @param {Object} options\n * @param {Model} options.model used to read xml files\n * @param {Boolean} options.lax whether to make parse errors warnings\n */\nfunction XMLReader(options) {\n\n  if (options instanceof Moddle) {\n    options = {\n      model: options\n    };\n  }\n\n  assign(this, { lax: false }, options);\n}\n\n\nXMLReader.prototype.fromXML = function(xml, rootHandler, done) {\n\n  var model = this.model,\n      lax = this.lax,\n      context = new Context({\n        parseRoot: rootHandler\n      });\n\n  var parser = new SaxParser(true, { xmlns: true, trim: true }),\n      stack = new Stack();\n\n  rootHandler.context = context;\n\n  // push root handler\n  stack.push(rootHandler);\n\n\n  function resolveReferences() {\n\n    var elementsById = context.elementsById;\n    var references = context.references;\n\n    var i, r;\n\n    for (i = 0; !!(r = references[i]); i++) {\n      var element = r.element;\n      var reference = elementsById[r.id];\n      var property = element.$descriptor.propertiesByName[r.property];\n\n      if (!reference) {\n        context.addWarning({\n          message: 'unresolved reference <' + r.id + '>',\n          element: r.element,\n          property: r.property,\n          value: r.id\n        });\n      }\n\n      if (property.isMany) {\n        var collection = element.get(property.name),\n            idx = collection.indexOf(r);\n\n        if (!reference) {\n          // remove unresolvable reference\n          collection.splice(idx, 1);\n        } else {\n          // update reference\n          collection[idx] = reference;\n        }\n      } else {\n        element.set(property.name, reference);\n      }\n    }\n  }\n\n  function handleClose(tagName) {\n    stack.pop().handleEnd();\n  }\n\n  function handleOpen(node) {\n    var handler = stack.peek();\n\n    normalizeNamespaces(node, model);\n\n    try {\n      stack.push(handler.handleNode(node));\n    } catch (e) {\n\n      var line = this.line,\n          column = this.column;\n\n      var message =\n        'unparsable content <' + node.name + '> detected/n/t' +\n          'line: ' + line + '/n/t' +\n          'column: ' + column + '/n/t' +\n          'nested error: ' + e.message;\n\n      if (lax) {\n        context.addWarning({\n          message: message,\n          error: e\n        });\n\n        console.warn('could not parse node');\n        console.warn(e);\n\n        stack.push(new NoopHandler());\n      } else {\n        console.error('could not parse document');\n        console.error(e);\n\n        throw new Error(message);\n      }\n    }\n  }\n\n  function handleText(text) {\n    stack.peek().handleText(text);\n  }\n\n  parser.onopentag = handleOpen;\n  parser.oncdata = parser.ontext = handleText;\n  parser.onclosetag = handleClose;\n  parser.onend = resolveReferences;\n\n  // deferred parse XML to make loading really ascnchronous\n  // this ensures the execution environment (node or browser)\n  // is kept responsive and that certain optimization strategies\n  // can kick in\n  defer(function() {\n    var error;\n\n    try {\n      parser.write(xml).close();\n    } catch (e) {\n      error = e;\n    }\n\n    done(error, error ? undefined : rootHandler.element, context);\n  });\n};\n\nXMLReader.prototype.handler = function(name) {\n  return new ElementHandler(this.model, name);\n};\n\nmodule.exports = XMLReader;\nmodule.exports.ElementHandler = ElementHandler;","'use strict';\n\nvar map = require(207),\n    forEach = require(204),\n    isString = require(322),\n    filter = require(202),\n    assign = require(325);\n\nvar Types = require(65),\n    parseNameNs = require(62).parseName,\n    common = require(52),\n    nameToAlias = common.nameToAlias;\n\nvar XML_PREAMBLE = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>/n',\n    ESCAPE_CHARS = /(<|>|'|\"|&|/n/r|/n)/g,\n    DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,\n    XSI_TYPE = common.XSI_TYPE;\n\n\nfunction nsName(ns) {\n  if (isString(ns)) {\n    return ns;\n  } else {\n    return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;\n  }\n}\n\nfunction getElementNs(ns, descriptor) {\n  if (descriptor.isGeneric) {\n    return descriptor.name;\n  } else {\n    return assign({ localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg) }, ns);\n  }\n}\n\nfunction getPropertyNs(ns, descriptor) {\n  return assign({ localName: descriptor.ns.localName }, ns);\n}\n\nfunction getSerializableProperties(element) {\n  var descriptor = element.$descriptor;\n\n  return filter(descriptor.properties, function(p) {\n    var name = p.name;\n\n    // do not serialize defaults\n    if (!element.hasOwnProperty(name)) {\n      return false;\n    }\n\n    var value = element[name];\n\n    // do not serialize default equals\n    if (value === p.default) {\n      return false;\n    }\n\n    return p.isMany ? value.length : true;\n  });\n}\n\nvar ESCAPE_MAP = {\n  '/n': '10',\n  '/n/r': '10',\n  '\"': '34',\n  '/'': '39',\n  '<': '60',\n  '>': '62',\n  '&': '38'\n};\n\n/**\n * Escape a string attribute to not contain any bad values (line breaks, '\"', ...)\n *\n * @param {String} str the string to escape\n * @return {String} the escaped string\n */\nfunction escapeAttr(str) {\n\n  // ensure we are handling strings here\n  str = isString(str) ? str : '' + str;\n\n  return str.replace(ESCAPE_CHARS, function(str) {\n    return '&#' + ESCAPE_MAP[str] + ';';\n  });\n}\n\nfunction filterAttributes(props) {\n  return filter(props, function(p) { return p.isAttr; });\n}\n\nfunction filterContained(props) {\n  return filter(props, function(p) { return !p.isAttr; });\n}\n\n\nfunction ReferenceSerializer(parent, ns) {\n  this.ns = ns;\n}\n\nReferenceSerializer.prototype.build = function(element) {\n  this.element = element;\n  return this;\n};\n\nReferenceSerializer.prototype.serializeTo = function(writer) {\n  writer\n    .appendIndent()\n    .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')\n    .appendNewLine();\n};\n\nfunction BodySerializer() {}\n\nBodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {\n  var escape = this.escape;\n\n  if (escape) {\n    writer.append('<![CDATA[');\n  }\n\n  writer.append(this.value);\n\n  if (escape) {\n    writer.append(']]>');\n  }\n};\n\nBodySerializer.prototype.build = function(prop, value) {\n  this.value = value;\n\n  if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {\n    this.escape = true;\n  }\n\n  return this;\n};\n\nfunction ValueSerializer(ns) {\n  this.ns = ns;\n}\n\nValueSerializer.prototype = new BodySerializer();\n\nValueSerializer.prototype.serializeTo = function(writer) {\n\n  writer\n    .appendIndent()\n    .append('<' + nsName(this.ns) + '>');\n\n  this.serializeValue(writer);\n\n  writer\n    .append( '</' + nsName(this.ns) + '>')\n    .appendNewLine();\n};\n\nfunction ElementSerializer(parent, ns) {\n  this.body = [];\n  this.attrs = [];\n\n  this.parent = parent;\n  this.ns = ns;\n}\n\nElementSerializer.prototype.build = function(element) {\n  this.element = element;\n\n  var otherAttrs = this.parseNsAttributes(element);\n\n  if (!this.ns) {\n    this.ns = this.nsTagName(element.$descriptor);\n  }\n\n  if (element.$descriptor.isGeneric) {\n    this.parseGeneric(element);\n  } else {\n    var properties = getSerializableProperties(element);\n\n    this.parseAttributes(filterAttributes(properties));\n    this.parseContainments(filterContained(properties));\n\n    this.parseGenericAttributes(element, otherAttrs);\n  }\n\n  return this;\n};\n\nElementSerializer.prototype.nsTagName = function(descriptor) {\n  var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n  return getElementNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.nsPropertyTagName = function(descriptor) {\n  var effectiveNs = this.logNamespaceUsed(descriptor.ns);\n  return getPropertyNs(effectiveNs, descriptor);\n};\n\nElementSerializer.prototype.isLocalNs = function(ns) {\n  return ns.uri === this.ns.uri;\n};\n\nElementSerializer.prototype.nsAttributeName = function(element) {\n\n  var ns;\n\n  if (isString(element)) {\n    ns = parseNameNs(element);\n  } else\n  if (element.ns) {\n    ns = element.ns;\n  }\n\n  var effectiveNs = this.logNamespaceUsed(ns);\n\n  // strip prefix if same namespace like parent\n  if (this.isLocalNs(effectiveNs)) {\n    return { localName: ns.localName };\n  } else {\n    return assign({ localName: ns.localName }, effectiveNs);\n  }\n};\n\nElementSerializer.prototype.parseGeneric = function(element) {\n\n  var self = this,\n      body = this.body,\n      attrs = this.attrs;\n\n  forEach(element, function(val, key) {\n\n    if (key === '$body') {\n      body.push(new BodySerializer().build({ type: 'String' }, val));\n    } else\n    if (key === '$children') {\n      forEach(val, function(child) {\n        body.push(new ElementSerializer(self).build(child));\n      });\n    } else\n    if (key.indexOf('$') !== 0) {\n      attrs.push({ name: key, value: escapeAttr(val) });\n    }\n  });\n};\n\n/**\n * Parse namespaces and return a list of left over generic attributes\n *\n * @param  {Object} element\n * @return {Array<Object>}\n */\nElementSerializer.prototype.parseNsAttributes = function(element) {\n  var self = this;\n\n  var genericAttrs = element.$attrs;\n\n  var attributes = [];\n\n  // parse namespace attributes first\n  // and log them. push non namespace attributes to a list\n  // and process them later\n  forEach(genericAttrs, function(value, name) {\n    var nameNs = parseNameNs(name);\n\n    if (nameNs.prefix === 'xmlns') {\n      self.logNamespace({ prefix: nameNs.localName, uri: value });\n    } else\n    if (!nameNs.prefix && nameNs.localName === 'xmlns') {\n      self.logNamespace({ uri: value });\n    } else {\n      attributes.push({ name: name, value: value });\n    }\n  });\n\n  return attributes;\n};\n\nElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {\n\n  var self = this;\n\n  forEach(attributes, function(attr) {\n\n    // do not serialize xsi:type attribute\n    // it is set manually based on the actual implementation type\n    if (attr.name === XSI_TYPE) {\n      return;\n    }\n\n    try {\n      self.addAttribute(self.nsAttributeName(attr.name), attr.value);\n    } catch (e) {\n      console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);\n    }\n  });\n};\n\nElementSerializer.prototype.parseContainments = function(properties) {\n\n  var self = this,\n      body = this.body,\n      element = this.element;\n\n  forEach(properties, function(p) {\n    var value = element.get(p.name),\n        isReference = p.isReference,\n        isMany = p.isMany;\n\n    var ns = self.nsPropertyTagName(p);\n\n    if (!isMany) {\n      value = [ value ];\n    }\n\n    if (p.isBody) {\n      body.push(new BodySerializer().build(p, value[0]));\n    } else\n    if (Types.isSimple(p.type)) {\n      forEach(value, function(v) {\n        body.push(new ValueSerializer(ns).build(p, v));\n      });\n    } else\n    if (isReference) {\n      forEach(value, function(v) {\n        body.push(new ReferenceSerializer(self, ns).build(v));\n      });\n    } else {\n      // allow serialization via type\n      // rather than element name\n      var asType = p.serialize === XSI_TYPE;\n\n      forEach(value, function(v) {\n        var serializer;\n\n        if (asType) {\n          serializer = new TypeSerializer(self, ns);\n        } else {\n          serializer = new ElementSerializer(self);\n        }\n\n        body.push(serializer.build(v));\n      });\n    }\n  });\n};\n\nElementSerializer.prototype.getNamespaces = function() {\n  if (!this.parent) {\n    if (!this.namespaces) {\n      this.namespaces = {\n        prefixMap: {},\n        uriMap: {},\n        used: {}\n      };\n    }\n  } else {\n    this.namespaces = this.parent.getNamespaces();\n  }\n\n  return this.namespaces;\n};\n\nElementSerializer.prototype.logNamespace = function(ns) {\n  var namespaces = this.getNamespaces();\n\n  var existing = namespaces.uriMap[ns.uri];\n\n  if (!existing) {\n    namespaces.uriMap[ns.uri] = ns;\n  }\n\n  namespaces.prefixMap[ns.prefix] = ns.uri;\n\n  return ns;\n};\n\nElementSerializer.prototype.logNamespaceUsed = function(ns) {\n  var element = this.element,\n      model = element.$model,\n      namespaces = this.getNamespaces();\n\n  // ns may be\n  //\n  //   * prefix only\n  //   * prefix:uri\n\n  var prefix = ns.prefix;\n  var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||\n            namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);\n\n  if (!uri) {\n    throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');\n  }\n\n  ns = namespaces.uriMap[uri];\n\n  if (!ns) {\n    ns = this.logNamespace({ prefix: prefix, uri: uri });\n  }\n\n  if (!namespaces.used[ns.uri]) {\n    namespaces.used[ns.uri] = ns;\n  }\n\n  return ns;\n};\n\nElementSerializer.prototype.parseAttributes = function(properties) {\n  var self = this,\n      element = this.element;\n\n  forEach(properties, function(p) {\n    self.logNamespaceUsed(p.ns);\n\n    var value = element.get(p.name);\n\n    if (p.isReference) {\n      value = value.id;\n    }\n\n    self.addAttribute(self.nsAttributeName(p), value);\n  });\n};\n\nElementSerializer.prototype.addAttribute = function(name, value) {\n  var attrs = this.attrs;\n\n  if (isString(value)) {\n    value = escapeAttr(value);\n  }\n\n  attrs.push({ name: name, value: value });\n};\n\nElementSerializer.prototype.serializeAttributes = function(writer) {\n  var attrs = this.attrs,\n      root = !this.parent,\n      namespaces = this.namespaces;\n\n  function collectNsAttrs() {\n    return map(namespaces.used, function(ns) {\n      var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');\n      return { name: name, value: ns.uri };\n    });\n  }\n\n  if (root) {\n    attrs = collectNsAttrs().concat(attrs);\n  }\n\n  forEach(attrs, function(a) {\n    writer\n      .append(' ')\n      .append(nsName(a.name)).append('=\"').append(a.value).append('\"');\n  });\n};\n\nElementSerializer.prototype.serializeTo = function(writer) {\n  var hasBody = this.body.length,\n      indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);\n\n  writer\n    .appendIndent()\n    .append('<' + nsName(this.ns));\n\n  this.serializeAttributes(writer);\n\n  writer.append(hasBody ? '>' : ' />');\n\n  if (hasBody) {\n\n    if (indent) {\n      writer\n        .appendNewLine()\n        .indent();\n    }\n\n    forEach(this.body, function(b) {\n      b.serializeTo(writer);\n    });\n\n    if (indent) {\n      writer\n        .unindent()\n        .appendIndent();\n    }\n\n    writer.append('</' + nsName(this.ns) + '>');\n  }\n\n  writer.appendNewLine();\n};\n\n/**\n * A serializer for types that handles serialization of data types\n */\nfunction TypeSerializer(parent, ns) {\n  ElementSerializer.call(this, parent, ns);\n}\n\nTypeSerializer.prototype = new ElementSerializer();\n\nTypeSerializer.prototype.build = function(element) {\n  var descriptor = element.$descriptor;\n\n  this.element = element;\n\n  this.typeNs = this.nsTagName(descriptor);\n\n  // add xsi:type attribute to represent the elements\n  // actual type\n\n  var typeNs = this.typeNs,\n      pkg = element.$model.getPackage(typeNs.uri),\n      typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';\n\n  this.addAttribute(this.nsAttributeName(XSI_TYPE),\n    (typeNs.prefix ? typeNs.prefix + ':' : '') +\n    typePrefix + descriptor.ns.localName);\n\n  // do the usual stuff\n  return ElementSerializer.prototype.build.call(this, element);\n};\n\nTypeSerializer.prototype.isLocalNs = function(ns) {\n  return ns.uri === this.typeNs.uri;\n};\n\nfunction SavingWriter() {\n  this.value = '';\n\n  this.write = function(str) {\n    this.value += str;\n  };\n}\n\nfunction FormatingWriter(out, format) {\n\n  var indent = [''];\n\n  this.append = function(str) {\n    out.write(str);\n\n    return this;\n  };\n\n  this.appendNewLine = function() {\n    if (format) {\n      out.write('/n');\n    }\n\n    return this;\n  };\n\n  this.appendIndent = function() {\n    if (format) {\n      out.write(indent.join('  '));\n    }\n\n    return this;\n  };\n\n  this.indent = function() {\n    indent.push('');\n    return this;\n  };\n\n  this.unindent = function() {\n    indent.pop();\n    return this;\n  };\n}\n\n/**\n * A writer for meta-model backed document trees\n *\n * @param {Object} options output options to pass into the writer\n */\nfunction XMLWriter(options) {\n\n  options = assign({ format: false, preamble: true }, options || {});\n\n  function toXML(tree, writer) {\n    var internalWriter = writer || new SavingWriter();\n    var formatingWriter = new FormatingWriter(internalWriter, options.format);\n\n    if (options.preamble) {\n      formatingWriter.append(XML_PREAMBLE);\n    }\n\n    new ElementSerializer().build(tree).serializeTo(formatingWriter);\n\n    if (!writer) {\n      return internalWriter.value;\n    }\n  }\n\n  return {\n    toXML: toXML\n  };\n}\n\nmodule.exports = XMLWriter;","// wrapper for non-node envs\n;(function (sax) {\n\nsax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\nsax.SAXParser = SAXParser\nsax.SAXStream = SAXStream\nsax.createStream = createStream\n\n// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n// since that's the earliest that a buffer overrun could occur.  This way, checks are\n// as rare as required, but as often as necessary to ensure never crossing this bound.\n// Furthermore, buffers are only tested at most once per write(), so passing a very\n// large string into write() might have undesirable effects, but this is manageable by\n// the caller, so it is assumed to be safe.  Thus, a call to write() may, in the extreme\n// edge case, result in creating at most one complete copy of the string passed in.\n// Set to Infinity to have unlimited buffers.\nsax.MAX_BUFFER_LENGTH = 64 * 1024\n\nvar buffers = [\n  \"comment\", \"sgmlDecl\", \"textNode\", \"tagName\", \"doctype\",\n  \"procInstName\", \"procInstBody\", \"entity\", \"attribName\",\n  \"attribValue\", \"cdata\", \"script\"\n]\n\nsax.EVENTS = // for discoverability.\n  [ \"text\"\n  , \"processinginstruction\"\n  , \"sgmldeclaration\"\n  , \"doctype\"\n  , \"comment\"\n  , \"attribute\"\n  , \"opentag\"\n  , \"closetag\"\n  , \"opencdata\"\n  , \"cdata\"\n  , \"closecdata\"\n  , \"error\"\n  , \"end\"\n  , \"ready\"\n  , \"script\"\n  , \"opennamespace\"\n  , \"closenamespace\"\n  ]\n\nfunction SAXParser (strict, opt) {\n  if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)\n\n  var parser = this\n  clearBuffers(parser)\n  parser.q = parser.c = \"\"\n  parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n  parser.opt = opt || {}\n  parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n  parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\"\n  parser.tags = []\n  parser.closed = parser.closedRoot = parser.sawRoot = false\n  parser.tag = parser.error = null\n  parser.strict = !!strict\n  parser.noscript = !!(strict || parser.opt.noscript)\n  parser.state = S.BEGIN\n  parser.ENTITIES = Object.create(sax.ENTITIES)\n  parser.attribList = []\n\n  // namespaces form a prototype chain.\n  // it always points at the current tag,\n  // which protos to its parent tag.\n  if (parser.opt.xmlns) parser.ns = Object.create(rootNS)\n\n  // mostly just for error reporting\n  parser.trackPosition = parser.opt.position !== false\n  if (parser.trackPosition) {\n    parser.position = parser.line = parser.column = 0\n  }\n  emit(parser, \"onready\")\n}\n\nif (!Object.create) Object.create = function (o) {\n  function f () { this.__proto__ = o }\n  f.prototype = o\n  return new f\n}\n\nif (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) {\n  return o.__proto__\n}\n\nif (!Object.keys) Object.keys = function (o) {\n  var a = []\n  for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n  return a\n}\n\nfunction checkBufferLength (parser) {\n  var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n    , maxActual = 0\n  for (var i = 0, l = buffers.length; i < l; i ++) {\n    var len = parser[buffers[i]].length\n    if (len > maxAllowed) {\n      // Text/cdata nodes can get big, and since they're buffered,\n      // we can get here under normal conditions.\n      // Avoid issues by emitting the text node now,\n      // so at least it won't get any bigger.\n      switch (buffers[i]) {\n        case \"textNode\":\n          closeText(parser)\n        break\n\n        case \"cdata\":\n          emitNode(parser, \"oncdata\", parser.cdata)\n          parser.cdata = \"\"\n        break\n\n        case \"script\":\n          emitNode(parser, \"onscript\", parser.script)\n          parser.script = \"\"\n        break\n\n        default:\n          error(parser, \"Max buffer length exceeded: \"+buffers[i])\n      }\n    }\n    maxActual = Math.max(maxActual, len)\n  }\n  // schedule the next check for the earliest possible buffer overrun.\n  parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual)\n                             + parser.position\n}\n\nfunction clearBuffers (parser) {\n  for (var i = 0, l = buffers.length; i < l; i ++) {\n    parser[buffers[i]] = \"\"\n  }\n}\n\nfunction flushBuffers (parser) {\n  closeText(parser)\n  if (parser.cdata !== \"\") {\n    emitNode(parser, \"oncdata\", parser.cdata)\n    parser.cdata = \"\"\n  }\n  if (parser.script !== \"\") {\n    emitNode(parser, \"onscript\", parser.script)\n    parser.script = \"\"\n  }\n}\n\nSAXParser.prototype =\n  { end: function () { end(this) }\n  , write: write\n  , resume: function () { this.error = null; return this }\n  , close: function () { return this.write(null) }\n  , flush: function () { flushBuffers(this) }\n  }\n\ntry {\n  var Stream = require(\"stream\").Stream\n} catch (ex) {\n  var Stream = function () {}\n}\n\n\nvar streamWraps = sax.EVENTS.filter(function (ev) {\n  return ev !== \"error\" && ev !== \"end\"\n})\n\nfunction createStream (strict, opt) {\n  return new SAXStream(strict, opt)\n}\n\nfunction SAXStream (strict, opt) {\n  if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)\n\n  Stream.apply(this)\n\n  this._parser = new SAXParser(strict, opt)\n  this.writable = true\n  this.readable = true\n\n\n  var me = this\n\n  this._parser.onend = function () {\n    me.emit(\"end\")\n  }\n\n  this._parser.onerror = function (er) {\n    me.emit(\"error\", er)\n\n    // if didn't throw, then means error was handled.\n    // go ahead and clear error, so we can write again.\n    me._parser.error = null\n  }\n\n  this._decoder = null;\n\n  streamWraps.forEach(function (ev) {\n    Object.defineProperty(me, \"on\" + ev, {\n      get: function () { return me._parser[\"on\" + ev] },\n      set: function (h) {\n        if (!h) {\n          me.removeAllListeners(ev)\n          return me._parser[\"on\"+ev] = h\n        }\n        me.on(ev, h)\n      },\n      enumerable: true,\n      configurable: false\n    })\n  })\n}\n\nSAXStream.prototype = Object.create(Stream.prototype,\n  { constructor: { value: SAXStream } })\n\nSAXStream.prototype.write = function (data) {\n  if (typeof Buffer === 'function' &&\n      typeof Buffer.isBuffer === 'function' &&\n      Buffer.isBuffer(data)) {\n    if (!this._decoder) {\n      var SD = require('string_decoder').StringDecoder\n      this._decoder = new SD('utf8')\n    }\n    data = this._decoder.write(data);\n  }\n\n  this._parser.write(data.toString())\n  this.emit(\"data\", data)\n  return true\n}\n\nSAXStream.prototype.end = function (chunk) {\n  if (chunk && chunk.length) this.write(chunk)\n  this._parser.end()\n  return true\n}\n\nSAXStream.prototype.on = function (ev, handler) {\n  var me = this\n  if (!me._parser[\"on\"+ev] && streamWraps.indexOf(ev) !== -1) {\n    me._parser[\"on\"+ev] = function () {\n      var args = arguments.length === 1 ? [arguments[0]]\n               : Array.apply(null, arguments)\n      args.splice(0, 0, ev)\n      me.emit.apply(me, args)\n    }\n  }\n\n  return Stream.prototype.on.call(me, ev, handler)\n}\n\n\n\n// character classes and tokens\nvar whitespace = \"/r/n/t \"\n  // this really needs to be replaced with character classes.\n  // XML allows all manner of ridiculous numbers and digits.\n  , number = \"0124356789\"\n  , letter = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n  // (Letter | \"_\" | \":\")\n  , quote = \"'/\"\"\n  , entity = number+letter+\"#\"\n  , attribEnd = whitespace + \">\"\n  , CDATA = \"[CDATA[\"\n  , DOCTYPE = \"DOCTYPE\"\n  , XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\"\n  , XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\"\n  , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n// turn all the string character sets into character class objects.\nwhitespace = charClass(whitespace)\nnumber = charClass(number)\nletter = charClass(letter)\n\n// http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n// This implementation works on strings, a single character at a time\n// as such, it cannot ever support astral-plane characters (10000-EFFFF)\n// without a significant breaking change to either this  parser, or the\n// JavaScript language.  Implementation of an emoji-capable xml parser\n// is left as an exercise for the reader.\nvar 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]/\n\nvar 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-]/\n\nquote = charClass(quote)\nentity = charClass(entity)\nattribEnd = charClass(attribEnd)\n\nfunction charClass (str) {\n  return str.split(\"\").reduce(function (s, c) {\n    s[c] = true\n    return s\n  }, {})\n}\n\nfunction isRegExp (c) {\n  return Object.prototype.toString.call(c) === '[object RegExp]'\n}\n\nfunction is (charclass, c) {\n  return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]\n}\n\nfunction not (charclass, c) {\n  return !is(charclass, c)\n}\n\nvar S = 0\nsax.STATE =\n{ BEGIN                     : S++\n, TEXT                      : S++ // general stuff\n, TEXT_ENTITY               : S++ // &amp and such.\n, OPEN_WAKA                 : S++ // <\n, SGML_DECL                 : S++ // <!BLARG\n, SGML_DECL_QUOTED          : S++ // <!BLARG foo \"bar\n, DOCTYPE                   : S++ // <!DOCTYPE\n, DOCTYPE_QUOTED            : S++ // <!DOCTYPE \"//blah\n, DOCTYPE_DTD               : S++ // <!DOCTYPE \"//blah\" [ ...\n, DOCTYPE_DTD_QUOTED        : S++ // <!DOCTYPE \"//blah\" [ \"foo\n, COMMENT_STARTING          : S++ // <!-\n, COMMENT                   : S++ // <!--\n, COMMENT_ENDING            : S++ // <!-- blah -\n, COMMENT_ENDED             : S++ // <!-- blah --\n, CDATA                     : S++ // <![CDATA[ something\n, CDATA_ENDING              : S++ // ]\n, CDATA_ENDING_2            : S++ // ]]\n, PROC_INST                 : S++ // <?hi\n, PROC_INST_BODY            : S++ // <?hi there\n, PROC_INST_ENDING          : S++ // <?hi \"there\" ?\n, OPEN_TAG                  : S++ // <strong\n, OPEN_TAG_SLASH            : S++ // <strong /\n, ATTRIB                    : S++ // <a\n, ATTRIB_NAME               : S++ // <a foo\n, ATTRIB_NAME_SAW_WHITE     : S++ // <a foo _\n, ATTRIB_VALUE              : S++ // <a foo=\n, ATTRIB_VALUE_QUOTED       : S++ // <a foo=\"bar\n, ATTRIB_VALUE_CLOSED       : S++ // <a foo=\"bar\"\n, ATTRIB_VALUE_UNQUOTED     : S++ // <a foo=bar\n, ATTRIB_VALUE_ENTITY_Q     : S++ // <foo bar=\"&quot;\"\n, ATTRIB_VALUE_ENTITY_U     : S++ // <foo bar=&quot;\n, CLOSE_TAG                 : S++ // </a\n, CLOSE_TAG_SAW_WHITE       : S++ // </a   >\n, SCRIPT                    : S++ // <script> ...\n, SCRIPT_ENDING             : S++ // <script> ... <\n}\n\nsax.ENTITIES =\n{ \"amp\" : \"&\"\n, \"gt\" : \">\"\n, \"lt\" : \"<\"\n, \"quot\" : \"/\"\"\n, \"apos\" : \"'\"\n, \"AElig\" : 198\n, \"Aacute\" : 193\n, \"Acirc\" : 194\n, \"Agrave\" : 192\n, \"Aring\" : 197\n, \"Atilde\" : 195\n, \"Auml\" : 196\n, \"Ccedil\" : 199\n, \"ETH\" : 208\n, \"Eacute\" : 201\n, \"Ecirc\" : 202\n, \"Egrave\" : 200\n, \"Euml\" : 203\n, \"Iacute\" : 205\n, \"Icirc\" : 206\n, \"Igrave\" : 204\n, \"Iuml\" : 207\n, \"Ntilde\" : 209\n, \"Oacute\" : 211\n, \"Ocirc\" : 212\n, \"Ograve\" : 210\n, \"Oslash\" : 216\n, \"Otilde\" : 213\n, \"Ouml\" : 214\n, \"THORN\" : 222\n, \"Uacute\" : 218\n, \"Ucirc\" : 219\n, \"Ugrave\" : 217\n, \"Uuml\" : 220\n, \"Yacute\" : 221\n, \"aacute\" : 225\n, \"acirc\" : 226\n, \"aelig\" : 230\n, \"agrave\" : 224\n, \"aring\" : 229\n, \"atilde\" : 227\n, \"auml\" : 228\n, \"ccedil\" : 231\n, \"eacute\" : 233\n, \"ecirc\" : 234\n, \"egrave\" : 232\n, \"eth\" : 240\n, \"euml\" : 235\n, \"iacute\" : 237\n, \"icirc\" : 238\n, \"igrave\" : 236\n, \"iuml\" : 239\n, \"ntilde\" : 241\n, \"oacute\" : 243\n, \"ocirc\" : 244\n, \"ograve\" : 242\n, \"oslash\" : 248\n, \"otilde\" : 245\n, \"ouml\" : 246\n, \"szlig\" : 223\n, \"thorn\" : 254\n, \"uacute\" : 250\n, \"ucirc\" : 251\n, \"ugrave\" : 249\n, \"uuml\" : 252\n, \"yacute\" : 253\n, \"yuml\" : 255\n, \"copy\" : 169\n, \"reg\" : 174\n, \"nbsp\" : 160\n, \"iexcl\" : 161\n, \"cent\" : 162\n, \"pound\" : 163\n, \"curren\" : 164\n, \"yen\" : 165\n, \"brvbar\" : 166\n, \"sect\" : 167\n, \"uml\" : 168\n, \"ordf\" : 170\n, \"laquo\" : 171\n, \"not\" : 172\n, \"shy\" : 173\n, \"macr\" : 175\n, \"deg\" : 176\n, \"plusmn\" : 177\n, \"sup1\" : 185\n, \"sup2\" : 178\n, \"sup3\" : 179\n, \"acute\" : 180\n, \"micro\" : 181\n, \"para\" : 182\n, \"middot\" : 183\n, \"cedil\" : 184\n, \"ordm\" : 186\n, \"raquo\" : 187\n, \"frac14\" : 188\n, \"frac12\" : 189\n, \"frac34\" : 190\n, \"iquest\" : 191\n, \"times\" : 215\n, \"divide\" : 247\n, \"OElig\" : 338\n, \"oelig\" : 339\n, \"Scaron\" : 352\n, \"scaron\" : 353\n, \"Yuml\" : 376\n, \"fnof\" : 402\n, \"circ\" : 710\n, \"tilde\" : 732\n, \"Alpha\" : 913\n, \"Beta\" : 914\n, \"Gamma\" : 915\n, \"Delta\" : 916\n, \"Epsilon\" : 917\n, \"Zeta\" : 918\n, \"Eta\" : 919\n, \"Theta\" : 920\n, \"Iota\" : 921\n, \"Kappa\" : 922\n, \"Lambda\" : 923\n, \"Mu\" : 924\n, \"Nu\" : 925\n, \"Xi\" : 926\n, \"Omicron\" : 927\n, \"Pi\" : 928\n, \"Rho\" : 929\n, \"Sigma\" : 931\n, \"Tau\" : 932\n, \"Upsilon\" : 933\n, \"Phi\" : 934\n, \"Chi\" : 935\n, \"Psi\" : 936\n, \"Omega\" : 937\n, \"alpha\" : 945\n, \"beta\" : 946\n, \"gamma\" : 947\n, \"delta\" : 948\n, \"epsilon\" : 949\n, \"zeta\" : 950\n, \"eta\" : 951\n, \"theta\" : 952\n, \"iota\" : 953\n, \"kappa\" : 954\n, \"lambda\" : 955\n, \"mu\" : 956\n, \"nu\" : 957\n, \"xi\" : 958\n, \"omicron\" : 959\n, \"pi\" : 960\n, \"rho\" : 961\n, \"sigmaf\" : 962\n, \"sigma\" : 963\n, \"tau\" : 964\n, \"upsilon\" : 965\n, \"phi\" : 966\n, \"chi\" : 967\n, \"psi\" : 968\n, \"omega\" : 969\n, \"thetasym\" : 977\n, \"upsih\" : 978\n, \"piv\" : 982\n, \"ensp\" : 8194\n, \"emsp\" : 8195\n, \"thinsp\" : 8201\n, \"zwnj\" : 8204\n, \"zwj\" : 8205\n, \"lrm\" : 8206\n, \"rlm\" : 8207\n, \"ndash\" : 8211\n, \"mdash\" : 8212\n, \"lsquo\" : 8216\n, \"rsquo\" : 8217\n, \"sbquo\" : 8218\n, \"ldquo\" : 8220\n, \"rdquo\" : 8221\n, \"bdquo\" : 8222\n, \"dagger\" : 8224\n, \"Dagger\" : 8225\n, \"bull\" : 8226\n, \"hellip\" : 8230\n, \"permil\" : 8240\n, \"prime\" : 8242\n, \"Prime\" : 8243\n, \"lsaquo\" : 8249\n, \"rsaquo\" : 8250\n, \"oline\" : 8254\n, \"frasl\" : 8260\n, \"euro\" : 8364\n, \"image\" : 8465\n, \"weierp\" : 8472\n, \"real\" : 8476\n, \"trade\" : 8482\n, \"alefsym\" : 8501\n, \"larr\" : 8592\n, \"uarr\" : 8593\n, \"rarr\" : 8594\n, \"darr\" : 8595\n, \"harr\" : 8596\n, \"crarr\" : 8629\n, \"lArr\" : 8656\n, \"uArr\" : 8657\n, \"rArr\" : 8658\n, \"dArr\" : 8659\n, \"hArr\" : 8660\n, \"forall\" : 8704\n, \"part\" : 8706\n, \"exist\" : 8707\n, \"empty\" : 8709\n, \"nabla\" : 8711\n, \"isin\" : 8712\n, \"notin\" : 8713\n, \"ni\" : 8715\n, \"prod\" : 8719\n, \"sum\" : 8721\n, \"minus\" : 8722\n, \"lowast\" : 8727\n, \"radic\" : 8730\n, \"prop\" : 8733\n, \"infin\" : 8734\n, \"ang\" : 8736\n, \"and\" : 8743\n, \"or\" : 8744\n, \"cap\" : 8745\n, \"cup\" : 8746\n, \"int\" : 8747\n, \"there4\" : 8756\n, \"sim\" : 8764\n, \"cong\" : 8773\n, \"asymp\" : 8776\n, \"ne\" : 8800\n, \"equiv\" : 8801\n, \"le\" : 8804\n, \"ge\" : 8805\n, \"sub\" : 8834\n, \"sup\" : 8835\n, \"nsub\" : 8836\n, \"sube\" : 8838\n, \"supe\" : 8839\n, \"oplus\" : 8853\n, \"otimes\" : 8855\n, \"perp\" : 8869\n, \"sdot\" : 8901\n, \"lceil\" : 8968\n, \"rceil\" : 8969\n, \"lfloor\" : 8970\n, \"rfloor\" : 8971\n, \"lang\" : 9001\n, \"rang\" : 9002\n, \"loz\" : 9674\n, \"spades\" : 9824\n, \"clubs\" : 9827\n, \"hearts\" : 9829\n, \"diams\" : 9830\n}\n\nObject.keys(sax.ENTITIES).forEach(function (key) {\n    var e = sax.ENTITIES[key]\n    var s = typeof e === 'number' ? String.fromCharCode(e) : e\n    sax.ENTITIES[key] = s\n})\n\nfor (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S\n\n// shorthand\nS = sax.STATE\n\nfunction emit (parser, event, data) {\n  parser[event] && parser[event](data)\n}\n\nfunction emitNode (parser, nodeType, data) {\n  if (parser.textNode) closeText(parser)\n  emit(parser, nodeType, data)\n}\n\nfunction closeText (parser) {\n  parser.textNode = textopts(parser.opt, parser.textNode)\n  if (parser.textNode) emit(parser, \"ontext\", parser.textNode)\n  parser.textNode = \"\"\n}\n\nfunction textopts (opt, text) {\n  if (opt.trim) text = text.trim()\n  if (opt.normalize) text = text.replace(//s+/g, \" \")\n  return text\n}\n\nfunction error (parser, er) {\n  closeText(parser)\n  if (parser.trackPosition) {\n    er += \"/nLine: \"+parser.line+\n          \"/nColumn: \"+parser.column+\n          \"/nChar: \"+parser.c\n  }\n  er = new Error(er)\n  parser.error = er\n  emit(parser, \"onerror\", er)\n  return parser\n}\n\nfunction end (parser) {\n  if (!parser.closedRoot) strictFail(parser, \"Unclosed root tag\")\n  if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, \"Unexpected end\")\n  closeText(parser)\n  parser.c = \"\"\n  parser.closed = true\n  emit(parser, \"onend\")\n  SAXParser.call(parser, parser.strict, parser.opt)\n  return parser\n}\n\nfunction strictFail (parser, message) {\n  if (typeof parser !== 'object' || !(parser instanceof SAXParser))\n    throw new Error('bad call to strictFail');\n  if (parser.strict) error(parser, message)\n}\n\nfunction newTag (parser) {\n  if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()\n  var parent = parser.tags[parser.tags.length - 1] || parser\n    , tag = parser.tag = { name : parser.tagName, attributes : {} }\n\n  // will be overridden if tag contails an xmlns=\"foo\" or xmlns:foo=\"bar\"\n  if (parser.opt.xmlns) tag.ns = parent.ns\n  parser.attribList.length = 0\n}\n\nfunction qname (name, attribute) {\n  var i = name.indexOf(\":\")\n    , qualName = i < 0 ? [ \"\", name ] : name.split(\":\")\n    , prefix = qualName[0]\n    , local = qualName[1]\n\n  // <x \"xmlns\"=\"http://foo\">\n  if (attribute && name === \"xmlns\") {\n    prefix = \"xmlns\"\n    local = \"\"\n  }\n\n  return { prefix: prefix, local: local }\n}\n\nfunction attrib (parser) {\n  if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()\n\n  if (parser.attribList.indexOf(parser.attribName) !== -1 ||\n      parser.tag.attributes.hasOwnProperty(parser.attribName)) {\n    return parser.attribName = parser.attribValue = \"\"\n  }\n\n  if (parser.opt.xmlns) {\n    var qn = qname(parser.attribName, true)\n      , prefix = qn.prefix\n      , local = qn.local\n\n    if (prefix === \"xmlns\") {\n      // namespace binding attribute; push the binding into scope\n      if (local === \"xml\" && parser.attribValue !== XML_NAMESPACE) {\n        strictFail( parser\n                  , \"xml: prefix must be bound to \" + XML_NAMESPACE + \"/n\"\n                  + \"Actual: \" + parser.attribValue )\n      } else if (local === \"xmlns\" && parser.attribValue !== XMLNS_NAMESPACE) {\n        strictFail( parser\n                  , \"xmlns: prefix must be bound to \" + XMLNS_NAMESPACE + \"/n\"\n                  + \"Actual: \" + parser.attribValue )\n      } else {\n        var tag = parser.tag\n          , parent = parser.tags[parser.tags.length - 1] || parser\n        if (tag.ns === parent.ns) {\n          tag.ns = Object.create(parent.ns)\n        }\n        tag.ns[local] = parser.attribValue\n      }\n    }\n\n    // defer onattribute events until all attributes have been seen\n    // so any new bindings can take effect; preserve attribute order\n    // so deferred events can be emitted in document order\n    parser.attribList.push([parser.attribName, parser.attribValue])\n  } else {\n    // in non-xmlns mode, we can emit the event right away\n    parser.tag.attributes[parser.attribName] = parser.attribValue\n    emitNode( parser\n            , \"onattribute\"\n            , { name: parser.attribName\n              , value: parser.attribValue } )\n  }\n\n  parser.attribName = parser.attribValue = \"\"\n}\n\nfunction openTag (parser, selfClosing) {\n  if (parser.opt.xmlns) {\n    // emit namespace binding events\n    var tag = parser.tag\n\n    // add namespace info to tag\n    var qn = qname(parser.tagName)\n    tag.prefix = qn.prefix\n    tag.local = qn.local\n    tag.uri = tag.ns[qn.prefix] || \"\"\n\n    if (tag.prefix && !tag.uri) {\n      strictFail(parser, \"Unbound namespace prefix: \"\n                       + JSON.stringify(parser.tagName))\n      tag.uri = qn.prefix\n    }\n\n    var parent = parser.tags[parser.tags.length - 1] || parser\n    if (tag.ns && parent.ns !== tag.ns) {\n      Object.keys(tag.ns).forEach(function (p) {\n        emitNode( parser\n                , \"onopennamespace\"\n                , { prefix: p , uri: tag.ns[p] } )\n      })\n    }\n\n    // handle deferred onattribute events\n    // Note: do not apply default ns to attributes:\n    //   http://www.w3.org/TR/REC-xml-names/#defaulting\n    for (var i = 0, l = parser.attribList.length; i < l; i ++) {\n      var nv = parser.attribList[i]\n      var name = nv[0]\n        , value = nv[1]\n        , qualName = qname(name, true)\n        , prefix = qualName.prefix\n        , local = qualName.local\n        , uri = prefix == \"\" ? \"\" : (tag.ns[prefix] || \"\")\n        , a = { name: name\n              , value: value\n              , prefix: prefix\n              , local: local\n              , uri: uri\n              }\n\n      // if there's any attributes with an undefined namespace,\n      // then fail on them now.\n      if (prefix && prefix != \"xmlns\" && !uri) {\n        strictFail(parser, \"Unbound namespace prefix: \"\n                         + JSON.stringify(prefix))\n        a.uri = prefix\n      }\n      parser.tag.attributes[name] = a\n      emitNode(parser, \"onattribute\", a)\n    }\n    parser.attribList.length = 0\n  }\n\n  parser.tag.isSelfClosing = !!selfClosing\n\n  // process the tag\n  parser.sawRoot = true\n  parser.tags.push(parser.tag)\n  emitNode(parser, \"onopentag\", parser.tag)\n  if (!selfClosing) {\n    // special case for <script> in non-strict mode.\n    if (!parser.noscript && parser.tagName.toLowerCase() === \"script\") {\n      parser.state = S.SCRIPT\n    } else {\n      parser.state = S.TEXT\n    }\n    parser.tag = null\n    parser.tagName = \"\"\n  }\n  parser.attribName = parser.attribValue = \"\"\n  parser.attribList.length = 0\n}\n\nfunction closeTag (parser) {\n  if (!parser.tagName) {\n    strictFail(parser, \"Weird empty close tag.\")\n    parser.textNode += \"</>\"\n    parser.state = S.TEXT\n    return\n  }\n\n  if (parser.script) {\n    if (parser.tagName !== \"script\") {\n      parser.script += \"</\" + parser.tagName + \">\"\n      parser.tagName = \"\"\n      parser.state = S.SCRIPT\n      return\n    }\n    emitNode(parser, \"onscript\", parser.script)\n    parser.script = \"\"\n  }\n\n  // first make sure that the closing tag actually exists.\n  // <a><b></c></b></a> will close everything, otherwise.\n  var t = parser.tags.length\n  var tagName = parser.tagName\n  if (!parser.strict) tagName = tagName[parser.looseCase]()\n  var closeTo = tagName\n  while (t --) {\n    var close = parser.tags[t]\n    if (close.name !== closeTo) {\n      // fail the first time in strict mode\n      strictFail(parser, \"Unexpected close tag\")\n    } else break\n  }\n\n  // didn't find it.  we already failed for strict, so just abort.\n  if (t < 0) {\n    strictFail(parser, \"Unmatched closing tag: \"+parser.tagName)\n    parser.textNode += \"</\" + parser.tagName + \">\"\n    parser.state = S.TEXT\n    return\n  }\n  parser.tagName = tagName\n  var s = parser.tags.length\n  while (s --> t) {\n    var tag = parser.tag = parser.tags.pop()\n    parser.tagName = parser.tag.name\n    emitNode(parser, \"onclosetag\", parser.tagName)\n\n    var x = {}\n    for (var i in tag.ns) x[i] = tag.ns[i]\n\n    var parent = parser.tags[parser.tags.length - 1] || parser\n    if (parser.opt.xmlns && tag.ns !== parent.ns) {\n      // remove namespace bindings introduced by tag\n      Object.keys(tag.ns).forEach(function (p) {\n        var n = tag.ns[p]\n        emitNode(parser, \"onclosenamespace\", { prefix: p, uri: n })\n      })\n    }\n  }\n  if (t === 0) parser.closedRoot = true\n  parser.tagName = parser.attribValue = parser.attribName = \"\"\n  parser.attribList.length = 0\n  parser.state = S.TEXT\n}\n\nfunction parseEntity (parser) {\n  var entity = parser.entity\n    , entityLC = entity.toLowerCase()\n    , num\n    , numStr = \"\"\n  if (parser.ENTITIES[entity])\n    return parser.ENTITIES[entity]\n  if (parser.ENTITIES[entityLC])\n    return parser.ENTITIES[entityLC]\n  entity = entityLC\n  if (entity.charAt(0) === \"#\") {\n    if (entity.charAt(1) === \"x\") {\n      entity = entity.slice(2)\n      num = parseInt(entity, 16)\n      numStr = num.toString(16)\n    } else {\n      entity = entity.slice(1)\n      num = parseInt(entity, 10)\n      numStr = num.toString(10)\n    }\n  }\n  entity = entity.replace(/^0+/, \"\")\n  if (numStr.toLowerCase() !== entity) {\n    strictFail(parser, \"Invalid character entity\")\n    return \"&\"+parser.entity + \";\"\n  }\n\n  return String.fromCodePoint(num)\n}\n\nfunction write (chunk) {\n  var parser = this\n  if (this.error) throw this.error\n  if (parser.closed) return error(parser,\n    \"Cannot write after close. Assign an onready handler.\")\n  if (chunk === null) return end(parser)\n  var i = 0, c = \"\"\n  while (parser.c = c = chunk.charAt(i++)) {\n    if (parser.trackPosition) {\n      parser.position ++\n      if (c === \"/n\") {\n        parser.line ++\n        parser.column = 0\n      } else parser.column ++\n    }\n    switch (parser.state) {\n\n      case S.BEGIN:\n        if (c === \"<\") {\n          parser.state = S.OPEN_WAKA\n          parser.startTagPosition = parser.position\n        } else if (not(whitespace,c)) {\n          // have to process this as a text node.\n          // weird, but happens.\n          strictFail(parser, \"Non-whitespace before first tag.\")\n          parser.textNode = c\n          parser.state = S.TEXT\n        }\n      continue\n\n      case S.TEXT:\n        if (parser.sawRoot && !parser.closedRoot) {\n          var starti = i-1\n          while (c && c!==\"<\" && c!==\"&\") {\n            c = chunk.charAt(i++)\n            if (c && parser.trackPosition) {\n              parser.position ++\n              if (c === \"/n\") {\n                parser.line ++\n                parser.column = 0\n              } else parser.column ++\n            }\n          }\n          parser.textNode += chunk.substring(starti, i-1)\n        }\n        if (c === \"<\") {\n          parser.state = S.OPEN_WAKA\n          parser.startTagPosition = parser.position\n        } else {\n          if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))\n            strictFail(parser, \"Text data outside of root node.\")\n          if (c === \"&\") parser.state = S.TEXT_ENTITY\n          else parser.textNode += c\n        }\n      continue\n\n      case S.SCRIPT:\n        // only non-strict\n        if (c === \"<\") {\n          parser.state = S.SCRIPT_ENDING\n        } else parser.script += c\n      continue\n\n      case S.SCRIPT_ENDING:\n        if (c === \"/\") {\n          parser.state = S.CLOSE_TAG\n        } else {\n          parser.script += \"<\" + c\n          parser.state = S.SCRIPT\n        }\n      continue\n\n      case S.OPEN_WAKA:\n        // either a /, ?, !, or text is coming next.\n        if (c === \"!\") {\n          parser.state = S.SGML_DECL\n          parser.sgmlDecl = \"\"\n        } else if (is(whitespace, c)) {\n          // wait for it...\n        } else if (is(nameStart,c)) {\n          parser.state = S.OPEN_TAG\n          parser.tagName = c\n        } else if (c === \"/\") {\n          parser.state = S.CLOSE_TAG\n          parser.tagName = \"\"\n        } else if (c === \"?\") {\n          parser.state = S.PROC_INST\n          parser.procInstName = parser.procInstBody = \"\"\n        } else {\n          strictFail(parser, \"Unencoded <\")\n          // if there was some whitespace, then add that in.\n          if (parser.startTagPosition + 1 < parser.position) {\n            var pad = parser.position - parser.startTagPosition\n            c = new Array(pad).join(\" \") + c\n          }\n          parser.textNode += \"<\" + c\n          parser.state = S.TEXT\n        }\n      continue\n\n      case S.SGML_DECL:\n        if ((parser.sgmlDecl+c).toUpperCase() === CDATA) {\n          emitNode(parser, \"onopencdata\")\n          parser.state = S.CDATA\n          parser.sgmlDecl = \"\"\n          parser.cdata = \"\"\n        } else if (parser.sgmlDecl+c === \"--\") {\n          parser.state = S.COMMENT\n          parser.comment = \"\"\n          parser.sgmlDecl = \"\"\n        } else if ((parser.sgmlDecl+c).toUpperCase() === DOCTYPE) {\n          parser.state = S.DOCTYPE\n          if (parser.doctype || parser.sawRoot) strictFail(parser,\n            \"Inappropriately located doctype declaration\")\n          parser.doctype = \"\"\n          parser.sgmlDecl = \"\"\n        } else if (c === \">\") {\n          emitNode(parser, \"onsgmldeclaration\", parser.sgmlDecl)\n          parser.sgmlDecl = \"\"\n          parser.state = S.TEXT\n        } else if (is(quote, c)) {\n          parser.state = S.SGML_DECL_QUOTED\n          parser.sgmlDecl += c\n        } else parser.sgmlDecl += c\n      continue\n\n      case S.SGML_DECL_QUOTED:\n        if (c === parser.q) {\n          parser.state = S.SGML_DECL\n          parser.q = \"\"\n        }\n        parser.sgmlDecl += c\n      continue\n\n      case S.DOCTYPE:\n        if (c === \">\") {\n          parser.state = S.TEXT\n          emitNode(parser, \"ondoctype\", parser.doctype)\n          parser.doctype = true // just remember that we saw it.\n        } else {\n          parser.doctype += c\n          if (c === \"[\") parser.state = S.DOCTYPE_DTD\n          else if (is(quote, c)) {\n            parser.state = S.DOCTYPE_QUOTED\n            parser.q = c\n          }\n        }\n      continue\n\n      case S.DOCTYPE_QUOTED:\n        parser.doctype += c\n        if (c === parser.q) {\n          parser.q = \"\"\n          parser.state = S.DOCTYPE\n        }\n      continue\n\n      case S.DOCTYPE_DTD:\n        parser.doctype += c\n        if (c === \"]\") parser.state = S.DOCTYPE\n        else if (is(quote,c)) {\n          parser.state = S.DOCTYPE_DTD_QUOTED\n          parser.q = c\n        }\n      continue\n\n      case S.DOCTYPE_DTD_QUOTED:\n        parser.doctype += c\n        if (c === parser.q) {\n          parser.state = S.DOCTYPE_DTD\n          parser.q = \"\"\n        }\n      continue\n\n      case S.COMMENT:\n        if (c === \"-\") parser.state = S.COMMENT_ENDING\n        else parser.comment += c\n      continue\n\n      case S.COMMENT_ENDING:\n        if (c === \"-\") {\n          parser.state = S.COMMENT_ENDED\n          parser.comment = textopts(parser.opt, parser.comment)\n          if (parser.comment) emitNode(parser, \"oncomment\", parser.comment)\n          parser.comment = \"\"\n        } else {\n          parser.comment += \"-\" + c\n          parser.state = S.COMMENT\n        }\n      continue\n\n      case S.COMMENT_ENDED:\n        if (c !== \">\") {\n          strictFail(parser, \"Malformed comment\")\n          // allow <!-- blah -- bloo --> in non-strict mode,\n          // which is a comment of \" blah -- bloo \"\n          parser.comment += \"--\" + c\n          parser.state = S.COMMENT\n        } else parser.state = S.TEXT\n      continue\n\n      case S.CDATA:\n        if (c === \"]\") parser.state = S.CDATA_ENDING\n        else parser.cdata += c\n      continue\n\n      case S.CDATA_ENDING:\n        if (c === \"]\") parser.state = S.CDATA_ENDING_2\n        else {\n          parser.cdata += \"]\" + c\n          parser.state = S.CDATA\n        }\n      continue\n\n      case S.CDATA_ENDING_2:\n        if (c === \">\") {\n          if (parser.cdata) emitNode(parser, \"oncdata\", parser.cdata)\n          emitNode(parser, \"onclosecdata\")\n          parser.cdata = \"\"\n          parser.state = S.TEXT\n        } else if (c === \"]\") {\n          parser.cdata += \"]\"\n        } else {\n          parser.cdata += \"]]\" + c\n          parser.state = S.CDATA\n        }\n      continue\n\n      case S.PROC_INST:\n        if (c === \"?\") parser.state = S.PROC_INST_ENDING\n        else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY\n        else parser.procInstName += c\n      continue\n\n      case S.PROC_INST_BODY:\n        if (!parser.procInstBody && is(whitespace, c)) continue\n        else if (c === \"?\") parser.state = S.PROC_INST_ENDING\n        else parser.procInstBody += c\n      continue\n\n      case S.PROC_INST_ENDING:\n        if (c === \">\") {\n          emitNode(parser, \"onprocessinginstruction\", {\n            name : parser.procInstName,\n            body : parser.procInstBody\n          })\n          parser.procInstName = parser.procInstBody = \"\"\n          parser.state = S.TEXT\n        } else {\n          parser.procInstBody += \"?\" + c\n          parser.state = S.PROC_INST_BODY\n        }\n      continue\n\n      case S.OPEN_TAG:\n        if (is(nameBody, c)) parser.tagName += c\n        else {\n          newTag(parser)\n          if (c === \">\") openTag(parser)\n          else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n          else {\n            if (not(whitespace, c)) strictFail(\n              parser, \"Invalid character in tag name\")\n            parser.state = S.ATTRIB\n          }\n        }\n      continue\n\n      case S.OPEN_TAG_SLASH:\n        if (c === \">\") {\n          openTag(parser, true)\n          closeTag(parser)\n        } else {\n          strictFail(parser, \"Forward-slash in opening tag not followed by >\")\n          parser.state = S.ATTRIB\n        }\n      continue\n\n      case S.ATTRIB:\n        // haven't read the attribute name yet.\n        if (is(whitespace, c)) continue\n        else if (c === \">\") openTag(parser)\n        else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n        else if (is(nameStart, c)) {\n          parser.attribName = c\n          parser.attribValue = \"\"\n          parser.state = S.ATTRIB_NAME\n        } else strictFail(parser, \"Invalid attribute name\")\n      continue\n\n      case S.ATTRIB_NAME:\n        if (c === \"=\") parser.state = S.ATTRIB_VALUE\n        else if (c === \">\") {\n          strictFail(parser, \"Attribute without value\")\n          parser.attribValue = parser.attribName\n          attrib(parser)\n          openTag(parser)\n        }\n        else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE\n        else if (is(nameBody, c)) parser.attribName += c\n        else strictFail(parser, \"Invalid attribute name\")\n      continue\n\n      case S.ATTRIB_NAME_SAW_WHITE:\n        if (c === \"=\") parser.state = S.ATTRIB_VALUE\n        else if (is(whitespace, c)) continue\n        else {\n          strictFail(parser, \"Attribute without value\")\n          parser.tag.attributes[parser.attribName] = \"\"\n          parser.attribValue = \"\"\n          emitNode(parser, \"onattribute\",\n                   { name : parser.attribName, value : \"\" })\n          parser.attribName = \"\"\n          if (c === \">\") openTag(parser)\n          else if (is(nameStart, c)) {\n            parser.attribName = c\n            parser.state = S.ATTRIB_NAME\n          } else {\n            strictFail(parser, \"Invalid attribute name\")\n            parser.state = S.ATTRIB\n          }\n        }\n      continue\n\n      case S.ATTRIB_VALUE:\n        if (is(whitespace, c)) continue\n        else if (is(quote, c)) {\n          parser.q = c\n          parser.state = S.ATTRIB_VALUE_QUOTED\n        } else {\n          strictFail(parser, \"Unquoted attribute value\")\n          parser.state = S.ATTRIB_VALUE_UNQUOTED\n          parser.attribValue = c\n        }\n      continue\n\n      case S.ATTRIB_VALUE_QUOTED:\n        if (c !== parser.q) {\n          if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_Q\n          else parser.attribValue += c\n          continue\n        }\n        attrib(parser)\n        parser.q = \"\"\n        parser.state = S.ATTRIB_VALUE_CLOSED\n      continue\n\n      case S.ATTRIB_VALUE_CLOSED:\n        if (is(whitespace, c)) {\n          parser.state = S.ATTRIB\n        } else if (c === \">\") openTag(parser)\n        else if (c === \"/\") parser.state = S.OPEN_TAG_SLASH\n        else if (is(nameStart, c)) {\n          strictFail(parser, \"No whitespace between attributes\")\n          parser.attribName = c\n          parser.attribValue = \"\"\n          parser.state = S.ATTRIB_NAME\n        } else strictFail(parser, \"Invalid attribute name\")\n      continue\n\n      case S.ATTRIB_VALUE_UNQUOTED:\n        if (not(attribEnd,c)) {\n          if (c === \"&\") parser.state = S.ATTRIB_VALUE_ENTITY_U\n          else parser.attribValue += c\n          continue\n        }\n        attrib(parser)\n        if (c === \">\") openTag(parser)\n        else parser.state = S.ATTRIB\n      continue\n\n      case S.CLOSE_TAG:\n        if (!parser.tagName) {\n          if (is(whitespace, c)) continue\n          else if (not(nameStart, c)) {\n            if (parser.script) {\n              parser.script += \"</\" + c\n              parser.state = S.SCRIPT\n            } else {\n              strictFail(parser, \"Invalid tagname in closing tag.\")\n            }\n          } else parser.tagName = c\n        }\n        else if (c === \">\") closeTag(parser)\n        else if (is(nameBody, c)) parser.tagName += c\n        else if (parser.script) {\n          parser.script += \"</\" + parser.tagName\n          parser.tagName = \"\"\n          parser.state = S.SCRIPT\n        } else {\n          if (not(whitespace, c)) strictFail(parser,\n            \"Invalid tagname in closing tag\")\n          parser.state = S.CLOSE_TAG_SAW_WHITE\n        }\n      continue\n\n      case S.CLOSE_TAG_SAW_WHITE:\n        if (is(whitespace, c)) continue\n        if (c === \">\") closeTag(parser)\n        else strictFail(parser, \"Invalid characters in closing tag\")\n      continue\n\n      case S.TEXT_ENTITY:\n      case S.ATTRIB_VALUE_ENTITY_Q:\n      case S.ATTRIB_VALUE_ENTITY_U:\n        switch(parser.state) {\n          case S.TEXT_ENTITY:\n            var returnState = S.TEXT, buffer = \"textNode\"\n          break\n\n          case S.ATTRIB_VALUE_ENTITY_Q:\n            var returnState = S.ATTRIB_VALUE_QUOTED, buffer = \"attribValue\"\n          break\n\n          case S.ATTRIB_VALUE_ENTITY_U:\n            var returnState = S.ATTRIB_VALUE_UNQUOTED, buffer = \"attribValue\"\n          break\n        }\n        if (c === \";\") {\n          parser[buffer] += parseEntity(parser)\n          parser.entity = \"\"\n          parser.state = returnState\n        }\n        else if (is(entity, c)) parser.entity += c\n        else {\n          strictFail(parser, \"Invalid character entity\")\n          parser[buffer] += \"&\" + parser.entity + c\n          parser.entity = \"\"\n          parser.state = returnState\n        }\n      continue\n\n      default:\n        throw new Error(parser, \"Unknown state: \" + parser.state)\n    }\n  } // while\n  // cdata blocks can get very big under normal conditions. emit and move on.\n  // if (parser.state === S.CDATA && parser.cdata) {\n  //   emitNode(parser, \"oncdata\", parser.cdata)\n  //   parser.cdata = \"\"\n  // }\n  if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)\n  return parser\n}\n\n/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\nif (!String.fromCodePoint) {\n        (function() {\n                var stringFromCharCode = String.fromCharCode;\n                var floor = Math.floor;\n                var fromCodePoint = function() {\n                        var MAX_SIZE = 0x4000;\n                        var codeUnits = [];\n                        var highSurrogate;\n                        var lowSurrogate;\n                        var index = -1;\n                        var length = arguments.length;\n                        if (!length) {\n                                return '';\n                        }\n                        var result = '';\n                        while (++index < length) {\n                                var codePoint = Number(arguments[index]);\n                                if (\n                                        !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n                                        codePoint < 0 || // not a valid Unicode code point\n                                        codePoint > 0x10FFFF || // not a valid Unicode code point\n                                        floor(codePoint) != codePoint // not an integer\n                                ) {\n                                        throw RangeError('Invalid code point: ' + codePoint);\n                                }\n                                if (codePoint <= 0xFFFF) { // BMP code point\n                                        codeUnits.push(codePoint);\n                                } else { // Astral code point; split in surrogate halves\n                                        // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n                                        codePoint -= 0x10000;\n                                        highSurrogate = (codePoint >> 10) + 0xD800;\n                                        lowSurrogate = (codePoint % 0x400) + 0xDC00;\n                                        codeUnits.push(highSurrogate, lowSurrogate);\n                                }\n                                if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n                                        result += stringFromCharCode.apply(null, codeUnits);\n                                        codeUnits.length = 0;\n                                }\n                        }\n                        return result;\n                };\n                if (Object.defineProperty) {\n                        Object.defineProperty(String, 'fromCodePoint', {\n                                'value': fromCodePoint,\n                                'configurable': true,\n                                'writable': true\n                        });\n                } else {\n                        String.fromCodePoint = fromCodePoint;\n                }\n        }());\n}\n\n})(typeof exports === \"undefined\" ? sax = {} : exports);\n","/**\n * Tiny stack for browser or server\n *\n * @author Jason Mulligan <jason.mulligan@avoidwork.com>\n * @copyright 2014 Jason Mulligan\n * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>\n * @link http://avoidwork.github.io/tiny-stack\n * @module tiny-stack\n * @version 0.1.0\n */\n\n( function ( global ) {\n\n\"use strict\";\n\n/**\n * TinyStack\n *\n * @constructor\n */\nfunction TinyStack () {\n\tthis.data = [null];\n\tthis.top  = 0;\n}\n\n/**\n * Clears the stack\n *\n * @method clear\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.clear = function clear () {\n\tthis.data = [null];\n\tthis.top  = 0;\n\n\treturn this;\n};\n\n/**\n * Gets the size of the stack\n *\n * @method length\n * @memberOf TinyStack\n * @return {Number} Size of stack\n */\nTinyStack.prototype.length = function length () {\n\treturn this.top;\n};\n\n/**\n * Gets the item at the top of the stack\n *\n * @method peek\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.peek = function peek () {\n\treturn this.data[this.top];\n};\n\n/**\n * Gets & removes the item at the top of the stack\n *\n * @method pop\n * @memberOf TinyStack\n * @return {Mixed} Item at the top of the stack\n */\nTinyStack.prototype.pop = function pop () {\n\tif ( this.top > 0 ) {\n\t\tthis.top--;\n\n\t\treturn this.data.pop();\n\t}\n\telse {\n\t\treturn undefined;\n\t}\n};\n\n/**\n * Pushes an item onto the stack\n *\n * @method push\n * @memberOf TinyStack\n * @return {Object} {@link TinyStack}\n */\nTinyStack.prototype.push = function push ( arg ) {\n\tthis.data[++this.top] = arg;\n\n\treturn this;\n};\n\n/**\n * TinyStack factory\n *\n * @method factory\n * @return {Object} {@link TinyStack}\n */\nfunction factory () {\n\treturn new TinyStack();\n}\n\n// Node, AMD & window supported\nif ( typeof exports != \"undefined\" ) {\n\tmodule.exports = factory;\n}\nelse if ( typeof define == \"function\" ) {\n\tdefine( function () {\n\t\treturn factory;\n\t} );\n}\nelse {\n\tglobal.stack = factory;\n}\n} )( this );\n","module.exports = require(61);","'use strict';\n\nfunction Base() { }\n\nBase.prototype.get = function(name) {\n  return this.$model.properties.get(this, name);\n};\n\nBase.prototype.set = function(name, value) {\n  this.$model.properties.set(this, name, value);\n};\n\n\nmodule.exports = Base;","'use strict';\n\nvar pick = require(330),\n    assign = require(325),\n    forEach = require(204);\n\nvar parseNameNs = require(62).parseName;\n\n\nfunction DescriptorBuilder(nameNs) {\n  this.ns = nameNs;\n  this.name = nameNs.name;\n  this.allTypes = [];\n  this.properties = [];\n  this.propertiesByName = {};\n}\n\nmodule.exports = DescriptorBuilder;\n\n\nDescriptorBuilder.prototype.build = function() {\n  return pick(this, [ 'ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty' ]);\n};\n\nDescriptorBuilder.prototype.addProperty = function(p, idx) {\n  this.addNamedProperty(p, true);\n\n  var properties = this.properties;\n\n  if (idx !== undefined) {\n    properties.splice(idx, 0, p);\n  } else {\n    properties.push(p);\n  }\n};\n\n\nDescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {\n  var oldNameNs = oldProperty.ns;\n\n  var props = this.properties,\n      propertiesByName = this.propertiesByName,\n      rename = oldProperty.name !== newProperty.name;\n\n  if (oldProperty.isBody) {\n\n    if (!newProperty.isBody) {\n      throw new Error(\n        'property <' + newProperty.ns.name + '> must be body property ' +\n        'to refine <' + oldProperty.ns.name + '>');\n    }\n\n    // TODO: Check compatibility\n    this.setBodyProperty(newProperty, false);\n  }\n\n  // replacing the named property is intentional\n  // thus, validate only if this is a \"rename\" operation\n  this.addNamedProperty(newProperty, rename);\n\n  // replace old property at index with new one\n  var idx = props.indexOf(oldProperty);\n  if (idx === -1) {\n    throw new Error('property <' + oldNameNs.name + '> not found in property list');\n  }\n\n  props[idx] = newProperty;\n\n  // replace propertiesByName entry with new property\n  propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;\n};\n\n\nDescriptorBuilder.prototype.redefineProperty = function(p) {\n\n  var nsPrefix = p.ns.prefix;\n  var parts = p.redefines.split('#');\n\n  var name = parseNameNs(parts[0], nsPrefix);\n  var attrName = parseNameNs(parts[1], name.prefix).name;\n\n  var redefinedProperty = this.propertiesByName[attrName];\n  if (!redefinedProperty) {\n    throw new Error('refined property <' + attrName + '> not found');\n  } else {\n    this.replaceProperty(redefinedProperty, p);\n  }\n\n  delete p.redefines;\n};\n\nDescriptorBuilder.prototype.addNamedProperty = function(p, validate) {\n  var ns = p.ns,\n      propsByName = this.propertiesByName;\n\n  if (validate) {\n    this.assertNotDefined(p, ns.name);\n    this.assertNotDefined(p, ns.localName);\n  }\n\n  propsByName[ns.name] = propsByName[ns.localName] = p;\n};\n\nDescriptorBuilder.prototype.removeNamedProperty = function(p) {\n  var ns = p.ns,\n      propsByName = this.propertiesByName;\n\n  delete propsByName[ns.name];\n  delete propsByName[ns.localName];\n};\n\nDescriptorBuilder.prototype.setBodyProperty = function(p, validate) {\n\n  if (validate && this.bodyProperty) {\n    throw new Error(\n      'body property defined multiple times ' +\n      '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');\n  }\n\n  this.bodyProperty = p;\n};\n\nDescriptorBuilder.prototype.addIdProperty = function(name) {\n  var nameNs = parseNameNs(name, this.ns.prefix);\n\n  var p = {\n    name: nameNs.localName,\n    type: 'String',\n    isAttr: true,\n    ns: nameNs\n  };\n\n  // ensure that id is always the first attribute (if present)\n  this.addProperty(p, 0);\n};\n\nDescriptorBuilder.prototype.assertNotDefined = function(p, name) {\n  var propertyName = p.name,\n      definedProperty = this.propertiesByName[propertyName];\n\n  if (definedProperty) {\n    throw new Error(\n      'property <' + propertyName + '> already defined; ' +\n      'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +\n      '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');\n  }\n};\n\nDescriptorBuilder.prototype.hasProperty = function(name) {\n  return this.propertiesByName[name];\n};\n\nDescriptorBuilder.prototype.addTrait = function(t) {\n\n  var allTypes = this.allTypes;\n\n  if (allTypes.indexOf(t) !== -1) {\n    return;\n  }\n\n  forEach(t.properties, function(p) {\n\n    // clone property to allow extensions\n    p = assign({}, p, {\n      name: p.ns.localName\n    });\n\n    Object.defineProperty(p, 'definedBy', {\n      value: t\n    });\n\n    // add redefine support\n    if (p.redefines) {\n      this.redefineProperty(p);\n    } else {\n      if (p.isBody) {\n        this.setBodyProperty(p);\n      }\n      this.addProperty(p);\n    }\n  }, this);\n\n  allTypes.push(t);\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar Base = require(58);\n\n\nfunction Factory(model, properties) {\n  this.model = model;\n  this.properties = properties;\n}\n\nmodule.exports = Factory;\n\n\nFactory.prototype.createType = function(descriptor) {\n\n  var model = this.model;\n\n  var props = this.properties,\n      prototype = Object.create(Base.prototype);\n\n  // initialize default values\n  forEach(descriptor.properties, function(p) {\n    if (!p.isMany && p.default !== undefined) {\n      prototype[p.name] = p.default;\n    }\n  });\n\n  props.defineModel(prototype, model);\n  props.defineDescriptor(prototype, descriptor);\n\n  var name = descriptor.ns.name;\n\n  /**\n   * The new type constructor\n   */\n  function ModdleElement(attrs) {\n    props.define(this, '$type', { value: name, enumerable: true });\n    props.define(this, '$attrs', { value: {} });\n    props.define(this, '$parent', { writable: true });\n\n    forEach(attrs, function(val, key) {\n      this.set(key, val);\n    }, this);\n  }\n\n  ModdleElement.prototype = prototype;\n\n  ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;\n\n  // static links\n  props.defineModel(ModdleElement, model);\n  props.defineDescriptor(ModdleElement, descriptor);\n\n  return ModdleElement;\n};","'use strict';\n\nvar isString = require(322),\n    isObject = require(320),\n    forEach = require(204),\n    find = require(203);\n\n\nvar Factory = require(60),\n    Registry = require(64),\n    Properties = require(63);\n\nvar parseNameNs = require(62).parseName;\n\n\n//// Moddle implementation /////////////////////////////////////////////////\n\n/**\n * @class Moddle\n *\n * A model that can be used to create elements of a specific type.\n *\n * @example\n *\n * var Moddle = require('moddle');\n *\n * var pkg = {\n *   name: 'mypackage',\n *   prefix: 'my',\n *   types: [\n *     { name: 'Root' }\n *   ]\n * };\n *\n * var moddle = new Moddle([pkg]);\n *\n * @param {Array<Package>} packages  the packages to contain\n * @param {Object} options  additional options to pass to the model\n */\nfunction Moddle(packages, options) {\n\n  options = options || {};\n\n  this.properties = new Properties(this);\n\n  this.factory = new Factory(this, this.properties);\n  this.registry = new Registry(packages, this.properties, options);\n\n  this.typeCache = {};\n}\n\nmodule.exports = Moddle;\n\n\n/**\n * Create an instance of the specified type.\n *\n * @method Moddle#create\n *\n * @example\n *\n * var foo = moddle.create('my:Foo');\n * var bar = moddle.create('my:Bar', { id: 'BAR_1' });\n *\n * @param  {String|Object} descriptor the type descriptor or name know to the model\n * @param  {Object} attrs   a number of attributes to initialize the model instance with\n * @return {Object}         model instance\n */\nModdle.prototype.create = function(descriptor, attrs) {\n  var Type = this.getType(descriptor);\n\n  if (!Type) {\n    throw new Error('unknown type <' + descriptor + '>');\n  }\n\n  return new Type(attrs);\n};\n\n\n/**\n * Returns the type representing a given descriptor\n *\n * @method Moddle#getType\n *\n * @example\n *\n * var Foo = moddle.getType('my:Foo');\n * var foo = new Foo({ 'id' : 'FOO_1' });\n *\n * @param  {String|Object} descriptor the type descriptor or name know to the model\n * @return {Object}         the type representing the descriptor\n */\nModdle.prototype.getType = function(descriptor) {\n\n  var cache = this.typeCache;\n\n  var name = isString(descriptor) ? descriptor : descriptor.ns.name;\n\n  var type = cache[name];\n\n  if (!type) {\n    descriptor = this.registry.getEffectiveDescriptor(name);\n    type = cache[name] = this.factory.createType(descriptor);\n  }\n\n  return type;\n};\n\n\n/**\n * Creates an any-element type to be used within model instances.\n *\n * This can be used to create custom elements that lie outside the meta-model.\n * The created element contains all the meta-data required to serialize it\n * as part of meta-model elements.\n *\n * @method Moddle#createAny\n *\n * @example\n *\n * var foo = moddle.createAny('vendor:Foo', 'http://vendor', {\n *   value: 'bar'\n * });\n *\n * var container = moddle.create('my:Container', 'http://my', {\n *   any: [ foo ]\n * });\n *\n * // go ahead and serialize the stuff\n *\n *\n * @param  {String} name  the name of the element\n * @param  {String} nsUri the namespace uri of the element\n * @param  {Object} [properties] a map of properties to initialize the instance with\n * @return {Object} the any type instance\n */\nModdle.prototype.createAny = function(name, nsUri, properties) {\n\n  var nameNs = parseNameNs(name);\n\n  var element = {\n    $type: name\n  };\n\n  var descriptor = {\n    name: name,\n    isGeneric: true,\n    ns: {\n      prefix: nameNs.prefix,\n      localName: nameNs.localName,\n      uri: nsUri\n    }\n  };\n\n  this.properties.defineDescriptor(element, descriptor);\n  this.properties.defineModel(element, this);\n  this.properties.define(element, '$parent', { enumerable: false, writable: true });\n\n  forEach(properties, function(a, key) {\n    if (isObject(a) && a.value !== undefined) {\n      element[a.name] = a.value;\n    } else {\n      element[key] = a;\n    }\n  });\n\n  return element;\n};\n\n/**\n * Returns a registered package by uri or prefix\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackage = function(uriOrPrefix) {\n  return this.registry.getPackage(uriOrPrefix);\n};\n\n/**\n * Returns a snapshot of all known packages\n *\n * @return {Object} the package\n */\nModdle.prototype.getPackages = function() {\n  return this.registry.getPackages();\n};\n\n/**\n * Returns the descriptor for an element\n */\nModdle.prototype.getElementDescriptor = function(element) {\n  return element.$descriptor;\n};\n\n/**\n * Returns true if the given descriptor or instance\n * represents the given type.\n *\n * May be applied to this, if element is omitted.\n */\nModdle.prototype.hasType = function(element, type) {\n  if (type === undefined) {\n    type = element;\n    element = this;\n  }\n\n  var descriptor = element.$model.getElementDescriptor(element);\n\n  return !!find(descriptor.allTypes, function(t) {\n    return t.name === type;\n  });\n};\n\n\n/**\n * Returns the descriptor of an elements named property\n */\nModdle.prototype.getPropertyDescriptor = function(element, property) {\n  return this.getElementDescriptor(element).propertiesByName[property];\n};\n","'use strict';\n\n/**\n * Parses a namespaced attribute name of the form (ns:)localName to an object,\n * given a default prefix to assume in case no explicit namespace is given.\n *\n * @param {String} name\n * @param {String} [defaultPrefix] the default prefix to take, if none is present.\n *\n * @return {Object} the parsed name\n */\nmodule.exports.parseName = function(name, defaultPrefix) {\n  var parts = name.split(/:/),\n      localName, prefix;\n\n  // no prefix (i.e. only local name)\n  if (parts.length === 1) {\n    localName = name;\n    prefix = defaultPrefix;\n  } else\n  // prefix + local name\n  if (parts.length === 2) {\n    localName = parts[1];\n    prefix = parts[0];\n  } else {\n    throw new Error('expected <prefix:localName> or <localName>, got ' + name);\n  }\n\n  name = (prefix ? prefix + ':' : '') + localName;\n\n  return {\n    name: name,\n    prefix: prefix,\n    localName: localName\n  };\n};","'use strict';\n\n\n/**\n * A utility that gets and sets properties of model elements.\n *\n * @param {Model} model\n */\nfunction Properties(model) {\n  this.model = model;\n}\n\nmodule.exports = Properties;\n\n\n/**\n * Sets a named property on the target element\n *\n * @param {Object} target\n * @param {String} name\n * @param {Object} value\n */\nProperties.prototype.set = function(target, name, value) {\n\n  var property = this.model.getPropertyDescriptor(target, name);\n\n  if (!property) {\n    target.$attrs[name] = value;\n  } else {\n    Object.defineProperty(target, property.name, {\n      enumerable: !property.isReference,\n      writable: true,\n      value: value\n    });\n  }\n};\n\n/**\n * Returns the named property of the given element\n *\n * @param  {Object} target\n * @param  {String} name\n *\n * @return {Object}\n */\nProperties.prototype.get = function(target, name) {\n\n  var property = this.model.getPropertyDescriptor(target, name);\n\n  if (!property) {\n    return target.$attrs[name];\n  }\n\n  var propertyName = property.name;\n\n  // check if access to collection property and lazily initialize it\n  if (!target[propertyName] && property.isMany) {\n    Object.defineProperty(target, propertyName, {\n      enumerable: !property.isReference,\n      writable: true,\n      value: []\n    });\n  }\n\n  return target[propertyName];\n};\n\n\n/**\n * Define a property on the target element\n *\n * @param  {Object} target\n * @param  {String} name\n * @param  {Object} options\n */\nProperties.prototype.define = function(target, name, options) {\n  Object.defineProperty(target, name, options);\n};\n\n\n/**\n * Define the descriptor for an element\n */\nProperties.prototype.defineDescriptor = function(target, descriptor) {\n  this.define(target, '$descriptor', { value: descriptor });\n};\n\n/**\n * Define the model for an element\n */\nProperties.prototype.defineModel = function(target, model) {\n  this.define(target, '$model', { value: model });\n};","'use strict';\n\nvar assign = require(325),\n    forEach = require(204);\n\nvar Types = require(65),\n    DescriptorBuilder = require(59);\n\nvar parseNameNs = require(62).parseName,\n    isBuiltInType = Types.isBuiltIn;\n\n\nfunction Registry(packages, properties, options) {\n  this.options = assign({ generateId: 'id' }, options || {});\n\n  this.packageMap = {};\n  this.typeMap = {};\n\n  this.packages = [];\n\n  this.properties = properties;\n\n  forEach(packages, this.registerPackage, this);\n}\n\nmodule.exports = Registry;\n\n\nRegistry.prototype.getPackage = function(uriOrPrefix) {\n  return this.packageMap[uriOrPrefix];\n};\n\nRegistry.prototype.getPackages = function() {\n  return this.packages;\n};\n\n\nRegistry.prototype.registerPackage = function(pkg) {\n\n  // copy package\n  pkg = assign({}, pkg);\n\n  // register types\n  forEach(pkg.types, function(descriptor) {\n    this.registerType(descriptor, pkg);\n  }, this);\n\n  this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;\n  this.packages.push(pkg);\n};\n\n\n/**\n * Register a type from a specific package with us\n */\nRegistry.prototype.registerType = function(type, pkg) {\n\n  type = assign({}, type, {\n    superClass: (type.superClass || []).slice(),\n    extends: (type.extends || []).slice(),\n    properties: (type.properties || []).slice()\n  });\n\n  var ns = parseNameNs(type.name, pkg.prefix),\n      name = ns.name,\n      propertiesByName = {};\n\n  // parse properties\n  forEach(type.properties, function(p) {\n\n    // namespace property names\n    var propertyNs = parseNameNs(p.name, ns.prefix),\n        propertyName = propertyNs.name;\n\n    // namespace property types\n    if (!isBuiltInType(p.type)) {\n      p.type = parseNameNs(p.type, propertyNs.prefix).name;\n    }\n\n    assign(p, {\n      ns: propertyNs,\n      name: propertyName\n    });\n\n    propertiesByName[propertyName] = p;\n  });\n\n  // update ns + name\n  assign(type, {\n    ns: ns,\n    name: name,\n    propertiesByName: propertiesByName\n  });\n\n  forEach(type.extends, function(extendsName) {\n    var extended = this.typeMap[extendsName];\n\n    extended.traits = extended.traits || [];\n    extended.traits.push(name);\n  }, this);\n\n  // link to package\n  this.definePackage(type, pkg);\n\n  // register\n  this.typeMap[name] = type;\n};\n\n\n/**\n * Traverse the type hierarchy from bottom to top.\n */\nRegistry.prototype.mapTypes = function(nsName, iterator) {\n\n  var type = isBuiltInType(nsName.name) ? { name: nsName.name } : this.typeMap[nsName.name];\n\n  var self = this;\n\n  /**\n   * Traverse the selected super type or trait\n   *\n   * @param {String} cls\n   */\n  function traverseSuper(cls) {\n    var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);\n    self.mapTypes(parentNs, iterator);\n  }\n\n  if (!type) {\n    throw new Error('unknown type <' + nsName.name + '>');\n  }\n\n  forEach(type.superClass, traverseSuper);\n\n  iterator(type);\n\n  forEach(type.traits, traverseSuper);\n};\n\n\n/**\n * Returns the effective descriptor for a type.\n *\n * @param  {String} type the namespaced name (ns:localName) of the type\n *\n * @return {Descriptor} the resulting effective descriptor\n */\nRegistry.prototype.getEffectiveDescriptor = function(name) {\n\n  var nsName = parseNameNs(name);\n\n  var builder = new DescriptorBuilder(nsName);\n\n  this.mapTypes(nsName, function(type) {\n    builder.addTrait(type);\n  });\n\n  // check we have an id assigned\n  var id = this.options.generateId;\n  if (id && !builder.hasProperty(id)) {\n    builder.addIdProperty(id);\n  }\n\n  var descriptor = builder.build();\n\n  // define package link\n  this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);\n\n  return descriptor;\n};\n\n\nRegistry.prototype.definePackage = function(target, pkg) {\n  this.properties.define(target, '$pkg', { value: pkg });\n};","'use strict';\n\n/**\n * Built-in moddle types\n */\nvar BUILTINS = {\n  String: true,\n  Boolean: true,\n  Integer: true,\n  Real: true,\n  Element: true\n};\n\n/**\n * Converters for built in types from string representations\n */\nvar TYPE_CONVERTERS = {\n  String: function(s) { return s; },\n  Boolean: function(s) { return s === 'true'; },\n  Integer: function(s) { return parseInt(s, 10); },\n  Real: function(s) { return parseFloat(s, 10); }\n};\n\n/**\n * Convert a type to its real representation\n */\nmodule.exports.coerceType = function(type, value) {\n\n  var converter = TYPE_CONVERTERS[type];\n\n  if (converter) {\n    return converter(value);\n  } else {\n    return value;\n  }\n};\n\n/**\n * Return whether the given type is built-in\n */\nmodule.exports.isBuiltIn = function(type) {\n  return !!BUILTINS[type];\n};\n\n/**\n * Return whether the given type is simple\n */\nmodule.exports.isSimple = function(type) {\n  return !!TYPE_CONVERTERS[type];\n};","module.exports={\n  \"name\": \"BPMN20\",\n  \"uri\": \"http://www.omg.org/spec/BPMN/20100524/MODEL\",\n  \"associations\": [],\n  \"types\": [\n    {\n      \"name\": \"Interface\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"operations\",\n          \"type\": \"Operation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"implementationRef\",\n          \"type\": \"String\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Operation\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"inMessageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outMessageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"errorRefs\",\n          \"type\": \"Error\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"implementationRef\",\n          \"type\": \"String\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"EndPoint\",\n      \"superClass\": [\n        \"RootElement\"\n      ]\n    },\n    {\n      \"name\": \"Auditing\",\n      \"superClass\": [\n        \"BaseElement\"\n      ]\n    },\n    {\n      \"name\": \"GlobalTask\",\n      \"superClass\": [\n        \"CallableElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"resources\",\n          \"type\": \"ResourceRole\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Monitoring\",\n      \"superClass\": [\n        \"BaseElement\"\n      ]\n    },\n    {\n      \"name\": \"Performer\",\n      \"superClass\": [\n        \"ResourceRole\"\n      ]\n    },\n    {\n      \"name\": \"Process\",\n      \"superClass\": [\n        \"FlowElementsContainer\",\n        \"CallableElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"processType\",\n          \"type\": \"ProcessType\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"isClosed\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"auditing\",\n          \"type\": \"Auditing\"\n        },\n        {\n          \"name\": \"monitoring\",\n          \"type\": \"Monitoring\"\n        },\n        {\n          \"name\": \"properties\",\n          \"type\": \"Property\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"supports\",\n          \"type\": \"Process\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"definitionalCollaborationRef\",\n          \"type\": \"Collaboration\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"isExecutable\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"resources\",\n          \"type\": \"ResourceRole\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"artifacts\",\n          \"type\": \"Artifact\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"correlationSubscriptions\",\n          \"type\": \"CorrelationSubscription\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"LaneSet\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"lanes\",\n          \"type\": \"Lane\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Lane\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"childLaneSet\",\n          \"type\": \"LaneSet\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"partitionElementRef\",\n          \"type\": \"BaseElement\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"flowNodeRef\",\n          \"type\": \"FlowNode\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"partitionElement\",\n          \"type\": \"BaseElement\"\n        }\n      ]\n    },\n    {\n      \"name\": \"GlobalManualTask\",\n      \"superClass\": [\n        \"GlobalTask\"\n      ]\n    },\n    {\n      \"name\": \"ManualTask\",\n      \"superClass\": [\n        \"Task\"\n      ]\n    },\n    {\n      \"name\": \"UserTask\",\n      \"superClass\": [\n        \"Task\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"renderings\",\n          \"type\": \"Rendering\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Rendering\",\n      \"superClass\": [\n        \"BaseElement\"\n      ]\n    },\n    {\n      \"name\": \"HumanPerformer\",\n      \"superClass\": [\n        \"Performer\"\n      ]\n    },\n    {\n      \"name\": \"PotentialOwner\",\n      \"superClass\": [\n        \"HumanPerformer\"\n      ]\n    },\n    {\n      \"name\": \"GlobalUserTask\",\n      \"superClass\": [\n        \"GlobalTask\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"renderings\",\n          \"type\": \"Rendering\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Gateway\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"FlowNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"gatewayDirection\",\n          \"type\": \"GatewayDirection\",\n          \"default\": \"Unspecified\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"EventBasedGateway\",\n      \"superClass\": [\n        \"Gateway\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"instantiate\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"eventGatewayType\",\n          \"type\": \"EventBasedGatewayType\",\n          \"isAttr\": true,\n          \"default\": \"Exclusive\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ComplexGateway\",\n      \"superClass\": [\n        \"Gateway\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"activationCondition\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"default\",\n          \"type\": \"SequenceFlow\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ExclusiveGateway\",\n      \"superClass\": [\n        \"Gateway\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"default\",\n          \"type\": \"SequenceFlow\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"InclusiveGateway\",\n      \"superClass\": [\n        \"Gateway\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"default\",\n          \"type\": \"SequenceFlow\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ParallelGateway\",\n      \"superClass\": [\n        \"Gateway\"\n      ]\n    },\n    {\n      \"name\": \"RootElement\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"BaseElement\"\n      ]\n    },\n    {\n      \"name\": \"Relationship\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"type\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"direction\",\n          \"type\": \"RelationshipDirection\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"source\",\n          \"isMany\": true,\n          \"isReference\": true,\n          \"type\": \"Element\"\n        },\n        {\n          \"name\": \"target\",\n          \"isMany\": true,\n          \"isReference\": true,\n          \"type\": \"Element\"\n        }\n      ]\n    },\n    {\n      \"name\": \"BaseElement\",\n      \"isAbstract\": true,\n      \"properties\": [\n        {\n          \"name\": \"id\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"documentation\",\n          \"type\": \"Documentation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"extensionDefinitions\",\n          \"type\": \"ExtensionDefinition\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"extensionElements\",\n          \"type\": \"ExtensionElements\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Extension\",\n      \"properties\": [\n        {\n          \"name\": \"mustUnderstand\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"definition\",\n          \"type\": \"ExtensionDefinition\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ExtensionDefinition\",\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"extensionAttributeDefinitions\",\n          \"type\": \"ExtensionAttributeDefinition\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ExtensionAttributeDefinition\",\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"type\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"isReference\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"extensionDefinition\",\n          \"type\": \"ExtensionDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ExtensionElements\",\n      \"properties\": [\n        {\n          \"name\": \"valueRef\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"type\": \"Element\"\n        },\n        {\n          \"name\": \"values\",\n          \"type\": \"Element\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"extensionAttributeDefinition\",\n          \"type\": \"ExtensionAttributeDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Documentation\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"text\",\n          \"type\": \"String\",\n          \"isBody\": true\n        },\n        {\n          \"name\": \"textFormat\",\n          \"default\": \"text/plain\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Event\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"FlowNode\",\n        \"InteractionNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"properties\",\n          \"type\": \"Property\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"IntermediateCatchEvent\",\n      \"superClass\": [\n        \"CatchEvent\"\n      ]\n    },\n    {\n      \"name\": \"IntermediateThrowEvent\",\n      \"superClass\": [\n        \"ThrowEvent\"\n      ]\n    },\n    {\n      \"name\": \"EndEvent\",\n      \"superClass\": [\n        \"ThrowEvent\"\n      ]\n    },\n    {\n      \"name\": \"StartEvent\",\n      \"superClass\": [\n        \"CatchEvent\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"isInterrupting\",\n          \"default\": true,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ThrowEvent\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Event\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"inputSet\",\n          \"type\": \"InputSet\"\n        },\n        {\n          \"name\": \"eventDefinitionRefs\",\n          \"type\": \"EventDefinition\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"dataInputAssociation\",\n          \"type\": \"DataInputAssociation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"dataInputs\",\n          \"type\": \"DataInput\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"eventDefinitions\",\n          \"type\": \"EventDefinition\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CatchEvent\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Event\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"parallelMultiple\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\",\n          \"default\": false\n        },\n        {\n          \"name\": \"outputSet\",\n          \"type\": \"OutputSet\"\n        },\n        {\n          \"name\": \"eventDefinitionRefs\",\n          \"type\": \"EventDefinition\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"dataOutputAssociation\",\n          \"type\": \"DataOutputAssociation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"dataOutputs\",\n          \"type\": \"DataOutput\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"eventDefinitions\",\n          \"type\": \"EventDefinition\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"BoundaryEvent\",\n      \"superClass\": [\n        \"CatchEvent\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"cancelActivity\",\n          \"default\": true,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"attachedToRef\",\n          \"type\": \"Activity\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"EventDefinition\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"RootElement\"\n      ]\n    },\n    {\n      \"name\": \"CancelEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ]\n    },\n    {\n      \"name\": \"ErrorEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"errorRef\",\n          \"type\": \"Error\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"TerminateEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ]\n    },\n    {\n      \"name\": \"EscalationEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"escalationRef\",\n          \"type\": \"Escalation\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Escalation\",\n      \"properties\": [\n        {\n          \"name\": \"structureRef\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"escalationCode\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ],\n      \"superClass\": [\n        \"RootElement\"\n      ]\n    },\n    {\n      \"name\": \"CompensateEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"waitForCompletion\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"activityRef\",\n          \"type\": \"Activity\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"TimerEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"timeDate\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"timeCycle\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"timeDuration\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        }\n      ]\n    },\n    {\n      \"name\": \"LinkEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"target\",\n          \"type\": \"LinkEventDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"source\",\n          \"type\": \"LinkEventDefinition\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"MessageEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"messageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"operationRef\",\n          \"type\": \"Operation\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ConditionalEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"condition\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        }\n      ]\n    },\n    {\n      \"name\": \"SignalEventDefinition\",\n      \"superClass\": [\n        \"EventDefinition\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"signalRef\",\n          \"type\": \"Signal\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Signal\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"structureRef\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ImplicitThrowEvent\",\n      \"superClass\": [\n        \"ThrowEvent\"\n      ]\n    },\n    {\n      \"name\": \"DataState\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ItemAwareElement\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"itemSubjectRef\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"dataState\",\n          \"type\": \"DataState\"\n        }\n      ]\n    },\n    {\n      \"name\": \"DataAssociation\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"transformation\",\n          \"type\": \"FormalExpression\"\n        },\n        {\n          \"name\": \"assignment\",\n          \"type\": \"Assignment\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"sourceRef\",\n          \"type\": \"ItemAwareElement\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"targetRef\",\n          \"type\": \"ItemAwareElement\",\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"DataInput\",\n      \"superClass\": [\n        \"ItemAwareElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"isCollection\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"inputSetRefs\",\n          \"type\": \"InputSet\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"inputSetWithOptional\",\n          \"type\": \"InputSet\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"inputSetWithWhileExecuting\",\n          \"type\": \"InputSet\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"DataOutput\",\n      \"superClass\": [\n        \"ItemAwareElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"isCollection\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"outputSetRefs\",\n          \"type\": \"OutputSet\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outputSetWithOptional\",\n          \"type\": \"OutputSet\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outputSetWithWhileExecuting\",\n          \"type\": \"OutputSet\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"InputSet\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"dataInputRefs\",\n          \"type\": \"DataInput\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"optionalInputRefs\",\n          \"type\": \"DataInput\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"whileExecutingInputRefs\",\n          \"type\": \"DataInput\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outputSetRefs\",\n          \"type\": \"OutputSet\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"OutputSet\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"dataOutputRefs\",\n          \"type\": \"DataOutput\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"inputSetRefs\",\n          \"type\": \"InputSet\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"optionalOutputRefs\",\n          \"type\": \"DataOutput\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"whileExecutingOutputRefs\",\n          \"type\": \"DataOutput\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Property\",\n      \"superClass\": [\n        \"ItemAwareElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"DataInputAssociation\",\n      \"superClass\": [\n        \"DataAssociation\"\n      ]\n    },\n    {\n      \"name\": \"DataOutputAssociation\",\n      \"superClass\": [\n        \"DataAssociation\"\n      ]\n    },\n    {\n      \"name\": \"InputOutputSpecification\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"inputSets\",\n          \"type\": \"InputSet\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"outputSets\",\n          \"type\": \"OutputSet\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"dataInputs\",\n          \"type\": \"DataInput\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"dataOutputs\",\n          \"type\": \"DataOutput\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"DataObject\",\n      \"superClass\": [\n        \"FlowElement\",\n        \"ItemAwareElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"isCollection\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        }\n      ]\n    },\n    {\n      \"name\": \"InputOutputBinding\",\n      \"properties\": [\n        {\n          \"name\": \"inputDataRef\",\n          \"type\": \"InputSet\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outputDataRef\",\n          \"type\": \"OutputSet\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"operationRef\",\n          \"type\": \"Operation\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Assignment\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"from\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"to\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        }\n      ]\n    },\n    {\n      \"name\": \"DataStore\",\n      \"superClass\": [\n        \"RootElement\",\n        \"ItemAwareElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"capacity\",\n          \"isAttr\": true,\n          \"type\": \"Integer\"\n        },\n        {\n          \"name\": \"isUnlimited\",\n          \"default\": true,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        }\n      ]\n    },\n    {\n      \"name\": \"DataStoreReference\",\n      \"superClass\": [\n        \"ItemAwareElement\",\n        \"FlowElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"dataStoreRef\",\n          \"type\": \"DataStore\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"DataObjectReference\",\n      \"superClass\": [\n        \"ItemAwareElement\",\n        \"FlowElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"dataObjectRef\",\n          \"type\": \"DataObject\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ConversationLink\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"sourceRef\",\n          \"type\": \"InteractionNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"targetRef\",\n          \"type\": \"InteractionNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ConversationAssociation\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"innerConversationNodeRef\",\n          \"type\": \"ConversationNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outerConversationNodeRef\",\n          \"type\": \"ConversationNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CallConversation\",\n      \"superClass\": [\n        \"ConversationNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"calledCollaborationRef\",\n          \"type\": \"Collaboration\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"participantAssociations\",\n          \"type\": \"ParticipantAssociation\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Conversation\",\n      \"superClass\": [\n        \"ConversationNode\"\n      ]\n    },\n    {\n      \"name\": \"SubConversation\",\n      \"superClass\": [\n        \"ConversationNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"conversationNodes\",\n          \"type\": \"ConversationNode\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ConversationNode\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"InteractionNode\",\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"participantRefs\",\n          \"type\": \"Participant\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"messageFlowRefs\",\n          \"type\": \"MessageFlow\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"correlationKeys\",\n          \"type\": \"CorrelationKey\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"GlobalConversation\",\n      \"superClass\": [\n        \"Collaboration\"\n      ]\n    },\n    {\n      \"name\": \"PartnerEntity\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"participantRef\",\n          \"type\": \"Participant\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"PartnerRole\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"participantRef\",\n          \"type\": \"Participant\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CorrelationProperty\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"correlationPropertyRetrievalExpression\",\n          \"type\": \"CorrelationPropertyRetrievalExpression\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"type\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Error\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"structureRef\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"errorCode\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"CorrelationKey\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"correlationPropertyRef\",\n          \"type\": \"CorrelationProperty\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Expression\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"isAbstract\": true\n    },\n    {\n      \"name\": \"FormalExpression\",\n      \"superClass\": [\n        \"Expression\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"language\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"body\",\n          \"type\": \"String\",\n          \"isBody\": true\n        },\n        {\n          \"name\": \"evaluatesToTypeRef\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Message\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"itemRef\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ItemDefinition\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"itemKind\",\n          \"type\": \"ItemKind\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"structureRef\",\n          \"type\": \"String\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"isCollection\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"import\",\n          \"type\": \"Import\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"FlowElement\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"auditing\",\n          \"type\": \"Auditing\"\n        },\n        {\n          \"name\": \"monitoring\",\n          \"type\": \"Monitoring\"\n        },\n        {\n          \"name\": \"categoryValueRef\",\n          \"type\": \"CategoryValue\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"SequenceFlow\",\n      \"superClass\": [\n        \"FlowElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"isImmediate\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"conditionExpression\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"sourceRef\",\n          \"type\": \"FlowNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"targetRef\",\n          \"type\": \"FlowNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"FlowElementsContainer\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"laneSets\",\n          \"type\": \"LaneSet\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"flowElements\",\n          \"type\": \"FlowElement\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CallableElement\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"ioSpecification\",\n          \"type\": \"InputOutputSpecification\"\n        },\n        {\n          \"name\": \"supportedInterfaceRefs\",\n          \"type\": \"Interface\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"ioBinding\",\n          \"type\": \"InputOutputBinding\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"FlowNode\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"FlowElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"incoming\",\n          \"type\": \"SequenceFlow\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outgoing\",\n          \"type\": \"SequenceFlow\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"lanes\",\n          \"type\": \"Lane\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CorrelationPropertyRetrievalExpression\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"messagePath\",\n          \"type\": \"FormalExpression\"\n        },\n        {\n          \"name\": \"messageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CorrelationPropertyBinding\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"dataPath\",\n          \"type\": \"FormalExpression\"\n        },\n        {\n          \"name\": \"correlationPropertyRef\",\n          \"type\": \"CorrelationProperty\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Resource\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"resourceParameters\",\n          \"type\": \"ResourceParameter\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ResourceParameter\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"isRequired\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"type\",\n          \"type\": \"ItemDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CorrelationSubscription\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"correlationKeyRef\",\n          \"type\": \"CorrelationKey\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"correlationPropertyBinding\",\n          \"type\": \"CorrelationPropertyBinding\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"MessageFlow\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"sourceRef\",\n          \"type\": \"InteractionNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"targetRef\",\n          \"type\": \"InteractionNode\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"messageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"MessageFlowAssociation\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"innerMessageFlowRef\",\n          \"type\": \"MessageFlow\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outerMessageFlowRef\",\n          \"type\": \"MessageFlow\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"InteractionNode\",\n      \"isAbstract\": true,\n      \"properties\": [\n        {\n          \"name\": \"incomingConversationLinks\",\n          \"type\": \"ConversationLink\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outgoingConversationLinks\",\n          \"type\": \"ConversationLink\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Participant\",\n      \"superClass\": [\n        \"InteractionNode\",\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"interfaceRefs\",\n          \"type\": \"Interface\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"participantMultiplicity\",\n          \"type\": \"ParticipantMultiplicity\"\n        },\n        {\n          \"name\": \"endPointRefs\",\n          \"type\": \"EndPoint\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"processRef\",\n          \"type\": \"Process\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ParticipantAssociation\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"innerParticipantRef\",\n          \"type\": \"Participant\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"outerParticipantRef\",\n          \"type\": \"Participant\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ParticipantMultiplicity\",\n      \"properties\": [\n        {\n          \"name\": \"minimum\",\n          \"default\": 0,\n          \"isAttr\": true,\n          \"type\": \"Integer\"\n        },\n        {\n          \"name\": \"maximum\",\n          \"default\": 1,\n          \"isAttr\": true,\n          \"type\": \"Integer\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Collaboration\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"isClosed\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"choreographyRef\",\n          \"type\": \"Choreography\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"artifacts\",\n          \"type\": \"Artifact\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"participantAssociations\",\n          \"type\": \"ParticipantAssociation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"messageFlowAssociations\",\n          \"type\": \"MessageFlowAssociation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"conversationAssociations\",\n          \"type\": \"ConversationAssociation\"\n        },\n        {\n          \"name\": \"participants\",\n          \"type\": \"Participant\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"messageFlows\",\n          \"type\": \"MessageFlow\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"correlationKeys\",\n          \"type\": \"CorrelationKey\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"conversations\",\n          \"type\": \"ConversationNode\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"conversationLinks\",\n          \"type\": \"ConversationLink\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ChoreographyActivity\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"FlowNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"participantRefs\",\n          \"type\": \"Participant\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"initiatingParticipantRef\",\n          \"type\": \"Participant\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"correlationKeys\",\n          \"type\": \"CorrelationKey\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"loopType\",\n          \"type\": \"ChoreographyLoopType\",\n          \"default\": \"None\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"CallChoreography\",\n      \"superClass\": [\n        \"ChoreographyActivity\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"calledChoreographyRef\",\n          \"type\": \"Choreography\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"participantAssociations\",\n          \"type\": \"ParticipantAssociation\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"SubChoreography\",\n      \"superClass\": [\n        \"ChoreographyActivity\",\n        \"FlowElementsContainer\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"artifacts\",\n          \"type\": \"Artifact\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ChoreographyTask\",\n      \"superClass\": [\n        \"ChoreographyActivity\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"messageFlowRef\",\n          \"type\": \"MessageFlow\",\n          \"isMany\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Choreography\",\n      \"superClass\": [\n        \"FlowElementsContainer\",\n        \"Collaboration\"\n      ]\n    },\n    {\n      \"name\": \"GlobalChoreographyTask\",\n      \"superClass\": [\n        \"Choreography\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"initiatingParticipantRef\",\n          \"type\": \"Participant\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"TextAnnotation\",\n      \"superClass\": [\n        \"Artifact\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"text\",\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"textFormat\",\n          \"default\": \"text/plain\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Group\",\n      \"superClass\": [\n        \"Artifact\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"categoryValueRef\",\n          \"type\": \"CategoryValue\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Association\",\n      \"superClass\": [\n        \"Artifact\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"associationDirection\",\n          \"type\": \"AssociationDirection\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"sourceRef\",\n          \"type\": \"BaseElement\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"targetRef\",\n          \"type\": \"BaseElement\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Category\",\n      \"superClass\": [\n        \"RootElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"categoryValue\",\n          \"type\": \"CategoryValue\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Artifact\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"BaseElement\"\n      ]\n    },\n    {\n      \"name\": \"CategoryValue\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"categorizedFlowElements\",\n          \"type\": \"FlowElement\",\n          \"isVirtual\": true,\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"value\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Activity\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"FlowNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"isForCompensation\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"loopCharacteristics\",\n          \"type\": \"LoopCharacteristics\"\n        },\n        {\n          \"name\": \"resources\",\n          \"type\": \"ResourceRole\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"default\",\n          \"type\": \"SequenceFlow\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"properties\",\n          \"type\": \"Property\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"ioSpecification\",\n          \"type\": \"InputOutputSpecification\"\n        },\n        {\n          \"name\": \"boundaryEventRefs\",\n          \"type\": \"BoundaryEvent\",\n          \"isMany\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"dataInputAssociations\",\n          \"type\": \"DataInputAssociation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"dataOutputAssociations\",\n          \"type\": \"DataOutputAssociation\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"startQuantity\",\n          \"default\": 1,\n          \"isAttr\": true,\n          \"type\": \"Integer\"\n        },\n        {\n          \"name\": \"completionQuantity\",\n          \"default\": 1,\n          \"isAttr\": true,\n          \"type\": \"Integer\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ServiceTask\",\n      \"superClass\": [\n        \"Task\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"operationRef\",\n          \"type\": \"Operation\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"SubProcess\",\n      \"superClass\": [\n        \"Activity\",\n        \"FlowElementsContainer\",\n        \"InteractionNode\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"triggeredByEvent\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"artifacts\",\n          \"type\": \"Artifact\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"LoopCharacteristics\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"BaseElement\"\n      ]\n    },\n    {\n      \"name\": \"MultiInstanceLoopCharacteristics\",\n      \"superClass\": [\n        \"LoopCharacteristics\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"isSequential\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"behavior\",\n          \"type\": \"MultiInstanceBehavior\",\n          \"default\": \"All\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"loopCardinality\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"loopDataInputRef\",\n          \"type\": \"ItemAwareElement\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"loopDataOutputRef\",\n          \"type\": \"ItemAwareElement\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"inputDataItem\",\n          \"type\": \"DataInput\"\n        },\n        {\n          \"name\": \"outputDataItem\",\n          \"type\": \"DataOutput\"\n        },\n        {\n          \"name\": \"completionCondition\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"complexBehaviorDefinition\",\n          \"type\": \"ComplexBehaviorDefinition\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"oneBehaviorEventRef\",\n          \"type\": \"EventDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"noneBehaviorEventRef\",\n          \"type\": \"EventDefinition\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"StandardLoopCharacteristics\",\n      \"superClass\": [\n        \"LoopCharacteristics\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"testBefore\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"loopCondition\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"loopMaximum\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        }\n      ]\n    },\n    {\n      \"name\": \"CallActivity\",\n      \"superClass\": [\n        \"Activity\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"calledElement\",\n          \"type\": \"String\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Task\",\n      \"superClass\": [\n        \"Activity\",\n        \"InteractionNode\"\n      ]\n    },\n    {\n      \"name\": \"SendTask\",\n      \"superClass\": [\n        \"Task\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"operationRef\",\n          \"type\": \"Operation\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"messageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ReceiveTask\",\n      \"superClass\": [\n        \"Task\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"instantiate\",\n          \"default\": false,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"operationRef\",\n          \"type\": \"Operation\",\n          \"isAttr\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"messageRef\",\n          \"type\": \"Message\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ScriptTask\",\n      \"superClass\": [\n        \"Task\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"scriptFormat\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"script\",\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"BusinessRuleTask\",\n      \"superClass\": [\n        \"Task\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"AdHocSubProcess\",\n      \"superClass\": [\n        \"SubProcess\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"completionCondition\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"ordering\",\n          \"type\": \"AdHocOrdering\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"cancelRemainingInstances\",\n          \"default\": true,\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Transaction\",\n      \"superClass\": [\n        \"SubProcess\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"protocol\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"method\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"GlobalScriptTask\",\n      \"superClass\": [\n        \"GlobalTask\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"scriptLanguage\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"script\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"GlobalBusinessRuleTask\",\n      \"superClass\": [\n        \"GlobalTask\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"implementation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ComplexBehaviorDefinition\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"condition\",\n          \"type\": \"FormalExpression\"\n        },\n        {\n          \"name\": \"event\",\n          \"type\": \"ImplicitThrowEvent\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ResourceRole\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"resourceRef\",\n          \"type\": \"Resource\",\n          \"isReference\": true\n        },\n        {\n          \"name\": \"resourceParameterBindings\",\n          \"type\": \"ResourceParameterBinding\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"resourceAssignmentExpression\",\n          \"type\": \"ResourceAssignmentExpression\"\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ResourceParameterBinding\",\n      \"properties\": [\n        {\n          \"name\": \"expression\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        },\n        {\n          \"name\": \"parameterRef\",\n          \"type\": \"ResourceParameter\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"ResourceAssignmentExpression\",\n      \"properties\": [\n        {\n          \"name\": \"expression\",\n          \"type\": \"Expression\",\n          \"serialize\": \"xsi:type\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Import\",\n      \"properties\": [\n        {\n          \"name\": \"importType\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"location\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"namespace\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Definitions\",\n      \"superClass\": [\n        \"BaseElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"targetNamespace\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"expressionLanguage\",\n          \"default\": \"http://www.w3.org/1999/XPath\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"typeLanguage\",\n          \"default\": \"http://www.w3.org/2001/XMLSchema\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"imports\",\n          \"type\": \"Import\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"extensions\",\n          \"type\": \"Extension\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"rootElements\",\n          \"type\": \"RootElement\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"diagrams\",\n          \"isMany\": true,\n          \"type\": \"bpmndi:BPMNDiagram\"\n        },\n        {\n          \"name\": \"exporter\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"relationships\",\n          \"type\": \"Relationship\",\n          \"isMany\": true\n        },\n        {\n          \"name\": \"exporterVersion\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        }\n      ]\n    }\n  ],\n  \"emumerations\": [\n    {\n      \"name\": \"ProcessType\",\n      \"literalValues\": [\n        {\n          \"name\": \"None\"\n        },\n        {\n          \"name\": \"Public\"\n        },\n        {\n          \"name\": \"Private\"\n        }\n      ]\n    },\n    {\n      \"name\": \"GatewayDirection\",\n      \"literalValues\": [\n        {\n          \"name\": \"Unspecified\"\n        },\n        {\n          \"name\": \"Converging\"\n        },\n        {\n          \"name\": \"Diverging\"\n        },\n        {\n          \"name\": \"Mixed\"\n        }\n      ]\n    },\n    {\n      \"name\": \"EventBasedGatewayType\",\n      \"literalValues\": [\n        {\n          \"name\": \"Parallel\"\n        },\n        {\n          \"name\": \"Exclusive\"\n        }\n      ]\n    },\n    {\n      \"name\": \"RelationshipDirection\",\n      \"literalValues\": [\n        {\n          \"name\": \"None\"\n        },\n        {\n          \"name\": \"Forward\"\n        },\n        {\n          \"name\": \"Backward\"\n        },\n        {\n          \"name\": \"Both\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ItemKind\",\n      \"literalValues\": [\n        {\n          \"name\": \"Physical\"\n        },\n        {\n          \"name\": \"Information\"\n        }\n      ]\n    },\n    {\n      \"name\": \"ChoreographyLoopType\",\n      \"literalValues\": [\n        {\n          \"name\": \"None\"\n        },\n        {\n          \"name\": \"Standard\"\n        },\n        {\n          \"name\": \"MultiInstanceSequential\"\n        },\n        {\n          \"name\": \"MultiInstanceParallel\"\n        }\n      ]\n    },\n    {\n      \"name\": \"AssociationDirection\",\n      \"literalValues\": [\n        {\n          \"name\": \"None\"\n        },\n        {\n          \"name\": \"One\"\n        },\n        {\n          \"name\": \"Both\"\n        }\n      ]\n    },\n    {\n      \"name\": \"MultiInstanceBehavior\",\n      \"literalValues\": [\n        {\n          \"name\": \"None\"\n        },\n        {\n          \"name\": \"One\"\n        },\n        {\n          \"name\": \"All\"\n        },\n        {\n          \"name\": \"Complex\"\n        }\n      ]\n    },\n    {\n      \"name\": \"AdHocOrdering\",\n      \"literalValues\": [\n        {\n          \"name\": \"Parallel\"\n        },\n        {\n          \"name\": \"Sequential\"\n        }\n      ]\n    }\n  ],\n  \"prefix\": \"bpmn\",\n  \"xml\": {\n    \"tagAlias\": \"lowerCase\",\n    \"typePrefix\": \"t\"\n  }\n}","module.exports={\n  \"name\": \"BPMNDI\",\n  \"uri\": \"http://www.omg.org/spec/BPMN/20100524/DI\",\n  \"types\": [\n    {\n      \"name\": \"BPMNDiagram\",\n      \"properties\": [\n        {\n          \"name\": \"plane\",\n          \"type\": \"BPMNPlane\",\n          \"redefines\": \"di:Diagram#rootElement\"\n        },\n        {\n          \"name\": \"labelStyle\",\n          \"type\": \"BPMNLabelStyle\",\n          \"isMany\": true\n        }\n      ],\n      \"superClass\": [\n        \"di:Diagram\"\n      ]\n    },\n    {\n      \"name\": \"BPMNPlane\",\n      \"properties\": [\n        {\n          \"name\": \"bpmnElement\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"type\": \"bpmn:BaseElement\",\n          \"redefines\": \"di:DiagramElement#modelElement\"\n        }\n      ],\n      \"superClass\": [\n        \"di:Plane\"\n      ]\n    },\n    {\n      \"name\": \"BPMNShape\",\n      \"properties\": [\n        {\n          \"name\": \"bpmnElement\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"type\": \"bpmn:BaseElement\",\n          \"redefines\": \"di:DiagramElement#modelElement\"\n        },\n        {\n          \"name\": \"isHorizontal\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"isExpanded\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"isMarkerVisible\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"label\",\n          \"type\": \"BPMNLabel\"\n        },\n        {\n          \"name\": \"isMessageVisible\",\n          \"isAttr\": true,\n          \"type\": \"Boolean\"\n        },\n        {\n          \"name\": \"participantBandKind\",\n          \"type\": \"ParticipantBandKind\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"choreographyActivityShape\",\n          \"type\": \"BPMNShape\",\n          \"isAttr\": true,\n          \"isReference\": true\n        }\n      ],\n      \"superClass\": [\n        \"di:LabeledShape\"\n      ]\n    },\n    {\n      \"name\": \"BPMNEdge\",\n      \"properties\": [\n        {\n          \"name\": \"label\",\n          \"type\": \"BPMNLabel\"\n        },\n        {\n          \"name\": \"bpmnElement\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"type\": \"bpmn:BaseElement\",\n          \"redefines\": \"di:DiagramElement#modelElement\"\n        },\n        {\n          \"name\": \"sourceElement\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"type\": \"di:DiagramElement\",\n          \"redefines\": \"di:Edge#source\"\n        },\n        {\n          \"name\": \"targetElement\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"type\": \"di:DiagramElement\",\n          \"redefines\": \"di:Edge#target\"\n        },\n        {\n          \"name\": \"messageVisibleKind\",\n          \"type\": \"MessageVisibleKind\",\n          \"isAttr\": true,\n          \"default\": \"initiating\"\n        }\n      ],\n      \"superClass\": [\n        \"di:LabeledEdge\"\n      ]\n    },\n    {\n      \"name\": \"BPMNLabel\",\n      \"properties\": [\n        {\n          \"name\": \"labelStyle\",\n          \"type\": \"BPMNLabelStyle\",\n          \"isAttr\": true,\n          \"isReference\": true,\n          \"redefines\": \"di:DiagramElement#style\"\n        }\n      ],\n      \"superClass\": [\n        \"di:Label\"\n      ]\n    },\n    {\n      \"name\": \"BPMNLabelStyle\",\n      \"properties\": [\n        {\n          \"name\": \"font\",\n          \"type\": \"dc:Font\"\n        }\n      ],\n      \"superClass\": [\n        \"di:Style\"\n      ]\n    }\n  ],\n  \"emumerations\": [\n    {\n      \"name\": \"ParticipantBandKind\",\n      \"literalValues\": [\n        {\n          \"name\": \"top_initiating\"\n        },\n        {\n          \"name\": \"middle_initiating\"\n        },\n        {\n          \"name\": \"bottom_initiating\"\n        },\n        {\n          \"name\": \"top_non_initiating\"\n        },\n        {\n          \"name\": \"middle_non_initiating\"\n        },\n        {\n          \"name\": \"bottom_non_initiating\"\n        }\n      ]\n    },\n    {\n      \"name\": \"MessageVisibleKind\",\n      \"literalValues\": [\n        {\n          \"name\": \"initiating\"\n        },\n        {\n          \"name\": \"non_initiating\"\n        }\n      ]\n    }\n  ],\n  \"associations\": [],\n  \"prefix\": \"bpmndi\"\n}","module.exports={\n  \"name\": \"DC\",\n  \"uri\": \"http://www.omg.org/spec/DD/20100524/DC\",\n  \"types\": [\n    {\n      \"name\": \"Boolean\"\n    },\n    {\n      \"name\": \"Integer\"\n    },\n    {\n      \"name\": \"Real\"\n    },\n    {\n      \"name\": \"String\"\n    },\n    {\n      \"name\": \"Font\",\n      \"properties\": [\n        {\n          \"name\": \"name\",\n          \"type\": \"String\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"size\",\n          \"type\": \"Real\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"isBold\",\n          \"type\": \"Boolean\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"isItalic\",\n          \"type\": \"Boolean\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"isUnderline\",\n          \"type\": \"Boolean\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"isStrikeThrough\",\n          \"type\": \"Boolean\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Point\",\n      \"properties\": [\n        {\n          \"name\": \"x\",\n          \"type\": \"Real\",\n          \"default\": \"0\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"y\",\n          \"type\": \"Real\",\n          \"default\": \"0\",\n          \"isAttr\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Bounds\",\n      \"properties\": [\n        {\n          \"name\": \"x\",\n          \"type\": \"Real\",\n          \"default\": \"0\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"y\",\n          \"type\": \"Real\",\n          \"default\": \"0\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"width\",\n          \"type\": \"Real\",\n          \"isAttr\": true\n        },\n        {\n          \"name\": \"height\",\n          \"type\": \"Real\",\n          \"isAttr\": true\n        }\n      ]\n    }\n  ],\n  \"prefix\": \"dc\",\n  \"associations\": []\n}","module.exports={\n  \"name\": \"DI\",\n  \"uri\": \"http://www.omg.org/spec/DD/20100524/DI\",\n  \"types\": [\n    {\n      \"name\": \"DiagramElement\",\n      \"isAbstract\": true,\n      \"properties\": [\n        {\n          \"name\": \"extension\",\n          \"type\": \"Extension\"\n        },\n        {\n          \"name\": \"owningDiagram\",\n          \"type\": \"Diagram\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"owningElement\",\n          \"type\": \"DiagramElement\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"modelElement\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isReference\": true,\n          \"type\": \"Element\"\n        },\n        {\n          \"name\": \"style\",\n          \"type\": \"Style\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"ownedElement\",\n          \"type\": \"DiagramElement\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Node\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"DiagramElement\"\n      ]\n    },\n    {\n      \"name\": \"Edge\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"DiagramElement\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"source\",\n          \"type\": \"DiagramElement\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"target\",\n          \"type\": \"DiagramElement\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isReference\": true\n        },\n        {\n          \"name\": \"waypoint\",\n          \"isUnique\": false,\n          \"isMany\": true,\n          \"type\": \"dc:Point\",\n          \"serialize\": \"xsi:type\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Diagram\",\n      \"isAbstract\": true,\n      \"properties\": [\n        {\n          \"name\": \"rootElement\",\n          \"type\": \"DiagramElement\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true\n        },\n        {\n          \"name\": \"name\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"documentation\",\n          \"isAttr\": true,\n          \"type\": \"String\"\n        },\n        {\n          \"name\": \"resolution\",\n          \"isAttr\": true,\n          \"type\": \"Real\"\n        },\n        {\n          \"name\": \"ownedStyle\",\n          \"type\": \"Style\",\n          \"isReadOnly\": true,\n          \"isVirtual\": true,\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Shape\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Node\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"bounds\",\n          \"type\": \"dc:Bounds\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Plane\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Node\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"planeElement\",\n          \"type\": \"DiagramElement\",\n          \"subsettedProperty\": \"DiagramElement-ownedElement\",\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"LabeledEdge\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Edge\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"ownedLabel\",\n          \"type\": \"Label\",\n          \"isReadOnly\": true,\n          \"subsettedProperty\": \"DiagramElement-ownedElement\",\n          \"isVirtual\": true,\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"LabeledShape\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Shape\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"ownedLabel\",\n          \"type\": \"Label\",\n          \"isReadOnly\": true,\n          \"subsettedProperty\": \"DiagramElement-ownedElement\",\n          \"isVirtual\": true,\n          \"isMany\": true\n        }\n      ]\n    },\n    {\n      \"name\": \"Label\",\n      \"isAbstract\": true,\n      \"superClass\": [\n        \"Node\"\n      ],\n      \"properties\": [\n        {\n          \"name\": \"bounds\",\n          \"type\": \"dc:Bounds\"\n        }\n      ]\n    },\n    {\n      \"name\": \"Style\",\n      \"isAbstract\": true\n    },\n    {\n      \"name\": \"Extension\",\n      \"properties\": [\n        {\n          \"name\": \"values\",\n          \"type\": \"Element\",\n          \"isMany\": true\n        }\n      ]\n    }\n  ],\n  \"associations\": [],\n  \"prefix\": \"di\",\n  \"xml\": {\n    \"tagAlias\": \"lowerCase\"\n  }\n}","module.exports = {\n  __depends__: [ require(103) ],\n  __init__: [ 'directEditing' ],\n  directEditing: [ 'type', require(71) ]\n};","'use strict';\n\nvar bind = require(213),\n    find = require(203);\n\nvar TextBox = require(72);\n\n\n/**\n * A direct editing component that allows users\n * to edit an elements text directly in the diagram\n *\n * @param {EventBus} eventBus the event bus\n */\nfunction DirectEditing(eventBus, canvas) {\n\n  this._eventBus = eventBus;\n\n  this._providers = [];\n  this._textbox = new TextBox({\n    container: canvas.getContainer(),\n    keyHandler: bind(this._handleKey, this)\n  });\n}\n\nDirectEditing.$inject = [ 'eventBus', 'canvas' ];\n\n\n/**\n * Register a direct editing provider\n\n * @param {Object} provider the provider, must expose an #activate(element) method that returns\n *                          an activation context ({ bounds: {x, y, width, height }, text }) if\n *                          direct editing is available for the given element.\n *                          Additionally the provider must expose a #update(element, value) method\n *                          to receive direct editing updates.\n */\nDirectEditing.prototype.registerProvider = function(provider) {\n  this._providers.push(provider);\n};\n\n\n/**\n * Returns true if direct editing is currently active\n *\n * @return {Boolean}\n */\nDirectEditing.prototype.isActive = function() {\n  return !!this._active;\n};\n\n\n/**\n * Cancel direct editing, if it is currently active\n */\nDirectEditing.prototype.cancel = function() {\n  if (!this._active) {\n    return;\n  }\n\n  this._fire('cancel');\n  this.close();\n};\n\n\nDirectEditing.prototype._fire = function(event) {\n  this._eventBus.fire('directEditing.' + event, { active: this._active });\n};\n\nDirectEditing.prototype.close = function() {\n  this._textbox.destroy();\n\n  this._fire('deactivate');\n\n  this._active = null;\n};\n\n\nDirectEditing.prototype.complete = function() {\n\n  var active = this._active;\n\n  if (!active) {\n    return;\n  }\n\n  var text = this.getValue();\n\n  if (text !== active.context.text) {\n    active.provider.update(active.element, text, active.context.text);\n  }\n\n  this._fire('complete');\n\n  this.close();\n};\n\n\nDirectEditing.prototype.getValue = function() {\n  return this._textbox.getValue();\n};\n\n\nDirectEditing.prototype._handleKey = function(e) {\n\n  // stop bubble\n  e.stopPropagation();\n\n  var key = e.keyCode || e.charCode;\n\n  // ESC\n  if (key === 27) {\n    e.preventDefault();\n    return this.cancel();\n  }\n\n  // Enter\n  if (key === 13 && !e.shiftKey) {\n    e.preventDefault();\n    return this.complete();\n  }\n};\n\n\n/**\n * Activate direct editing on the given element\n *\n * @param {Object} ElementDescriptor the descriptor for a shape or connection\n * @return {Boolean} true if the activation was possible\n */\nDirectEditing.prototype.activate = function(element) {\n\n  if (this.isActive()) {\n    this.cancel();\n  }\n\n  // the direct editing context\n  var context;\n\n  var provider = find(this._providers, function(p) {\n    return !!(context = p.activate(element)) ? p : null;\n  });\n\n  // check if activation took place\n  if (context) {\n    this._textbox.create(context.bounds, context.style, context.text);\n\n    this._active = {\n      element: element,\n      context: context,\n      provider: provider\n    };\n\n    this._fire('activate');\n  }\n\n  return !!context;\n};\n\n\nmodule.exports = DirectEditing;","'use strict';\n\nvar assign = require(325),\n    domEvent = require(344),\n    domRemove = require(347);\n\nfunction stopPropagation(event) {\n  event.stopPropagation();\n}\n\nfunction TextBox(options) {\n\n  this.container = options.container;\n  this.textarea = document.createElement('textarea');\n\n  this.keyHandler = options.keyHandler || function() {};\n}\n\nmodule.exports = TextBox;\n\n\nTextBox.prototype.create = function(bounds, style, value) {\n\n  var textarea = this.textarea,\n      container = this.container;\n\n  assign(textarea.style, {\n    width: bounds.width + 'px',\n    height: bounds.height + 'px',\n    left: bounds.x + 'px',\n    top: bounds.y + 'px',\n    position: 'absolute',\n    textAlign: 'center',\n    boxSizing: 'border-box'\n  }, style || {});\n\n  textarea.value = value;\n  textarea.title = 'Press SHIFT+Enter for line feed';\n\n  domEvent.bind(textarea, 'keydown', this.keyHandler);\n  domEvent.bind(textarea, 'mousedown', stopPropagation);\n\n  container.appendChild(textarea);\n\n  setTimeout(function() {\n    textarea.select();\n    textarea.focus();\n  }, 100);\n};\n\nTextBox.prototype.destroy = function() {\n  var textarea = this.textarea;\n\n  textarea.value = '';\n\n  domEvent.unbind(textarea, 'keydown', this.keyHandler);\n  domEvent.unbind(textarea, 'mousedown', stopPropagation);\n\n  domRemove(textarea);\n};\n\nTextBox.prototype.getValue = function() {\n  return this.textarea.value;\n};","module.exports = require(74);","'use strict';\n\nvar di = require(190);\n\n\n/**\n * Bootstrap an injector from a list of modules, instantiating a number of default components\n *\n * @ignore\n * @param {Array<didi.Module>} bootstrapModules\n *\n * @return {didi.Injector} a injector to use to access the components\n */\nfunction bootstrap(bootstrapModules) {\n\n  var modules = [],\n      components = [];\n\n  function hasModule(m) {\n    return modules.indexOf(m) >= 0;\n  }\n\n  function addModule(m) {\n    modules.push(m);\n  }\n\n  function visit(m) {\n    if (hasModule(m)) {\n      return;\n    }\n\n    (m.__depends__ || []).forEach(visit);\n\n    if (hasModule(m)) {\n      return;\n    }\n\n    addModule(m);\n\n    (m.__init__ || []).forEach(function(c) {\n      components.push(c);\n    });\n  }\n\n  bootstrapModules.forEach(visit);\n\n  var injector = new di.Injector(modules);\n\n  components.forEach(function(c) {\n\n    try {\n      // eagerly resolve component (fn or string)\n      injector[typeof c === 'string' ? 'get' : 'invoke'](c);\n    } catch (e) {\n      console.error('Failed to instantiate component');\n      console.error(e.stack);\n\n      throw e;\n    }\n  });\n\n  return injector;\n}\n\n/**\n * Creates an injector from passed options.\n *\n * @ignore\n * @param  {Object} options\n * @return {didi.Injector}\n */\nfunction createInjector(options) {\n\n  options = options || {};\n\n  var configModule = {\n    'config': ['value', options]\n  };\n\n  var coreModule = require(83);\n\n  var modules = [ configModule, coreModule ].concat(options.modules || []);\n\n  return bootstrap(modules);\n}\n\n\n/**\n * The main diagram-js entry point that bootstraps the diagram with the given\n * configuration.\n *\n * To register extensions with the diagram, pass them as Array<didi.Module> to the constructor.\n *\n * @class djs.Diagram\n * @memberOf djs\n * @constructor\n *\n * @example\n *\n * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>\n *\n * // plug-in implemenentation\n * function MyLoggingPlugin(eventBus) {\n *   eventBus.on('shape.added', function(event) {\n *     console.log('shape ', event.shape, ' was added to the diagram');\n *   });\n * }\n *\n * // export as module\n * module.exports = {\n *   __init__: [ 'myLoggingPlugin' ],\n *     myLoggingPlugin: [ 'type', MyLoggingPlugin ]\n * };\n *\n *\n * // instantiate the diagram with the new plug-in\n *\n * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ] });\n *\n * diagram.invoke([ 'canvas', function(canvas) {\n *   // add shape to drawing canvas\n *   canvas.addShape({ x: 10, y: 10 });\n * });\n *\n * // 'shape ... was added to the diagram' logged to console\n *\n * @param {Object} options\n * @param {Array<didi.Module>} [options.modules] external modules to instantiate with the diagram\n * @param {didi.Injector} [injector] an (optional) injector to bootstrap the diagram with\n */\nfunction Diagram(options, injector) {\n\n  // create injector unless explicitly specified\n  this.injector = injector = injector || createInjector(options);\n\n  // API\n\n  /**\n   * Resolves a diagram service\n   *\n   * @method Diagram#get\n   *\n   * @param {String} name the name of the diagram service to be retrieved\n   * @param {Object} [locals] a number of locals to use to resolve certain dependencies\n   */\n  this.get = injector.get;\n\n  /**\n   * Executes a function into which diagram services are injected\n   *\n   * @method Diagram#invoke\n   *\n   * @param {Function|Object[]} fn the function to resolve\n   * @param {Object} locals a number of locals to use to resolve certain dependencies\n   */\n  this.invoke = injector.invoke;\n\n  // init\n\n  // indicate via event\n\n\n  /**\n   * An event indicating that all plug-ins are loaded.\n   *\n   * Use this event to fire other events to interested plug-ins\n   *\n   * @memberOf Diagram\n   *\n   * @event diagram.init\n   *\n   * @example\n   *\n   * eventBus.on('diagram.init', function() {\n   *   eventBus.fire('my-custom-event', { foo: 'BAR' });\n   * });\n   *\n   * @type {Object}\n   */\n  this.get('eventBus').fire('diagram.init');\n}\n\nmodule.exports = Diagram;\n\n\n/**\n * Destroys the diagram\n *\n * @method  Diagram#destroy\n */\nDiagram.prototype.destroy = function() {\n  this.get('eventBus').fire('diagram.destroy');\n};","'use strict';\n\nvar forEach = require(204),\n    isFunction = require(317),\n    isArray = require(316);\n\n\n/**\n * A utility that can be used to plug-in into the command execution for\n * extension and/or validation.\n *\n * @param {EventBus} eventBus\n *\n * @example\n *\n * var inherits = require('inherits');\n *\n * var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');\n *\n * function CommandLogger(eventBus) {\n *   CommandInterceptor.call(this, eventBus);\n *\n *   this.preExecute(function(event) {\n *     console.log('command pre-execute', event);\n *   });\n * }\n *\n * inherits(CommandLogger, CommandInterceptor);\n *\n */\nfunction CommandInterceptor(eventBus) {\n  this._eventBus = eventBus;\n}\n\nCommandInterceptor.$inject = [ 'eventBus' ];\n\nmodule.exports = CommandInterceptor;\n\nfunction unwrapEvent(fn) {\n  return function(event) {\n    return fn(event.context, event.command, event);\n  };\n}\n\n/**\n * Register an interceptor for a command execution\n *\n * @param  {String|Array<String>} [events] list of commands to register on\n * @param  {String} [hook] command hook, i.e. preExecute, executed to listen on\n * @param  {Function} handlerFn interceptor to be invoked with (event)\n * @param  {Boolean} unwrap if true, unwrap the event and pass (context, command, event) to the\n *                          listener instead\n */\nCommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {\n\n  if (isFunction(hook)) {\n    unwrap = handlerFn;\n    handlerFn = hook;\n    hook = null;\n  }\n\n  if (!isFunction(handlerFn)) {\n    throw new Error('handlerFn must be a function');\n  }\n\n  if (!isArray(events)) {\n    events = [ events ];\n  }\n\n  var eventBus = this._eventBus;\n\n  forEach(events, function(event) {\n    // concat commandStack(.event)?(.hook)?\n    var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');\n\n    eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);\n  });\n};\n\n\nvar hooks = [\n  'canExecute',\n  'preExecute',\n  'execute',\n  'executed',\n  'postExecute',\n  'revert',\n  'reverted'\n];\n\n/*\n * Install hook shortcuts\n *\n * This will generate the CommandInterceptor#(preExecute|...|reverted) methods\n * which will in term forward to CommandInterceptor#on.\n */\nforEach(hooks, function(hook) {\n  CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {\n    if (isFunction(events)) {\n      unwrap = fn;\n      fn = events;\n      events = null;\n    }\n\n    this.on(events, hook, fn, unwrap);\n  };\n});","'use strict';\n\nvar unique = require(199),\n    isArray = require(316),\n    assign = require(325);\n\nvar InternalEvent = require(81).Event;\n\n\n/**\n * A service that offers un- and redoable execution of commands.\n *\n * The command stack is responsible for executing modeling actions\n * in a un- and redoable manner. To do this it delegates the actual\n * command execution to {@link CommandHandler}s.\n *\n * Command handlers provide {@link CommandHandler#execute(ctx)} and\n * {@link CommandHandler#revert(ctx)} methods to un- and redo a command\n * identified by a command context.\n *\n *\n * ## Life-Cycle events\n *\n * In the process the command stack fires a number of life-cycle events\n * that other components to participate in the command execution.\n *\n *    * preExecute\n *    * execute\n *    * executed\n *    * postExecute\n *    * revert\n *    * reverted\n *\n * A special event is used for validating, whether a command can be\n * performed prior to its execution.\n *\n *    * canExecute\n *\n * Each of the events is fired as `commandStack.{eventName}` and\n * `commandStack.{commandName}.{eventName}`, respectively. This gives\n * components fine grained control on where to hook into.\n *\n * The event object fired transports `command`, the name of the\n * command and `context`, the command context.\n *\n *\n * ## Creating Command Handlers\n *\n * Command handlers should provide the {@link CommandHandler#execute(ctx)}\n * and {@link CommandHandler#revert(ctx)} methods to implement\n * redoing and undoing of a command. They must ensure undo is performed\n * properly in order not to break the undo chain.\n *\n * Command handlers may execute other modeling operations (and thus\n * commands) in their `preExecute` and `postExecute` phases. The command\n * stack will properly group all commands together into a logical unit\n * that may be re- and undone atomically.\n *\n * Command handlers must not execute other commands from within their\n * core implementation (`execute`, `revert`).\n *\n *\n * ## Change Tracking\n *\n * During the execution of the CommandStack it will keep track of all\n * elements that have been touched during the command's execution.\n *\n * At the end of the CommandStack execution it will notify interested\n * components via an 'elements.changed' event with all the dirty\n * elements.\n *\n * The event can be picked up by components that are interested in the fact\n * that elements have been changed. One use case for this is updating\n * their graphical representation after moving / resizing or deletion.\n *\n *\n * @param {EventBus} eventBus\n * @param {Injector} injector\n */\nfunction CommandStack(eventBus, injector) {\n\n  /**\n   * A map of all registered command handlers.\n   *\n   * @type {Object}\n   */\n  this._handlerMap = {};\n\n  /**\n   * A stack containing all re/undoable actions on the diagram\n   *\n   * @type {Array<Object>}\n   */\n  this._stack = [];\n\n  /**\n   * The current index on the stack\n   *\n   * @type {Number}\n   */\n  this._stackIdx = -1;\n\n  /**\n   * Current active commandStack execution\n   *\n   * @type {Object}\n   */\n  this._currentExecution = {\n    actions: [],\n    dirty: []\n  };\n\n\n  this._injector = injector;\n  this._eventBus = eventBus;\n\n  this._uid = 1;\n}\n\nCommandStack.$inject = [ 'eventBus', 'injector' ];\n\nmodule.exports = CommandStack;\n\n\n/**\n * Execute a command\n *\n * @param {String} command the command to execute\n * @param {Object} context the environment to execute the command in\n */\nCommandStack.prototype.execute = function(command, context) {\n  if (!command) {\n    throw new Error('command required');\n  }\n\n  var action = { command: command, context: context };\n\n  this._pushAction(action);\n  this._internalExecute(action);\n  this._popAction(action);\n};\n\n\n/**\n * Ask whether a given command can be executed.\n *\n * Implementors may hook into the mechanism on two ways:\n *\n *   * in event listeners:\n *\n *     Users may prevent the execution via an event listener.\n *     It must prevent the default action for `commandStack.(<command>.)canExecute` events.\n *\n *   * in command handlers:\n *\n *     If the method {@link CommandHandler#canExecute} is implemented in a handler\n *     it will be called to figure out whether the execution is allowed.\n *\n * @param  {String} command the command to execute\n * @param  {Object} context the environment to execute the command in\n *\n * @return {Boolean} true if the command can be executed\n */\nCommandStack.prototype.canExecute = function(command, context) {\n\n  var action = { command: command, context: context };\n\n  var handler = this._getHandler(command);\n\n  if (!handler) {\n    return false;\n  }\n\n  var result = this._fire(command, 'canExecute', action);\n\n  // handler#canExecute will only be called if no listener\n  // decided on a result already\n  if (result === undefined && handler.canExecute) {\n    result = handler.canExecute(context);\n  }\n\n  return result;\n};\n\n\n/**\n * Clear the command stack, erasing all undo / redo history\n */\nCommandStack.prototype.clear = function() {\n  this._stack.length = 0;\n  this._stackIdx = -1;\n\n  this._fire('changed');\n};\n\n\n/**\n * Undo last command(s)\n */\nCommandStack.prototype.undo = function() {\n  var action = this._getUndoAction(),\n      next;\n\n  if (action) {\n    this._pushAction(action);\n\n    while (action) {\n      this._internalUndo(action);\n      next = this._getUndoAction();\n\n      if (!next || next.id !== action.id) {\n        break;\n      }\n\n      action = next;\n    }\n\n    this._popAction();\n  }\n};\n\n\n/**\n * Redo last command(s)\n */\nCommandStack.prototype.redo = function() {\n  var action = this._getRedoAction(),\n      next;\n\n  if (action) {\n    this._pushAction(action);\n\n    while (action) {\n      this._internalExecute(action, true);\n      next = this._getRedoAction();\n\n      if (!next || next.id !== action.id) {\n        break;\n      }\n\n      action = next;\n    }\n\n    this._popAction();\n  }\n};\n\n\n/**\n * Register a handler instance with the command stack\n *\n * @param {String} command\n * @param {CommandHandler} handler\n */\nCommandStack.prototype.register = function(command, handler) {\n  this._setHandler(command, handler);\n};\n\n\n/**\n * Register a handler type with the command stack\n * by instantiating it and injecting its dependencies.\n *\n * @param {String} command\n * @param {Function} a constructor for a {@link CommandHandler}\n */\nCommandStack.prototype.registerHandler = function(command, handlerCls) {\n\n  if (!command || !handlerCls) {\n    throw new Error('command and handlerCls must be defined');\n  }\n\n  var handler = this._injector.instantiate(handlerCls);\n  this.register(command, handler);\n};\n\nCommandStack.prototype.canUndo = function() {\n  return !!this._getUndoAction();\n};\n\nCommandStack.prototype.canRedo = function() {\n  return !!this._getRedoAction();\n};\n\n////// stack access  //////////////////////////////////////\n\nCommandStack.prototype._getRedoAction = function() {\n  return this._stack[this._stackIdx + 1];\n};\n\n\nCommandStack.prototype._getUndoAction = function() {\n  return this._stack[this._stackIdx];\n};\n\n\n////// internal functionality /////////////////////////////\n\nCommandStack.prototype._internalUndo = function(action) {\n  var command = action.command,\n      context = action.context;\n\n  var handler = this._getHandler(command);\n\n  this._fire(command, 'revert', action);\n\n  this._markDirty(handler.revert(context));\n\n  this._revertedAction(action);\n\n  this._fire(command, 'reverted', action);\n};\n\n\nCommandStack.prototype._fire = function(command, qualifier, event) {\n  if (arguments.length < 3) {\n    event = qualifier;\n    qualifier = null;\n  }\n\n  var names = qualifier ? [ command + '.' + qualifier, qualifier ] : [ command ],\n      i, name, result;\n\n  event = assign(new InternalEvent(), event);\n\n  for (i = 0; !!(name = names[i]); i++) {\n    result = this._eventBus.fire('commandStack.' + name, event);\n\n    if (event.cancelBubble) {\n      break;\n    }\n  }\n\n  return result;\n};\n\nCommandStack.prototype._createId = function() {\n  return this._uid++;\n};\n\n\nCommandStack.prototype._internalExecute = function(action, redo) {\n  var command = action.command,\n      context = action.context;\n\n  var handler = this._getHandler(command);\n\n  if (!handler) {\n    throw new Error('no command handler registered for <' + command + '>');\n  }\n\n  this._pushAction(action);\n\n  if (!redo) {\n    this._fire(command, 'preExecute', action);\n\n    if (handler.preExecute) {\n      handler.preExecute(context);\n    }\n  }\n\n  this._fire(command, 'execute', action);\n\n  // execute\n  this._markDirty(handler.execute(context));\n\n  // log to stack\n  this._executedAction(action, redo);\n\n  this._fire(command, 'executed', action);\n\n  if (!redo) {\n    if (handler.postExecute) {\n      handler.postExecute(context);\n    }\n\n    this._fire(command, 'postExecute', action);\n  }\n\n  this._popAction(action);\n};\n\n\nCommandStack.prototype._pushAction = function(action) {\n\n  var execution = this._currentExecution,\n      actions = execution.actions;\n\n  var baseAction = actions[0];\n\n  if (!action.id) {\n    action.id = (baseAction && baseAction.id) || this._createId();\n  }\n\n  actions.push(action);\n};\n\n\nCommandStack.prototype._popAction = function() {\n  var execution = this._currentExecution,\n      actions = execution.actions,\n      dirty = execution.dirty;\n\n  actions.pop();\n\n  if (!actions.length) {\n    this._eventBus.fire('elements.changed', { elements: unique(dirty) });\n\n    dirty.length = 0;\n\n    this._fire('changed');\n  }\n};\n\n\nCommandStack.prototype._markDirty = function(elements) {\n  var execution = this._currentExecution;\n\n  if (!elements) {\n    return;\n  }\n\n  elements = isArray(elements) ? elements : [ elements ];\n\n  execution.dirty = execution.dirty.concat(elements);\n};\n\n\nCommandStack.prototype._executedAction = function(action, redo) {\n  var stackIdx = ++this._stackIdx;\n\n  if (!redo) {\n    this._stack.splice(stackIdx, this._stack.length, action);\n  }\n};\n\n\nCommandStack.prototype._revertedAction = function(action) {\n  this._stackIdx--;\n};\n\n\nCommandStack.prototype._getHandler = function(command) {\n  return this._handlerMap[command];\n};\n\nCommandStack.prototype._setHandler = function(command, handler) {\n  if (!command || !handler) {\n    throw new Error('command and handler required');\n  }\n\n  if (this._handlerMap[command]) {\n    throw new Error('overriding handler for command <' + command + '>');\n  }\n\n  this._handlerMap[command] = handler;\n};\n","module.exports = {\n  __depends__: [ require(83) ],\n  commandStack: [ 'type', require(76) ]\n};","'use strict';\n\nvar isNumber = require(319),\n    assign = require(325),\n    forEach = require(204);\n\nvar Collections = require(175);\n\nvar Snap = require(188);\n\nfunction round(number, resolution) {\n  return Math.round(number * resolution) / resolution;\n}\n\nfunction ensurePx(number) {\n  return isNumber(number) ? number + 'px' : number;\n}\n\n/**\n * Creates a HTML container element for a SVG element with\n * the given configuration\n *\n * @param  {Object} options\n * @return {HTMLElement} the container element\n */\nfunction createContainer(options) {\n\n  options = assign({}, { width: '100%', height: '100%' }, options);\n\n  var container = options.container || document.body;\n\n  // create a <div> around the svg element with the respective size\n  // this way we can always get the correct container size\n  // (this is impossible for <svg> elements at the moment)\n  var parent = document.createElement('div');\n  parent.setAttribute('class', 'djs-container');\n\n  assign(parent.style, {\n    position: 'relative',\n    overflow: 'hidden',\n    width: ensurePx(options.width),\n    height: ensurePx(options.height)\n  });\n\n  container.appendChild(parent);\n\n  return parent;\n}\n\nfunction createGroup(parent, cls) {\n  return parent.group().attr({ 'class' : cls });\n}\n\nvar BASE_LAYER = 'base';\n\n\n/**\n * The main drawing canvas.\n *\n * @class\n * @constructor\n *\n * @emits Canvas#canvas.init\n *\n * @param {Object} config\n * @param {EventBus} eventBus\n * @param {GraphicsFactory} graphicsFactory\n * @param {ElementRegistry} elementRegistry\n */\nfunction Canvas(config, eventBus, graphicsFactory, elementRegistry) {\n  this._eventBus = eventBus;\n  this._elementRegistry = elementRegistry;\n  this._graphicsFactory = graphicsFactory;\n\n  this._init(config || {});\n}\n\nCanvas.$inject = [ 'config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry' ];\n\nmodule.exports = Canvas;\n\n\nCanvas.prototype._init = function(config) {\n\n  // Creates a <svg> element that is wrapped into a <div>.\n  // This way we are always able to correctly figure out the size of the svg element\n  // by querying the parent node.\n  //\n  // (It is not possible to get the size of a svg element cross browser @ 2014-04-01)\n  //\n  // <div class=\"djs-container\" style=\"width: {desired-width}, height: {desired-height}\">\n  //   <svg width=\"100%\" height=\"100%\">\n  //    ...\n  //   </svg>\n  // </div>\n\n  // html container\n  var eventBus = this._eventBus,\n\n      container = createContainer(config),\n      svg = Snap.createSnapAt('100%', '100%', container),\n      viewport = createGroup(svg, 'viewport'),\n\n      self = this;\n\n  this._container = container;\n  this._svg = svg;\n  this._viewport = viewport;\n  this._layers = {};\n\n  eventBus.on('diagram.init', function(event) {\n\n    /**\n     * An event indicating that the canvas is ready to be drawn on.\n     *\n     * @memberOf Canvas\n     *\n     * @event canvas.init\n     *\n     * @type {Object}\n     * @property {Snap<SVGSVGElement>} svg the created svg element\n     * @property {Snap<SVGGroup>} viewport the direct parent of diagram elements and shapes\n     */\n    eventBus.fire('canvas.init', { svg: svg, viewport: viewport });\n  });\n\n  eventBus.on('diagram.destroy', function() {\n\n    var parent = self._container.parentNode;\n\n    if (parent) {\n      parent.removeChild(container);\n    }\n\n    eventBus.fire('canvas.destroy', { svg: self._svg, viewport: self._viewport });\n\n    self._svg.remove();\n\n    self._svg = self._container = self._layers = self._viewport = null;\n  });\n\n};\n\n/**\n * Returns the default layer on which\n * all elements are drawn.\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getDefaultLayer = function() {\n  return this.getLayer(BASE_LAYER);\n};\n\n/**\n * Returns a layer that is used to draw elements\n * or annotations on it.\n *\n * @param  {String} name\n *\n * @returns {Snap<SVGGroup>}\n */\nCanvas.prototype.getLayer = function(name) {\n\n  if (!name) {\n    throw new Error('must specify a name');\n  }\n\n  var layer = this._layers[name];\n  if (!layer) {\n    layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);\n  }\n\n  return layer;\n};\n\n\n/**\n * Returns the html element that encloses the\n * drawing canvas.\n *\n * @return {DOMNode}\n */\nCanvas.prototype.getContainer = function() {\n  return this._container;\n};\n\n\n/////////////// markers ///////////////////////////////////\n\nCanvas.prototype._updateMarker = function(element, marker, add) {\n  var container;\n\n  if (!element.id) {\n    element = this._elementRegistry.get(element);\n  }\n\n  // we need to access all\n  container = this._elementRegistry._elements[element.id];\n\n  if (!container) {\n    return;\n  }\n\n  forEach([ container.gfx, container.secondaryGfx ], function(gfx) {\n    if (gfx) {\n      // invoke either addClass or removeClass based on mode\n      gfx[add ? 'addClass' : 'removeClass'](marker);\n    }\n  });\n\n  /**\n   * An event indicating that a marker has been updated for an element\n   *\n   * @event element.marker.update\n   * @type {Object}\n   * @property {djs.model.Element} element the shape\n   * @property {Object} gfx the graphical representation of the shape\n   * @property {String} marker\n   * @property {Boolean} add true if the marker was added, false if it got removed\n   */\n  this._eventBus.fire('element.marker.update', { element: element, gfx: container.gfx, marker: marker, add: !!add });\n};\n\n\n/**\n * Adds a marker to an element (basically a css class).\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @example\n * canvas.addMarker('foo', 'some-marker');\n *\n * var fooGfx = canvas.getGraphics('foo');\n *\n * fooGfx; // <g class=\"... some-marker\"> ... </g>\n *\n * @param {String|djs.model.Base} element\n * @param {String} marker\n */\nCanvas.prototype.addMarker = function(element, marker) {\n  this._updateMarker(element, marker, true);\n};\n\n\n/**\n * Remove a marker from an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param  {String|djs.model.Base} element\n * @param  {String} marker\n */\nCanvas.prototype.removeMarker = function(element, marker) {\n  this._updateMarker(element, marker, false);\n};\n\n/**\n * Check the existence of a marker on element.\n *\n * @param  {String|djs.model.Base} element\n * @param  {String} marker\n */\nCanvas.prototype.hasMarker = function(element, marker) {\n  if (!element.id) {\n    element = this._elementRegistry.get(element);\n  }\n\n  var gfx = this.getGraphics(element);\n\n  return gfx && gfx.hasClass(marker);\n};\n\n/**\n * Toggles a marker on an element.\n *\n * Fires the element.marker.update event, making it possible to\n * integrate extension into the marker life-cycle, too.\n *\n * @param  {String|djs.model.Base} element\n * @param  {String} marker\n */\nCanvas.prototype.toggleMarker = function(element, marker) {\n  if(this.hasMarker(element, marker)) {\n    this.removeMarker(element, marker);\n  } else {\n    this.addMarker(element, marker);\n  }\n};\n\nCanvas.prototype.getRootElement = function() {\n  if (!this._rootElement) {\n    this.setRootElement({ id: '__implicitroot' });\n  }\n\n  return this._rootElement;\n};\n\n\n\n//////////////// root element handling ///////////////////////////\n\n/**\n * Sets a given element as the new root element for the canvas\n * and returns the new root element.\n *\n * @param {Object|djs.model.Root} element\n * @param {Boolean} [override] whether to override the current root element, if any\n *\n * @return {Object|djs.model.Root} new root element\n */\nCanvas.prototype.setRootElement = function(element, override) {\n\n  this._ensureValidId(element);\n\n  var oldRoot = this._rootElement,\n      elementRegistry = this._elementRegistry,\n      eventBus = this._eventBus;\n\n  if (oldRoot) {\n    if (!override) {\n      throw new Error('rootElement already set, need to specify override');\n    }\n\n    // simulate element remove event sequence\n    eventBus.fire('root.remove', { element: oldRoot });\n    eventBus.fire('root.removed', { element: oldRoot });\n\n    elementRegistry.remove(oldRoot);\n  }\n\n  var gfx = this.getDefaultLayer();\n\n  // resemble element add event sequence\n  eventBus.fire('root.add', { element: element });\n\n  elementRegistry.add(element, gfx, this._svg);\n\n  eventBus.fire('root.added', { element: element, gfx: gfx });\n\n  this._rootElement = element;\n\n  return element;\n};\n\n\n\n///////////// add functionality ///////////////////////////////\n\nCanvas.prototype._ensureValidId = function(element) {\n  if (!element.id) {\n    throw new Error('element must have an id');\n  }\n\n  if (this._elementRegistry.get(element.id)) {\n    throw new Error('element with id ' + element.id + ' already exists');\n  }\n};\n\nCanvas.prototype._setParent = function(element, parent) {\n  Collections.add(parent.children, element);\n  element.parent = parent;\n};\n\n/**\n * Adds an element to the canvas.\n *\n * This wires the parent <-> child relationship between the element and\n * a explicitly specified parent or an implicit root element.\n *\n * During add it emits the events\n *\n *  * <{type}.add> (element, parent)\n *  * <{type}.added> (element, gfx)\n *\n * Extensions may hook into these events to perform their magic.\n *\n * @param {String} type\n * @param {Object|djs.model.Base} element\n * @param {Object|djs.model.Base} [parent]\n *\n * @return {Object|djs.model.Base} the added element\n */\nCanvas.prototype._addElement = function(type, element, parent) {\n\n  parent = parent || this.getRootElement();\n\n  var eventBus = this._eventBus,\n      graphicsFactory = this._graphicsFactory;\n\n  this._ensureValidId(element);\n\n  eventBus.fire(type + '.add', { element: element, parent: parent });\n\n  this._setParent(element, parent);\n\n  // create graphics\n  var gfx = graphicsFactory.create(type, element);\n\n  this._elementRegistry.add(element, gfx);\n\n  // update its visual\n  graphicsFactory.update(type, element, gfx);\n\n  eventBus.fire(type + '.added', { element: element, gfx: gfx });\n\n  return element;\n};\n\n/**\n * Adds a shape to the canvas\n *\n * @param {Object|djs.model.Shape} shape to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Shape} the added shape\n */\nCanvas.prototype.addShape = function(shape, parent) {\n  return this._addElement('shape', shape, parent);\n};\n\n/**\n * Adds a connection to the canvas\n *\n * @param {Object|djs.model.Connection} connection to add to the diagram\n * @param {djs.model.Base} [parent]\n *\n * @return {djs.model.Connection} the added connection\n */\nCanvas.prototype.addConnection = function(connection, parent) {\n  return this._addElement('connection', connection, parent);\n};\n\n\n/**\n * Internal remove element\n */\nCanvas.prototype._removeElement = function(element, type) {\n\n  var elementRegistry = this._elementRegistry,\n      graphicsFactory = this._graphicsFactory,\n      eventBus = this._eventBus;\n\n  element = elementRegistry.get(element.id || element);\n\n  if (!element) {\n    // element was removed already\n    return;\n  }\n\n  eventBus.fire(type + '.remove', { element: element });\n\n  graphicsFactory.remove(element);\n\n  // unset parent <-> child relationship\n  Collections.remove(element.parent && element.parent.children, element);\n  element.parent = null;\n\n  eventBus.fire(type + '.removed', { element: element });\n\n  elementRegistry.remove(element);\n\n  return element;\n};\n\n\n/**\n * Removes a shape from the canvas\n *\n * @param {String|djs.model.Shape} shape or shape id to be removed\n *\n * @return {djs.model.Shape} the removed shape\n */\nCanvas.prototype.removeShape = function(shape) {\n\n  /**\n   * An event indicating that a shape is about to be removed from the canvas.\n   *\n   * @memberOf Canvas\n   *\n   * @event shape.remove\n   * @type {Object}\n   * @property {djs.model.Shape} element the shape descriptor\n   * @property {Object} gfx the graphical representation of the shape\n   */\n\n  /**\n   * An event indicating that a shape has been removed from the canvas.\n   *\n   * @memberOf Canvas\n   *\n   * @event shape.removed\n   * @type {Object}\n   * @property {djs.model.Shape} element the shape descriptor\n   * @property {Object} gfx the graphical representation of the shape\n   */\n  return this._removeElement(shape, 'shape');\n};\n\n\n/**\n * Removes a connection from the canvas\n *\n * @param {String|djs.model.Connection} connection or connection id to be removed\n *\n * @return {djs.model.Connection} the removed connection\n */\nCanvas.prototype.removeConnection = function(connection) {\n\n  /**\n   * An event indicating that a connection is about to be removed from the canvas.\n   *\n   * @memberOf Canvas\n   *\n   * @event connection.remove\n   * @type {Object}\n   * @property {djs.model.Connection} element the connection descriptor\n   * @property {Object} gfx the graphical representation of the connection\n   */\n\n  /**\n   * An event indicating that a connection has been removed from the canvas.\n   *\n   * @memberOf Canvas\n   *\n   * @event connection.removed\n   * @type {Object}\n   * @property {djs.model.Connection} element the connection descriptor\n   * @property {Object} gfx the graphical representation of the connection\n   */\n  return this._removeElement(connection, 'connection');\n};\n\n\n/**\n * Sends a shape to the front.\n *\n * This method takes parent / child relationships between shapes into account\n * and makes sure that children are properly handled, too.\n *\n * @param {djs.model.Shape} shape descriptor of the shape to be sent to front\n * @param {boolean} [bubble=true] whether to send parent shapes to front, too\n */\nCanvas.prototype.sendToFront = function(shape, bubble) {\n\n  if (bubble !== false) {\n    bubble = true;\n  }\n\n  if (bubble && shape.parent) {\n    this.sendToFront(shape.parent);\n  }\n\n  forEach(shape.children, function(child) {\n    this.sendToFront(child, false);\n  }, this);\n\n  var gfx = this.getGraphics(shape),\n      gfxParent = gfx.parent();\n\n  gfx.remove().appendTo(gfxParent);\n};\n\n\n/**\n * Return the graphical object underlaying a certain diagram element\n *\n * @param {String|djs.model.Base} element descriptor of the element\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nCanvas.prototype.getGraphics = function(element, secondary) {\n  return this._elementRegistry.getGraphics(element, secondary);\n};\n\n\nCanvas.prototype._fireViewboxChange = function() {\n  this._eventBus.fire('canvas.viewbox.changed', { viewbox: this.viewbox(false) });\n};\n\n\n/**\n * Gets or sets the view box of the canvas, i.e. the area that is currently displayed\n *\n * @param  {Object} [box] the new view box to set\n * @param  {Number} box.x the top left X coordinate of the canvas visible in view box\n * @param  {Number} box.y the top left Y coordinate of the canvas visible in view box\n * @param  {Number} box.width the visible width\n * @param  {Number} box.height\n *\n * @example\n *\n * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })\n *\n * // sets the visible area of the diagram to (100|100) -> (600|100)\n * // and and scales it according to the diagram width\n *\n * @return {Object} the current view box\n */\nCanvas.prototype.viewbox = function(box) {\n\n  if (box === undefined && this._cachedViewbox) {\n    return this._cachedViewbox;\n  }\n\n  var viewport = this._viewport,\n      innerBox,\n      outerBox = this.getSize(),\n      matrix,\n      scale,\n      x, y;\n\n  if (!box) {\n    // compute the inner box based on the\n    // diagrams default layer. This allows us to exclude\n    // external components, such as overlays\n    innerBox = this.getDefaultLayer().getBBox(true);\n\n    matrix = viewport.transform().localMatrix;\n    scale = round(matrix.a, 1000);\n\n    x = round(-matrix.e || 0, 1000);\n    y = round(-matrix.f || 0, 1000);\n\n    box = this._cachedViewbox = {\n      x: x ? x / scale : 0,\n      y: y ? y / scale : 0,\n      width: outerBox.width / scale,\n      height: outerBox.height / scale,\n      scale: scale,\n      inner: {\n        width: innerBox.width,\n        height: innerBox.height,\n        x: innerBox.x,\n        y: innerBox.y\n      },\n      outer: outerBox\n    };\n\n    return box;\n  } else {\n    scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);\n\n    matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);\n    viewport.transform(matrix);\n\n    this._fireViewboxChange();\n  }\n\n  return box;\n};\n\n\n/**\n * Gets or sets the scroll of the canvas.\n *\n * @param {Object} [delta] the new scroll to apply.\n *\n * @param {Number} [delta.dx]\n * @param {Number} [delta.dy]\n */\nCanvas.prototype.scroll = function(delta) {\n\n  var node = this._viewport.node;\n  var matrix = node.getCTM();\n\n  if (delta) {\n    delta = assign({ dx: 0, dy: 0 }, delta || {});\n\n    matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);\n\n    setCTM(node, matrix);\n\n    this._fireViewboxChange();\n  }\n\n  return { x: matrix.e, y: matrix.f };\n};\n\n\n/**\n * Gets or sets the current zoom of the canvas, optionally zooming to the specified position.\n *\n * @param {String|Number} [newScale] the new zoom level, either a number, i.e. 0.9,\n *                                   or `fit-viewport` to adjust the size to fit the current viewport\n * @param {String|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom into mid or null\n *\n * @return {Number} the current scale\n */\nCanvas.prototype.zoom = function(newScale, center) {\n\n  if (newScale === 'fit-viewport') {\n    return this._fitViewport(center);\n  }\n\n  var vbox = this.viewbox();\n\n  if (newScale === undefined) {\n    return vbox.scale;\n  }\n\n  var outer = vbox.outer;\n\n  if (center === 'auto') {\n    center = {\n      x: outer.width / 2,\n      y: outer.height / 2\n    };\n  }\n\n  var matrix = this._setZoom(newScale, center);\n\n  this._fireViewboxChange();\n\n  return round(matrix.a, 1000);\n};\n\nfunction setCTM(node, m) {\n  var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';\n  node.setAttribute('transform', mstr);\n}\n\nCanvas.prototype._fitViewport = function(center) {\n\n  var vbox = this.viewbox(),\n      outer = vbox.outer,\n      inner = vbox.inner,\n      newScale,\n      newViewbox;\n\n  // display the complete diagram without zooming in.\n  // instead of relying on internal zoom, we perform a\n  // hard reset on the canvas viewbox to realize this\n  //\n  // if diagram does not need to be zoomed in, we focus it around\n  // the diagram origin instead\n\n  if (inner.x >= 0 &&\n      inner.y >= 0 &&\n      inner.x + inner.width <= outer.width &&\n      inner.y + inner.height <= outer.height &&\n      !center) {\n\n    newViewbox = {\n      x: 0,\n      y: 0,\n      width: Math.max(inner.width + inner.x, outer.width),\n      height: Math.max(inner.height + inner.y, outer.height)\n    };\n  } else {\n\n    newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);\n    newViewbox = {\n      x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),\n      y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),\n      width: outer.width / newScale,\n      height: outer.height / newScale\n    };\n  }\n\n  this.viewbox(newViewbox);\n\n  return this.viewbox().scale;\n};\n\n\nCanvas.prototype._setZoom = function(scale, center) {\n\n  var svg = this._svg.node,\n      viewport = this._viewport.node;\n\n  var matrix = svg.createSVGMatrix();\n  var point = svg.createSVGPoint();\n\n  var centerPoint,\n      originalPoint,\n      currentMatrix,\n      scaleMatrix,\n      newMatrix;\n\n  currentMatrix = viewport.getCTM();\n\n\n  var currentScale = currentMatrix.a;\n\n  if (center) {\n    centerPoint = assign(point, center);\n\n    // revert applied viewport transformations\n    originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());\n\n    // create scale matrix\n    scaleMatrix = matrix\n                    .translate(originalPoint.x, originalPoint.y)\n                    .scale(1 / currentScale * scale)\n                    .translate(-originalPoint.x, -originalPoint.y);\n\n    newMatrix = currentMatrix.multiply(scaleMatrix);\n  } else {\n    newMatrix = matrix.scale(scale);\n  }\n\n  setCTM(this._viewport.node, newMatrix);\n\n  return newMatrix;\n};\n\n\n/**\n * Returns the size of the canvas\n *\n * @return {Dimensions}\n */\nCanvas.prototype.getSize = function () {\n  return {\n    width: this._container.clientWidth,\n    height: this._container.clientHeight\n  };\n};\n\n\n/**\n * Return the absolute bounding box for the given element\n *\n * The absolute bounding box may be used to display overlays in the\n * callers (browser) coordinate system rather than the zoomed in/out\n * canvas coordinates.\n *\n * @param  {ElementDescriptor} element\n * @return {Bounds} the absolute bounding box\n */\nCanvas.prototype.getAbsoluteBBox = function(element) {\n  var vbox = this.viewbox();\n  var bbox;\n\n  // connection\n  // use svg bbox\n  if (element.waypoints) {\n    var gfx = this.getGraphics(element);\n\n    var transformBBox = gfx.getBBox(true);\n    bbox = gfx.getBBox();\n\n    bbox.x -= transformBBox.x;\n    bbox.y -= transformBBox.y;\n\n    bbox.width += 2 * transformBBox.x;\n    bbox.height +=  2 * transformBBox.y;\n  }\n  // shapes\n  // use data\n  else {\n    bbox = element;\n  }\n\n  var x = bbox.x * vbox.scale - vbox.x * vbox.scale;\n  var y = bbox.y * vbox.scale - vbox.y * vbox.scale;\n\n  var width = bbox.width * vbox.scale;\n  var height = bbox.height * vbox.scale;\n\n  return {\n    x: x,\n    y: y,\n    width: width,\n    height: height\n  };\n};\n","'use strict';\n\nvar Model = require(168);\n\n\n/**\n * A factory for diagram-js shapes\n */\nfunction ElementFactory() {\n  this._uid = 12;\n}\n\nmodule.exports = ElementFactory;\n\n\nElementFactory.prototype.createRoot = function(attrs) {\n  return this.create('root', attrs);\n};\n\nElementFactory.prototype.createLabel = function(attrs) {\n  return this.create('label', attrs);\n};\n\nElementFactory.prototype.createShape = function(attrs) {\n  return this.create('shape', attrs);\n};\n\nElementFactory.prototype.createConnection = function(attrs) {\n  return this.create('connection', attrs);\n};\n\n/**\n * Create a model element with the given type and\n * a number of pre-set attributes.\n *\n * @param  {String} type\n * @param  {Object} attrs\n * @return {djs.model.Base} the newly created model instance\n */\nElementFactory.prototype.create = function(type, attrs) {\n\n  attrs = attrs || {};\n\n  if (!attrs.id) {\n    attrs.id = type + '_' + (this._uid++);\n  }\n\n  return Model.create(type, attrs);\n};","'use strict';\n\nvar ELEMENT_ID = 'data-element-id';\n\n\n/**\n * @class\n *\n * A registry that keeps track of all shapes in the diagram.\n */\nfunction ElementRegistry() {\n  this._elements = {};\n}\n\nmodule.exports = ElementRegistry;\n\n/**\n * Register a pair of (element, gfx, (secondaryGfx)).\n *\n * @param {djs.model.Base} element\n * @param {Snap<SVGElement>} gfx\n * @param {Snap<SVGElement>} [secondaryGfx] optional other element to register, too\n */\nElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {\n\n  var id = element.id;\n\n  this._validateId(id);\n\n  // associate dom node with element\n  gfx.attr(ELEMENT_ID, id);\n\n  if (secondaryGfx) {\n    secondaryGfx.attr(ELEMENT_ID, id);\n  }\n\n  this._elements[id] = { element: element, gfx: gfx, secondaryGfx: secondaryGfx };\n};\n\n/**\n * Removes an element from the registry.\n *\n * @param {djs.model.Base} element\n */\nElementRegistry.prototype.remove = function(element) {\n  var elements = this._elements,\n      id = element.id || element,\n      container = id && elements[id];\n\n  if (container) {\n\n    // unset element id on gfx\n    container.gfx.attr(ELEMENT_ID, null);\n\n    if (container.secondaryGfx) {\n      container.secondaryGfx.attr(ELEMENT_ID, null);\n    }\n\n    delete elements[id];\n  }\n};\n\n/**\n * Update the id of an element\n *\n * @param {djs.model.Base} element\n * @param {String} newId\n */\nElementRegistry.prototype.updateId = function(element, newId) {\n\n  this._validateId(newId);\n\n  if (typeof element === 'string') {\n    element = this.get(element);\n  }\n\n  var gfx = this.getGraphics(element),\n      secondaryGfx = this.getGraphics(element, true);\n\n  this.remove(element);\n\n  element.id = newId;\n\n  this.add(element, gfx, secondaryGfx);\n};\n\n/**\n * Return the model element for a given id or graphics.\n *\n * @example\n *\n * elementRegistry.get('SomeElementId_1');\n * elementRegistry.get(gfx);\n *\n *\n * @param {String|SVGElement} filter for selecting the element\n *\n * @return {djs.model.Base}\n */\nElementRegistry.prototype.get = function(filter) {\n  var id;\n\n  if (typeof filter === 'string') {\n    id = filter;\n  } else {\n    id = filter && filter.attr(ELEMENT_ID);\n  }\n\n  var container = this._elements[id];\n  return container && container.element;\n};\n\n/**\n * Return all elements that match a given filter function.\n *\n * @param {Function} fn\n *\n * @return {Array<djs.model.Base>}\n */\nElementRegistry.prototype.filter = function(fn) {\n\n  var filtered = [];\n\n  this.forEach(function(element, gfx) {\n    if(fn(element, gfx)) {\n      filtered.push(element);\n    }\n  });\n\n  return filtered;\n};\n\n/**\n * Iterate over all diagram elements.\n *\n * @param {Function} fn\n */\nElementRegistry.prototype.forEach = function(fn) {\n\n  var map = this._elements;\n\n  Object.keys(map).forEach(function(id) {\n    var container = map[id],\n        element = container.element,\n        gfx = container.gfx;\n\n    return fn(element, gfx);\n  });\n};\n\n/**\n * Return the graphical representation of an element or its id.\n *\n * @example\n * elementRegistry.getGraphics('SomeElementId_1');\n * elementRegistry.getGraphics(rootElement); // <g ...>\n *\n * elementRegistry.getGraphics(rootElement, true); // <svg ...>\n *\n *\n * @param {String|djs.model.Base} filter\n * @param {Boolean} [secondary=false] whether to return the secondary connected element\n *\n * @return {SVGElement}\n */\nElementRegistry.prototype.getGraphics = function(filter, secondary) {\n  var id = filter.id || filter;\n\n  var container = this._elements[id];\n  return container && (secondary ? container.secondaryGfx : container.gfx);\n};\n\n/**\n * Validate the suitability of the given id and signals a problem\n * with an exception.\n *\n * @param {String} id\n *\n * @throws {Error} if id is empty or already assigned\n */\nElementRegistry.prototype._validateId = function(id) {\n  if (!id) {\n    throw new Error('element must have an id');\n  }\n\n  if (this._elements[id]) {\n    throw new Error('element with id ' + id + ' already added');\n  }\n};","'use strict';\n\nvar isFunction = require(317),\n    isArray = require(316),\n    isNumber = require(319),\n    assign = require(325);\n\nvar DEFAULT_PRIORITY = 1000;\n\n\n/**\n * A general purpose event bus.\n *\n * This component is used to communicate across a diagram instance.\n * Other parts of a diagram can use it to listen to and broadcast events.\n *\n *\n * ## Registering for Events\n *\n * The event bus provides the {@link EventBus#on} and {@link EventBus#once}\n * methods to register for events. {@link EventBus#off} can be used to\n * remove event registrations. Listeners receive an instance of {@link Event}\n * as the first argument. It allows them to hook into the event execution.\n *\n * ```javascript\n *\n * // listen for event\n * eventBus.on('foo', function(event) {\n *\n *   // access event type\n *   event.type; // 'foo'\n *\n *   // stop propagation to other listeners\n *   event.stopPropagation();\n *\n *   // prevent event default\n *   event.preventDefault();\n * });\n *\n * // listen for event with custom payload\n * eventBus.on('bar', function(event, payload) {\n *   console.log(payload);\n * });\n *\n * // listen for event returning value\n * eventBus.on('foobar', function(event) {\n *\n *   // stop event propagation + prevent default\n *   return false;\n *\n *   // stop event propagation + return custom result\n *   return {\n *     complex: 'listening result'\n *   };\n * });\n *\n *\n * // listen with custom priority (default=1000, higher is better)\n * eventBus.on('priorityfoo', 1500, function(event) {\n *   console.log('invoked first!');\n * });\n * ```\n *\n *\n * ## Emitting Events\n *\n * Events can be emitted via the event bus using {@link EventBus#fire}.\n *\n * ```javascript\n *\n * // false indicates that the default action\n * // was prevented by listeners\n * if (eventBus.fire('foo') === false) {\n *   console.log('default has been prevented!');\n * };\n *\n *\n * // custom args + return value listener\n * eventBus.on('sum', function(event, a, b) {\n *   return a + b;\n * });\n *\n * // you can pass custom arguments + retrieve result values.\n * var sum = eventBus.fire('sum', 1, 2);\n * console.log(sum); // 3\n * ```\n */\nfunction EventBus() {\n  this._listeners = {};\n\n  // cleanup on destroy\n\n  var self = this;\n\n  // destroy on lowest priority to allow\n  // message passing until the bitter end\n  this.on('diagram.destroy', 1, function() {\n    self._listeners = null;\n  });\n}\n\nmodule.exports = EventBus;\n\n\n/**\n * Register an event listener for events with the given name.\n *\n * The callback will be invoked with `event, ...additionalArguments`\n * that have been passed to {@link EventBus#fire}.\n *\n * Returning false from a listener will prevent the events default action\n * (if any is specified). To stop an event from being processed further in\n * other listeners execute {@link Event#stopPropagation}.\n *\n * Returning anything but `undefined` from a listener will stop the listener propagation.\n *\n * @param {String|Array<String>} events\n * @param {Number} [priority=1000] the priority in which this listener is called, larger is higher\n * @param {Function} callback\n */\nEventBus.prototype.on = function(events, priority, callback) {\n\n  events = isArray(events) ? events : [ events ];\n\n  if (isFunction(priority)) {\n    callback = priority;\n    priority = DEFAULT_PRIORITY;\n  }\n\n  if (!isNumber(priority)) {\n    throw new Error('priority must be a number');\n  }\n\n  var self = this,\n      listener = { priority: priority, callback: callback };\n\n  events.forEach(function(e) {\n    self._addListener(e, listener);\n  });\n};\n\n\n/**\n * Register an event listener that is executed only once.\n *\n * @param {String} event the event name to register for\n * @param {Function} callback the callback to execute\n */\nEventBus.prototype.once = function(event, callback) {\n\n  var self = this;\n\n  function wrappedCallback() {\n    callback.apply(self, arguments);\n    self.off(event, wrappedCallback);\n  }\n\n  this.on(event, wrappedCallback);\n};\n\n\n/**\n * Removes event listeners by event and callback.\n *\n * If no callback is given, all listeners for a given event name are being removed.\n *\n * @param {String} event\n * @param {Function} [callback]\n */\nEventBus.prototype.off = function(event, callback) {\n  var listeners = this._getListeners(event),\n      listener, idx;\n\n  if (callback) {\n\n    // move through listeners from back to front\n    // and remove matching listeners\n    for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {\n      if (listener.callback === callback) {\n        listeners.splice(idx, 1);\n      }\n    }\n  } else {\n    // clear listeners\n    listeners.length = 0;\n  }\n};\n\n\n/**\n * Fires a named event.\n *\n * @example\n *\n * // fire event by name\n * events.fire('foo');\n *\n * // fire event object with nested type\n * var event = { type: 'foo' };\n * events.fire(event);\n *\n * // fire event with explicit type\n * var event = { x: 10, y: 20 };\n * events.fire('element.moved', event);\n *\n * // pass additional arguments to the event\n * events.on('foo', function(event, bar) {\n *   alert(bar);\n * });\n *\n * events.fire({ type: 'foo' }, 'I am bar!');\n *\n * @param {String} [name] the optional event name\n * @param {Object} [event] the event object\n * @param {...Object} additional arguments to be passed to the callback functions\n *\n * @return {Boolean} the events return value, if specified or false if the\n *                   default action was prevented by listeners\n */\nEventBus.prototype.fire = function(type, data) {\n\n  var event,\n      originalType,\n      listeners, idx, listener,\n      returnValue,\n      args;\n\n  args = Array.prototype.slice.call(arguments);\n\n  if (typeof type === 'object') {\n    event = type;\n    type = event.type;\n  }\n\n  if (!type) {\n    throw new Error('no event type specified');\n  }\n\n  listeners = this._listeners[type];\n\n  if (!listeners) {\n    return;\n  }\n\n  // we make sure we fire instances of our home made\n  // events here. We wrap them only once, though\n  if (data instanceof Event) {\n    // we are fine, we alread have an event\n    event = data;\n  } else {\n    event = new Event();\n    event.init(data);\n  }\n\n  // ensure we pass the event as the first parameter\n  args[0] = event;\n\n  // original event type (in case we delegate)\n  originalType = event.type;\n\n  try {\n\n    // update event type before delegation\n    if (type !== originalType) {\n      event.type = type;\n    }\n\n    for (idx = 0; !!(listener = listeners[idx]); idx++) {\n\n      // handle stopped propagation\n      if (event.cancelBubble) {\n        break;\n      }\n\n      try {\n        // returning false prevents the default action\n        returnValue = event.returnValue = listener.callback.apply(null, args);\n\n        // stop propagation on return value\n        if (returnValue !== undefined) {\n          event.stopPropagation();\n        }\n\n        // prevent default on return false\n        if (returnValue === false) {\n          event.preventDefault();\n        }\n      } catch (e) {\n        if (!this.handleError(e)) {\n          console.error('unhandled error in event listener');\n          console.error(e.stack);\n\n          throw e;\n        }\n      }\n    }\n  } finally {\n    // reset event type after delegation\n    if (type !== originalType) {\n      event.type = originalType;\n    }\n  }\n\n  // set the return value to false if the event default\n  // got prevented and no other return value exists\n  if (returnValue === undefined && event.defaultPrevented) {\n    returnValue = false;\n  }\n\n  return returnValue;\n};\n\n\nEventBus.prototype.handleError = function(error) {\n  return this.fire('error', { error: error }) === false;\n};\n\n\n/*\n * Add new listener with a certain priority to the list\n * of listeners (for the given event).\n *\n * The semantics of listener registration / listener execution are\n * first register, first serve: New listeners will always be inserted\n * after existing listeners with the same priority.\n *\n * Example: Inserting two listeners with priority 1000 and 1300\n *\n *    * before: [ 1500, 1500, 1000, 1000 ]\n *    * after: [ 1500, 1500, (new=1300), 1000, 1000, (new=1000) ]\n *\n * @param {String} event\n * @param {Object} listener { priority, callback }\n */\nEventBus.prototype._addListener = function(event, newListener) {\n\n  var listeners = this._getListeners(event),\n      existingListener,\n      idx;\n\n  // ensure we order listeners by priority from\n  // 0 (high) to n > 0 (low)\n  for (idx = 0; !!(existingListener = listeners[idx]); idx++) {\n    if (existingListener.priority < newListener.priority) {\n\n      // prepend newListener at before existingListener\n      listeners.splice(idx, 0, newListener);\n      return;\n    }\n  }\n\n  listeners.push(newListener);\n};\n\n\nEventBus.prototype._getListeners = function(name) {\n  var listeners = this._listeners[name];\n\n  if (!listeners) {\n    this._listeners[name] = listeners = [];\n  }\n\n  return listeners;\n};\n\n\n/**\n * A event that is emitted via the event bus.\n */\nfunction Event() { }\n\nmodule.exports.Event = Event;\n\nEvent.prototype.stopPropagation = function() {\n  this.cancelBubble = true;\n};\n\nEvent.prototype.preventDefault = function() {\n  this.defaultPrevented = true;\n};\n\nEvent.prototype.init = function(data) {\n  assign(this, data || {});\n};\n","'use strict';\n\nvar forEach = require(204),\n    reduce = require(208);\n\nvar GraphicsUtil = require(180),\n    domClear = require(340);\n\n/**\n * A factory that creates graphical elements\n *\n * @param {Renderer} renderer\n */\nfunction GraphicsFactory(renderer, elementRegistry) {\n  this._renderer = renderer;\n  this._elementRegistry = elementRegistry;\n}\n\nGraphicsFactory.$inject = [ 'renderer', 'elementRegistry' ];\n\nmodule.exports = GraphicsFactory;\n\n\nGraphicsFactory.prototype._getChildren = function(element) {\n\n  var gfx = this._elementRegistry.getGraphics(element);\n\n  var childrenGfx;\n\n  // root element\n  if (!element.parent) {\n    childrenGfx = gfx;\n  } else {\n    childrenGfx = GraphicsUtil.getChildren(gfx);\n    if (!childrenGfx) {\n      childrenGfx = gfx.parent().group().attr('class', 'djs-children');\n    }\n  }\n\n  return childrenGfx;\n};\n\n/**\n * Clears the graphical representation of the element and returns the\n * cleared visual (the <g class=\"djs-visual\" /> element).\n */\nGraphicsFactory.prototype._clear = function(gfx) {\n  var visual = GraphicsUtil.getVisual(gfx);\n\n  domClear(visual.node);\n\n  return visual;\n};\n\n/**\n * Creates a gfx container for shapes and connections\n *\n * The layout is as follows:\n *\n * <g class=\"djs-group\">\n *\n *   <!-- the gfx -->\n *   <g class=\"djs-element djs-(shape|connection)\">\n *     <g class=\"djs-visual\">\n *       <!-- the renderer draws in here -->\n *     </g>\n *\n *     <!-- extensions (overlays, click box, ...) goes here\n *   </g>\n *\n *   <!-- the gfx child nodes -->\n *   <g class=\"djs-children\"></g>\n * </g>\n *\n * @param {Object} parent\n * @param {String} type the type of the element, i.e. shape | connection\n */\nGraphicsFactory.prototype._createContainer = function(type, parentGfx) {\n  var outerGfx = parentGfx.group().attr('class', 'djs-group'),\n      gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);\n\n  // create visual\n  gfx.group().attr('class', 'djs-visual');\n\n  return gfx;\n};\n\nGraphicsFactory.prototype.create = function(type, element) {\n  var childrenGfx = this._getChildren(element.parent);\n  return this._createContainer(type, childrenGfx);\n};\n\n\nGraphicsFactory.prototype.updateContainments = function(elements) {\n\n  var self = this,\n      elementRegistry = this._elementRegistry,\n      parents;\n\n\n  parents = reduce(elements, function(map, e) {\n\n    if (e.parent) {\n      map[e.parent.id] = e.parent;\n    }\n\n    return map;\n  }, {});\n\n  // update all parents of changed and reorganized their children\n  // in the correct order (as indicated in our model)\n  forEach(parents, function(parent) {\n\n    var childGfx = self._getChildren(parent),\n        children = parent.children;\n\n    if (!children) {\n      return;\n    }\n\n    forEach(children.slice().reverse(), function(c) {\n      var gfx = elementRegistry.getGraphics(c);\n      gfx.parent().prependTo(childGfx);\n    });\n  });\n\n};\n\nGraphicsFactory.prototype.update = function(type, element, gfx) {\n\n  // Do not update root element\n  if (!element.parent) {\n    return;\n  }\n\n  var visual = this._clear(gfx);\n\n  // redraw\n  if (type === 'shape') {\n    this._renderer.drawShape(visual, element);\n\n    // update positioning\n    gfx.translate(element.x, element.y);\n  } else\n  if (type === 'connection') {\n    this._renderer.drawConnection(visual, element);\n  } else {\n    throw new Error('unknown type: ' + type);\n  }\n\n  gfx.attr('display', element.hidden ? 'none' : 'block');\n};\n\n\nGraphicsFactory.prototype.remove = function(element) {\n  var gfx = this._elementRegistry.getGraphics(element);\n\n  // remove\n  gfx.parent().remove();\n};\n","module.exports = {\n  __depends__: [ require(86) ],\n  __init__: [ 'canvas' ],\n  canvas: [ 'type', require(78) ],\n  elementRegistry: [ 'type', require(80) ],\n  elementFactory: [ 'type', require(79) ],\n  eventBus: [ 'type', require(81) ],\n  graphicsFactory: [ 'type', require(82) ]\n};","'use strict';\n\nvar Snap = require(188);\n\n\n/**\n * The default renderer used for shapes and connections.\n *\n * @param {Styles} styles\n */\nfunction Renderer(styles) {\n  this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });\n  this.SHAPE_STYLE = styles.style({ fill: 'white', stroke: 'fuchsia', strokeWidth: 2 });\n}\n\nmodule.exports = Renderer;\n\nRenderer.$inject = ['styles'];\n\n\nRenderer.prototype.drawShape = function drawShape(gfxGroup, data) {\n  return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);\n};\n\nRenderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {\n  return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);\n};\n\nfunction componentsToPath(components) {\n  return components.join(',').replace(/,?([A-z]),?/g, '$1');\n}\n\n/**\n * Gets the default SVG path of a shape that represents it's visual bounds.\n *\n * @param {djs.model.Shape} shape\n * @return {string} svg path\n */\nRenderer.prototype.getShapePath = function getShapePath(shape) {\n\n  var x = shape.x,\n      y = shape.y,\n      width = shape.width,\n      height = shape.height;\n\n  var shapePath = [\n    ['M', x, y],\n    ['l', width, 0],\n    ['l', 0, height],\n    ['l', -width, 0],\n    ['z']\n  ];\n\n  return componentsToPath(shapePath);\n};\n\n/**\n * Gets the default SVG path of a connection that represents it's visual bounds.\n *\n * @param {djs.model.Connection} connection\n * @return {string} svg path\n */\nRenderer.prototype.getConnectionPath = function getConnectionPath(connection) {\n  var waypoints = connection.waypoints;\n\n  var idx, point, connectionPath = [];\n\n  for (idx = 0; !!(point = waypoints[idx]); idx++) {\n\n    // take invisible docking into account\n    // when creating the path\n    point = point.original || point;\n\n    connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);\n  }\n\n  return componentsToPath(connectionPath);\n};\n\n\nfunction toSVGPoints(points) {\n  var result = '';\n\n  for (var i = 0, p; !!(p = points[i]); i++) {\n    result += p.x + ',' + p.y + ' ';\n  }\n\n  return result;\n}\n\nfunction createLine(points, attrs) {\n  return Snap.create('polyline', { points: toSVGPoints(points) }).attr(attrs || {});\n}\n\nfunction updateLine(gfx, points) {\n  return gfx.attr({ points: toSVGPoints(points) });\n}\n\nmodule.exports.createLine = createLine;\nmodule.exports.updateLine = updateLine;","'use strict';\n\nvar isArray = require(316),\n    assign = require(325),\n    reduce = require(208);\n\n\n/**\n * A component that manages shape styles\n */\nfunction Styles() {\n\n  var defaultTraits = {\n\n    'no-fill': {\n      fill: 'none'\n    },\n    'no-border': {\n      strokeOpacity: 0.0\n    },\n    'no-events': {\n      pointerEvents: 'none'\n    }\n  };\n\n  /**\n   * Builds a style definition from a className, a list of traits and an object of additional attributes.\n   *\n   * @param  {String} className\n   * @param  {Array<String>} traits\n   * @param  {Object} additionalAttrs\n   *\n   * @return {Object} the style defintion\n   */\n  this.cls = function(className, traits, additionalAttrs) {\n    var attrs = this.style(traits, additionalAttrs);\n\n    return assign(attrs, { 'class': className });\n  };\n\n  /**\n   * Builds a style definition from a list of traits and an object of additional attributes.\n   *\n   * @param  {Array<String>} traits\n   * @param  {Object} additionalAttrs\n   *\n   * @return {Object} the style defintion\n   */\n  this.style = function(traits, additionalAttrs) {\n\n    if (!isArray(traits) && !additionalAttrs) {\n      additionalAttrs = traits;\n      traits = [];\n    }\n\n    var attrs = reduce(traits, function(attrs, t) {\n      return assign(attrs, defaultTraits[t] || {});\n    }, {});\n\n    return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n  };\n}\n\nmodule.exports = Styles;","module.exports = {\n  renderer: [ 'type', require(84) ],\n  styles: [ 'type', require(85) ]\n};","'use strict';\n\nvar Geometry = require(179),\n    Util = require(90);\n\nvar MARKER_OK = 'connect-ok',\n    MARKER_NOT_OK = 'connect-not-ok',\n    MARKER_CONNECT_HOVER = 'connect-hover',\n    MARKER_CONNECT_UPDATING = 'djs-updating';\n\nvar COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',\n    COMMAND_RECONNECT_START = 'connection.reconnectStart',\n    COMMAND_RECONNECT_END = 'connection.reconnectEnd';\n\nvar round = Math.round;\n\n\n/**\n * A component that implements moving of bendpoints\n */\nfunction BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {\n\n  var connectionDocking;\n\n  // optional connection docking integration\n  try {\n    connectionDocking = injector.get('connectionDocking');\n  } catch (e) {}\n\n\n  // API\n\n  this.start = function(event, connection, bendpointIndex, insert) {\n\n    var type,\n        context,\n        waypoints = connection.waypoints,\n        gfx = canvas.getGraphics(connection);\n\n    if (!insert && bendpointIndex === 0) {\n      type = COMMAND_RECONNECT_START;\n    } else\n    if (!insert && bendpointIndex === waypoints.length - 1) {\n      type = COMMAND_RECONNECT_END;\n    } else {\n      type = COMMAND_BENDPOINT_UPDATE;\n    }\n\n    context = {\n      connection: connection,\n      bendpointIndex: bendpointIndex,\n      insert: insert,\n      type: type\n    };\n\n    dragging.activate(event, 'bendpoint.move', {\n      data: {\n        connection: connection,\n        connectionGfx: gfx,\n        context: context\n      }\n    });\n  };\n\n\n  // DRAGGING IMPLEMENTATION\n\n\n  function redrawConnection(data) {\n    graphicsFactory.update('connection', data.connection, data.connectionGfx);\n  }\n\n  function filterRedundantWaypoints(waypoints) {\n    return waypoints.filter(function(r, idx) {\n      return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);\n    });\n  }\n\n  eventBus.on('bendpoint.move.start', function(e) {\n\n    var context = e.context,\n        connection = context.connection,\n        originalWaypoints = connection.waypoints,\n        waypoints = originalWaypoints.slice(),\n        insert = context.insert,\n        idx = context.bendpointIndex;\n\n    context.originalWaypoints = originalWaypoints;\n\n    if (insert) {\n      // insert placeholder for bendpoint to-be-added\n      waypoints.splice(idx, 0, null);\n    }\n\n    connection.waypoints = waypoints;\n\n    // add dragger gfx\n    context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));\n    context.draggerGfx.addClass('djs-dragging');\n\n    canvas.addMarker(connection, MARKER_CONNECT_UPDATING);\n  });\n\n  eventBus.on('bendpoint.move.hover', function(e) {\n    e.context.hover = e.hover;\n\n    canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);\n  });\n\n  eventBus.on([\n    'bendpoint.move.out',\n    'bendpoint.move.cleanup'\n  ], function(e) {\n\n    // remove connect marker\n    // if it was added\n    var hover = e.context.hover;\n\n    if (hover) {\n      canvas.removeMarker(hover, MARKER_CONNECT_HOVER);\n      canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);\n    }\n  });\n\n  eventBus.on('bendpoint.move.move', function(e) {\n\n    var context = e.context,\n        moveType = context.type,\n        connection = e.connection,\n        source, target;\n\n    connection.waypoints[context.bendpointIndex] = { x: e.x, y: e.y };\n\n    if (connectionDocking) {\n\n      if (context.hover) {\n        if (moveType === COMMAND_RECONNECT_START) {\n          source = context.hover;\n        }\n\n        if (moveType === COMMAND_RECONNECT_END) {\n          target = context.hover;\n        }\n      }\n\n      connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);\n    }\n\n    // asks whether reconnect / bendpoint move / bendpoint add\n    // is allowed at the given position\n    var allowed = context.allowed = rules.allowed(context.type, context);\n\n    if (allowed) {\n\n      if (context.hover) {\n        canvas.removeMarker(context.hover, MARKER_NOT_OK);\n        canvas.addMarker(context.hover, MARKER_OK);\n\n        context.target = context.hover;\n      }\n    } else\n    if (allowed === false) {\n      if (context.hover) {\n        canvas.removeMarker(context.hover, MARKER_OK);\n        canvas.addMarker(context.hover, MARKER_NOT_OK);\n\n        context.target = null;\n      }\n    }\n\n    // add dragger gfx\n    context.draggerGfx.translate(e.x, e.y);\n\n    redrawConnection(e);\n  });\n\n  eventBus.on([\n    'bendpoint.move.end',\n    'bendpoint.move.cancel'\n  ], function(e) {\n\n    var context = e.context,\n        connection = context.connection;\n\n    // remove dragger gfx\n    context.draggerGfx.remove();\n\n    context.newWaypoints = connection.waypoints.slice();\n\n    connection.waypoints = context.originalWaypoints;\n\n    canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);\n  });\n\n  eventBus.on('bendpoint.move.end', function(e) {\n\n    var context = e.context,\n        waypoints = context.newWaypoints,\n        bendpointIndex = context.bendpointIndex,\n        bendpoint = waypoints[bendpointIndex],\n        allowed = context.allowed;\n\n    // ensure we have actual pixel values bendpoint\n    // coordinates (important when zoom level was > 1 during move)\n    bendpoint.x = round(bendpoint.x);\n    bendpoint.y = round(bendpoint.y);\n\n    if (allowed === true && context.type === COMMAND_RECONNECT_START) {\n      modeling.reconnectStart(context.connection, context.target, bendpoint);\n    } else\n    if (allowed === true && context.type === COMMAND_RECONNECT_END) {\n      modeling.reconnectEnd(context.connection, context.target, bendpoint);\n    } else\n    if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {\n      modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));\n    } else {\n      redrawConnection(e);\n\n      return false;\n    }\n  });\n\n  eventBus.on('bendpoint.move.cancel', function(e) {\n    redrawConnection(e);\n  });\n}\n\nBendpointMove.$inject = [ 'injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling' ];\n\nmodule.exports = BendpointMove;","'use strict';\n\nvar assign = require(325),\n    pick = require(330),\n    forEach = require(204);\n\nvar Snap = require(188);\n\nvar round = Math.round;\n\n\nfunction BendpointSnapping(eventBus) {\n\n  function snapTo(candidates, point) {\n    return Snap.snapTo(candidates, point);\n  }\n\n  function toPoint(e) {\n    return pick(e, [ 'x', 'y' ]);\n  }\n\n  function mid(element) {\n    if (element.width) {\n      return {\n        x: round(element.width / 2 + element.x),\n        y: round(element.height / 2 + element.y)\n      };\n    }\n  }\n\n  function getSnapPoints(context) {\n\n    var snapPoints = context.snapPoints,\n        waypoints = context.connection.waypoints,\n        bendpointIndex = context.bendpointIndex,\n        referenceWaypoints = [ waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1] ];\n\n    if (!snapPoints) {\n      context.snapPoints = snapPoints = { horizontal: [] , vertical: [] };\n\n      forEach(referenceWaypoints, function(p) {\n        // we snap on existing bendpoints only,\n        // not placeholders that are inserted during add\n        if (p) {\n          p = p.original || p;\n\n          snapPoints.horizontal.push(p.y);\n          snapPoints.vertical.push(p.x);\n        }\n      });\n    }\n\n    return snapPoints;\n  }\n\n  eventBus.on('bendpoint.move.start', function(event) {\n    event.context.snapStart = toPoint(event);\n  });\n\n  eventBus.on('bendpoint.move.move', 1500, function(event) {\n\n    var context = event.context,\n        snapPoints = getSnapPoints(context),\n        start = context.snapStart,\n        target = context.target,\n        targetMid = target && mid(target),\n        x = start.x + event.dx,\n        y = start.y + event.dy,\n        sx, sy;\n\n    if (!snapPoints) {\n      return;\n    }\n\n    // snap\n    sx = snapTo(targetMid ? snapPoints.vertical.concat([ targetMid.x ]) : snapPoints.vertical, x);\n    sy = snapTo(targetMid ? snapPoints.horizontal.concat([ targetMid.y ]) : snapPoints.horizontal, y);\n\n\n    // correction x/y\n    var cx = (x - sx),\n        cy = (y - sy);\n\n    // update delta\n    assign(event, {\n      dx: event.dx - cx,\n      dy: event.dy - cy,\n      x: event.x - cx,\n      y: event.y - cy\n    });\n  });\n}\n\n\nBendpointSnapping.$inject = [ 'eventBus' ];\n\nmodule.exports = BendpointSnapping;","'use strict';\n\nvar domEvent = require(344),\n    Util = require(90);\n\nvar BENDPOINT_CLS = Util.BENDPOINT_CLS;\n\n\n/**\n * A service that adds editable bendpoints to connections.\n */\nfunction Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {\n\n  function getConnectionIntersection(waypoints, event) {\n    var localPosition = Util.toCanvasCoordinates(canvas, event);\n    return Util.getApproxIntersection(waypoints, localPosition);\n  }\n\n  function activateBendpointMove(event, connection) {\n    var waypoints = connection.waypoints,\n        intersection = getConnectionIntersection(waypoints, event);\n\n    if (!intersection) {\n      return;\n    }\n\n    bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);\n  }\n\n  function getBendpointsContainer(element, create) {\n\n    var layer = canvas.getLayer('overlays'),\n        gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');\n\n    if (!gfx && create) {\n      gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);\n\n      domEvent.bind(gfx.node, 'mousedown', function(event) {\n        activateBendpointMove(event, element);\n      });\n    }\n\n    return gfx;\n  }\n\n  function createBendpoints(gfx, connection) {\n    connection.waypoints.forEach(function(p, idx) {\n      Util.addBendpoint(gfx).translate(p.x, p.y);\n    });\n\n    // add floating bendpoint\n    Util.addBendpoint(gfx).addClass('floating');\n  }\n\n  function clearBendpoints(gfx) {\n    gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {\n      s.remove();\n    });\n  }\n\n  function addBendpoints(connection) {\n    var gfx = getBendpointsContainer(connection);\n\n    if (!gfx) {\n      gfx = getBendpointsContainer(connection, true);\n      createBendpoints(gfx, connection);\n    }\n\n    return gfx;\n  }\n\n  function updateBendpoints(connection) {\n\n    var gfx = getBendpointsContainer(connection);\n\n    if (gfx) {\n      clearBendpoints(gfx);\n      createBendpoints(gfx, connection);\n    }\n  }\n\n  eventBus.on('connection.changed', function(event) {\n    updateBendpoints(event.element);\n  });\n\n  eventBus.on('connection.remove', function(event) {\n    var gfx = getBendpointsContainer(event.element);\n    if (gfx) {\n      gfx.remove();\n    }\n  });\n\n  eventBus.on('element.marker.update', function(event) {\n\n    var element = event.element,\n        bendpointsGfx;\n\n    if (!element.waypoints) {\n      return;\n    }\n\n    bendpointsGfx = addBendpoints(element);\n    bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);\n  });\n\n  eventBus.on('element.mousemove', function(event) {\n\n    var element = event.element,\n        waypoints = element.waypoints,\n        bendpointsGfx,\n        floating,\n        intersection;\n\n    if (waypoints) {\n\n      bendpointsGfx = getBendpointsContainer(element, true);\n      floating = bendpointsGfx.select('.floating');\n\n      if (!floating) {\n        return;\n      }\n\n      intersection = getConnectionIntersection(waypoints, event.originalEvent);\n\n      if (intersection) {\n        floating.translate(intersection.point.x, intersection.point.y);\n      }\n    }\n  });\n\n  eventBus.on('element.mousedown', function(event) {\n\n    var originalEvent = event.originalEvent,\n        element = event.element,\n        waypoints = element.waypoints;\n\n    if (!waypoints) {\n      return;\n    }\n\n    activateBendpointMove(originalEvent, element, waypoints);\n  });\n\n  eventBus.on('selection.changed', function(event) {\n    var newSelection = event.newSelection,\n        primary = newSelection[0];\n\n    if (primary && primary.waypoints) {\n      addBendpoints(primary);\n    }\n  });\n\n  eventBus.on('element.hover', function(event) {\n    var element = event.element;\n\n    if (element.waypoints) {\n      addBendpoints(element);\n\n      interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');\n    }\n  });\n\n  eventBus.on('element.out', function(event) {\n    interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');\n  });\n}\n\nBendpoints.$inject = [ 'injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove' ];\n\nmodule.exports = Bendpoints;","'use strict';\n\nvar Snap = require(188);\n\nvar Events = require(178),\n    Geometry = require(179);\n\nvar BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';\n\nmodule.exports.toCanvasCoordinates = function(canvas, event) {\n\n  var position = Events.toPoint(event),\n      clientRect = canvas._container.getBoundingClientRect(),\n      offset;\n\n  // canvas relative position\n\n  offset = {\n    x: clientRect.left,\n    y: clientRect.top\n  };\n\n  // update actual event payload with canvas relative measures\n\n  var viewbox = canvas.viewbox();\n\n  return {\n    x: viewbox.x + (position.x - offset.x) / viewbox.scale,\n    y: viewbox.y + (position.y - offset.y) / viewbox.scale\n  };\n};\n\nmodule.exports.addBendpoint = function(parentGfx) {\n  var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);\n\n  groupGfx.circle(0, 0, 4).addClass('djs-visual');\n  groupGfx.circle(0, 0, 10).addClass('djs-hit');\n\n  return groupGfx;\n};\n\n\nfunction circlePath(center, r) {\n  var x = center.x,\n      y = center.y;\n\n  return [\n    ['M', x, y],\n    ['m', 0, -r],\n    ['a', r, r, 0, 1, 1, 0, 2 * r],\n    ['a', r, r, 0, 1, 1, 0, -2 * r],\n    ['z']\n  ];\n}\n\nfunction linePath(points) {\n  var segments = [];\n\n  points.forEach(function(p, idx) {\n    segments.push([ idx === 0 ? 'M' : 'L', p.x, p.y ]);\n  });\n\n  return segments;\n}\n\n\nvar INTERSECTION_THRESHOLD = 10;\n\nfunction getBendpointIntersection(waypoints, reference) {\n\n  var i, w;\n\n  for (i = 0; !!(w = waypoints[i]); i++) {\n\n    if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {\n      return {\n        point: waypoints[i],\n        bendpoint: true,\n        index: i\n      };\n    }\n  }\n\n  return null;\n}\n\nfunction getPathIntersection(waypoints, reference) {\n\n  var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));\n\n  var a = intersections[0],\n      b = intersections[intersections.length - 1],\n      idx;\n\n  if (!a) {\n    // no intersection\n    return null;\n  }\n\n  if (a !== b) {\n\n    if (a.segment2 !== b.segment2) {\n      // we use the bendpoint in between both segments\n      // as the intersection point\n\n      idx = Math.max(a.segment2, b.segment2) - 1;\n\n      return {\n        point: waypoints[idx],\n        bendpoint: true,\n        index: idx\n      };\n    }\n\n    return {\n      point: {\n        x: (Math.round(a.x + b.x) / 2),\n        y: (Math.round(a.y + b.y) / 2)\n      },\n      index: a.segment2\n    };\n  }\n\n  return {\n    point: {\n      x: Math.round(a.x),\n      y: Math.round(a.y)\n    },\n    index: a.segment2\n  };\n}\n\n/**\n * Returns the closest point on the connection towards a given reference point.\n *\n * @param  {Array<Point>} waypoints\n * @param  {Point} reference\n *\n * @return {Object} intersection data (segment, point)\n */\nmodule.exports.getApproxIntersection = function(waypoints, reference) {\n  return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);\n};","module.exports = {\n  __depends__: [ require(101), require(147) ],\n  __init__: [ 'bendpoints', 'bendpointSnapping' ],\n  bendpoints: [ 'type', require(89) ],\n  bendpointMove: [ 'type', require(87) ],\n  bendpointSnapping: [ 'type', require(88) ]\n};","'use strict';\n\n/**\n * Adds change support to the diagram, including\n *\n * <ul>\n *   <li>redrawing shapes and connections on change</li>\n * </ul>\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {GraphicsFactory} graphicsFactory\n */\nfunction ChangeSupport(eventBus, elementRegistry, graphicsFactory) {\n\n  // redraw shapes / connections on change\n\n  eventBus.on('element.changed', function(event) {\n\n    var element = event.element;\n\n    if (!event.gfx) {\n      event.gfx = elementRegistry.getGraphics(element);\n    }\n\n    // shape + gfx may have been deleted\n    if (!event.gfx) {\n      return;\n    }\n\n    if (element.waypoints) {\n      eventBus.fire('connection.changed', event);\n    } else {\n      eventBus.fire('shape.changed', event);\n    }\n  });\n\n  eventBus.on('elements.changed', function(event) {\n\n    var elements = event.elements;\n\n    elements.forEach(function(e) {\n      eventBus.fire('element.changed', { element: e });\n    });\n\n    graphicsFactory.updateContainments(elements);\n  });\n\n  eventBus.on('shape.changed', function(event) {\n    graphicsFactory.update('shape', event.element, event.gfx);\n  });\n\n  eventBus.on('connection.changed', function(event) {\n    graphicsFactory.update('connection', event.element, event.gfx);\n  });\n}\n\nChangeSupport.$inject = [ 'eventBus', 'elementRegistry', 'graphicsFactory' ];\n\nmodule.exports = ChangeSupport;\n","module.exports = {\n  __init__: [ 'changeSupport'],\n  changeSupport: [ 'type', require(92) ]\n};","'use strict';\n\nvar LayoutUtil = require(166);\n\nvar MARKER_OK = 'connect-ok',\n    MARKER_NOT_OK = 'connect-not-ok';\n\n\nfunction Connect(eventBus, dragging, modeling, rules, canvas, renderer) {\n\n  // TODO(nre): separate UI and events\n\n  // rules\n\n  function canConnect(source, target) {\n    return rules.allowed('connection.create', {\n      source: source,\n      target: target\n    });\n  }\n\n\n  // layouting\n\n  function crop(start, end, source, target) {\n\n    var sourcePath = renderer.getShapePath(source),\n        targetPath = target && renderer.getShapePath(target),\n        connectionPath = renderer.getConnectionPath({ waypoints: [ start, end ] });\n\n    start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;\n    end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;\n\n    return [ start, end ];\n  }\n\n\n  // event handlers\n\n  eventBus.on('connect.move', function(event) {\n\n    var context = event.context,\n        source = context.source,\n        target = context.target,\n        visual = context.visual,\n        start, end, waypoints;\n\n    // update connection visuals during drag\n\n    start = LayoutUtil.getMidPoint(source);\n\n    end = {\n      x: event.x,\n      y: event.y\n    };\n\n    waypoints = crop(start, end, source, target);\n\n    visual.attr('points', [ waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y ]);\n  });\n\n  eventBus.on('connect.hover', function(event) {\n    var context = event.context,\n        source = context.source,\n        hover = event.hover,\n        canExecute;\n\n    canExecute = context.canExecute = canConnect(source, hover);\n\n    // simply ignore hover\n    if (canExecute === null) {\n      return;\n    }\n\n    context.target = hover;\n\n    canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);\n  });\n\n  eventBus.on([ 'connect.out', 'connect.cleanup' ], function(event) {\n    var context = event.context;\n\n    if (context.target) {\n      canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n    }\n\n    context.target = null;\n  });\n\n  eventBus.on('connect.cleanup', function(event) {\n    var context = event.context;\n\n    if (context.visual) {\n      context.visual.remove();\n    }\n  });\n\n  eventBus.on('connect.start', function(event) {\n    var context = event.context,\n        visual;\n\n    visual = canvas.getDefaultLayer().polyline().attr({\n      'stroke': '#333',\n      'strokeDasharray': [ 1 ],\n      'strokeWidth': 2,\n      'pointer-events': 'none'\n    });\n\n    context.visual = visual;\n  });\n\n  eventBus.on('connect.end', function(event) {\n\n    var context = event.context,\n        source = context.source,\n        target = context.target,\n        canExecute = context.canExecute || canConnect(source, target);\n\n    if (!canExecute) {\n      return false;\n    }\n\n    modeling.connect(source, target);\n  });\n\n\n  // API\n\n  this.start = function(event, source, autoActivate) {\n\n    dragging.activate(event, 'connect', {\n      autoActivate: autoActivate,\n      data: {\n        shape: source,\n        context: {\n          source: source\n        }\n      }\n    });\n  };\n}\n\nConnect.$inject = [ 'eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer' ];\n\nmodule.exports = Connect;","module.exports = {\n  __depends__: [\n    require(151),\n    require(147),\n    require(101)\n  ],\n  connect: [ 'type', require(94) ]\n};\n","'use strict';\n\nvar isFunction = require(317),\n    forEach = require(204),\n\n    domDelegate = require(342),\n    domClear = require(340),\n    domEvent = require(344),\n    domAttr = require(338),\n    domQuery = require(346),\n    domClasses = require(339),\n    domify = require(343);\n\n\nvar entrySelector = '.entry';\n\n\n/**\n * A context pad that displays element specific, contextual actions next\n * to a diagram element.\n *\n * @param {EventBus} eventBus\n * @param {Overlays} overlays\n */\nfunction ContextPad(eventBus, overlays) {\n\n  this._providers = [];\n\n  this._eventBus = eventBus;\n  this._overlays = overlays;\n\n  this._current = null;\n\n  this._init();\n}\n\nContextPad.$inject = [ 'eventBus', 'overlays' ];\n\n/**\n * Registers events needed for interaction with other components\n */\nContextPad.prototype._init = function() {\n\n  var eventBus = this._eventBus;\n\n  var self = this;\n\n  eventBus.on('selection.changed', function(e) {\n\n    var selection = e.newSelection;\n\n    if (selection.length === 1) {\n      self.open(selection[0]);\n    } else {\n      self.close();\n    }\n  });\n};\n\n\n/**\n * Register a provider with the context pad\n *\n * @param  {ContextPadProvider} provider\n */\nContextPad.prototype.registerProvider = function(provider) {\n  this._providers.push(provider);\n};\n\n\n/**\n * Returns the context pad entries for a given element\n *\n * @param {djs.element.Base} element\n *\n * @return {Array<ContextPadEntryDescriptor>} list of entries\n */\nContextPad.prototype.getEntries = function(element) {\n  var entries = {};\n\n  // loop through all providers and their entries.\n  // group entries by id so that overriding an entry is possible\n  forEach(this._providers, function(provider) {\n    var e = provider.getContextPadEntries(element);\n\n    forEach(e, function(entry, id) {\n      entries[id] = entry;\n    });\n  });\n\n  return entries;\n};\n\n\n/**\n * Trigger an action available on the opened context pad\n *\n * @param  {String} action\n * @param  {Event} event\n */\nContextPad.prototype.trigger = function(action, event, autoActivate) {\n\n  var current = this._current,\n      element = current.element,\n      entries = current.entries,\n      entry,\n      handler,\n      originalEvent,\n      button = event.delegateTarget || event.target;\n\n  if (!button) {\n    return event.preventDefault();\n  }\n\n  entry = entries[domAttr(button, 'data-action')];\n  handler = entry.action;\n\n  originalEvent = event.originalEvent || event;\n\n  // simple action (via callback function)\n  if (isFunction(handler)) {\n    if (action === 'click') {\n      return handler(originalEvent, element, autoActivate);\n    }\n  } else {\n    if (handler[action]) {\n      return handler[action](originalEvent, element, autoActivate);\n    }\n  }\n\n  // silence other actions\n  event.preventDefault();\n};\n\n\n/**\n * Open the context pad for the given element\n *\n * @param {djs.model.Base} element\n */\nContextPad.prototype.open = function(element) {\n\n  if (this._current && this._current.open) {\n\n    if (this._current.element === element) {\n      // no change needed\n      return;\n    }\n\n    this.close();\n  }\n\n  this._updateAndOpen(element);\n};\n\n\nContextPad.prototype._updateAndOpen = function(element) {\n\n  var entries = this.getEntries(element),\n      pad = this.getPad(element),\n      html = pad.html;\n\n  domClear(html);\n\n  forEach(entries, function(entry, id) {\n    var grouping = entry.group || 'default',\n        control = domify(entry.html || '<div class=\"entry\" draggable=\"true\"></div>'),\n        container;\n\n    domAttr(control, 'data-action', id);\n\n    container = domQuery('[data-group=' + grouping + ']', html);\n    if (!container) {\n      container = domify('<div class=\"group\" data-group=\"' + grouping + '\"></div>');\n      html.appendChild(container);\n    }\n\n    container.appendChild(control);\n\n    if (entry.className) {\n      domClasses(control).add(entry.className);\n    }\n\n    if (entry.title) {\n      domAttr(control, 'title', entry.title);\n    }\n\n    if (entry.imageUrl) {\n      control.appendChild(domify('<img src=\"' + entry.imageUrl + '\">'));\n    }\n  });\n\n  domClasses(html).add('open');\n\n  this._current = {\n    element: element,\n    pad: pad,\n    entries: entries,\n    open: true\n  };\n\n  this._eventBus.fire('contextPad.open', { current: this._current });\n};\n\nContextPad.prototype.getPad = function(element) {\n\n  var self = this;\n\n  var overlays = this._overlays,\n      pads = overlays.get({ element: element, type: 'context-pad' });\n\n  // create context pad on demand if needed\n  if (!pads.length) {\n\n    var html = domify('<div class=\"djs-context-pad\"></div>');\n\n    domDelegate.bind(html, entrySelector, 'click', function(event) {\n      self.trigger('click', event);\n    });\n\n    domDelegate.bind(html, entrySelector, 'dragstart', function(event) {\n      self.trigger('dragstart', event);\n    });\n\n    // stop propagation of mouse events\n    domEvent.bind(html, 'mousedown', function(event) {\n      event.stopPropagation();\n    });\n\n    overlays.add(element, 'context-pad', {\n      position: {\n        right: -9,\n        top: -6\n      },\n      html: html\n    });\n\n    pads = overlays.get({ element: element, type: 'context-pad' });\n\n    this._eventBus.fire('contextPad.create', { element: element, pad: pads[0] });\n  }\n\n  return pads[0];\n};\n\n\n/**\n * Close the context pad\n */\nContextPad.prototype.close = function() {\n\n  var html;\n\n  if (this._current) {\n    if (this._current.open) {\n      html = this._current.pad.html;\n      domClasses(html).remove('open');\n    }\n\n    this._current.open = false;\n\n    this._eventBus.fire('contextPad.close', { current: this._current });\n  }\n};\n\n\n/**\n * Return the element the context pad is currently opened for,\n * if it is opened.\n *\n * @example\n *\n * contextPad.open(shape1);\n *\n * if (contextPad.isOpen()) {\n *   // yes, we are open\n * }\n *\n * @return {djs.model.Base} element\n */\nContextPad.prototype.isOpen = function() {\n  return this._current && this._current.open;\n};\n\nmodule.exports = ContextPad;\n","module.exports = {\n  __depends__: [\n    require(103),\n    require(135)\n  ],\n  contextPad: [ 'type', require(96) ]\n};","'use strict';\n\nvar MARKER_OK = 'drop-ok',\n    MARKER_NOT_OK = 'drop-not-ok';\n\n\nfunction Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {\n\n  // rules\n\n  function canCreate(shape, target, source) {\n\n    if (source) {\n      return rules.allowed('shape.append', {\n        source: source,\n        shape: shape,\n        parent: target\n      });\n    } else {\n      return rules.allowed('shape.create', {\n        shape: shape,\n        parent: target\n      });\n    }\n  }\n\n\n  // visual helpers\n\n  function createVisual(shape) {\n    var group, preview, visual;\n\n    group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));\n\n    preview = group.group().addClass('djs-dragger');\n\n    preview.translate(shape.width / -2, shape.height / -2);\n\n    visual = preview.group().addClass('djs-visual');\n\n    // hijack renderer to draw preview\n    renderer.drawShape(visual, shape);\n\n    return group;\n  }\n\n\n  // event handlers\n\n  eventBus.on('create.move', function(event) {\n\n    var context = event.context,\n        shape = context.shape,\n        visual = context.visual;\n\n    // lazy init drag visual once we received the first real\n    // drag move event (this allows us to get the proper canvas local coordinates)\n    if (!visual) {\n      visual = context.visual = createVisual(shape);\n    }\n\n    visual.translate(event.x, event.y);\n\n    var hover = event.hover,\n        canExecute;\n\n    canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);\n\n    // ignore hover visually if canExecute is null\n    if (hover && canExecute !== null) {\n      context.target = hover;\n      canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);\n    }\n  });\n\n  eventBus.on([ 'create.end', 'create.out', 'create.cleanup' ], function(event) {\n    var context = event.context;\n\n    if (context.target) {\n      canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n    }\n  });\n\n  eventBus.on('create.end', function(event) {\n    var context = event.context,\n        source = context.source,\n        shape = context.shape,\n        target = context.target,\n        canExecute = context.canExecute,\n        position = {\n          x: event.x,\n          y: event.y\n        };\n\n    if (!canExecute) {\n      return false;\n    }\n\n    if (source) {\n      modeling.appendShape(source, shape, position, target);\n    } else {\n      modeling.createShape(shape, position, target);\n    }\n  });\n\n\n  eventBus.on('create.cleanup', function(event) {\n    var context = event.context;\n\n    if (context.visual) {\n      context.visual.remove();\n    }\n  });\n\n  // API\n\n  this.start = function(event, shape, source) {\n\n    dragging.activate(event, 'create', {\n      cursor: 'grabbing',\n      autoActivate: true,\n      data: {\n        shape: shape,\n        context: {\n          shape: shape,\n          source: source\n        }\n      }\n    });\n  };\n}\n\nCreate.$inject = [ 'eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles' ];\n\nmodule.exports = Create;","module.exports = {\n  __depends__: [\n    require(101),\n    require(151)\n  ],\n  create: [ 'type', require(98) ]\n};","'use strict';\n\n/* global TouchEvent */\n\nvar assign = require(325);\n\nvar domEvent = require(344),\n    Event = require(178),\n    ClickTrap = require(174),\n    Cursor = require(176);\n\nfunction suppressEvent(event) {\n  if (event instanceof MouseEvent) {\n    Event.stopEvent(event, true);\n  } else {\n    Event.preventDefault(event);\n  }\n}\n\nfunction getLength(point) {\n  return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));\n}\n\nfunction substract(p1, p2) {\n  return {\n    x: p1.x - p2.x,\n    y: p1.y - p2.y\n  };\n}\n\n/**\n * A helper that fires canvas localized drag events and realizes\n * the general \"drag-and-drop\" look and feel.\n *\n * Calling {@link Dragging#activate} activates dragging on a canvas.\n *\n * It provides the following:\n *\n *   * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the {@link EventBus}.\n *     Each of the events is prefixed with a prefix that is assigned during activate.\n *   * sets and restores the cursor\n *   * sets and restores the selection\n *   * ensures there can be only one drag operation active at a time\n *\n * Dragging may be canceled manually by calling {@link Dragging#cancel} or by pressing ESC.\n *\n * @example\n *\n * function MyDragComponent(eventBus, dragging) {\n *\n *   eventBus.on('mydrag.start', function(event) {\n *     console.log('yes, we start dragging');\n *   });\n *\n *   eventBus.on('mydrag.move', function(event) {\n *     console.log('canvas local coordinates', event.x, event.y, event.dx, event.dy);\n *\n *     // local drag data is passed with the event\n *     event.context.foo; // \"BAR\"\n *\n *     // the original mouse event, too\n *     event.originalEvent; // MouseEvent(...)\n *   });\n *\n *   eventBus.on('element.click', function(event) {\n *     dragging.activate(event, 'mydrag', {\n *       cursor: 'grabbing',\n *       data: {\n *         context: {\n *           foo: \"BAR\"\n *         }\n *       }\n *     });\n *   });\n * }\n */\nfunction Dragging(eventBus, canvas, selection) {\n\n  var defaultOptions = {\n    threshold: 5\n  };\n\n  // the currently active drag operation\n  // dragging is active as soon as this context exists.\n  //\n  // it is visually _active_ only when a context.active flag is set to true.\n  var context;\n\n\n  // helpers\n\n  function fire(type) {\n\n    var ActualEvent = require(81).Event;\n\n    var event = assign(new ActualEvent(), context.payload, context.data);\n\n    // default integration\n    if (eventBus.fire('drag.' + type, event) === false) {\n      return false;\n    }\n\n    return eventBus.fire(context.prefix + '.' + type, event);\n  }\n\n  // event listeners\n\n  function move(event, activate) {\n\n    var payload = context.payload,\n        start = context.start,\n        position = Event.toPoint(event),\n        delta = substract(position, start),\n        clientRect = canvas._container.getBoundingClientRect(),\n        offset;\n\n    // canvas relative position\n\n    offset = {\n      x: clientRect.left,\n      y: clientRect.top\n    };\n\n    // update actual event payload with canvas relative measures\n\n    var viewbox = canvas.viewbox();\n\n    var movement = {\n      x: viewbox.x + (position.x - offset.x) / viewbox.scale,\n      y: viewbox.y + (position.y - offset.y) / viewbox.scale,\n      dx: delta.x / viewbox.scale,\n      dy: delta.y / viewbox.scale\n    };\n\n    // activate context explicitly or once threshold is reached\n\n    if (!context.active && (activate || getLength(delta) > context.threshold)) {\n\n      // fire start event with original\n      // starting coordinates\n\n      assign(payload, {\n        x: movement.x - movement.dx,\n        y: movement.y - movement.dy,\n        dx: 0,\n        dy: 0\n      }, { originalEvent: event });\n\n      if (false === fire('start')) {\n        return cancel();\n      }\n\n      context.active = true;\n\n      // unset selection\n      if (!context.keepSelection) {\n        context.previousSelection = selection.get();\n        selection.select(null);\n      }\n\n      // allow custom cursor\n      if (context.cursor) {\n        Cursor.set(context.cursor);\n      }\n    }\n\n    suppressEvent(event);\n\n    if (context.active) {\n\n      // fire move event with actual coordinates\n      assign(payload, movement, { originalEvent: event });\n\n      fire('move');\n    }\n  }\n\n  function end(event) {\n\n    var returnValue = true;\n\n    if (context.active) {\n\n      if (event) {\n        context.payload.originalEvent = event;\n\n        // suppress original event (click, ...)\n        // because we just ended a drag operation\n        suppressEvent(event);\n      }\n\n      // implementations may stop restoring the\n      // original state (selections, ...) by preventing the\n      // end events default action\n      returnValue = fire('end');\n    }\n\n    if (returnValue === false) {\n      fire('rejected');\n    }\n\n    cleanup(returnValue !== true);\n  }\n\n\n  // cancel active drag operation if the user presses\n  // the ESC key on the keyboard\n\n  function checkCancel(event) {\n\n    if (event.which === 27) {\n      event.preventDefault();\n\n      cancel();\n    }\n  }\n\n\n  // prevent ghost click that might occur after a finished\n  // drag and drop session\n\n  function trapClickAndEnd(event) {\n\n    var untrap;\n\n    // trap the click in case we are part of an active\n    // drag operation. This will effectively prevent\n    // the ghost click that cannot be canceled otherwise.\n    if (context.active) {\n      untrap = ClickTrap.install();\n      setTimeout(untrap, 400);\n    }\n\n    end(event);\n  }\n\n  function trapTouch(event) {\n    move(event);\n  }\n\n  // update the drag events hover (djs.model.Base) and hoverGfx (Snap<SVGElement>)\n  // properties during hover and out and fire {prefix}.hover and {prefix}.out properties\n  // respectively\n\n  function hover(event) {\n    var payload = context.payload;\n\n    payload.hoverGfx = event.gfx;\n    payload.hover = event.element;\n\n    fire('hover');\n  }\n\n  function out(event) {\n    fire('out');\n\n    var payload = context.payload;\n\n    payload.hoverGfx = null;\n    payload.hover = null;\n  }\n\n\n  // life-cycle methods\n\n  function cancel(restore) {\n\n    if (!context) {\n      return;\n    }\n\n    if (context.active) {\n      fire('cancel');\n    }\n\n    cleanup(restore);\n  }\n\n  function cleanup(restore) {\n\n    fire('cleanup');\n\n    // reset cursor\n    Cursor.unset();\n\n    // reset dom listeners\n    domEvent.unbind(document, 'mousemove', move);\n\n    domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);\n    domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);\n\n    domEvent.unbind(document, 'keyup', checkCancel);\n\n    domEvent.unbind(document, 'touchstart', trapTouch, true);\n    domEvent.unbind(document, 'touchcancel', cancel, true);\n    domEvent.unbind(document, 'touchmove', move, true);\n    domEvent.unbind(document, 'touchend', end, true);\n\n    eventBus.off('element.hover', hover);\n    eventBus.off('element.out', out);\n\n    // restore selection, unless it has changed\n    if (restore !== false && context.previousSelection && !selection.get().length) {\n      selection.select(context.previousSelection);\n    }\n\n    context = null;\n  }\n\n  /**\n   * Activate a drag operation\n   *\n   * @param  {MouseEvent|TouchEvent} [event]\n   * @param  {String} prefix\n   * @param  {Object} [options]\n   */\n  function activate(event, prefix, options) {\n\n    // only one drag operation may be active, at a time\n    if (context) {\n      cancel(false);\n    }\n\n    options = assign({}, defaultOptions, options || {});\n\n    var data = options.data || {},\n        originalEvent,\n        start;\n\n    if (event) {\n      originalEvent = Event.getOriginal(event) || event;\n      start = Event.toPoint(event);\n\n      suppressEvent(event);\n    } else {\n      originalEvent = null;\n      start = { x: 0, y: 0 };\n    }\n\n    context = assign({\n      prefix: prefix,\n      data: data,\n      payload: {},\n      start: start\n    }, options);\n\n    // skip dom registration if trigger\n    // is set to manual (during testing)\n    if (!options.manual) {\n\n      // add dom listeners\n\n      // fixes TouchEvent not being available on desktop Firefox\n      if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {\n        domEvent.bind(document, 'touchstart', trapTouch, true);\n        domEvent.bind(document, 'touchcancel', cancel, true);\n        domEvent.bind(document, 'touchmove', move, true);\n        domEvent.bind(document, 'touchend', end, true);\n      } else {\n        // assume we use the mouse to interact per default\n        domEvent.bind(document, 'mousemove', move);\n\n        domEvent.bind(document, 'mousedown', trapClickAndEnd, true);\n        domEvent.bind(document, 'mouseup', trapClickAndEnd, true);\n      }\n\n      domEvent.bind(document, 'keyup', checkCancel);\n\n      eventBus.on('element.hover', hover);\n      eventBus.on('element.out', out);\n    }\n\n    fire('activate');\n\n    if (options.autoActivate) {\n      move(event, true);\n    }\n  }\n\n  // cancel on diagram destruction\n  eventBus.on('diagram.destroy', cancel);\n\n\n  // API\n\n  this.activate = activate;\n  this.move = move;\n  this.hover = hover;\n  this.out = out;\n  this.end = end;\n\n  this.cancel = cancel;\n\n  // for introspection\n\n  this.active = function() {\n    return context;\n  };\n\n  this.setOptions = function(options) {\n    assign(defaultOptions, options);\n  };\n}\n\nDragging.$inject = [ 'eventBus', 'canvas', 'selection' ];\n\nmodule.exports = Dragging;","module.exports = {\n  __depends__: [\n    require(151)\n  ],\n  dragging: [ 'type', require(100) ]\n};","'use strict';\n\nvar forEach = require(204),\n    domDelegate = require(342),\n    Renderer = require(84),\n    createLine = Renderer.createLine,\n    updateLine = Renderer.updateLine;\n\n\nvar isPrimaryButton = require(182).isPrimaryButton;\n\nvar Snap = require(188);\n\n/**\n * A plugin that provides interaction events for diagram elements.\n *\n * It emits the following events:\n *\n *   * element.hover\n *   * element.out\n *   * element.click\n *   * element.dblclick\n *   * element.mousedown\n *\n * Each event is a tuple { element, gfx, originalEvent }.\n *\n * Canceling the event via Event#preventDefault() prevents the original DOM operation.\n *\n * @param {EventBus} eventBus\n */\nfunction InteractionEvents(eventBus, elementRegistry, styles) {\n\n  var HIT_STYLE = styles.cls('djs-hit', [ 'no-fill', 'no-border' ], {\n    stroke: 'white',\n    strokeWidth: 15\n  });\n\n  function fire(type, event) {\n    var target = event.delegateTarget || event.target,\n        gfx = target && new Snap(target),\n        element = elementRegistry.get(gfx),\n        returnValue;\n\n    if (!gfx || !element) {\n      return;\n    }\n\n    returnValue = eventBus.fire(type, { element: element, gfx: gfx, originalEvent: event });\n\n    if (returnValue === false) {\n      event.stopPropagation();\n      event.preventDefault();\n    }\n  }\n\n  var handlers = {};\n\n  function mouseHandler(type) {\n\n    var fn = handlers[type];\n\n    if (!fn) {\n      fn = handlers[type] = function(event) {\n        // only indicate left mouse button interactions\n        if (isPrimaryButton(event)) {\n          fire(type, event);\n        }\n      };\n    }\n\n    return fn;\n  }\n\n  var bindings = {\n    mouseover: 'element.hover',\n    mouseout: 'element.out',\n    click: 'element.click',\n    dblclick: 'element.dblclick',\n    mousedown: 'element.mousedown',\n    mouseup: 'element.mouseup'\n  };\n\n  var elementSelector = 'svg, .djs-element';\n\n  ///// event registration\n\n  function registerEvent(node, event, localEvent) {\n    var handler = mouseHandler(localEvent);\n    handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);\n  }\n\n  function unregisterEvent(node, event, localEvent) {\n    domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);\n  }\n\n  function registerEvents(svg) {\n    forEach(bindings, function(val, key) {\n      registerEvent(svg.node, key, val);\n    });\n  }\n\n  function unregisterEvents(svg) {\n    forEach(bindings, function(val, key) {\n      unregisterEvent(svg.node, key, val);\n    });\n  }\n\n  eventBus.on('canvas.destroy', function(event) {\n    unregisterEvents(event.svg);\n  });\n\n  eventBus.on('canvas.init', function(event) {\n    registerEvents(event.svg);\n  });\n\n\n  eventBus.on([ 'shape.added', 'connection.added' ], function(event) {\n    var element = event.element,\n        gfx = event.gfx,\n        hit,\n        type;\n\n    if (element.waypoints) {\n      hit = createLine(element.waypoints);\n      type = 'connection';\n    } else {\n      hit = Snap.create('rect', { x: 0, y: 0, width: element.width, height: element.height });\n      type = 'shape';\n    }\n\n    hit.attr(HIT_STYLE).appendTo(gfx.node);\n  });\n\n  // update djs-hit on change\n\n  eventBus.on('shape.changed', function(event) {\n\n    var element = event.element,\n        gfx = event.gfx,\n        hit = gfx.select('.djs-hit');\n\n    hit.attr({\n      width: element.width,\n      height: element.height\n    });\n  });\n\n  eventBus.on('connection.changed', function(event) {\n\n    var element = event.element,\n        gfx = event.gfx,\n        hit = gfx.select('.djs-hit');\n\n    updateLine(hit, element.waypoints);\n  });\n\n\n  // API\n\n  this.fire = fire;\n\n  this.mouseHandler = mouseHandler;\n\n  this.registerEvent = registerEvent;\n  this.unregisterEvent = unregisterEvent;\n}\n\n\nInteractionEvents.$inject = [ 'eventBus', 'elementRegistry', 'styles' ];\n\nmodule.exports = InteractionEvents;\n\n\n/**\n * An event indicating that the mouse hovered over an element\n *\n * @event element.hover\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has left an element\n *\n * @event element.out\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has clicked an element\n *\n * @event element.click\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has double clicked an element\n *\n * @event element.dblclick\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone down on an element.\n *\n * @event element.mousedown\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */\n\n/**\n * An event indicating that the mouse has gone up on an element.\n *\n * @event element.mouseup\n *\n * @type {Object}\n * @property {djs.model.Base} element\n * @property {Snap<Element>} gfx\n * @property {Event} originalEvent\n */","module.exports = {\n  __init__: [ 'interactionEvents' ],\n  interactionEvents: [ 'type', require(102) ]\n};","'use strict';\n\nvar domEvent = require(344),\n    domMatches = require(345);\n\n/**\n * A keyboard abstraction that may be activated and\n * deactivated by users at will, consuming key events\n * and triggering diagram actions.\n *\n * The implementation fires the following key events that allow\n * other components to hook into key handling:\n *\n *  - keyboard.bind\n *  - keyboard.unbind\n *  - keyboard.init\n *  - keyboard.destroy\n *\n * All events contain the fields (node, listeners).\n *\n * A default binding for the keyboard may be specified via the\n * `keyboard.bindTo` configuration option.\n *\n * @param {EventBus} eventBus\n * @param {CommandStack} commandStack\n * @param {Modeling} modeling\n * @param {Selection} selection\n */\nfunction Keyboard(config, eventBus, commandStack, modeling, selection) {\n\n  var self = this;\n\n  this._commandStack = commandStack;\n  this._modeling = modeling;\n  this._selection = selection;\n  this._eventBus = eventBus;\n\n  this._listeners = [];\n\n  // our key handler is a singleton that passes\n  // (keycode, modifiers) to each listener.\n  //\n  // listeners must indicate that they handled a key event\n  // by returning true. This stops the event propagation.\n  //\n  this._keyHandler = function(event) {\n\n    var i, l,\n        target = event.target,\n        listeners = self._listeners,\n        code = event.keyCode || event.charCode || -1;\n\n    if (domMatches(target, 'input, textarea')) {\n      return;\n    }\n\n    for (i = 0; !!(l = listeners[i]); i++) {\n      if (l(code, event)) {\n        event.stopPropagation();\n      }\n    }\n  };\n\n  // properly clean dom registrations\n  eventBus.on('diagram.destroy', function() {\n    self._fire('destroy');\n\n    self.unbind();\n    self._listeners = null;\n  });\n\n  eventBus.on('diagram.init', function() {\n    self._fire('init');\n\n    if (config && config.bindTo) {\n      self.bind(config.bindTo);\n    }\n  });\n\n  this._init();\n}\n\nKeyboard.$inject = [ 'config.keyboard', 'eventBus', 'commandStack', 'modeling', 'selection' ];\n\nmodule.exports = Keyboard;\n\n\nKeyboard.prototype.bind = function(node) {\n  this._node = node;\n\n  // bind key events\n  domEvent.bind(node, 'keydown', this._keyHandler, true);\n\n  this._fire('bind');\n};\n\nKeyboard.prototype.getBinding = function() {\n  return this._node;\n};\n\nKeyboard.prototype.unbind = function() {\n  var node = this._node;\n\n  if (node) {\n    this._fire('unbind');\n\n    // unbind key events\n    domEvent.unbind(node, 'keydown', this._keyHandler, true);\n  }\n\n  this._node = null;\n};\n\n\nKeyboard.prototype._fire = function(event) {\n  this._eventBus.fire('keyboard.' + event, { node: this._node, listeners: this._listeners });\n};\n\nKeyboard.prototype._init = function() {\n\n  var listeners = this._listeners,\n      commandStack = this._commandStack,\n      modeling = this._modeling,\n      selection = this._selection;\n\n\n  // init default listeners\n\n  // undo\n  // (CTRL|CMD) + Z\n  function undo(key, modifiers) {\n\n    if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {\n      commandStack.undo();\n\n      return true;\n    }\n  }\n\n  // redo\n  // CTRL + Y\n  // CMD + SHIFT + Z\n  function redo(key, modifiers) {\n\n    if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {\n      commandStack.redo();\n\n      return true;\n    }\n  }\n\n\n  // delete selected element\n  // DEL\n  function remove(key, modifiers) {\n\n    if (key === 46) {\n\n      var selectedElements = selection.get();\n\n      if (selectedElements.length) {\n        modeling.removeElements(selectedElements.slice());\n      }\n\n      return true;\n    }\n  }\n\n  listeners.push(undo);\n  listeners.push(redo);\n  listeners.push(remove);\n};\n\n\n/**\n * Add a listener function that is notified with (key, modifiers) whenever\n * the keyboard is bound and the user presses a key.\n *\n * @param {Function} listenerFn\n */\nKeyboard.prototype.addListener = function(listenerFn) {\n  this._listeners.push(listenerFn);\n};\n\nKeyboard.prototype.hasModifier = hasModifier;\nKeyboard.prototype.isCmd = isCmd;\nKeyboard.prototype.isShift = isShift;\n\n\nfunction hasModifier(modifiers) {\n  return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);\n}\n\nfunction isCmd(modifiers) {\n  return modifiers.ctrlKey || modifiers.metaKey;\n}\n\nfunction isShift(modifiers) {\n  return modifiers.shiftKey;\n}\n","module.exports = {\n  __init__: [ 'keyboard' ],\n  keyboard: [ 'type', require(104) ]\n};\n","'use strict';\n\nvar values = require(331);\n\nvar getEnclosedElements = require(177).getEnclosedElements;\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier;\n\nvar Snap = require(188);\n\n\nfunction LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {\n\n  this._selection = selection;\n  this._dragging = dragging;\n\n  var self = this;\n\n  // lasso visuals implementation\n\n  /**\n  * A helper that realizes the selection box visual\n  */\n  var visuals = {\n\n    create: function(context) {\n      var container = canvas.getDefaultLayer(),\n          frame;\n\n      frame = context.frame = Snap.create('rect', {\n        class: 'djs-lasso-overlay',\n        width:  1,\n        height: 1,\n        x: 0,\n        y: 0\n      });\n\n      frame.appendTo(container);\n    },\n\n    update: function(context) {\n      var frame = context.frame,\n          bbox  = context.bbox;\n\n      frame.attr({\n        x: bbox.x,\n        y: bbox.y,\n        width: bbox.width,\n        height: bbox.height\n      });\n    },\n\n    remove: function(context) {\n\n      if (context.frame) {\n        context.frame.remove();\n      }\n    }\n  };\n\n\n  eventBus.on('lasso.selection.end', function(event) {\n\n    setTimeout(function() {\n      self.activateLasso(event.originalEvent, true);\n    });\n  });\n\n  // lasso interaction implementation\n\n  eventBus.on('lasso.end', function(event) {\n\n    var bbox = toBBox(event);\n\n    var elements = elementRegistry.filter(function(element) {\n      return element;\n    });\n\n    self.select(elements, bbox);\n  });\n\n  eventBus.on('lasso.start', function(event) {\n\n    var context = event.context;\n\n    context.bbox = toBBox(event);\n    visuals.create(context);\n  });\n\n  eventBus.on('lasso.move', function(event) {\n\n    var context = event.context;\n\n    context.bbox = toBBox(event);\n    visuals.update(context);\n  });\n\n  eventBus.on('lasso.end', function(event) {\n\n    var context = event.context;\n\n    visuals.remove(context);\n  });\n\n  eventBus.on('lasso.cleanup', function(event) {\n\n    var context = event.context;\n\n    visuals.remove(context);\n  });\n\n\n  // event integration\n\n  eventBus.on('element.mousedown', 1500, function(event) {\n\n    if (hasPrimaryModifier(event)) {\n      self.activateLasso(event.originalEvent);\n\n      event.stopPropagation();\n    }\n  });\n}\n\nLassoTool.$inject = [\n  'eventBus',\n  'canvas',\n  'dragging',\n  'elementRegistry',\n  'selection'\n];\n\nmodule.exports = LassoTool;\n\n\nLassoTool.prototype.activateLasso = function(event, autoActivate) {\n\n  this._dragging.activate(event, 'lasso', {\n    autoActivate: autoActivate,\n    cursor: 'crosshair',\n    data: {\n      context: {}\n    }\n  });\n};\n\nLassoTool.prototype.activateSelection = function(event) {\n\n  this._dragging.activate(event, 'lasso.selection', {\n    cursor: 'crosshair'\n  });\n};\n\nLassoTool.prototype.select = function(elements, bbox) {\n  var selectedElements = getEnclosedElements(elements, bbox);\n\n  this._selection.select(values(selectedElements));\n};\n\n\nfunction toBBox(event) {\n\n  var start = {\n\n    x: event.x - event.dx,\n    y: event.y - event.dy\n  };\n\n  var end = {\n    x: event.x,\n    y: event.y\n  };\n\n  var bbox;\n\n  if ((start.x <= end.x && start.y < end.y) ||\n      (start.x < end.x && start.y <= end.y)) {\n\n      bbox = {\n        x: start.x,\n        y: start.y,\n        width:  end.x - start.x,\n        height: end.y - start.y\n      };\n  } else if ((start.x >= end.x && start.y < end.y) ||\n             (start.x > end.x && start.y <= end.y)) {\n\n    bbox = {\n      x: end.x,\n      y: start.y,\n      width:  start.x - end.x,\n      height: end.y - start.y\n    };\n  } else if ((start.x <= end.x && start.y > end.y) ||\n             (start.x < end.x && start.y >= end.y)) {\n\n    bbox = {\n      x: start.x,\n      y: end.y,\n      width:  end.x - start.x,\n      height: start.y - end.y\n    };\n  } else if ((start.x >= end.x && start.y > end.y) ||\n             (start.x > end.x && start.y >= end.y)) {\n\n    bbox = {\n      x: end.x,\n      y: end.y,\n      width:  start.x - end.x,\n      height: start.y - end.y\n    };\n  } else {\n\n    bbox = {\n      x: end.x,\n      y: end.y,\n      width:  0,\n      height: 0\n    };\n  }\n  return bbox;\n}","'use strict';\n\nmodule.exports = {\n  __init__: [ 'lassoTool' ],\n  lassoTool: [ 'type', require(106) ]\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar model = require(168);\n\n\n/**\n * The basic modeling entry point.\n *\n * @param {EventBus} eventBus\n * @param {ElementFactory} elementFactory\n * @param {CommandStack} commandStack\n */\nfunction Modeling(eventBus, elementFactory, commandStack) {\n  this._eventBus = eventBus;\n  this._elementFactory = elementFactory;\n  this._commandStack = commandStack;\n\n  var self = this;\n\n  eventBus.on('diagram.init', function() {\n    // register modeling handlers\n    self.registerHandlers(commandStack);\n  });\n}\n\nModeling.$inject = [ 'eventBus', 'elementFactory', 'commandStack' ];\n\nmodule.exports = Modeling;\n\n\nModeling.prototype.getHandlers = function() {\n  return {\n    'shape.append': require(109),\n    'shape.create': require(112),\n    'shape.delete': require(115),\n    'shape.move': require(118),\n    'shapes.move': require(119),\n    'shape.resize': require(123),\n    'shape.replace': require(122),\n\n    'spaceTool': require(124),\n\n    'label.create': require(111),\n\n    'connection.create': require(110),\n    'connection.delete': require(113),\n    'connection.move': require(117),\n    'connection.layout': require(116),\n\n    'connection.updateWaypoints': require(126),\n\n    'connection.reconnectStart': require(121),\n    'connection.reconnectEnd': require(121),\n\n    'elements.delete': require(114),\n    'element.updateAnchors': require(125)\n  };\n};\n\n/**\n * Register handlers with the command stack\n *\n * @param {CommandStack} commandStack\n */\nModeling.prototype.registerHandlers = function(commandStack) {\n  forEach(this.getHandlers(), function(handler, id) {\n    commandStack.registerHandler(id, handler);\n  });\n};\n\n\n///// modeling helpers /////////////////////////////////////////\n\n\nModeling.prototype.moveShape = function(shape, delta, newParent, hints) {\n\n  var context = {\n    shape: shape,\n    delta:  delta,\n    newParent: newParent,\n    hints: hints || {}\n  };\n\n  this._commandStack.execute('shape.move', context);\n};\n\n\nModeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {\n\n  var context = {\n    shapes: shapes,\n    delta: delta,\n    newParent: newParent,\n    hints: hints || {}\n  };\n\n  this._commandStack.execute('shapes.move', context);\n};\n\n/**\n * Update the anchors on the element with the given delta movement\n * @param  {djs.model.Element} element\n * @param  {Point} delta\n */\nModeling.prototype.updateAnchors = function(element, delta) {\n  var context = {\n    element: element,\n    delta: delta\n  };\n\n  this._commandStack.execute('element.updateAnchors', context);\n};\n\nModeling.prototype.moveConnection = function(connection, delta, newParent, hints) {\n\n  var context = {\n    connection: connection,\n    delta: delta,\n    newParent: newParent,\n    hints: hints || {}\n  };\n\n  this._commandStack.execute('connection.move', context);\n};\n\n\nModeling.prototype.layoutConnection = function(connection, hints) {\n\n  var context = {\n    connection: connection,\n    hints: hints || {}\n  };\n\n  this._commandStack.execute('connection.layout', context);\n};\n\n\nModeling.prototype.createConnection = function(source, target, connection, parent) {\n\n  connection = this._create('connection', connection);\n\n  var context = {\n    source: source,\n    target: target,\n    parent: parent,\n    connection: connection\n  };\n\n  this._commandStack.execute('connection.create', context);\n\n  return context.connection;\n};\n\nModeling.prototype.createShape = function(shape, position, parent) {\n\n  shape = this._create('shape', shape);\n\n  var context = {\n    position: position,\n    parent: parent,\n    shape: shape\n  };\n\n  this._commandStack.execute('shape.create', context);\n\n  return context.shape;\n};\n\n\nModeling.prototype.createLabel = function(labelTarget, position, label, parent) {\n\n  label = this._create('label', label);\n\n  var context = {\n    labelTarget: labelTarget,\n    position: position,\n    parent: parent,\n    shape: label\n  };\n\n  this._commandStack.execute('label.create', context);\n\n  return context.shape;\n};\n\n\nModeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {\n\n  shape = this._create('shape', shape);\n\n  var context = {\n    source: source,\n    position: position,\n    parent: parent,\n    shape: shape,\n    connection: connection,\n    connectionParent: connectionParent\n  };\n\n  this._commandStack.execute('shape.append', context);\n\n  return context.shape;\n};\n\n\nModeling.prototype.removeElements = function(elements) {\n  var context = {\n    elements: elements\n  };\n\n  this._commandStack.execute('elements.delete', context);\n};\n\n\nModeling.prototype.removeShape = function(shape) {\n  var context = {\n    shape: shape\n  };\n\n  this._commandStack.execute('shape.delete', context);\n};\n\n\nModeling.prototype.removeConnection = function(connection) {\n  var context = {\n    connection: connection\n  };\n\n  this._commandStack.execute('connection.delete', context);\n};\n\nModeling.prototype.replaceShape = function(oldShape, newShape, options) {\n  var context = {\n    oldShape: oldShape,\n    newData: newShape,\n    options: options\n  };\n\n  this._commandStack.execute('shape.replace', context);\n\n  return context.newShape;\n};\n\nModeling.prototype.resizeShape = function(shape, newBounds) {\n  var context = {\n    shape: shape,\n    newBounds: newBounds\n  };\n\n  this._commandStack.execute('shape.resize', context);\n};\n\nModeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {\n  var context = {\n    movingShapes: movingShapes,\n    resizingShapes: resizingShapes,\n    delta: delta,\n    direction: direction\n  };\n\n  this._commandStack.execute('spaceTool', context);\n};\n\nModeling.prototype.updateWaypoints = function(connection, newWaypoints) {\n  var context = {\n    connection: connection,\n    newWaypoints: newWaypoints\n  };\n\n  this._commandStack.execute('connection.updateWaypoints', context);\n};\n\nModeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {\n  var context = {\n    connection: connection,\n    newSource: newSource,\n    dockingPoint: dockingPoint\n  };\n\n  this._commandStack.execute('connection.reconnectStart', context);\n};\n\nModeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {\n  var context = {\n    connection: connection,\n    newTarget: newTarget,\n    dockingPoint: dockingPoint\n  };\n\n  this._commandStack.execute('connection.reconnectEnd', context);\n};\n\nModeling.prototype.connect = function(source, target, attrs) {\n  return this.createConnection(source, target, attrs || {}, source.parent);\n};\n\n\nModeling.prototype._create = function(type, attrs) {\n  if (attrs instanceof model.Base) {\n    return attrs;\n  } else {\n    return this._elementFactory.create(type, attrs);\n  }\n};\n","'use strict';\n\nvar inherits = require(195);\n\n\n/**\n * A handler that implements reversible appending of shapes\n * to a source shape.\n *\n * @param {canvas} Canvas\n * @param {elementFactory} ElementFactory\n * @param {modeling} Modeling\n */\nfunction AppendShapeHandler(modeling) {\n  this._modeling = modeling;\n}\n\ninherits(AppendShapeHandler, require(120));\n\n\nAppendShapeHandler.$inject = [ 'modeling' ];\n\nmodule.exports = AppendShapeHandler;\n\n\n////// api /////////////////////////////////////////////\n\n/**\n * Creates a new shape\n *\n * @param {Object} context\n * @param {ElementDescriptor} context.shape the new shape\n * @param {ElementDescriptor} context.source the source object\n * @param {ElementDescriptor} context.parent the parent object\n * @param {Point} context.position position of the new element\n */\nAppendShapeHandler.prototype.preExecute = function(context) {\n\n  if (!context.source) {\n    throw new Error('source required');\n  }\n\n  var parent = context.parent || context.source.parent,\n      shape = this._modeling.createShape(context.shape, context.position, parent);\n\n  context.shape = shape;\n};\n\nAppendShapeHandler.prototype.postExecute = function(context) {\n  var parent = context.connectionParent || context.shape.parent;\n\n  // create connection\n  this._modeling.connect(context.source, context.shape, context.connection, parent);\n};","'use strict';\n\n\nfunction CreateConnectionHandler(canvas, layouter) {\n  this._canvas = canvas;\n  this._layouter = layouter;\n}\n\nCreateConnectionHandler.$inject = [ 'canvas', 'layouter' ];\n\nmodule.exports = CreateConnectionHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n/**\n * Appends a shape to a target shape\n *\n * @param {Object} context\n * @param {djs.element.Base} context.source the source object\n * @param {djs.element.Base} context.target the parent object\n * @param {Point} context.position position of the new element\n */\nCreateConnectionHandler.prototype.execute = function(context) {\n\n  var source = context.source,\n      target = context.target,\n      parent = context.parent;\n\n  if (!source || !target) {\n    throw new Error('source and target required');\n  }\n\n  if (!parent) {\n    throw new Error('parent required');\n  }\n\n  var connection = context.connection;\n\n  connection.source = source;\n  connection.target = target;\n\n  if (!connection.waypoints) {\n    connection.waypoints = this._layouter.layoutConnection(connection);\n  }\n\n  // add connection\n  this._canvas.addConnection(connection, parent);\n\n  return connection;\n};\n\nCreateConnectionHandler.prototype.revert = function(context) {\n  var connection = context.connection;\n\n  this._canvas.removeConnection(connection);\n\n  connection.source = null;\n  connection.target = null;\n};","'use strict';\n\nvar inherits = require(195);\n\nvar CreateShapeHandler = require(112);\n\n\n/**\n * A handler that attaches a label to a given target shape.\n *\n * @param {canvas} Canvas\n */\nfunction CreateLabelHandler(canvas) {\n  CreateShapeHandler.call(this, canvas);\n}\n\ninherits(CreateLabelHandler, CreateShapeHandler);\n\nCreateLabelHandler.$inject = [ 'canvas' ];\n\nmodule.exports = CreateLabelHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n\n/**\n * Appends a label to a target shape.\n *\n * @method CreateLabelHandler#execute\n *\n * @param {Object} context\n * @param {ElementDescriptor} context.target the element the label is attached to\n * @param {ElementDescriptor} context.parent the parent object\n * @param {Point} context.position position of the new element\n */\n\n/**\n * Undo append by removing the shape\n */\nCreateLabelHandler.prototype.revert = function(context) {\n  context.shape.labelTarget = null;\n  this._canvas.removeShape(context.shape);\n};\n\n\n////// helpers /////////////////////////////////////////\n\nCreateLabelHandler.prototype.getParent = function(context) {\n  return context.parent || context.labelTarget && context.labelTarget.parent;\n};\n\nCreateLabelHandler.prototype.addElement = function(shape, parent, context) {\n  shape.labelTarget = context.labelTarget;\n  this._canvas.addShape(shape, parent, true);\n};","'use strict';\n\nvar assign = require(325);\n\n\n/**\n * A handler that implements reversible addition of shapes.\n *\n * @param {canvas} Canvas\n */\nfunction CreateShapeHandler(canvas) {\n  this._canvas = canvas;\n}\n\nCreateShapeHandler.$inject = [ 'canvas' ];\n\nmodule.exports = CreateShapeHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n\n/**\n * Appends a shape to a target shape\n *\n * @param {Object} context\n * @param {djs.model.Base} context.parent the parent object\n * @param {Point} context.position position of the new element\n */\nCreateShapeHandler.prototype.execute = function(context) {\n\n  var parent = this.getParent(context);\n\n  var shape = context.shape;\n\n  this.setPosition(shape, context);\n\n  this.addElement(shape, parent, context);\n\n  return shape;\n};\n\n\n/**\n * Undo append by removing the shape\n */\nCreateShapeHandler.prototype.revert = function(context) {\n  this._canvas.removeShape(context.shape);\n};\n\n\n////// helpers /////////////////////////////////////////\n\nCreateShapeHandler.prototype.getParent = function(context) {\n  var parent = context.parent;\n\n  if (!parent) {\n    throw new Error('parent required');\n  }\n\n  return parent;\n};\n\nCreateShapeHandler.prototype.getPosition = function(context) {\n  if (!context.position) {\n    throw new Error('no position given');\n  }\n\n  return context.position;\n};\n\nCreateShapeHandler.prototype.addElement = function(shape, parent) {\n  this._canvas.addShape(shape, parent);\n};\n\nCreateShapeHandler.prototype.setPosition = function(shape, context) {\n  var position = this.getPosition(context);\n\n  // update to center position\n  // specified in create context\n  assign(shape, {\n    x: position.x - shape.width / 2,\n    y: position.y - shape.height / 2\n  });\n};","'use strict';\n\nvar Collections = require(175);\n\n\n/**\n * A handler that implements reversible deletion of Connections.\n *\n */\nfunction DeleteConnectionHandler(canvas, modeling) {\n  this._canvas = canvas;\n  this._modeling = modeling;\n}\n\nDeleteConnectionHandler.$inject = [ 'canvas', 'modeling' ];\n\nmodule.exports = DeleteConnectionHandler;\n\n\n/**\n * - Remove attached label\n */\nDeleteConnectionHandler.prototype.preExecute = function(context) {\n\n  var connection = context.connection;\n\n  // Remove label\n  if (connection.label) {\n    this._modeling.removeShape(connection.label);\n  }\n};\n\nDeleteConnectionHandler.prototype.execute = function(context) {\n\n  var connection = context.connection,\n      parent = connection.parent;\n\n  context.parent = parent;\n  context.parentIndex = Collections.indexOf(parent.children, connection);\n\n  context.source = connection.source;\n  context.target = connection.target;\n\n  this._canvas.removeConnection(connection);\n\n  connection.source = null;\n  connection.target = null;\n  connection.label  = null;\n};\n\n/**\n * Command revert implementation.\n */\nDeleteConnectionHandler.prototype.revert = function(context) {\n\n  var connection = context.connection,\n      parent = context.parent,\n      parentIndex = context.parentIndex;\n\n  connection.source = context.source;\n  connection.target = context.target;\n\n  // restore previous location in old parent\n  Collections.add(parent.children, connection, parentIndex);\n\n  this._canvas.addConnection(connection, parent);\n};\n","'use strict';\n\nvar forEach = require(204),\n    inherits = require(195);\n\n\nfunction DeleteElementsHandler(modeling, elementRegistry) {\n  this._modeling = modeling;\n  this._elementRegistry = elementRegistry;\n}\n\ninherits(DeleteElementsHandler, require(120));\n\nDeleteElementsHandler.$inject = [ 'modeling', 'elementRegistry' ];\n\nmodule.exports = DeleteElementsHandler;\n\n\nDeleteElementsHandler.prototype.postExecute = function(context) {\n\n  var modeling = this._modeling,\n      elementRegistry = this._elementRegistry,\n      elements = context.elements;\n\n  forEach(elements, function(element) {\n\n    // element may have been removed with previous\n    // remove operations already (e.g. in case of nesting)\n    if (!elementRegistry.get(element.id)) {\n      return;\n    }\n\n    if (element.waypoints) {\n      modeling.removeConnection(element);\n    } else {\n      modeling.removeShape(element);\n    }\n  });\n};","'use strict';\n\nvar Collections = require(175);\n\n\n/**\n * A handler that implements reversible deletion of shapes.\n *\n */\nfunction DeleteShapeHandler(canvas, modeling) {\n  this._canvas = canvas;\n  this._modeling = modeling;\n}\n\nDeleteShapeHandler.$inject = [ 'canvas', 'modeling' ];\n\nmodule.exports = DeleteShapeHandler;\n\n\n/**\n * - Remove connections\n * - Remove all direct children\n */\nDeleteShapeHandler.prototype.preExecute = function(context) {\n\n  var shape    = context.shape,\n      label    = shape.label,\n      modeling = this._modeling;\n\n  // Clean up on removeShape(label)\n  if (shape.labelTarget) {\n    context.labelTarget = shape.labelTarget;\n    shape.labelTarget = null;\n  }\n\n  // Remove label\n  if (label) {\n    this._modeling.removeShape(label);\n  }\n\n  // remove connections\n  this._saveClear(shape.incoming, function(connection) {\n    // To make sure that the connection isn't removed twice\n    // For example if a container is removed\n    modeling.removeConnection(connection);\n  });\n\n  this._saveClear(shape.outgoing, function(connection) {\n    modeling.removeConnection(connection);\n  });\n\n\n  // remove children\n  this._saveClear(shape.children, function(e) {\n    modeling.removeShape(e);\n  });\n};\n\n\nDeleteShapeHandler.prototype._saveClear = function(collection, remove) {\n\n  var e;\n\n  while (!!(e = collection[0])) {\n    remove(e);\n  }\n};\n\n\n/**\n * Remove shape and remember the parent\n */\nDeleteShapeHandler.prototype.execute = function(context) {\n\n  var shape = context.shape,\n      parent = shape.parent;\n\n  context.parent = parent;\n  context.parentIndex = Collections.indexOf(parent.children, shape);\n\n  shape.label = null;\n\n  this._canvas.removeShape(shape);\n};\n\n\n/**\n * Command revert implementation\n */\nDeleteShapeHandler.prototype.revert = function(context) {\n\n  var shape = context.shape,\n      parent = context.parent,\n      parentIndex = context.parentIndex,\n      labelTarget = context.labelTarget;\n\n  // restore previous location in old parent\n  Collections.add(parent.children, shape, parentIndex);\n\n  if (labelTarget) {\n    labelTarget.label = shape;\n  }\n\n  this._canvas.addShape(shape, parent);\n};\n","'use strict';\n\nvar assign = require(325);\n\n\n/**\n * A handler that implements reversible moving of shapes.\n */\nfunction LayoutConnectionHandler(layouter, canvas) {\n  this._layouter = layouter;\n  this._canvas = canvas;\n}\n\nLayoutConnectionHandler.$inject = [ 'layouter', 'canvas' ];\n\nmodule.exports = LayoutConnectionHandler;\n\nLayoutConnectionHandler.prototype.execute = function(context) {\n\n  var connection = context.connection,\n      parent = connection.parent,\n      connectionSiblings = parent.children;\n\n  var oldIndex = connectionSiblings.indexOf(connection);\n\n  assign(context, {\n    oldWaypoints: connection.waypoints,\n    oldIndex: oldIndex\n  });\n\n  sendToFront(connection);\n\n  connection.waypoints = this._layouter.layoutConnection(connection, context.hints);\n\n  return connection;\n};\n\nLayoutConnectionHandler.prototype.revert = function(context) {\n\n  var connection = context.connection,\n      parent = connection.parent,\n      connectionSiblings = parent.children,\n      currentIndex = connectionSiblings.indexOf(connection),\n      oldIndex = context.oldIndex;\n\n  connection.waypoints = context.oldWaypoints;\n\n  if (oldIndex !== currentIndex) {\n\n    // change position of connection in shape\n    connectionSiblings.splice(currentIndex, 1);\n    connectionSiblings.splice(oldIndex, 0, connection);\n  }\n\n  return connection;\n};\n\n// connections should have a higher z-order as there source and targets\nfunction sendToFront(connection) {\n\n  var connectionSiblings = connection.parent.children;\n\n  var connectionIdx = connectionSiblings.indexOf(connection),\n      sourceIdx = findIndex(connectionSiblings, connection.source),\n      targetIdx = findIndex(connectionSiblings, connection.target),\n\n      // ensure we do not send the connection back\n      // if it is already in front\n      insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);\n\n  if (connectionIdx < insertIndex) {\n    connectionSiblings.splice(insertIndex, 0, connection); // add to new position\n    connectionSiblings.splice(connectionIdx, 1); // remove from old position\n  }\n\n  function findIndex(array, obj) {\n\n    var index = array.indexOf(obj);\n    if (index < 0 && obj) {\n      var parent = obj.parent;\n      index = findIndex(array, parent);\n    }\n    return index;\n  }\n\n  return insertIndex;\n}\n","'use strict';\n\nvar forEach = require(204);\n\nvar Collections = require(175);\n\n\n/**\n * A handler that implements reversible moving of connections.\n *\n * The handler differs from the layout connection handler in a sense\n * that it preserves the connection layout.\n */\nfunction MoveConnectionHandler() { }\n\nmodule.exports = MoveConnectionHandler;\n\n\nMoveConnectionHandler.prototype.execute = function(context) {\n\n  var updateAnchors = (context.hints.updateAnchors !== false);\n\n  var connection  = context.connection,\n      delta       = context.delta;\n\n  var newParent = this.getNewParent(connection, context),\n      oldParent = connection.parent;\n\n  // save old position + parent in context\n  context.oldParent = oldParent;\n  context.oldParentIndex = Collections.indexOf(oldParent.children, connection);\n\n  // update waypoint positions\n  forEach(connection.waypoints, function(p) {\n    p.x += delta.x;\n    p.y += delta.y;\n\n    if (updateAnchors && p.original) {\n      p.original.x += delta.x;\n      p.original.y += delta.y;\n    }\n  });\n\n  // update parent\n  connection.parent = newParent;\n\n  return connection;\n};\n\nMoveConnectionHandler.prototype.revert = function(context) {\n\n  var updateAnchors = (context.hints.updateAnchors !== false);\n\n  var connection = context.connection,\n      oldParent = context.oldParent,\n      oldParentIndex = context.oldParentIndex,\n      delta = context.delta;\n\n  // restore previous location in old parent\n  Collections.add(oldParent.children, connection, oldParentIndex);\n\n  // restore parent\n  connection.parent = oldParent;\n\n  // revert to old waypoint positions\n  forEach(connection.waypoints, function(p) {\n    p.x -= delta.x;\n    p.y -= delta.y;\n\n    if (updateAnchors && p.original) {\n      p.original.x -= delta.x;\n      p.original.y -= delta.y;\n    }\n  });\n\n  return connection;\n};\n\n\nMoveConnectionHandler.prototype.getNewParent = function(connection, context) {\n  return context.newParent || connection.parent;\n};\n","'use strict';\n\nvar assign = require(325),\n    forEach = require(204);\n\nvar MoveHelper = require(127),\n    Collections = require(175);\n\n\n/**\n * A handler that implements reversible moving of shapes.\n */\nfunction MoveShapeHandler(modeling) {\n  this._modeling = modeling;\n\n  this._helper = new MoveHelper(modeling);\n}\n\nMoveShapeHandler.$inject = [ 'modeling' ];\n\nmodule.exports = MoveShapeHandler;\n\n\nMoveShapeHandler.prototype.execute = function(context) {\n\n  var shape = context.shape,\n      delta = context.delta,\n      newParent = this.getNewParent(context),\n      oldParent = shape.parent;\n\n  // save old parent in context\n  context.oldParent = oldParent;\n  context.oldParentIndex = Collections.indexOf(oldParent.children, shape);\n\n  // update shape parent + position\n  assign(shape, {\n    parent: newParent,\n    x: shape.x + delta.x,\n    y: shape.y + delta.y\n  });\n\n  return shape;\n};\n\nMoveShapeHandler.prototype.postExecute = function(context) {\n\n  var shape = context.shape,\n      delta = context.delta;\n\n  var modeling = this._modeling;\n\n  if (context.hints.updateAnchors !== false) {\n    modeling.updateAnchors(shape, delta);\n  }\n\n  if (context.hints.layout !== false) {\n    forEach(shape.incoming, function(c) {\n      modeling.layoutConnection(c, { endChanged: true });\n    });\n\n    forEach(shape.outgoing, function(c) {\n      modeling.layoutConnection(c, { startChanged: true });\n    });\n  }\n\n  if (context.hints.recurse !== false) {\n    this.moveChildren(context);\n  }\n};\n\nMoveShapeHandler.prototype.revert = function(context) {\n\n  var shape = context.shape,\n      oldParent = context.oldParent,\n      oldParentIndex = context.oldParentIndex,\n      delta = context.delta;\n\n  // restore previous location in old parent\n  Collections.add(oldParent.children, shape, oldParentIndex);\n\n  // revert to old position and parent\n  assign(shape, {\n    parent: oldParent,\n    x: shape.x - delta.x,\n    y: shape.y - delta.y\n  });\n\n  return shape;\n};\n\nMoveShapeHandler.prototype.moveChildren = function(context) {\n\n  var delta = context.delta,\n      shape = context.shape;\n\n  this._helper.moveRecursive(shape.children, delta, null);\n};\n\nMoveShapeHandler.prototype.getNewParent = function(context) {\n  return context.newParent || context.shape.parent;\n};","'use strict';\n\nvar MoveHelper = require(127);\n\n\n/**\n * A handler that implements reversible moving of shapes.\n */\nfunction MoveShapesHandler(modeling) {\n  this._helper = new MoveHelper(modeling);\n}\n\nMoveShapesHandler.$inject = [ 'modeling' ];\n\nmodule.exports = MoveShapesHandler;\n\nMoveShapesHandler.prototype.preExecute = function(context) {\n  context.closure = this._helper.getClosure(context.shapes);\n};\n\nMoveShapesHandler.prototype.postExecute = function(context) {\n  this._helper.moveClosure(context.closure, context.delta, context.newParent);\n};\n\n\nMoveShapesHandler.prototype.execute = function(context) { };\nMoveShapesHandler.prototype.revert = function(context) { };\n","'use strict';\n\nfunction NoopHandler() {}\n\nmodule.exports = NoopHandler;\n\nNoopHandler.prototype.execute = function() {};\nNoopHandler.prototype.revert = function() {};","'use strict';\n\n\nfunction ReconnectConnectionHandler(layouter) { }\n\nReconnectConnectionHandler.$inject = [ 'layouter' ];\n\nmodule.exports = ReconnectConnectionHandler;\n\nReconnectConnectionHandler.prototype.execute = function(context) {\n\n  var newSource = context.newSource,\n      newTarget = context.newTarget,\n      connection = context.connection;\n\n  if (!newSource && !newTarget) {\n    throw new Error('newSource or newTarget are required');\n  }\n\n  if (newSource && newTarget) {\n    throw new Error('must specify either newSource or newTarget');\n  }\n\n  if (newSource) {\n    context.oldSource = connection.source;\n    connection.source = newSource;\n\n    context.oldDockingPoint = connection.waypoints[0];\n    connection.waypoints[0] = context.dockingPoint;\n  }\n\n  if (newTarget) {\n    context.oldTarget = connection.target;\n    connection.target = newTarget;\n\n    context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];\n    connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;\n  }\n\n  return connection;\n};\n\nReconnectConnectionHandler.prototype.revert = function(context) {\n\n  var newSource = context.newSource,\n      newTarget = context.newTarget,\n      connection = context.connection;\n\n  if (newSource) {\n    connection.source = context.oldSource;\n    connection.waypoints[0] = context.oldDockingPoint;\n  }\n\n  if (newTarget) {\n    connection.target = context.oldTarget;\n    connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;\n  }\n\n  return connection;\n};","'use strict';\n\nvar forEach = require(204);\n\n\n/**\n * A handler that implements reversible replacing of shapes.\n * Internally the old shape will be removed and the new shape will be added.\n *\n *\n * @class\n * @constructor\n *\n * @param {canvas} Canvas\n */\nfunction ReplaceShapeHandler(modeling, rules) {\n  this._modeling = modeling;\n  this._rules = rules;\n}\n\nReplaceShapeHandler.$inject = [ 'modeling', 'rules' ];\n\nmodule.exports = ReplaceShapeHandler;\n\n\n\n////// api /////////////////////////////////////////\n\n\n/**\n * Replaces a shape with an replacement Element.\n *\n * The newData object should contain type, x, y.\n *\n * If possible also the incoming/outgoing connection\n * will be restored.\n *\n * @param {Object} context\n */\n ReplaceShapeHandler.prototype.preExecute = function(context) {\n\n  var modeling = this._modeling,\n      rules = this._rules;\n\n  var oldShape = context.oldShape,\n      newData = context.newData,\n      newShape;\n\n\n  // (1) place a new shape at the given position\n\n  var position = {\n    x: newData.x,\n    y: newData.y\n  };\n\n  newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);\n\n\n  // (2) reconnect connections to the new shape (where allowed)\n\n  var incoming = oldShape.incoming.slice(),\n      outgoing = oldShape.outgoing.slice();\n\n  forEach(incoming, function(connection) {\n    var waypoints = connection.waypoints,\n        docking = waypoints[waypoints.length - 1],\n        allowed = rules.allowed('connection.reconnectEnd', {\n          source: connection.source,\n          target: newShape,\n          connection: connection\n        });\n\n    if (allowed) {\n      modeling.reconnectEnd(connection, newShape, docking);\n    }\n  });\n\n  forEach(outgoing, function(connection) {\n    var waypoints = connection.waypoints,\n        docking = waypoints[0],\n        allowed = rules.allowed('connection.reconnectStart', {\n          source: newShape,\n          target: connection.target,\n          connection: connection\n        });\n\n    if (allowed) {\n      modeling.reconnectStart(connection, newShape, docking);\n    }\n  });\n};\n\n\nReplaceShapeHandler.prototype.postExecute = function(context) {\n  var modeling = this._modeling;\n\n  var oldShape = context.oldShape;\n\n  modeling.removeShape(oldShape);\n};\n\n\nReplaceShapeHandler.prototype.execute = function(context) { };\n\nReplaceShapeHandler.prototype.revert = function(context) {};\n","'use strict';\n\nvar assign = require(325),\n    forEach = require(204);\n\n\n/**\n * A handler that implements reversible resizing of shapes.\n *\n */\nfunction ResizeShapeHandler(modeling) {\n  this._modeling = modeling;\n}\n\nResizeShapeHandler.$inject = [ 'modeling' ];\n\nmodule.exports = ResizeShapeHandler;\n\n/**\n * {\n *   shape: {....}\n *   newBounds: {\n *     width:  20,\n *     height: 40,\n *     x:       5,\n *     y:      10\n *   }\n *\n * }\n */\nResizeShapeHandler.prototype.execute = function(context) {\n\n  var shape   = context.shape,\n      newBounds = context.newBounds;\n\n  if (newBounds.x === undefined || newBounds.y === undefined || \n      newBounds.width === undefined || newBounds.height === undefined) {\n    throw new Error('newBounds must have {x, y, width, height} properties');\n  }\n\n  if (newBounds.width < 10 || newBounds.height < 10) {\n    throw new Error('width and height cannot be less than 10px');\n  }\n\n  // save old bbox in context\n  context.oldBounds = {\n    width:  shape.width,\n    height: shape.height,\n    x:      shape.x,\n    y:      shape.y\n  };\n\n  // update shape\n  assign(shape, {\n    width:  newBounds.width,\n    height: newBounds.height,\n    x:      newBounds.x,\n    y:      newBounds.y\n  });\n\n  return shape;\n};\n\nResizeShapeHandler.prototype.postExecute = function(context) {\n\n  var shape = context.shape;\n\n  var modeling = this._modeling;\n\n  forEach(shape.incoming, function(c) {\n    modeling.layoutConnection(c, { endChanged: true });\n  });\n\n  forEach(shape.outgoing, function(c) {\n    modeling.layoutConnection(c, { startChanged: true });\n  });\n\n};\n\nResizeShapeHandler.prototype.revert = function(context) {\n\n  var shape   = context.shape,\n      oldBounds = context.oldBounds;\n\n  // restore previous bbox\n  assign(shape, {\n    width:  oldBounds.width,\n    height: oldBounds.height,\n    x:      oldBounds.x,\n    y:      oldBounds.y\n  });\n\n  return shape;\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar SpaceUtil = require(157);\n\n/**\n * A handler that implements reversible creating and removing of space.\n *\n * It executes in two phases:\n *\n *  (1) resize all affected resizeShapes\n *  (2) move all affected moveShapes\n */\nfunction SpaceToolHandler(modeling) {\n  this._modeling = modeling;\n}\n\nSpaceToolHandler.$inject = [ 'modeling' ];\n\nmodule.exports = SpaceToolHandler;\n\n\nSpaceToolHandler.prototype.preExecute = function(context) {\n\n  // resize\n  var modeling = this._modeling,\n      resizingShapes = context.resizingShapes,\n      delta = context.delta,\n      direction = context.direction;\n\n  forEach(resizingShapes, function(shape) {\n    var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);\n\n    modeling.resizeShape(shape, newBounds);\n  });\n};\n\nSpaceToolHandler.prototype.postExecute = function(context) {\n  // move\n  var modeling = this._modeling,\n      movingShapes = context.movingShapes,\n      delta = context.delta;\n\n  modeling.moveShapes(movingShapes, delta);\n};\n\nSpaceToolHandler.prototype.execute = function(context) {};\nSpaceToolHandler.prototype.revert = function(context) {};\n","'use strict';\n\nvar forEach = require(204),\n    assign = require(325);\n\n\n/**\n * Update the anchors of\n */\nfunction UpdateAnchorsHandler() { }\n\nmodule.exports = UpdateAnchorsHandler;\n\n\nUpdateAnchorsHandler.prototype.execute = function(context) {\n\n  // update connection anchors\n  return this.updateAnchors(context.element, context.delta);\n};\n\nUpdateAnchorsHandler.prototype.revert = function(context) {\n\n  var delta = context.delta,\n      revertedDelta = { x: -1 * delta.x, y: -1 * delta.y };\n\n  // revert update connection anchors\n  return this.updateAnchors(context.element, revertedDelta);\n};\n\n/**\n * Update anchors on the element according to the delta movement.\n *\n * @param {djs.model.Element} element\n * @param {Point} delta\n *\n * @return Array<djs.model.Connection>\n */\nUpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {\n\n  function add(point, delta) {\n    return {\n      x: point.x + delta.x,\n      y: point.y + delta.y\n    };\n  }\n\n  function updateAnchor(waypoint) {\n    var original = waypoint.original;\n\n    waypoint.original = assign(original || {}, add(original || waypoint, delta));\n  }\n\n  var changed = [];\n\n  forEach(element.incoming, function(c) {\n    var waypoints = c.waypoints;\n    updateAnchor(waypoints[waypoints.length - 1]);\n\n    changed.push(c);\n  });\n\n  forEach(element.outgoing, function(c) {\n    var waypoints = c.waypoints;\n    updateAnchor(waypoints[0]);\n\n    changed.push(c);\n  });\n\n  return changed;\n};","'use strict';\n\nfunction UpdateWaypointsHandler() { }\n\nmodule.exports = UpdateWaypointsHandler;\n\nUpdateWaypointsHandler.prototype.execute = function(context) {\n\n  var connection = context.connection,\n      newWaypoints = context.newWaypoints;\n\n  context.oldWaypoints = connection.waypoints;\n\n  connection.waypoints = newWaypoints;\n\n  return connection;\n};\n\nUpdateWaypointsHandler.prototype.revert = function(context) {\n\n  var connection = context.connection,\n      oldWaypoints = context.oldWaypoints;\n\n  connection.waypoints = oldWaypoints;\n\n  return connection;\n};","'use strict';\n\nvar forEach = require(204);\n\nvar Elements = require(177);\n\n\n/**\n * A helper that is able to carry out serialized move operations on multiple elements.\n *\n * @param {Modeling} modeling\n */\nfunction MoveHelper(modeling) {\n  this._modeling = modeling;\n}\n\nmodule.exports = MoveHelper;\n\n/**\n * Move the specified elements and all children by the given delta.\n *\n * This moves all enclosed connections, too and layouts all affected\n * external connections.\n *\n * @param  {Array<djs.model.Base>} elements\n * @param  {Point} delta\n * @param  {djs.model.Base} newParent applied to the first level of shapes\n *\n * @return {Array<djs.model.Base>} list of touched elements\n */\nMoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {\n  return this.moveClosure(this.getClosure(elements), delta, newParent);\n};\n\n/**\n * Move the given closure of elmements\n */\nMoveHelper.prototype.moveClosure = function(closure, delta, newParent) {\n\n  var modeling = this._modeling;\n\n  var allShapes = closure.allShapes,\n      allConnections = closure.allConnections,\n      enclosedConnections = closure.enclosedConnections,\n      topLevel = closure.topLevel;\n\n  // move all shapes\n  forEach(allShapes, function(s) {\n\n    modeling.moveShape(s, delta, topLevel[s.id] && newParent, {\n      recurse: false,\n      layout: false\n    });\n  });\n\n  // move all child connections / layout external connections\n  forEach(allConnections, function(c) {\n\n    var startMoved = !!allShapes[c.source.id],\n        endMoved = !!allShapes[c.target.id];\n\n    if (enclosedConnections[c.id] &&\n        startMoved && endMoved) {\n      modeling.moveConnection(c, delta, topLevel[c.id] && newParent, { updateAnchors: false });\n    } else {\n      modeling.layoutConnection(c, {\n        startChanged: startMoved,\n        endChanged: endMoved\n      });\n    }\n  });\n};\n\n/**\n * Returns the closure for the selected elements\n *\n * @param  {Array<djs.model.Base>} elements\n * @return {Object} closure\n */\nMoveHelper.prototype.getClosure = function(elements) {\n  return Elements.getClosure(elements);\n};\n","module.exports = {\n  __depends__: [\n    require(77),\n    require(93),\n    require(147)\n  ],\n  __init__: [ 'modeling' ],\n  modeling: [ 'type', require(108) ],\n  layouter: [ 'type', require(164) ]\n};\n","'use strict';\n\nvar assign = require(325),\n    filter = require(202),\n    groupBy = require(205);\n\n\nvar LOW_PRIORITY = 500,\n    HIGH_PRIORITY = 1500;\n\nvar getOriginalEvent = require(178).getOriginal;\n\nvar round = Math.round;\n\n\n/**\n * Return a filtered list of elements that do not contain\n * those nested into others.\n *\n * @param  {Array<djs.model.Base>} elements\n *\n * @return {Array<djs.model.Base>} filtered\n */\nfunction removeNested(elements) {\n\n  var ids = groupBy(elements, 'id');\n\n  return filter(elements, function(element) {\n    while (!!(element = element.parent)) {\n      if (ids[element.id]) {\n        return false;\n      }\n    }\n\n    return true;\n  });\n}\n\n\n\n/**\n * A plugin that makes shapes draggable / droppable.\n *\n * @param {EventBus} eventBus\n * @param {Dragging} dragging\n * @param {Modeling} modeling\n * @param {Selection} selection\n * @param {Rules} rules\n */\nfunction MoveEvents(eventBus, dragging, modeling, selection, rules) {\n\n  // rules\n\n  function canMove(shapes, delta, target) {\n\n    return rules.allowed('shapes.move', {\n      shapes: shapes,\n      delta: delta,\n      newParent: target\n    });\n  }\n\n\n  // move events\n\n  // assign a high priority to this handler to setup the environment\n  // others may hook up later, e.g. at default priority and modify\n  // the move environment\n  //\n  eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {\n\n    var context = event.context,\n        shape = event.shape,\n        shapes = selection.get().slice();\n\n    // move only single shape shape if the dragged element\n    // is not part of the current selection\n    if (shapes.indexOf(shape) === -1) {\n      shapes = [ shape ];\n    }\n\n    // ensure we remove nested elements in the collection\n    shapes = removeNested(shapes);\n\n    // attach shapes to drag context\n    assign(context, {\n      shapes: shapes,\n      shape: shape\n    });\n\n    // check if we can move the elements\n    if (!canMove(shapes)) {\n      // suppress move operation\n      event.stopPropagation();\n\n      return false;\n    }\n  });\n\n  // assign a low priority to this handler\n  // to let others modify the move event before we update\n  // the context\n  //\n  eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {\n\n    var context = event.context,\n        shapes = context.shapes,\n        hover = event.hover,\n        delta = { x: event.dx, y: event.dy },\n        canExecute;\n\n    // check if we can move the elements\n    canExecute = canMove(shapes, delta, hover);\n\n    context.delta = delta;\n    context.canExecute = canExecute;\n\n    // simply ignore move over\n    if (canExecute === null) {\n      context.target = null;\n\n      return;\n    }\n\n    context.target = hover;\n  });\n\n  eventBus.on('shape.move.end', function(event) {\n\n    var context = event.context;\n\n    var delta = context.delta,\n        canExecute = context.canExecute;\n\n    if (!canExecute) {\n      return false;\n    }\n\n    // ensure we have actual pixel values deltas\n    // (important when zoom level was > 1 during move)\n    delta.x = round(delta.x);\n    delta.y = round(delta.y);\n\n    modeling.moveShapes(context.shapes, delta, context.target);\n  });\n\n\n  // move activation\n\n  eventBus.on('element.mousedown', function(event) {\n\n    var originalEvent = getOriginalEvent(event);\n\n    if (!originalEvent) {\n      throw new Error('must supply DOM mousedown event');\n    }\n\n    start(originalEvent, event.element);\n  });\n\n\n  function start(event, element, activate) {\n\n    // do not move connections or the root element\n    if (element.waypoints || !element.parent) {\n      return;\n    }\n\n    dragging.activate(event, 'shape.move', {\n      cursor: 'grabbing',\n      autoActivate: activate,\n      data: {\n        shape: element,\n        context: {}\n      }\n    });\n  }\n\n  // API\n\n  this.start = start;\n}\n\nMoveEvents.$inject = [ 'eventBus', 'dragging', 'modeling', 'selection', 'rules' ];\n\nmodule.exports = MoveEvents;\n","'use strict';\n\nvar flatten = require(196),\n    forEach = require(204),\n    filter = require(202),\n    find = require(203),\n    map = require(207);\n\nvar Elements = require(177);\n\nvar LOW_PRIORITY = 500;\n\nvar MARKER_DRAGGING = 'djs-dragging',\n    MARKER_OK = 'drop-ok',\n    MARKER_NOT_OK = 'drop-not-ok';\n\n\n/**\n * A plugin that makes shapes draggable / droppable.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Canvas} canvas\n * @param {Styles} styles\n */\nfunction MoveVisuals(eventBus, elementRegistry, canvas, styles) {\n\n  function getGfx(e) {\n    return elementRegistry.getGraphics(e);\n  }\n\n  function getVisualDragShapes(shapes) {\n\n    var elements = Elements.selfAndDirectChildren(shapes, true);\n    var filteredElements = removeEdges(elements);\n\n    return filteredElements;\n  }\n\n  function getAllDraggedElements(shapes) {\n    var allShapes = Elements.selfAndAllChildren(shapes, true);\n\n    var allConnections = map(allShapes, function(shape) {\n      return (shape.incoming || []).concat(shape.outgoing || []);\n    });\n\n    return flatten(allShapes.concat(allConnections), true);\n  }\n\n  function addDragger(shape, dragGroup) {\n    var gfx = getGfx(shape);\n    var dragger = gfx.clone();\n    var bbox = gfx.getBBox();\n\n    dragger.attr(styles.cls('djs-dragger', [], {\n      x: bbox.x,\n      y: bbox.y\n    }));\n\n    dragGroup.add(dragger);\n  }\n\n  // assign a low priority to this handler\n  // to let others modify the move context before\n  // we draw things\n  //\n  eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {\n\n    var context = event.context,\n        dragShapes = context.shapes;\n\n    var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));\n\n    var visuallyDraggedShapes = getVisualDragShapes(dragShapes);\n\n    visuallyDraggedShapes.forEach(function(shape) {\n      addDragger(shape, dragGroup);\n    });\n\n\n    // cache all dragged elements / gfx\n    // so that we can quickly undo their state changes later\n    var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);\n\n    // add dragging marker\n    forEach(allDraggedElements, function(e) {\n      canvas.addMarker(e, MARKER_DRAGGING);\n    });\n\n    context.dragGroup = dragGroup;\n  });\n\n  // assign a low priority to this handler\n  // to let others modify the move context before\n  // we draw things\n  //\n  eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {\n\n    var context = event.context,\n        dragGroup = context.dragGroup,\n        target = context.target;\n\n    if (target) {\n      canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n    }\n\n    dragGroup.translate(event.dx, event.dy);\n  });\n\n  eventBus.on([ 'shape.move.out', 'shape.move.cleanup' ], function(event) {\n    var context = event.context;\n\n    if (context.target) {\n      canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);\n    }\n  });\n\n  eventBus.on('shape.move.cleanup', function(event) {\n\n    var context = event.context,\n        allDraggedElements = context.allDraggedElements,\n        dragGroup = context.dragGroup;\n\n\n    // remove dragging marker\n    forEach(allDraggedElements, function(e) {\n      canvas.removeMarker(e, MARKER_DRAGGING);\n    });\n\n    if (dragGroup) {\n      dragGroup.remove();\n    }\n  });\n}\n\n// returns elements minus all connections\n// where source or target is not elements\nfunction removeEdges(elements) {\n\n  var filteredElements = filter(elements, function(element) {\n\n    if (!element.waypoints) { // shapes\n      return true;\n    } else {                  // connections\n      var srcFound = find(elements, element.source);\n      var targetFound = find(elements, element.target);\n\n      return srcFound && targetFound;\n    }\n  });\n\n  return filteredElements;\n}\n\nMoveVisuals.$inject = [ 'eventBus', 'elementRegistry', 'canvas', 'styles' ];\n\nmodule.exports = MoveVisuals;\n","module.exports = {\n  __depends__: [\n    require(103),\n    require(151),\n    require(133),\n    require(147),\n    require(101)\n  ],\n  __init__: [ 'move', 'moveVisuals' ],\n  move: [ 'type', require(129) ],\n  moveVisuals: [ 'type', require(130) ]\n};\n","'use strict';\n\nvar Snap = require(188);\nvar getBBox = require(177).getBBox;\n\n\n/**\n * @class\n *\n * A plugin that adds an outline to shapes and connections that may be activated and styled\n * via CSS classes.\n *\n * @param {EventBus} events the event bus\n */\nfunction Outline(eventBus, styles, elementRegistry) {\n\n  var OUTLINE_OFFSET = 6;\n\n  var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);\n\n  function createOutline(gfx, bounds) {\n    return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);\n  }\n\n  function updateShapeOutline(outline, bounds) {\n\n    outline.attr({\n      x: -OUTLINE_OFFSET,\n      y: -OUTLINE_OFFSET,\n      width: bounds.width + OUTLINE_OFFSET * 2,\n      height: bounds.height + OUTLINE_OFFSET * 2\n    });\n  }\n\n  function updateConnectionOutline(outline, connection) {\n\n    var bbox = getBBox(connection);\n\n    outline.attr({\n      x: bbox.x - OUTLINE_OFFSET,\n      y: bbox.y - OUTLINE_OFFSET,\n      width: bbox.width + OUTLINE_OFFSET * 2,\n      height: bbox.height + OUTLINE_OFFSET * 2\n    });\n  }\n\n  eventBus.on([ 'shape.added', 'shape.changed' ], function(event) {\n    var element = event.element,\n        gfx     = event.gfx;\n\n    var outline = gfx.select('.djs-outline');\n\n    if (!outline) {\n      outline = createOutline(gfx, element);\n    }\n\n    updateShapeOutline(outline, element);\n  });\n\n  eventBus.on([ 'connection.added', 'connection.changed' ], function(event) {\n    var element = event.element,\n        gfx     = event.gfx;\n\n    var outline = gfx.select('.djs-outline');\n\n    if (!outline) {\n      outline = createOutline(gfx, element);\n    }\n\n    updateConnectionOutline(outline, element);\n  });\n\n\n}\n\n\nOutline.$inject = ['eventBus', 'styles', 'elementRegistry'];\n\nmodule.exports = Outline;\n","'use strict';\n\nmodule.exports = {\n  __init__: [ 'outline' ],\n  outline: [ 'type', require(132) ]\n};","'use strict';\n\nvar isArray = require(316),\n    isString = require(322),\n    isObject = require(320),\n    assign = require(325),\n    forEach = require(204),\n    filter = require(202),\n    debounce = require(214);\n\nvar domify = require(343),\n    domClasses = require(339),\n    domRemove = require(347);\n\nvar getBBox = require(177).getBBox;\n\n// document wide unique overlay ids\nvar ids = new (require(181))('ov');\n\n\nfunction createRoot(parent) {\n  var root = domify('<div class=\"djs-overlay-container\" style=\"position: absolute; width: 0; height: 0;\" />');\n  parent.insertBefore(root, parent.firstChild);\n\n  return root;\n}\n\n\nfunction setPosition(el, x, y) {\n  assign(el.style, { left: x + 'px', top: y + 'px' });\n}\n\nfunction setVisible(el, visible) {\n  el.style.display = visible === false ? 'none' : '';\n}\n\n/**\n * A service that allows users to attach overlays to diagram elements.\n *\n * The overlay service will take care of overlay positioning during updates.\n *\n * @example\n *\n * // add a pink badge on the top left of the shape\n * overlays.add(someShape, {\n *   position: {\n *     top: -5,\n *     left: -5\n *   },\n *   html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add via shape id\n *\n * overlays.add('some-element-id', {\n *   position: {\n *     top: -5,\n *     left: -5\n *   }\n *   html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or add with optional type\n *\n * overlays.add(someShape, 'badge', {\n *   position: {\n *     top: -5,\n *     left: -5\n *   }\n *   html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n *\n * // remove an overlay\n *\n * var id = overlays.add(...);\n * overlays.remove(id);\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n * @param {ElementRegistry} elementRegistry\n */\nfunction Overlays(config, eventBus, canvas, elementRegistry) {\n\n  this._eventBus = eventBus;\n  this._canvas = canvas;\n  this._elementRegistry = elementRegistry;\n\n  this._ids = ids;\n\n  this._overlayDefaults = {\n    show: {\n      minZoom: 0.7,\n      maxZoom: 5.0\n    }\n  };\n\n  /**\n   * Mapping overlayId -> overlay\n   */\n  this._overlays = {};\n\n  /**\n   * Mapping elementId -> overlay container\n   */\n  this._overlayContainers = {};\n\n  // root html element for all overlays\n  this._overlayRoot = createRoot(canvas.getContainer());\n\n  this._init(config);\n}\n\n\nOverlays.$inject = [ 'config.overlays', 'eventBus', 'canvas', 'elementRegistry' ];\n\nmodule.exports = Overlays;\n\n\n/**\n * Returns the overlay with the specified id or a list of overlays\n * for an element with a given type.\n *\n * @example\n *\n * // return the single overlay with the given id\n * overlays.get('some-id');\n *\n * // return all overlays for the shape\n * overlays.get({ element: someShape });\n *\n * // return all overlays on shape with type 'badge'\n * overlays.get({ element: someShape, type: 'badge' });\n *\n * // shape can also be specified as id\n * overlays.get({ element: 'element-id', type: 'badge' });\n *\n *\n * @param {Object} search\n * @param {String} [search.id]\n * @param {String|djs.model.Base} [search.element]\n * @param {String} [search.type]\n *\n * @return {Object|Array<Object>} the overlay(s)\n */\nOverlays.prototype.get = function(search) {\n\n  if (isString(search)) {\n    search = { id: search };\n  }\n\n  if (search.element) {\n    var container = this._getOverlayContainer(search.element, true);\n\n    // return a list of overlays when searching by element (+type)\n    if (container) {\n      return search.type ? filter(container.overlays, { type: search.type }) : container.overlays.slice();\n    } else {\n      return [];\n    }\n  } else\n  if (search.type) {\n    return filter(this._overlays, { type: search.type });\n  } else {\n    // return single element when searching by id\n    return search.id ? this._overlays[search.id] : null;\n  }\n};\n\n/**\n * Adds a HTML overlay to an element.\n *\n * @param {String|djs.model.Base}   element   attach overlay to this shape\n * @param {String}                  [type]    optional type to assign to the overlay\n * @param {Object}                  overlay   the overlay configuration\n *\n * @param {String|DOMElement}       overlay.html                 html element to use as an overlay\n * @param {Object}                  [overlay.show]               show configuration\n * @param {Number}                  [overlay.show.minZoom]       minimal zoom level to show the overlay\n * @param {Number}                  [overlay.show.maxZoom]       maximum zoom level to show the overlay\n * @param {Object}                  overlay.position             where to attach the overlay\n * @param {Number}                  [overlay.position.left]      relative to element bbox left attachment\n * @param {Number}                  [overlay.position.top]       relative to element bbox top attachment\n * @param {Number}                  [overlay.position.bottom]    relative to element bbox bottom attachment\n * @param {Number}                  [overlay.position.right]     relative to element bbox right attachment\n *\n * @return {String}                 id that may be used to reference the overlay for update or removal\n */\nOverlays.prototype.add = function(element, type, overlay) {\n\n  if (isObject(type)) {\n    overlay = type;\n    type = null;\n  }\n\n  if (!element.id) {\n    element = this._elementRegistry.get(element);\n  }\n\n  if (!overlay.position) {\n    throw new Error('must specifiy overlay position');\n  }\n\n  if (!overlay.html) {\n    throw new Error('must specifiy overlay html');\n  }\n\n  if (!element) {\n    throw new Error('invalid element specified');\n  }\n\n  var id = this._ids.next();\n\n  overlay = assign({}, this._overlayDefaults, overlay, {\n    id: id,\n    type: type,\n    element: element,\n    html: overlay.html\n  });\n\n  this._addOverlay(overlay);\n\n  return id;\n};\n\n\n/**\n * Remove an overlay with the given id or all overlays matching the given filter.\n *\n * @see Overlays#get for filter options.\n *\n * @param {String} [id]\n * @param {Object} [filter]\n */\nOverlays.prototype.remove = function(filter) {\n\n  var overlays = this.get(filter) || [];\n\n  if (!isArray(overlays)) {\n    overlays = [ overlays ];\n  }\n\n  var self = this;\n\n  forEach(overlays, function(overlay) {\n\n    var container = self._getOverlayContainer(overlay.element, true);\n\n    if (overlay) {\n      domRemove(overlay.html);\n      domRemove(overlay.htmlContainer);\n\n      delete overlay.htmlContainer;\n      delete overlay.element;\n\n      delete self._overlays[overlay.id];\n    }\n\n    if (container) {\n      var idx = container.overlays.indexOf(overlay);\n      if (idx !== -1) {\n        container.overlays.splice(idx, 1);\n      }\n    }\n  });\n\n};\n\n\nOverlays.prototype.show = function() {\n  setVisible(this._overlayRoot);\n};\n\n\nOverlays.prototype.hide = function() {\n  setVisible(this._overlayRoot, false);\n};\n\n\nOverlays.prototype._updateOverlayContainer = function(container) {\n  var element = container.element,\n      html = container.html;\n\n  // update container left,top according to the elements x,y coordinates\n  // this ensures we can attach child elements relative to this container\n\n  var x = element.x,\n      y = element.y;\n\n  if (element.waypoints) {\n    var bbox = getBBox(element);\n    x = bbox.x;\n    y = bbox.y;\n  }\n\n  setPosition(html, x, y);\n};\n\n\nOverlays.prototype._updateOverlay = function(overlay) {\n\n  var position = overlay.position,\n      htmlContainer = overlay.htmlContainer,\n      element = overlay.element;\n\n  // update overlay html relative to shape because\n  // it is already positioned on the element\n\n  // update relative\n  var left = position.left,\n      top = position.top;\n\n  if (position.right !== undefined) {\n\n    var width;\n\n    if (element.waypoints) {\n      width = getBBox(element).width;\n    } else {\n      width = element.width;\n    }\n\n    left = position.right * -1 + width;\n  }\n\n  if (position.bottom !== undefined) {\n\n    var height;\n\n    if (element.waypoints) {\n      height = getBBox(element).height;\n    } else {\n      height = element.height;\n    }\n\n    top = position.bottom * -1 + height;\n  }\n\n  setPosition(htmlContainer, left || 0, top || 0);\n};\n\n\nOverlays.prototype._createOverlayContainer = function(element) {\n  var html = domify('<div class=\"djs-overlays djs-overlays-' + element.id + '\" style=\"position: absolute\" />');\n\n  this._overlayRoot.appendChild(html);\n\n  var container = {\n    html: html,\n    element: element,\n    overlays: []\n  };\n\n  this._updateOverlayContainer(container);\n\n  return container;\n};\n\n\nOverlays.prototype._updateRoot = function(viewbox) {\n  var a = viewbox.scale || 1;\n  var d = viewbox.scale || 1;\n\n  var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';\n\n  this._overlayRoot.style.transform = matrix;\n  this._overlayRoot.style['-ms-transform'] = matrix;\n};\n\n\nOverlays.prototype._getOverlayContainer = function(element, raw) {\n  var id = (element && element.id) || element;\n\n  var container = this._overlayContainers[id];\n  if (!container && !raw) {\n    container = this._overlayContainers[id] = this._createOverlayContainer(element);\n  }\n\n  return container;\n};\n\n\nOverlays.prototype._addOverlay = function(overlay) {\n\n  var id = overlay.id,\n      element = overlay.element,\n      html = overlay.html,\n      htmlContainer,\n      overlayContainer;\n\n  // unwrap jquery (for those who need it)\n  if (html.get) {\n    html = html.get(0);\n  }\n\n  // create proper html elements from\n  // overlay HTML strings\n  if (isString(html)) {\n    html = domify(html);\n  }\n\n  overlayContainer = this._getOverlayContainer(element);\n\n  htmlContainer = domify('<div class=\"djs-overlay\" data-overlay-id=\"' + id + '\" style=\"position: absolute\">');\n\n  htmlContainer.appendChild(html);\n\n  if (overlay.type) {\n    domClasses(htmlContainer).add('djs-overlay-' + overlay.type);\n  }\n\n  overlay.htmlContainer = htmlContainer;\n\n  overlayContainer.overlays.push(overlay);\n  overlayContainer.html.appendChild(htmlContainer);\n\n  this._overlays[id] = overlay;\n\n  this._updateOverlay(overlay);\n};\n\nOverlays.prototype._updateOverlayVisibilty = function(viewbox) {\n\n  forEach(this._overlays, function(overlay) {\n    var show = overlay.show,\n        htmlContainer = overlay.htmlContainer,\n        visible = true;\n\n    if (show) {\n      if (show.minZoom > viewbox.scale ||\n          show.maxZoom < viewbox.scale) {\n        visible = false;\n      }\n\n      setVisible(htmlContainer, visible);\n    }\n  });\n};\n\nOverlays.prototype._init = function(config) {\n\n  var eventBus = this._eventBus;\n\n  var self = this;\n\n\n  // scroll/zoom integration\n\n  var updateViewbox = function(viewbox) {\n    self._updateRoot(viewbox);\n    self._updateOverlayVisibilty(viewbox);\n\n    self.show();\n  };\n\n  if (!config || config.deferUpdate !== false) {\n    updateViewbox = debounce(updateViewbox, 300);\n  }\n\n  eventBus.on('canvas.viewbox.changed', function(event) {\n    self.hide();\n    updateViewbox(event.viewbox);\n  });\n\n\n  // remove integration\n\n  eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n    var overlays = self.get({ element: e.element });\n\n    forEach(overlays, function(o) {\n      self.remove(o.id);\n    });\n  });\n\n\n  // move integration\n\n  eventBus.on([\n    'element.changed'\n  ], function(e) {\n    var element = e.element;\n\n    var container = self._getOverlayContainer(element, true);\n\n    if (container) {\n      forEach(container.overlays, function(overlay) {\n        self._updateOverlay(overlay);\n      });\n\n      self._updateOverlayContainer(container);\n    }\n  });\n\n\n  // marker integration, simply add them on the overlays as classes, too.\n\n  eventBus.on('element.marker.update', function(e) {\n    var container = self._getOverlayContainer(e.element, true);\n    if (container) {\n      domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);\n    }\n  });\n};\n","module.exports = {\n  __init__: [ 'overlays' ],\n  overlays: [ 'type', require(134) ]\n};","'use strict';\n\nvar isFunction = require(317),\n    forEach = require(204);\n\nvar domify = require(343),\n    domQuery = require(346),\n    domAttr = require(338),\n    domClear = require(340),\n    domClasses = require(339),\n    domMatches = require(345),\n    domDelegate = require(342),\n    domEvent = require(344);\n\n\nvar toggleSelector = '.djs-palette-toggle',\n    entrySelector = '.entry',\n    elementSelector = toggleSelector + ', ' + entrySelector;\n\n\n/**\n * A palette containing modeling elements.\n */\nfunction Palette(eventBus, canvas) {\n\n  this._eventBus = eventBus;\n  this._canvas = canvas;\n\n  this._providers = [];\n}\n\nPalette.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = Palette;\n\n\n/**\n * Register a provider with the palette\n *\n * @param  {PaletteProvider} provider\n */\nPalette.prototype.registerProvider = function(provider) {\n  this._providers.push(provider);\n\n  if (!this._container) {\n    this._init();\n  }\n\n  this._update();\n};\n\n\n/**\n * Returns the palette entries for a given element\n *\n * @return {Array<PaletteEntryDescriptor>} list of entries\n */\nPalette.prototype.getEntries = function() {\n\n  var entries = {};\n\n  // loop through all providers and their entries.\n  // group entries by id so that overriding an entry is possible\n  forEach(this._providers, function(provider) {\n    var e = provider.getPaletteEntries();\n\n    forEach(e, function(entry, id) {\n      entries[id] = entry;\n    });\n  });\n\n  return entries;\n};\n\n\n/**\n * Initialize\n */\nPalette.prototype._init = function() {\n  var parent = this._canvas.getContainer(),\n      container = this._container = domify(Palette.HTML_MARKUP),\n      self = this;\n\n  parent.appendChild(container);\n\n  domDelegate.bind(container, elementSelector, 'click', function(event) {\n\n    var target = event.delegateTarget;\n\n    if (domMatches(target, toggleSelector)) {\n      return self.toggle();\n    }\n\n    self.trigger('click', event);\n  });\n\n  // prevent drag propagation\n  domEvent.bind(container, 'mousedown', function(event) {\n    event.stopPropagation();\n  });\n\n  // prevent drag propagation\n  domDelegate.bind(container, entrySelector, 'dragstart', function(event) {\n    self.trigger('dragstart', event);\n  });\n\n  this._eventBus.fire('palette.create', {\n    html: container\n  });\n};\n\n\nPalette.prototype._update = function() {\n\n  var entriesContainer = domQuery('.djs-palette-entries', this._container),\n      entries = this._entries = this.getEntries();\n\n  domClear(entriesContainer);\n\n  forEach(entries, function(entry, id) {\n\n    var grouping = entry.group || 'default';\n\n    var container = domQuery('[data-group=' + grouping + ']', entriesContainer);\n    if (!container) {\n      container = domify('<div class=\"group\" data-group=\"' + grouping + '\"></div>');\n      entriesContainer.appendChild(container);\n    }\n\n    var html = entry.html || (\n      entry.separator ?\n        '<hr class=\"separator\" />' :\n        '<div class=\"entry\" draggable=\"true\"></div>');\n\n\n    var control = domify(html);\n    container.appendChild(control);\n\n    if (!entry.separator) {\n      domAttr(control, 'data-action', id);\n\n      if (entry.title) {\n        domAttr(control, 'title', entry.title);\n      }\n\n      if (entry.className) {\n        domClasses(control).add(entry.className);\n      }\n\n      if (entry.imageUrl) {\n        control.appendChild(domify('<img src=\"' + entry.imageUrl + '\">'));\n      }\n    }\n  });\n\n  // open after update\n  this.open(true);\n};\n\n\n/**\n * Trigger an action available on the palette\n *\n * @param  {String} action\n * @param  {Event} event\n */\nPalette.prototype.trigger = function(action, event, autoActivate) {\n\n  var entries = this._entries,\n      entry,\n      handler,\n      originalEvent,\n      button = event.delegateTarget || event.target;\n\n  if (!button) {\n    return event.preventDefault();\n  }\n\n\n  entry = entries[domAttr(button, 'data-action')];\n  handler = entry.action;\n\n  originalEvent = event.originalEvent || event;\n\n  // simple action (via callback function)\n  if (isFunction(handler)) {\n    if (action === 'click') {\n      return handler(originalEvent, autoActivate);\n    }\n  } else {\n    if (handler[action]) {\n      return handler[action](originalEvent, autoActivate);\n    }\n  }\n\n  // silence other actions\n  event.preventDefault();\n};\n\n\n/**\n * Close the palette\n */\nPalette.prototype.close = function() {\n  domClasses(this._container).remove('open');\n};\n\n\n/**\n * Open the palette\n */\nPalette.prototype.open = function() {\n  domClasses(this._container).add('open');\n};\n\n\nPalette.prototype.toggle = function(open) {\n  if (this.isOpen()) {\n    this.close();\n  } else {\n    this.open();\n  }\n};\n\n\n/**\n * Return true if the palette is opened.\n *\n * @example\n *\n * palette.open();\n *\n * if (palette.isOpen()) {\n *   // yes, we are open\n * }\n *\n * @return {boolean} true if palette is opened\n */\nPalette.prototype.isOpen = function() {\n  return this._container && domClasses(this._container).has('open');\n};\n\n\n/* markup definition */\n\nPalette.HTML_MARKUP =\n  '<div class=\"djs-palette\">' +\n    '<div class=\"djs-palette-entries\"></div>' +\n    '<div class=\"djs-palette-toggle\"></div>' +\n  '</div>';","module.exports = {\n  __init__: [ 'palette' ],\n  palette: [ 'type', require(136) ]\n};\n","'use strict';\n\nvar forEach = require(204),\n    assign = require(325),\n    domEvent = require(344),\n    domify = require(343),\n    domClasses = require(339),\n    domAttr = require(338),\n    domRemove = require(347);\n\n\nfunction PopupMenu(eventBus, canvas) {\n\n  this._eventBus = eventBus;\n  this._canvas  = canvas;\n  this._instances = {};\n}\n\nPopupMenu.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = PopupMenu;\n\nPopupMenu.prototype.open = function(name, position, entries, options) {\n\n  var outer = this,\n      canvas = this._canvas,\n      instances = outer._instances;\n\n  // return existing instance\n  if (instances[name]) {\n    return instances[name];\n  }\n\n  var parent = canvas.getContainer();\n\n  //------------------------\n  function PopupMenuInstance() {\n\n    var self = this;\n\n    self._actions = {};\n    self.name = name || 'popup-menu';\n\n    var _options = {\n      entryClassName: 'entry'\n    };\n    assign(_options, options);\n\n    // Container setup\n    var container = this._container = domify('<div class=\"djs-popup\">');\n\n    assign(container.style, {\n      position: 'absolute',\n      left: position.x + 'px',\n      top: position.y  + 'px'\n    });\n    domClasses(container).add(name);\n\n    // Add entries\n    forEach(entries, function(entry) {\n\n      var entryContainer = domify('<div>');\n      domClasses(entryContainer).add(entry.className || _options.entryClassName);\n      domClasses(entryContainer).add('djs-popup-entry');\n\n      if (entry.style) {\n        domAttr(entryContainer, 'style', entry.style);\n      }\n\n      if (entry.action) {\n        domAttr(entryContainer, 'data-action', entry.action.name);\n        self._actions[entry.action.name] = entry.action.handler;\n      }\n\n      var title = domify('<span>');\n      title.textContent = entry.label;\n      entryContainer.appendChild(title);\n\n      container.appendChild(entryContainer);\n    });\n\n    // Event handler\n    domEvent.bind(container, 'click', function(event) {\n      self.trigger(event);\n    });\n\n    // apply canvas zoom level\n    var zoom = canvas.zoom();\n\n    container.style.transformOrigin = 'top left';\n    container.style.transform = 'scale(' + zoom + ')';\n\n    // Attach to DOM\n    parent.appendChild(container);\n\n    // Add Handler\n    this.bindHandlers();\n  }\n\n  PopupMenuInstance.prototype.close = function() {\n    this.unbindHandlers();\n    domRemove(this._container);\n    delete outer._instances[this.name];\n  };\n\n  PopupMenuInstance.prototype.bindHandlers = function() {\n\n    var self = this,\n        eventBus = outer._eventBus;\n\n    this._closeHandler = function() {\n      self.close();\n    };\n\n    eventBus.once('contextPad.close', this._closeHandler);\n    eventBus.once('canvas.viewbox.changed', this._closeHandler);\n  };\n\n  PopupMenuInstance.prototype.unbindHandlers = function() {\n\n    var eventBus = outer._eventBus;\n\n    eventBus.off('contextPad.close', this._closeHandler);\n    eventBus.off('canvas.viewbox.changed', this._closeHandler);\n  };\n\n  PopupMenuInstance.prototype.trigger = function(event) {\n\n    var element = event.target,\n        actionName = element.getAttribute('data-action') ||\n                     element.parentNode.getAttribute('data-action');\n\n    var action = this._actions[actionName];\n\n\n    if (action) {\n      action();\n    }\n\n    // silence other actions\n    event.preventDefault();\n  };\n\n  var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);\n\n  return instance;\n};\n","'use strict';\n\nmodule.exports = {\n  __init__: [ 'popupMenu' ],\n  popupMenu: [ 'type', require(138) ]\n};\n","'use strict';\n\n\n/**\n * Service that allow replacing of elements.\n *\n *\n * @class\n * @constructor\n */\nfunction Replace(modeling) {\n\n  this._modeling = modeling;\n}\n\nmodule.exports = Replace;\n\nReplace.$inject = [ 'modeling' ];\n\n/**\n * @param {Element} oldElement - Element to be replaced\n * @param {Object}  newElementData - Containing information about the new Element, for example height, width, type.\n * @param {Object}  options - Custom options that will be attached to the context. It can be used to inject data\n *                            that is needed in the command chain. For example it could be used in\n *                            eventbus.on('commandStack.shape.replace.postExecute') to change shape attributes after\n *                            shape creation.\n */\nReplace.prototype.replaceElement = function(oldElement, newElementData, options) {\n\n  var modeling = this._modeling;\n\n  var newElement = null;\n\n  if (oldElement.waypoints) {\n    // TODO\n    // modeling.replaceConnection\n  } else {\n    // set center of element for modeling API\n    // if no new width / height is given use old elements size\n    newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;\n    newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;\n\n    newElement = modeling.replaceShape(oldElement, newElementData, options);\n  }\n\n  return newElement;\n};\n","'use strict';\n\nmodule.exports = {\n  __init__: [ 'replace' ],\n  replace: [ 'type', require(140) ]\n};\n","'use strict';\n\nvar forEach = require(204),\n    filter = require(202),\n    pick = require(330);\n\nvar ResizeUtil = require(143),\n    domEvent = require(344),\n    Elements = require(177);\n\nvar isPrimaryButton = require(182).isPrimaryButton;\n\nvar round = Math.round;\n\nvar Snap = require(188);\n\nvar HANDLE_OFFSET = -2,\n    HANDLE_SIZE  = 5,\n    HANDLE_HIT_SIZE = 20;\n\nvar MARKER_RESIZING = 'djs-resizing',\n    MARKER_RESIZE_NOT_OK = 'resize-not-ok',\n    CLS_RESIZER   = 'djs-resizer';\n\n\n/**\n * Implements resize on shapes by\n *\n *   * adding resize handles,\n *   * creating a visual during resize\n *   * checking resize rules\n *   * committing a change once finished\n *\n *\n *  ## Customizing\n *\n *  It's possible to customize the resizing behaviour by intercepting 'resize.start'\n *  and providing the following parameters through the 'context':\n *\n *    * minDimensions ({ width, height }) - Minimum shape dimensions\n *    * childrenBoxPadding (number) - Gap between the minimum bounding box and the container\n *\n *  f.ex:\n *\n *  eventBus.on('resize.start', 1500, function(event) {\n *    var context = event.context,\n *\n *   context.minDimensions = { width: 140, height: 120 };\n *   context.childrenBoxPadding = 30;\n *  });\n */\n\nfunction Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {\n\n  function canResize(context) {\n    var ctx = pick(context, [ 'newBounds', 'shape', 'delta', 'direction' ]);\n    return rules.allowed('shape.resize', ctx);\n  }\n\n\n  // resizing implementation //////////////////////////////////\n\n  /**\n   * A helper that realizes the resize visuals\n   */\n  var visuals = {\n    create: function(context) {\n      var container = canvas.getDefaultLayer(),\n          shape = context.shape,\n          frame;\n\n      frame = context.frame = Snap.create('rect', {\n        class: 'djs-resize-overlay',\n        width:  shape.width + 10,\n        height: shape.height + 10,\n        x: shape.x -5,\n        y: shape.y -5\n      });\n\n      frame.appendTo(container);\n    },\n\n    update: function(context) {\n      var frame = context.frame,\n          bounds = context.newBounds;\n\n      if (bounds.width > 5) {\n        frame.attr({\n          x: bounds.x,\n          width: bounds.width\n        });\n      }\n\n      if (bounds.height > 5) {\n        frame.attr({\n          y: bounds.y,\n          height: bounds.height\n        });\n      }\n\n      frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);\n    },\n\n    remove: function(context) {\n      if (context.frame) {\n        context.frame.remove();\n      }\n    }\n  };\n\n  function computeMinBoundaryBox(context) {\n\n    var shape = context.shape,\n        direction = context.direction,\n        minDimensions = context.minDimensions || {},\n        childrenBoxPadding = context.childrenBoxPadding || 20,\n        children,\n        minBoundaryBox;\n\n    // grab all the shapes that are NOT labels or connections\n    children = filter(shape.children, function(child) {\n      // connections\n      if (child.waypoints) {\n        return false;\n      }\n\n      // labels\n      if (child.type === 'label') {\n        return false;\n      }\n\n      return true;\n    });\n\n    // compute a minimum bounding box\n    // around the existing children\n    if (children.length) {\n      minBoundaryBox = Elements.getBBox(children);\n\n      // add a gap between the minBoundaryBox and the resizable container\n      minBoundaryBox.width += childrenBoxPadding * 2;\n      minBoundaryBox.height += childrenBoxPadding * 2;\n      minBoundaryBox.x -= childrenBoxPadding;\n      minBoundaryBox.y -= childrenBoxPadding;\n    } else {\n      minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {\n        width: minDimensions.width || 10,\n        height: minDimensions.height || 10\n      });\n    }\n\n    return minBoundaryBox;\n  }\n\n  eventBus.on('resize.start', function(event) {\n\n    var context = event.context,\n        shape = context.shape,\n        minBoundaryBox = context.minBoundaryBox;\n\n    if (minBoundaryBox === undefined) {\n      context.minBoundaryBox = computeMinBoundaryBox(context);\n    }\n\n    // add resizable indicator\n    canvas.addMarker(shape, MARKER_RESIZING);\n\n    visuals.create(context);\n  });\n\n  eventBus.on('resize.move', function(event) {\n\n    var context = event.context,\n        shape = context.shape,\n        direction = context.direction,\n        minBoundaryBox = context.minBoundaryBox,\n        delta;\n\n    delta = {\n      x: event.dx,\n      y: event.dy\n    };\n\n    context.delta = delta;\n\n    context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);\n\n    if (minBoundaryBox) {\n      context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);\n    }\n\n    // update + cache executable state\n    context.canExecute = canResize(context);\n\n    // update resize frame visuals\n    visuals.update(context);\n  });\n\n  eventBus.on('resize.end', function(event) {\n    var context = event.context,\n        shape = context.shape;\n\n    var newBounds = context.newBounds;\n\n\n    // ensure we have actual pixel values for new bounds\n    // (important when zoom level was > 1 during move)\n    newBounds.x = round(newBounds.x);\n    newBounds.y = round(newBounds.y);\n    newBounds.width = round(newBounds.width);\n    newBounds.height = round(newBounds.height);\n\n    // perform the actual resize\n    if (context.canExecute) {\n      modeling.resizeShape(shape, context.newBounds);\n    }\n  });\n\n  eventBus.on('resize.cleanup', function(event) {\n\n    var context = event.context,\n        shape = context.shape;\n\n    // remove resizable indicator\n    canvas.removeMarker(shape, MARKER_RESIZING);\n\n    // remove frame + destroy context\n    visuals.remove(context);\n  });\n\n\n  function activate(event, shape, direction) {\n\n    dragging.activate(event, 'resize', {\n      autoActivate: true,\n      cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),\n      data: {\n        shape: shape,\n        context: {\n          direction: direction,\n          shape: shape\n        }\n      }\n    });\n  }\n\n  function makeDraggable(element, gfx, direction) {\n\n    function listener(event) {\n      // only trigger on left mouse button\n      if (isPrimaryButton(event)) {\n        activate(event, element, direction);\n      }\n    }\n\n    domEvent.bind(gfx.node, 'mousedown', listener);\n    domEvent.bind(gfx.node, 'touchstart', listener);\n  }\n\n  function __createResizer(gfx, x, y, rotation, direction) {\n\n    var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);\n\n    var origin = -HANDLE_SIZE + HANDLE_OFFSET;\n\n    // Create four drag indicators on the outline\n    group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');\n    group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');\n\n    var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);\n    group.transform(matrix);\n\n    return group;\n  }\n\n  function createResizer(element, gfx, direction) {\n\n    var resizer;\n\n    if (direction === 'nw') {\n      resizer = __createResizer(gfx, 0, 0, 0, direction);\n    } else if (direction === 'ne') {\n      resizer = __createResizer(gfx, element.width, 0, 90, direction);\n    } else if (direction === 'se') {\n      resizer = __createResizer(gfx, element.width, element.height, 180, direction);\n    } else {\n      resizer = __createResizer(gfx, 0, element.height, 270, direction);\n    }\n\n    makeDraggable(element, resizer, direction);\n  }\n\n  // resize handles implementation ///////////////////////////////\n\n  function addResize(shape) {\n\n    if (!canResize({ shape: shape })) {\n      return;\n    }\n\n    var gfx = elementRegistry.getGraphics(shape);\n\n    createResizer(shape, gfx, 'nw');\n    createResizer(shape, gfx, 'ne');\n    createResizer(shape, gfx, 'se');\n    createResizer(shape, gfx, 'sw');\n  }\n\n  function removeResize(shape) {\n\n    var gfx = elementRegistry.getGraphics(shape);\n    var resizers = gfx.selectAll('.' + CLS_RESIZER);\n\n    forEach(resizers, function(resizer){\n      resizer.remove();\n    });\n  }\n\n  eventBus.on('selection.changed', function(e) {\n\n    var oldSelection = e.oldSelection,\n        newSelection = e.newSelection;\n\n    // remove old selection markers\n    forEach(oldSelection, removeResize);\n\n    // add new selection markers ONLY if single selection\n    if (newSelection.length === 1) {\n      forEach(newSelection, addResize);\n    }\n  });\n\n  eventBus.on('shape.changed', function(e) {\n    var shape = e.element;\n\n    removeResize(shape);\n\n    if (selection.isSelected(shape)) {\n      addResize(shape);\n    }\n  });\n\n\n  // API\n\n  this.activate = activate;\n}\n\nResize.$inject = [ 'eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging' ];\n\nmodule.exports = Resize;\n","'use strict';\n\n/**\n * Resize the given bounds by the specified delta from a given anchor point.\n *\n * @param {Bounds} bounds the bounding box that should be resized\n * @param {String} direction in which the element is resized (nw, ne, se, sw)\n * @param {Point} delta of the resize operation\n *\n * @return {Bounds} resized bounding box\n */\nmodule.exports.resizeBounds = function(bounds, direction, delta) {\n\n  var dx = delta.x,\n      dy = delta.y;\n\n  switch (direction) {\n\n    case 'nw':\n      return {\n        x: bounds.x + dx,\n        y: bounds.y + dy,\n        width: bounds.width - dx,\n        height: bounds.height - dy\n      };\n\n    case 'sw':\n      return {\n        x: bounds.x + dx,\n        y: bounds.y,\n        width: bounds.width - dx,\n        height: bounds.height + dy\n      };\n\n    case 'ne':\n      return {\n        x: bounds.x,\n        y: bounds.y + dy,\n        width: bounds.width + dx,\n        height: bounds.height - dy\n      };\n\n    case 'se':\n      return {\n        x: bounds.x,\n        y: bounds.y,\n        width: bounds.width + dx,\n        height: bounds.height + dy\n      };\n\n    default:\n      throw new Error('unrecognized direction: ' + direction);\n  }\n};\n\nmodule.exports.reattachPoint = function(bounds, newBounds, point) {\n\n  var sx = bounds.width / newBounds.width,\n      sy = bounds.height / newBounds.height;\n\n  return {\n    x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),\n    y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)\n  };\n};\n\n\nmodule.exports.ensureMinBounds = function(currentBounds, minBounds) {\n  var topLeft = {\n    x: Math.min(currentBounds.x, minBounds.x),\n    y: Math.min(currentBounds.y, minBounds.y)\n  };\n\n  var bottomRight = {\n    x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),\n    y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)\n  };\n\n  return {\n    x: topLeft.x,\n    y: topLeft.y,\n    width: bottomRight.x - topLeft.x,\n    height: bottomRight.y - topLeft.y\n  };\n};\n\n\nmodule.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {\n  \n  switch(direction) {\n    case 'nw':\n      return {\n        x: currentBounds.x + currentBounds.width - minDimensions.width,\n        y: currentBounds.y + currentBounds.height - minDimensions.height,\n        width: minDimensions.width,\n        height: minDimensions.height\n      };\n    case 'sw':\n      return {\n        x: currentBounds.x + currentBounds.width - minDimensions.width,\n        y: currentBounds.y,\n        width: minDimensions.width,\n        height: minDimensions.height\n      };\n    case 'ne':\n      return {\n        x: currentBounds.x,\n        y: currentBounds.y + currentBounds.height - minDimensions.height,\n        width: minDimensions.width,\n        height: minDimensions.height\n      };\n    case 'se':\n      return {\n        x: currentBounds.x,\n        y: currentBounds.y,\n        width: minDimensions.width,\n        height: minDimensions.height\n      };\n    default:\n      throw new Error('unrecognized direction: ' + direction);\n  }\n};\n\n\n","module.exports = {\n  __depends__: [\n    require(128),\n    require(147),\n    require(101)\n  ],\n  __init__: [ 'resize' ],\n  resize: [ 'type', require(142) ]\n};\n","'use strict';\n\nvar inherits = require(195);\n\nvar CommandInterceptor = require(75);\n\n/**\n * A basic provider that may be extended to implement modeling rules.\n *\n * Extensions should implement the init method to actually add their custom\n * modeling checks. Checks may be added via the #addRule(action, fn) method.\n *\n * @param {EventBus} eventBus\n */\nfunction RuleProvider(eventBus) {\n  CommandInterceptor.call(this, eventBus);\n\n  this.init();\n}\n\nRuleProvider.$inject = [ 'eventBus' ];\n\ninherits(RuleProvider, CommandInterceptor);\n\nmodule.exports = RuleProvider;\n\n\n/**\n * Adds a modeling rule for the given action, implemented through a callback function.\n *\n * The function will receive the modeling specific action context to perform its check.\n * It must return false or null to disallow the action from happening.\n *\n * Returning <code>null</code> may encode simply ignoring the action.\n *\n * @example\n *\n * ResizableRules.prototype.init = function() {\n *\n *   this.addRule('shape.resize', function(context) {\n *\n *     var shape = context.shape;\n *\n *     if (!context.newBounds) {\n *       // check general resizability\n *       if (!shape.resizable) {\n *         return false;\n *       }\n *     } else {\n *       // element must have minimum size of 10*10 points\n *       return context.newBounds.width > 10 && context.newBounds.height > 10;\n *     }\n *   });\n * };\n *\n * @param {String|Array<String>} actions the identifier for the modeling action to check\n * @param {Function} fn the callback function that performs the actual check\n */\nRuleProvider.prototype.addRule = function(actions, fn) {\n\n  var self = this;\n\n  if (typeof actions === 'string') {\n    actions = [ actions ];\n  }\n\n  actions.forEach(function(action) {\n\n    self.canExecute(action, function(context, action, event) {\n      return fn(context);\n    }, true);\n  });\n};","'use strict';\n\n/**\n * A service that provides rules for certain diagram actions.\n *\n * @param {CommandStack} commandStack\n */\nfunction Rules(commandStack) {\n  this._commandStack = commandStack;\n}\n\nRules.$inject = [ 'commandStack' ];\n\nmodule.exports = Rules;\n\n\n/**\n * This method can be queried to ask whether certain modeling actions\n * are allowed or not.\n *\n * @param  {String} action the action to be checked\n * @param  {Object} [context] the context to check the action in\n *\n * @return {Boolean} returns true, false or null depending on whether the\n *                   operation is allowed, not allowed or should be ignored.\n */\nRules.prototype.allowed = function(action, context) {\n  var allowed = this._commandStack.canExecute(action, context);\n\n  // map undefined to true, i.e. no rules\n  return allowed === undefined ? true : allowed;\n};","module.exports = {\n  __depends__: [ require(77) ],\n  __init__: [ 'rules' ],\n  rules: [ 'type', require(146) ]\n};\n","'use strict';\n\nvar isArray = require(316),\n    forEach = require(204);\n\n\n/**\n * A service that offers the current selection in a diagram.\n * Offers the api to control the selection, too.\n *\n * @class\n *\n * @param {EventBus} eventBus the event bus\n */\nfunction Selection(eventBus) {\n\n  this._eventBus = eventBus;\n\n  this._selectedElements = [];\n\n  var self = this;\n\n  eventBus.on([ 'shape.remove', 'connection.remove' ], function(e) {\n    var element = e.element;\n    self.deselect(element);\n  });\n}\n\nSelection.$inject = [ 'eventBus' ];\n\nmodule.exports = Selection;\n\n\nSelection.prototype.deselect = function(element) {\n  var selectedElements = this._selectedElements;\n\n  var idx = selectedElements.indexOf(element);\n\n  if (idx !== -1) {\n    var oldSelection = selectedElements.slice();\n\n    selectedElements.splice(idx, 1);\n\n    this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n  }\n};\n\n\nSelection.prototype.get = function() {\n  return this._selectedElements;\n};\n\nSelection.prototype.isSelected = function(element) {\n  return this._selectedElements.indexOf(element) !== -1;\n};\n\n\n/**\n * This method selects one or more elements on the diagram.\n *\n * By passing an additional add parameter you can decide whether or not the element(s)\n * should be added to the already existing selection or not.\n *\n * @method Selection#select\n *\n * @param  {Object|Object[]} elements element or array of elements to be selected\n * @param  {boolean} [add] whether the element(s) should be appended to the current selection, defaults to false\n */\nSelection.prototype.select = function(elements, add) {\n  var selectedElements = this._selectedElements,\n      oldSelection = selectedElements.slice();\n\n  if (!isArray(elements)) {\n    elements = elements ? [ elements ] : [];\n  }\n\n  // selection may be cleared by passing an empty array or null\n  // to the method\n  if (add) {\n    forEach(elements, function(element) {\n      if (selectedElements.indexOf(element) !== -1) {\n        // already selected\n        return;\n      } else {\n        selectedElements.push(element);\n      }\n    });\n  } else {\n    this._selectedElements = selectedElements = elements.slice();\n  }\n  this._eventBus.fire('selection.changed', { oldSelection: oldSelection, newSelection: selectedElements });\n};\n","'use strict';\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier;\n\n\nfunction SelectionBehavior(eventBus, selection, canvas) {\n\n  eventBus.on('create.end', 500, function(e) {\n    if (e.context.canExecute) {\n      selection.select(e.shape);\n    }\n  });\n\n  eventBus.on('connect.end', 500, function(e) {\n    if (e.context.canExecute && e.context.target) {\n      selection.select(e.context.target);\n    }\n  });\n\n  eventBus.on('shape.move.end', 500, function(e) {\n    selection.select(e.context.shapes);\n  });\n\n\n  // Shift + click selection\n  eventBus.on('element.click', function(event) {\n\n    var element = event.element;\n\n    // do not select the root element\n    // or connections\n    if (element === canvas.getRootElement()) {\n      element = null;\n    }\n\n    var isSelected = selection.isSelected(element),\n        isMultiSelect = selection.get().length > 1;\n\n    // mouse-event: SELECTION_KEY\n    var add = hasPrimaryModifier(event);\n\n    // select OR deselect element in multi selection\n    if (isSelected && isMultiSelect) {\n      if (add) {\n        return selection.deselect(element);\n      } else {\n        return selection.select(element);\n      }\n    } else\n    if (!isSelected) {\n      selection.select(element, add);\n    } else {\n      selection.deselect(element);\n    }\n  });\n}\n\nSelectionBehavior.$inject = [ 'eventBus', 'selection', 'canvas' ];\n\nmodule.exports = SelectionBehavior;\n","'use strict';\n\nvar forEach = require(204);\n\nvar MARKER_HOVER = 'hover',\n    MARKER_SELECTED = 'selected';\n\n\n/**\n * A plugin that adds a visible selection UI to shapes and connections\n * by appending the <code>hover</code> and <code>selected</code> classes to them.\n *\n * @class\n *\n * Makes elements selectable, too.\n *\n * @param {EventBus} events\n * @param {SelectionService} selection\n * @param {Canvas} canvas\n */\nfunction SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {\n\n  this._multiSelectionBox = null;\n\n  function addMarker(e, cls) {\n    canvas.addMarker(e, cls);\n  }\n\n  function removeMarker(e, cls) {\n    canvas.removeMarker(e, cls);\n  }\n\n  events.on('element.hover', function(event) {\n    addMarker(event.element, MARKER_HOVER);\n  });\n\n  events.on('element.out', function(event) {\n    removeMarker(event.element, MARKER_HOVER);\n  });\n\n  events.on('selection.changed', function(event) {\n\n    function deselect(s) {\n      removeMarker(s, MARKER_SELECTED);\n    }\n\n    function select(s) {\n      addMarker(s, MARKER_SELECTED);\n    }\n\n    var oldSelection = event.oldSelection,\n        newSelection = event.newSelection;\n\n    forEach(oldSelection, function(e) {\n      if (newSelection.indexOf(e) === -1) {\n        deselect(e);\n      }\n    });\n\n    forEach(newSelection, function(e) {\n      if (oldSelection.indexOf(e) === -1) {\n        select(e);\n      }\n    });\n  });\n}\n\nSelectionVisuals.$inject = [\n  'eventBus',\n  'canvas',\n  'selection',\n  'graphicsFactory',\n  'styles'\n];\n\nmodule.exports = SelectionVisuals;\n","module.exports = {\n  __init__: [ 'selectionVisuals', 'selectionBehavior' ],\n  __depends__: [\n    require(103),\n    require(133)\n  ],\n  selection: [ 'type', require(148) ],\n  selectionVisuals: [ 'type', require(150) ],\n  selectionBehavior: [ 'type', require(149) ]\n};\n","'use strict';\n\nvar forEach = require(204);\n\nvar snapTo = require(153).snapTo;\n\n\n/**\n * A snap context, containing the (possibly incomplete)\n * mappings of drop targets (to identify the snapping)\n * to computed snap points.\n */\nfunction SnapContext() {\n\n  /**\n   * Map<String, SnapPoints> mapping drop targets to\n   * a list of possible snappings.\n   *\n   * @type {Object}\n   */\n  this._targets = {};\n\n  /**\n   * Map<String, Point> initial positioning of element\n   * regarding various snap directions.\n   *\n   * @type {Object}\n   */\n  this._snapOrigins = {};\n\n  /**\n   * List of snap locations\n   *\n   * @type {Array<String>}\n   */\n  this._snapLocations = [];\n\n  /**\n   * Map<String, Array<Point>> of default snapping locations\n   *\n   * @type {Object}\n   */\n  this._defaultSnaps = {};\n}\n\n\nSnapContext.prototype.getSnapOrigin = function(snapLocation) {\n  return this._snapOrigins[snapLocation];\n};\n\n\nSnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {\n  this._snapOrigins[snapLocation] = initialValue;\n\n  if (this._snapLocations.indexOf(snapLocation) === -1) {\n    this._snapLocations.push(snapLocation);\n  }\n};\n\n\nSnapContext.prototype.addDefaultSnap = function(type, point) {\n\n  var snapValues = this._defaultSnaps[type];\n\n  if (!snapValues) {\n    snapValues = this._defaultSnaps[type] = [];\n  }\n\n  snapValues.push(point);\n};\n\n/**\n * Return a number of initialized snaps, i.e. snap locations such as\n * top-left, mid, bottom-right and so forth.\n *\n * @return {Array<String>} snapLocations\n */\nSnapContext.prototype.getSnapLocations = function() {\n  return this._snapLocations;\n};\n\n/**\n * Set the snap locations for this context.\n *\n * The order of locations determines precedence.\n *\n * @param {Array<String>} snapLocations\n */\nSnapContext.prototype.setSnapLocations = function(snapLocations) {\n  this._snapLocations = snapLocations;\n};\n\n/**\n * Get snap points for a given target\n *\n * @param {Element|String} target\n */\nSnapContext.prototype.pointsForTarget = function(target) {\n\n  var targetId = target.id || target;\n\n  var snapPoints = this._targets[targetId];\n\n  if (!snapPoints) {\n    snapPoints = this._targets[targetId] = new SnapPoints();\n    snapPoints.initDefaults(this._defaultSnaps);\n  }\n\n  return snapPoints;\n};\n\nmodule.exports = SnapContext;\n\n\n/**\n * Creates the snap points and initializes them with the\n * given default values.\n *\n * @param {Object<String, Array<Point>>} [defaultPoints]\n */\nfunction SnapPoints(defaultSnaps) {\n\n  /**\n   * Map<String, Map<(x|y), Array<Number>>> mapping snap locations,\n   * i.e. top-left, bottom-right, center to actual snap values.\n   *\n   * @type {Object}\n   */\n  this._snapValues = {};\n}\n\nSnapPoints.prototype.add = function(snapLocation, point) {\n\n  var snapValues = this._snapValues[snapLocation];\n\n  if (!snapValues) {\n    snapValues = this._snapValues[snapLocation] = { x: [], y: [] };\n  }\n\n  if (snapValues.x.indexOf(point.x) === -1) {\n    snapValues.x.push(point.x);\n  }\n\n  if (snapValues.y.indexOf(point.y) === -1) {\n    snapValues.y.push(point.y);\n  }\n};\n\n\nSnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {\n  var snappingValues = this._snapValues[snapLocation];\n  \n  return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);\n};\n\n/**\n * Initialize a number of default snapping points.\n *\n * @param  {Object} defaultSnaps\n */\nSnapPoints.prototype.initDefaults = function(defaultSnaps) {\n\n  var self = this;\n\n  forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {\n    forEach(snapPoints, function(point) {\n      self.add(snapLocation, point);\n    });\n  });\n};","'use strict';\n\nvar abs = Math.abs,\n    round = Math.round;\n\n\n/**\n * Snap value to a collection of reference values.\n *\n * @param  {Number} value\n * @param  {Array<Number>} values\n * @param  {Number} [tolerance=10]\n *\n * @return {Number} the value we snapped to or null, if none snapped\n */\nfunction snapTo(value, values, tolerance) {\n  tolerance = tolerance === undefined ? 10 : tolerance;\n\n  var idx, snapValue;\n\n  for (idx = 0; idx < values.length; idx++) {\n    snapValue = values[idx];\n\n    if (abs(snapValue - value) <= tolerance) {\n      return snapValue;\n    }\n  }\n}\n\n\nmodule.exports.snapTo = snapTo;\n\n\nfunction topLeft(bounds) {\n  return {\n    x: bounds.x,\n    y: bounds.y\n  };\n}\n\nmodule.exports.topLeft = topLeft;\n\n\nfunction mid(bounds, defaultValue) {\n\n  if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {\n    return defaultValue;\n  }\n\n  return {\n    x: round(bounds.x + bounds.width / 2),\n    y: round(bounds.y + bounds.height / 2)\n  };\n}\n\nmodule.exports.mid = mid;\n\n\nfunction bottomRight(bounds) {\n  return {\n    x: bounds.x + bounds.width,\n    y: bounds.y + bounds.height\n  };\n}\n\nmodule.exports.bottomRight = bottomRight;","'use strict';\n\nvar filter = require(202),\n    forEach = require(204),\n    debounce = require(214);\n\n\nvar mid = require(153).mid;\n\nvar SnapContext = require(152);\n\n/**\n * A general purpose snapping component for diagram elements.\n *\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nfunction Snapping(eventBus, canvas) {\n\n  this._canvas = canvas;\n\n  var self = this;\n\n  eventBus.on([ 'shape.move.start', 'create.start' ], function(event) {\n    self.initSnap(event);\n  });\n\n  eventBus.on([ 'shape.move.move', 'shape.move.end', 'create.move', 'create.end' ], function(event) {\n    if (event.snapped) {\n      return;\n    }\n\n    self.snap(event);\n  });\n\n  eventBus.on([ 'shape.move.cleanup', 'create.cleanup' ], function(event) {\n    self.hide();\n  });\n\n  // delay hide by 1000 seconds since last match\n  this._asyncHide = debounce(this.hide, 1000);\n}\n\nSnapping.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = Snapping;\n\n\nSnapping.prototype.initSnap = function(event) {\n\n  var context = event.context,\n      shape = context.shape,\n      snapContext = context.snapContext;\n\n  if (!snapContext) {\n    snapContext = context.snapContext = new SnapContext();\n  }\n\n  var snapMid = mid(shape, event);\n\n  snapContext.setSnapOrigin('mid', {\n    x: snapMid.x - event.x,\n    y: snapMid.y - event.y\n  });\n\n  return snapContext;\n};\n\n\nSnapping.prototype.snap = function(event) {\n\n  var context = event.context,\n      snapContext = context.snapContext,\n      shape = context.shape,\n      target = context.target,\n      snapLocations = snapContext.getSnapLocations();\n\n  if (!target) {\n    return;\n  }\n\n  var snapPoints = snapContext.pointsForTarget(target);\n\n  if (!snapPoints.initialized) {\n    this.addTargetSnaps(snapPoints, shape, target);\n\n    snapPoints.initialized = true;\n  }\n\n\n  var snapping = {};\n\n  forEach(snapLocations, function(location) {\n\n    var snapOrigin = snapContext.getSnapOrigin(location);\n\n    var snapCurrent = {\n      x: event.x + snapOrigin.x,\n      y: event.y + snapOrigin.y\n    };\n\n    // snap on both axis, if not snapped already\n    forEach([ 'x', 'y' ], function(axis) {\n      var locationSnapping;\n\n      if (!snapping[axis]) {\n        locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);\n        \n        if (locationSnapping !== undefined) {\n          snapping[axis] = {\n            value: locationSnapping,\n            originValue: locationSnapping - snapOrigin[axis]\n          };\n        }\n      }\n    });\n    \n    // no more need to snap, drop out of interation\n    if (snapping.x && snapping.y) {\n      return false;\n    }\n  });\n\n\n  // show snap visuals\n\n  this.showSnapLine('vertical', snapping.x && snapping.x.value);\n  this.showSnapLine('horizontal', snapping.y && snapping.y.value);\n\n\n  // adjust event { x, y, dx, dy } and mark as snapping\n  var cx, cy;\n\n  if (snapping.x) {\n\n    cx = event.x - snapping.x.originValue;\n\n    event.x = snapping.x.originValue;\n    event.dx = event.dx - cx;\n\n    event.snapped = true;\n  }\n\n  if (snapping.y) {\n    cy = event.y - snapping.y.originValue;\n\n    event.y = snapping.y.originValue;\n    event.dy = event.dy - cy;\n\n    event.snapped = true;\n  }\n};\n\n\nSnapping.prototype._createLine = function(orientation) {\n\n  var root = this._canvas.getLayer('snap');\n\n  var line = root.path('M0,0 L0,0').addClass('djs-snap-line');\n\n  return {\n    update: function(position) {\n\n      if (position === undefined) {\n        line.attr({ display: 'none' });\n      } else {\n        if (orientation === 'horizontal') {\n          line.attr({\n            path: 'M-100000,' + position + ' L+100000,' + position,\n            display: ''\n          });\n        } else {\n          line.attr({\n            path: 'M ' + position + ',-100000 L ' + position + ', +100000',\n            display: ''\n          });\n        }\n      }\n    }\n  };\n};\n\n\nSnapping.prototype._createSnapLines = function() {\n\n  this._snapLines = {\n    horizontal: this._createLine('horizontal'),\n    vertical: this._createLine('vertical')\n  };\n};\n\nSnapping.prototype.showSnapLine = function(orientation, position) {\n\n  var line = this.getSnapLine(orientation);\n\n  if (line) {\n    line.update(position);\n  }\n\n  this._asyncHide();\n};\n\nSnapping.prototype.getSnapLine = function(orientation) {\n  if (!this._snapLines) {\n    this._createSnapLines();\n  }\n\n  return this._snapLines[orientation];\n};\n\nSnapping.prototype.hide = function() {\n  forEach(this._snapLines, function(l) {\n    l.update();\n  });\n};\n\nSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {\n\n  var siblings = this.getSiblings(shape, target);\n\n  forEach(siblings, function(s) {\n    snapPoints.add('mid', mid(s));\n  });\n\n};\n\nSnapping.prototype.getSiblings = function(element, target) {\n\n  // snap to all non connection siblings\n  return target && filter(target.children, function(e) {\n    return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;\n  });\n};","'use strict';\n\nvar SpaceUtil = require(157);\n\nvar Cursor = require(176);\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier;\n\nvar abs = Math.abs,\n    round = Math.round;\n\nvar HIGH_PRIORITY = 1500;\n\n/**\n * A tool that allows users to create and remove space in a diagram.\n *\n * The tool needs to be activated manually via {@link SpaceTool#activate(MouseEvent)}.\n */\nfunction SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {\n\n  function canResize(shape) {\n    var ctx = { shape: shape };\n    return rules.allowed('shape.resize', ctx);\n  }\n\n  function activateSelection(event, autoActivate) {\n    dragging.activate(event, 'spaceTool.selection', {\n      cursor: 'crosshair',\n      autoActivate: autoActivate,\n      data: {\n        context: {\n          crosshair: {}\n        }\n      }\n    });\n  }\n\n  function activateMakeSpace(event) {\n    dragging.activate(event, 'spaceTool', {\n      autoActivate: true,\n      cursor: 'crosshair',\n      data: {\n        context: {}\n      }\n    });\n  }\n\n\n  eventBus.on('spaceTool.selection.end', function(event) {\n    setTimeout(function() {\n      activateMakeSpace(event.originalEvent);\n    });\n  });\n\n\n  var AXIS_TO_DIMENSION = { x: 'width', y: 'height' },\n      AXIS_INVERTED = { x: 'y', y: 'x' };\n\n\n  function initializeMakeSpace(event, context) {\n\n    var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',\n        offset = event['d' + axis],\n        // start point of create space operation\n        spacePos = event[axis] - offset,\n        // list of moving shapes\n        movingShapes = [],\n        // list of resizing shapes\n        resizingShapes = [];\n\n    if (abs(offset) < 5) {\n      return false;\n    }\n\n    // inverts the offset to choose the shapes\n    // on the opposite side of the resizer if\n    // a key modifier is pressed\n    if (hasPrimaryModifier(event)) {\n      offset *= -1;\n    }\n\n    // collect all elements that need to be moved _AND_\n    // resized given on the initial create space position\n    elementRegistry.forEach(function (shape) {\n      var shapeStart = shape[ [ axis ]],\n          shapeEnd = shapeStart + shape[ AXIS_TO_DIMENSION[ axis ]];\n\n      // checking if it's root\n      if (!shape.parent) {\n        return;\n      }\n\n      // checking if it's a shape\n      if (shape.waypoints) {\n        return;\n      }\n\n      // shape after spacePos\n      if (offset > 0 && shapeStart > spacePos) {\n        return movingShapes.push(shape);\n      }\n\n      // shape before spacePos\n      if (offset < 0 && shapeEnd < spacePos) {\n        return movingShapes.push(shape);\n      }\n\n      // shape on top of spacePos, resize only if allowed\n      if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {\n        return resizingShapes.push(shape);\n      }\n    });\n\n    // store data in context\n    context.axis = axis;\n    context.direction = SpaceUtil.getDirection(axis, offset);\n    context.movingShapes = movingShapes;\n    context.resizingShapes = resizingShapes;\n\n    Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));\n\n    return true;\n  }\n\n\n  eventBus.on('spaceTool.move', HIGH_PRIORITY , function(event) {\n\n    var context = event.context;\n\n    if (!context.initialized) {\n      context.initialized = initializeMakeSpace(event, context);\n    }\n  });\n\n\n  eventBus.on('spaceTool.end', function(event) {\n\n    var context = event.context,\n        axis = context.axis,\n        direction = context.direction,\n        movingShapes = context.movingShapes,\n        resizingShapes = context.resizingShapes;\n\n    // skip if create space has not been initialized yet\n    if (!context.initialized) {\n      return;\n    }\n\n    var delta = { x: round(event.dx), y: round(event.dy) };\n    delta[ AXIS_INVERTED[ axis ] ] = 0;\n\n    return modeling.createSpace(movingShapes, resizingShapes, delta, direction);\n  });\n\n  // API\n  this.activateSelection = activateSelection;\n  this.activateMakeSpace = activateMakeSpace;\n}\n\nSpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];\n\nmodule.exports = SpaceTool;\n","'use strict';\n\nvar forEach = require(204);\n\n\nvar MARKER_DRAGGING = 'djs-dragging';\n\n\n/**\n * A plugin that makes shapes draggable / droppable.\n *\n * @param {EventBus} eventBus\n * @param {ElementRegistry} elementRegistry\n * @param {Canvas} canvas\n * @param {Styles} styles\n */\n\nfunction SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {\n\n  function getGfx(e) {\n    return elementRegistry.getGraphics(e);\n  }\n\n  function addDragger(shape, dragGroup) {\n    var gfx = getGfx(shape);\n    var dragger = gfx.clone();\n    var bbox = gfx.getBBox();\n\n    dragger.attr(styles.cls('djs-dragger', [], {\n      x: bbox.x,\n      y: bbox.y\n    }));\n\n    dragGroup.add(dragger);\n  }\n\n  eventBus.on('spaceTool.selection.start', function(event) {\n    var space = canvas.getLayer('space'),\n        context = event.context;\n\n    var orientation = {\n      x: 'M 0,-10000 L 0,10000',\n      y: 'M -10000,0 L 10000,0'\n    };\n\n    var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', [ 'no-events' ]));\n\n    crosshairGroup.path(orientation.x).addClass('djs-crosshair');\n    crosshairGroup.path(orientation.y).addClass('djs-crosshair');\n\n    context.crosshairGroup = crosshairGroup;\n  });\n\n  eventBus.on('spaceTool.selection.move', function(event) {\n    var crosshairGroup = event.context.crosshairGroup;\n\n    crosshairGroup.translate(event.x, event.y);\n  });\n\n  eventBus.on('spaceTool.selection.cleanup', function(event) {\n    var context = event.context,\n        crosshairGroup = context.crosshairGroup;\n\n    if (crosshairGroup) {\n      crosshairGroup.remove();\n    }\n  });\n\n\n  // assign a low priority to this handler\n  // to let others modify the move context before\n  // we draw things\n  eventBus.on('spaceTool.move', function(event) {\n    /*\n      TODO (Ricardo): extend connections while adding space\n    */\n\n    var context = event.context,\n        line = context.line,\n        axis = context.axis,\n        dragShapes = context.movingShapes;\n\n    if (!context.initialized) {\n      return;\n    }\n\n    if (!context.dragGroup) {\n      var spaceLayer = canvas.getLayer('space');\n      line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');\n\n      context.line  = line;\n      var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', [ 'no-events' ]));\n\n\n      forEach(dragShapes, function(shape) {\n        addDragger(shape, dragGroup);\n        canvas.addMarker(shape, MARKER_DRAGGING);\n      });\n\n      context.dragGroup = dragGroup;\n    }\n\n    var orientation = {\n      x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',\n      y: 'M -10000, ' + event.y + ' L 10000, ' + event.y\n    };\n\n    line.attr({\n      path: orientation[ axis ],\n      display: ''\n    });\n\n    var opposite = { x: 'y', y: 'x' };\n    var delta = { x: event.dx, y: event.dy };\n    delta[ opposite[ context.axis ] ] = 0;\n\n    context.dragGroup.translate(delta.x, delta.y);\n  });\n\n  eventBus.on('spaceTool.cleanup', function(event) {\n\n    var context = event.context,\n        shapes = context.movingShapes,\n        line = context.line,\n        dragGroup = context.dragGroup;\n\n    // remove dragging marker\n    forEach(shapes, function(e) {\n      canvas.removeMarker(e, MARKER_DRAGGING);\n    });\n\n    if (dragGroup) {\n      line.remove();\n      dragGroup.remove();\n    }\n  });\n}\n\nSpaceToolVisuals.$inject = [ 'eventBus', 'elementRegistry', 'canvas', 'styles' ];\n\nmodule.exports = SpaceToolVisuals;\n","'use strict';\n\n/**\n * Get Resize direction given axis + offset\n *\n * @param {String} axis (x|y)\n * @param {Number} offset\n *\n * @return {String} (e|w|n|s)\n */\nfunction getDirection(axis, offset) {\n\n  if (axis === 'x') {\n    if (offset > 0) {\n      return 'e';\n    }\n\n    if (offset < 0) {\n      return 'w';\n    }\n  }\n\n  if (axis === 'y') {\n    if (offset > 0) {\n      return 's';\n    }\n\n    if (offset < 0) {\n      return 'n';\n    }\n  }\n\n  return null;\n}\n\nmodule.exports.getDirection = getDirection;\n\n/**\n * Resize the given bounds by the specified delta from a given anchor point.\n *\n * @param {Bounds} bounds the bounding box that should be resized\n * @param {String} direction in which the element is resized (n, s, e, w)\n * @param {Point} delta of the resize operation\n *\n * @return {Bounds} resized bounding box\n */\nmodule.exports.resizeBounds = function(bounds, direction, delta) {\n\n  var dx = delta.x,\n      dy = delta.y;\n\n  switch (direction) {\n\n    case 'n':\n      return {\n        x: bounds.x,\n        y: bounds.y + dy,\n        width: bounds.width,\n        height: bounds.height - dy\n      };\n\n    case 's':\n      return {\n        x: bounds.x,\n        y: bounds.y,\n        width: bounds.width,\n        height: bounds.height + dy\n      };\n\n    case 'w':\n      return {\n        x: bounds.x + dx,\n        y: bounds.y,\n        width: bounds.width - dx,\n        height: bounds.height\n      };\n\n    case 'e':\n      return {\n        x: bounds.x,\n        y: bounds.y,\n        width: bounds.width + dx,\n        height: bounds.height\n      };\n\n    default:\n      throw new Error('unrecognized direction: ' + direction);\n  }\n};","module.exports = {\n  __init__: ['spaceToolVisuals'],\n  __depends__: [require(101), require(128), require(147) ],\n  spaceTool: ['type', require(155)],\n  spaceToolVisuals: ['type', require(156) ]\n};\n","'use strict';\n\nvar isString = require(322),\n    assign = require(325),\n    forEach = require(204),\n    debounce = require(214);\n\nvar domify = require(343),\n    domAttr = require(338),\n    domClasses = require(339),\n    domRemove = require(347),\n    domDelegate = require(342);\n\n\n// document wide unique tooltip ids\nvar ids = new (require(181))('tt');\n\n\nfunction createRoot(parent) {\n  var root = domify('<div class=\"djs-tooltip-container\" style=\"position: absolute; width: 0; height: 0;\" />');\n  parent.insertBefore(root, parent.firstChild);\n\n  return root;\n}\n\n\nfunction setPosition(el, x, y) {\n  assign(el.style, { left: x + 'px', top: y + 'px' });\n}\n\nfunction setVisible(el, visible) {\n  el.style.display = visible === false ? 'none' : '';\n}\n\n\nvar tooltipClass = 'djs-tooltip',\n    tooltipSelector = '.' + tooltipClass;\n\n/**\n * A service that allows users to render tool tips on the diagram.\n *\n * The tooltip service will take care of updating the tooltip positioning\n * during navigation + zooming.\n *\n * @example\n *\n * ```javascript\n *\n * // add a pink badge on the top left of the shape\n * tooltips.add({\n *   position: {\n *     x: 50,\n *     y: 100\n *   },\n *   html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>'\n * });\n *\n * // or with optional life span\n * tooltips.add({\n *   position: {\n *     top: -5,\n *     left: -5\n *   },\n *   html: '<div style=\"width: 10px; background: fuchsia; color: white;\">0</div>',\n *   ttl: 2000\n * });\n *\n * // remove a tool tip\n * var id = tooltips.add(...);\n * tooltips.remove(id);\n * ```\n *\n * @param {Object} config\n * @param {EventBus} eventBus\n * @param {Canvas} canvas\n */\nfunction Tooltips(config, eventBus, canvas) {\n\n  this._eventBus = eventBus;\n  this._canvas = canvas;\n\n  this._ids = ids;\n\n  this._tooltipDefaults = {\n    show: {\n      minZoom: 0.7,\n      maxZoom: 5.0\n    }\n  };\n\n  /**\n   * Mapping tooltipId -> tooltip\n   */\n  this._tooltips = {};\n\n  // root html element for all tooltips\n  this._tooltipRoot = createRoot(canvas.getContainer());\n\n\n  var self = this;\n\n  domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {\n    event.stopPropagation();\n  });\n\n  domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {\n    self.trigger('mouseover', event);\n  });\n\n  domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {\n    self.trigger('mouseout', event);\n  });\n\n  this._init(config);\n}\n\n\nTooltips.$inject = [ 'config.tooltips', 'eventBus', 'canvas' ];\n\nmodule.exports = Tooltips;\n\n\n/**\n * Adds a HTML tooltip to the diagram\n *\n * @param {Object}               tooltip   the tooltip configuration\n *\n * @param {String|DOMElement}    tooltip.html                 html element to use as an tooltip\n * @param {Object}               [tooltip.show]               show configuration\n * @param {Number}               [tooltip.show.minZoom]       minimal zoom level to show the tooltip\n * @param {Number}               [tooltip.show.maxZoom]       maximum zoom level to show the tooltip\n * @param {Object}               tooltip.position             where to attach the tooltip\n * @param {Number}               [tooltip.position.left]      relative to element bbox left attachment\n * @param {Number}               [tooltip.position.top]       relative to element bbox top attachment\n * @param {Number}               [tooltip.position.bottom]    relative to element bbox bottom attachment\n * @param {Number}               [tooltip.position.right]     relative to element bbox right attachment\n * @param {Number}               [tooltip.timeout=-1]\n *\n * @return {String}              id that may be used to reference the tooltip for update or removal\n */\nTooltips.prototype.add = function(tooltip) {\n\n  if (!tooltip.position) {\n    throw new Error('must specifiy tooltip position');\n  }\n\n  if (!tooltip.html) {\n    throw new Error('must specifiy tooltip html');\n  }\n\n  var id = this._ids.next();\n\n  tooltip = assign({}, this._tooltipDefaults, tooltip, {\n    id: id\n  });\n\n  this._addTooltip(tooltip);\n\n  if (tooltip.timeout) {\n    this.setTimeout(tooltip);\n  }\n\n  return id;\n};\n\nTooltips.prototype.trigger = function(action, event) {\n\n  var node = event.delegateTarget || event.target;\n\n  var tooltip = this.get(domAttr(node, 'data-tooltip-id'));\n\n  if (!tooltip) {\n    return;\n  }\n\n  if (action === 'mouseover' && tooltip.timeout) {\n    this.clearTimeout(tooltip);\n  }\n\n  if (action === 'mouseout' && tooltip.timeout) {\n    // cut timeout after mouse out\n    tooltip.timeout = 1000;\n\n    this.setTimeout(tooltip);\n  }\n\n  console.log('mouse leave', event);\n};\n\n/**\n * Get a tooltip with the given id\n *\n * @param {String} id\n */\nTooltips.prototype.get = function(id) {\n\n  if (typeof id !== 'string') {\n    id = id.id;\n  }\n\n  return this._tooltips[id];\n};\n\nTooltips.prototype.clearTimeout = function(tooltip) {\n\n  tooltip = this.get(tooltip);\n\n  if (!tooltip) {\n    return;\n  }\n\n  var removeTimer = tooltip.removeTimer;\n\n  if (removeTimer) {\n    clearTimeout(removeTimer);\n    tooltip.removeTimer = null;\n  }\n};\n\nTooltips.prototype.setTimeout = function(tooltip) {\n\n  tooltip = this.get(tooltip);\n\n  if (!tooltip) {\n    return;\n  }\n\n  this.clearTimeout(tooltip);\n\n  var self = this;\n\n  tooltip.removeTimer = setTimeout(function() {\n    self.remove(tooltip);\n  }, tooltip.timeout);\n};\n\n/**\n * Remove an tooltip with the given id\n *\n * @param {String} id\n */\nTooltips.prototype.remove = function(id) {\n\n  var tooltip = this.get(id);\n\n  if (tooltip) {\n    domRemove(tooltip.html);\n    domRemove(tooltip.htmlContainer);\n\n    delete tooltip.htmlContainer;\n\n    delete this._tooltips[tooltip.id];\n  }\n};\n\n\nTooltips.prototype.show = function() {\n  setVisible(this._tooltipRoot);\n};\n\n\nTooltips.prototype.hide = function() {\n  setVisible(this._tooltipRoot, false);\n};\n\n\nTooltips.prototype._updateRoot = function(viewbox) {\n  var a = viewbox.scale || 1;\n  var d = viewbox.scale || 1;\n\n  var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';\n\n  this._tooltipRoot.style.transform = matrix;\n  this._tooltipRoot.style['-ms-transform'] = matrix;\n};\n\n\nTooltips.prototype._addTooltip = function(tooltip) {\n\n  var id = tooltip.id,\n      html = tooltip.html,\n      htmlContainer,\n      tooltipRoot = this._tooltipRoot;\n\n  // unwrap jquery (for those who need it)\n  if (html.get) {\n    html = html.get(0);\n  }\n\n  // create proper html elements from\n  // tooltip HTML strings\n  if (isString(html)) {\n    html = domify(html);\n  }\n\n  htmlContainer = domify('<div data-tooltip-id=\"' + id + '\" class=\"' + tooltipClass + '\" style=\"position: absolute\">');\n\n  htmlContainer.appendChild(html);\n\n  if (tooltip.type) {\n    domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);\n  }\n\n  if (tooltip.className) {\n    domClasses(htmlContainer).add(tooltip.className);\n  }\n\n  tooltip.htmlContainer = htmlContainer;\n\n  tooltipRoot.appendChild(htmlContainer);\n\n  this._tooltips[id] = tooltip;\n\n  this._updateTooltip(tooltip);\n};\n\n\nTooltips.prototype._updateTooltip = function(tooltip) {\n\n  var position = tooltip.position,\n      htmlContainer = tooltip.htmlContainer;\n\n  // update overlay html based on tooltip x, y\n\n  setPosition(htmlContainer, position.x, position.y);\n};\n\n\nTooltips.prototype._updateTooltipVisibilty = function(viewbox) {\n\n  forEach(this._tooltips, function(tooltip) {\n    var show = tooltip.show,\n        htmlContainer = tooltip.htmlContainer,\n        visible = true;\n\n    if (show) {\n      if (show.minZoom > viewbox.scale ||\n          show.maxZoom < viewbox.scale) {\n        visible = false;\n      }\n\n      setVisible(htmlContainer, visible);\n    }\n  });\n};\n\nTooltips.prototype._init = function(config) {\n\n  var self = this;\n\n\n  // scroll/zoom integration\n\n  var updateViewbox = function(viewbox) {\n    self._updateRoot(viewbox);\n    self._updateTooltipVisibilty(viewbox);\n\n    self.show();\n  };\n\n  if (!config || config.deferUpdate !== false) {\n    updateViewbox = debounce(updateViewbox, 300);\n  }\n\n  this._eventBus.on('canvas.viewbox.changed', function(event) {\n    self.hide();\n    updateViewbox(event.viewbox);\n  });\n};\n","module.exports = {\n  __init__: [ 'tooltips' ],\n  tooltips: [ 'type', require(159) ]\n};","'use strict';\n\nfunction TouchFix(canvas, eventBus) {\n\n  var self = this;\n\n  eventBus.on('canvas.init', function(e) {\n    self.addBBoxMarker(e.svg);\n  });\n}\n\nTouchFix.$inject = [ 'canvas', 'eventBus' ];\n\nmodule.exports = TouchFix;\n\n\n/**\n * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element\n * if there is no shape between 0,0 and viewport elements origin.\n *\n * So touchstart event is only fired when the <g class=\"viewport\"> element was hit.\n * Putting an element over and below the 'viewport' fixes that behavior.\n */\nTouchFix.prototype.addBBoxMarker = function(paper) {\n\n  var markerStyle = {\n    fill: 'none',\n    class: 'outer-bound-marker'\n  };\n\n  paper.rect(-10000, -10000, 10, 10).attr(markerStyle);\n  paper.rect(10000, 10000, 10, 10).attr(markerStyle);\n};\n","'use strict';\n\nvar forEach = require(204),\n    domEvent = require(344),\n    domClosest = require(341),\n    Hammer = require(186),\n    Snap = require(188),\n    Event = require(178);\n\nvar MIN_ZOOM = 0.2,\n    MAX_ZOOM = 4;\n\nvar mouseEvents = [\n  'mousedown',\n  'mouseup',\n  'mouseover',\n  'mouseout',\n  'click',\n  'dblclick'\n];\n\nfunction log() {\n  if (false) {\n    console.log.apply(console, arguments);\n  }\n}\n\nfunction get(service, injector) {\n  try {\n    return injector.get(service);\n  } catch (e) {\n    return null;\n  }\n}\n\nfunction createTouchRecognizer(node) {\n\n  function stopEvent(event) {\n    Event.stopEvent(event, true);\n  }\n\n  function stopMouse(event) {\n\n    forEach(mouseEvents, function(e) {\n      domEvent.bind(node, e, stopEvent, true);\n    });\n  }\n\n  function allowMouse(event) {\n    setTimeout(function() {\n      forEach(mouseEvents, function(e) {\n        domEvent.unbind(node, e, stopEvent, true);\n      });\n    }, 500);\n  }\n\n  domEvent.bind(node, 'touchstart', stopMouse, true);\n  domEvent.bind(node, 'touchend', allowMouse, true);\n  domEvent.bind(node, 'touchcancel', allowMouse, true);\n\n  // A touch event recognizer that handles\n  // touch events only (we know, we can already handle\n  // mouse events out of the box)\n\n  var recognizer = new Hammer.Manager(node, {\n    inputClass: Hammer.TouchInput,\n    recognizers: []\n  });\n\n\n  var tap = new Hammer.Tap();\n  var pan = new Hammer.Pan({ threshold: 10 });\n  var press = new Hammer.Press();\n  var pinch = new Hammer.Pinch();\n\n  var doubleTap = new Hammer.Tap({ event: 'doubletap', taps: 2 });\n\n  pinch.requireFailure(pan);\n  pinch.requireFailure(press);\n\n  recognizer.add([ pan, press, pinch, doubleTap, tap ]);\n\n  recognizer.reset = function(force) {\n    var recognizers = this.recognizers,\n        session = this.session;\n\n    if (session.stopped) {\n      return;\n    }\n\n    log('recognizer', 'stop');\n\n    recognizer.stop(force);\n\n    setTimeout(function() {\n      var i, r;\n\n      log('recognizer', 'reset');\n      for (i = 0; !!(r = recognizers[i]); i++) {\n        r.reset();\n        r.state = 8; // FAILED STATE\n      }\n\n      session.curRecognizer = null;\n    }, 0);\n  };\n\n  recognizer.on('hammer.input', function(event) {\n    if (event.srcEvent.defaultPrevented) {\n      recognizer.reset(true);\n    }\n  });\n\n  return recognizer;\n}\n\n/**\n * A plugin that provides touch events for elements.\n *\n * @param {EventBus} eventBus\n * @param {InteractionEvents} interactionEvents\n */\nfunction TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {\n\n  // optional integrations\n  var dragging = get('dragging', injector),\n      move = get('move', injector),\n      contextPad = get('contextPad', injector),\n      palette = get('palette', injector);\n\n  // the touch recognizer\n  var recognizer;\n\n  function handler(type) {\n\n    return function(event) {\n      log('element', type, event);\n\n      interactionEvents.fire(type, event);\n    };\n  }\n\n  function getGfx(target) {\n    var node = domClosest(target, 'svg, .djs-element', true);\n    return node && new Snap(node);\n  }\n\n  function initEvents(svg) {\n\n    // touch recognizer\n    recognizer = createTouchRecognizer(svg);\n\n    recognizer.on('doubletap', handler('element.dblclick'));\n\n    recognizer.on('tap', handler('element.click'));\n\n    function startGrabCanvas(event) {\n\n      log('canvas', 'grab start');\n\n      var lx = 0, ly = 0;\n\n      function update(e) {\n\n        var dx = e.deltaX - lx,\n            dy = e.deltaY - ly;\n\n        canvas.scroll({ dx: dx, dy: dy });\n\n        lx = e.deltaX;\n        ly = e.deltaY;\n      }\n\n      function end(e) {\n        recognizer.off('panmove', update);\n        recognizer.off('panend', end);\n        recognizer.off('pancancel', end);\n\n        log('canvas', 'grab end');\n      }\n\n      recognizer.on('panmove', update);\n      recognizer.on('panend', end);\n      recognizer.on('pancancel', end);\n    }\n\n    function startGrab(event) {\n\n      var gfx = getGfx(event.target),\n          element = gfx && elementRegistry.get(gfx);\n\n      // recognizer\n      if (move && canvas.getRootElement() !== element) {\n        log('element', 'move start', element, event, true);\n        return move.start(event, element, true);\n      } else {\n        startGrabCanvas(event);\n      }\n    }\n\n    function startZoom(e) {\n\n      log('canvas', 'zoom start');\n\n      var zoom = canvas.zoom(),\n          mid = e.center;\n\n      function update(e) {\n\n        var ratio = 1 - (1 - e.scale) / 1.50,\n            newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));\n\n        canvas.zoom(newZoom, mid);\n\n        Event.stopEvent(e, true);\n      }\n\n      function end(e) {\n        recognizer.off('pinchmove', update);\n        recognizer.off('pinchend', end);\n        recognizer.off('pinchcancel', end);\n\n        recognizer.reset(true);\n\n        log('canvas', 'zoom end');\n      }\n\n      recognizer.on('pinchmove', update);\n      recognizer.on('pinchend', end);\n      recognizer.on('pinchcancel', end);\n    }\n\n    recognizer.on('panstart', startGrab);\n    recognizer.on('press', startGrab);\n\n    recognizer.on('pinchstart', startZoom);\n  }\n\n  if (dragging) {\n\n    // simulate hover during dragging\n    eventBus.on('drag.move', function(event) {\n\n      var position = Event.toPoint(event.originalEvent);\n\n      var node = document.elementFromPoint(position.x, position.y),\n          gfx = getGfx(node),\n          element = gfx && elementRegistry.get(gfx);\n\n      if (element !== event.hover) {\n        if (event.hover) {\n          dragging.out(event);\n        }\n\n        if (element) {\n          dragging.hover({ element: element, gfx: gfx });\n\n          event.hover = element;\n          event.hoverGfx = gfx;\n        }\n      }\n    });\n  }\n\n  if (contextPad) {\n\n    eventBus.on('contextPad.create', function(event) {\n      var node = event.pad.html;\n\n      // touch recognizer\n      var padRecognizer = createTouchRecognizer(node);\n\n      padRecognizer.on('panstart', function(event) {\n        log('context-pad', 'panstart', event);\n        contextPad.trigger('dragstart', event, true);\n      });\n\n      padRecognizer.on('press', function(event) {\n        log('context-pad', 'press', event);\n        contextPad.trigger('dragstart', event, true);\n      });\n\n      padRecognizer.on('tap', function(event) {\n        log('context-pad', 'tap', event);\n        contextPad.trigger('click', event);\n      });\n    });\n  }\n\n  if (palette) {\n    eventBus.on('palette.create', function(event) {\n      var node = event.html;\n\n      // touch recognizer\n      var padRecognizer = createTouchRecognizer(node);\n\n      padRecognizer.on('panstart', function(event) {\n        log('palette', 'panstart', event);\n        palette.trigger('dragstart', event, true);\n      });\n\n      padRecognizer.on('press', function(event) {\n        log('palette', 'press', event);\n        palette.trigger('dragstart', event, true);\n      });\n\n      padRecognizer.on('tap', function(event) {\n        log('palette', 'tap', event);\n        palette.trigger('click', event);\n      });\n    });\n  }\n\n  eventBus.on('canvas.init', function(event) {\n    initEvents(event.svg.node);\n  });\n}\n\n\nTouchInteractionEvents.$inject = [\n  'injector',\n  'canvas',\n  'eventBus',\n  'elementRegistry',\n  'interactionEvents',\n  'touchFix'\n];\n\nmodule.exports = TouchInteractionEvents;","module.exports = {\n  __depends__: [ require(103) ],\n  __init__: [ 'touchInteractionEvents' ],\n  touchInteractionEvents: [ 'type', require(162) ],\n  touchFix: [ 'type', require(161) ]\n};","'use strict';\n\nvar LayoutUtil = require(166);\n\n\n/**\n * A base connection layouter implementation\n * that layouts the connection by directly connecting\n * mid(source) + mid(target).\n */\nfunction BaseLayouter() {}\n\nmodule.exports = BaseLayouter;\n\n\n/**\n * Return the new layouted waypoints for the given connection.\n *\n * @param {djs.model.Connection} connection\n * @param {Object} hints\n * @param {Boolean} [hints.movedStart=false]\n * @param {Boolean} [hints.movedEnd=false]\n *\n * @return {Array<Point>} the layouted connection waypoints\n */\nBaseLayouter.prototype.layoutConnection = function(connection, hints) {\n  return [\n    LayoutUtil.getMidPoint(connection.source),\n    LayoutUtil.getMidPoint(connection.target)\n  ];\n};\n","'use strict';\n\nvar assign = require(325);\n\nvar LayoutUtil = require(166);\n\n\nfunction dockingToPoint(docking) {\n  // use the dockings actual point and\n  // retain the original docking\n  return assign({ original: docking.point.original || docking.point }, docking.actual);\n}\n\n\n/**\n * A {@link ConnectionDocking} that crops connection waypoints based on\n * the path(s) of the connection source and target.\n *\n * @param {djs.core.ElementRegistry} elementRegistry\n */\nfunction CroppingConnectionDocking(elementRegistry, renderer) {\n  this._elementRegistry = elementRegistry;\n  this._renderer = renderer;\n}\n\nCroppingConnectionDocking.$inject = [ 'elementRegistry', 'renderer' ];\n\nmodule.exports = CroppingConnectionDocking;\n\n\n/**\n * @inheritDoc ConnectionDocking#getCroppedWaypoints\n */\nCroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {\n\n  source = source || connection.source;\n  target = target || connection.target;\n\n  var sourceDocking = this.getDockingPoint(connection, source, true),\n      targetDocking = this.getDockingPoint(connection, target);\n\n  var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);\n\n  croppedWaypoints.unshift(dockingToPoint(sourceDocking));\n  croppedWaypoints.push(dockingToPoint(targetDocking));\n\n  return croppedWaypoints;\n};\n\n/**\n * Return the connection docking point on the specified shape\n *\n * @inheritDoc ConnectionDocking#getDockingPoint\n */\nCroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {\n\n  var waypoints = connection.waypoints,\n      dockingIdx,\n      dockingPoint,\n      croppedPoint;\n\n  dockingIdx = dockStart ? 0 : waypoints.length - 1;\n  dockingPoint = waypoints[dockingIdx];\n\n  croppedPoint = this._getIntersection(shape, connection, dockStart);\n\n  return {\n    point: dockingPoint,\n    actual: croppedPoint || dockingPoint,\n    idx: dockingIdx\n  };\n};\n\n\n////// helper methods ///////////////////////////////////////////////////\n\nCroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {\n\n  var shapePath = this._getShapePath(shape),\n      connectionPath = this._getConnectionPath(connection);\n\n  return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);\n};\n\nCroppingConnectionDocking.prototype._getConnectionPath = function(connection) {\n  return this._renderer.getConnectionPath(connection);\n};\n\nCroppingConnectionDocking.prototype._getShapePath = function(shape) {\n  return this._renderer.getShapePath(shape);\n};\n\nCroppingConnectionDocking.prototype._getGfx = function(element) {\n  return this._elementRegistry.getGraphics(element);\n};","'use strict';\n\nvar isArray = require(316),\n    sortBy = require(211);\n\nvar Snap = require(188);\n\n/**\n * Returns whether two points are in a horizontal or vertical line.\n *\n * @param {Point} a\n * @param {Point} b\n *\n * @return {String|Boolean} returns false if the points are not\n *                          aligned or 'h|v' if they are aligned\n *                          horizontally / vertically.\n */\nfunction pointsAligned(a, b) {\n  switch (true) {\n    case a.x === b.x:\n      return 'h';\n    case a.y === b.y:\n      return 'v';\n  }\n\n  return false;\n}\n\nmodule.exports.pointsAligned = pointsAligned;\n\n\nfunction roundPoint(point) {\n\n  return {\n    x: Math.round(point.x),\n    y: Math.round(point.y)\n  };\n}\n\nmodule.exports.roundPoint = roundPoint;\n\n\nfunction pointsEqual(a, b) {\n  return a.x === b.x && a.y === b.y;\n}\n\nmodule.exports.pointsEqual = pointsEqual;\n\n\nfunction pointDistance(a, b) {\n  return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));\n}\n\nmodule.exports.pointDistance = pointDistance;\n\n\nfunction asTRBL(bounds) {\n  return {\n    top: bounds.y,\n    right: bounds.x + (bounds.width || 0),\n    bottom: bounds.y + (bounds.height || 0),\n    left: bounds.x\n  };\n}\n\nmodule.exports.asTRBL = asTRBL;\n\n\nfunction getMidPoint(bounds) {\n  return roundPoint({\n    x: bounds.x + bounds.width / 2,\n    y: bounds.y + bounds.height / 2\n  });\n}\n\nmodule.exports.getMidPoint = getMidPoint;\n\n\n////// orientation utils //////////////////////////////\n\nfunction getOrientation(rect, reference, pointDistance) {\n\n  pointDistance = pointDistance || 0;\n\n  var rectOrientation = asTRBL(rect),\n      referenceOrientation = asTRBL(reference);\n\n  var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,\n      right = rectOrientation.left - pointDistance >= referenceOrientation.right,\n      bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,\n      left = rectOrientation.right + pointDistance <= referenceOrientation.left;\n\n  var vertical = top ? 'top' : (bottom ? 'bottom' : null),\n      horizontal = left ? 'left' : (right ? 'right' : null);\n\n  if (horizontal && vertical) {\n    return vertical + '-' + horizontal;\n  } else\n  if (horizontal || vertical) {\n    return horizontal || vertical;\n  } else {\n    return 'intersect';\n  }\n}\n\nmodule.exports.getOrientation = getOrientation;\n\n\nfunction hasAnyOrientation(rect, reference, pointDistance, locations) {\n\n  if (isArray(pointDistance)) {\n    locations = pointDistance;\n    pointDistance = 0;\n  }\n\n  var orientation = getOrientation(rect, reference, pointDistance);\n\n  return locations.indexOf(orientation) !== -1;\n}\n\nmodule.exports.hasAnyOrientation = hasAnyOrientation;\n\n\n////// intersection utils //////////////////////////////\n\nfunction getElementLineIntersection(elementPath, linePath, cropStart) {\n\n  var intersections = getIntersections(elementPath, linePath);\n\n  // recognize intersections\n  // only one -> choose\n  // two close together -> choose first\n  // two or more distinct -> pull out appropriate one\n  // none -> ok (fallback to point itself)\n  if (intersections.length === 1) {\n    return roundPoint(intersections[0]);\n  } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {\n    return roundPoint(intersections[0]);\n  } else if (intersections.length > 1) {\n\n    // sort by intersections based on connection segment +\n    // distance from start\n    intersections = sortBy(intersections, function(i) {\n      var distance = Math.floor(i.t2 * 100) || 1;\n\n      distance = 100 - distance;\n\n      distance = (distance < 10 ? '0' : '') + distance;\n\n      // create a sort string that makes sure we sort\n      // line segment ASC + line segment position DESC (for cropStart)\n      // line segment ASC + line segment position ASC (for cropEnd)\n      return i.segment2 + '#' + distance;\n    });\n\n    return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);\n  }\n\n  return null;\n}\n\nmodule.exports.getElementLineIntersection = getElementLineIntersection;\n\n\nfunction getIntersections(a, b) {\n  return Snap.path.intersection(a, b);\n}\n\nmodule.exports.getIntersections = getIntersections;","'use strict';\n\nvar isArray = require(316),\n    find = require(203);\n\nvar LayoutUtil = require(166),\n    Geometry = require(179);\n\nvar MIN_DISTANCE = 20;\n\n\n/**\n * Returns the mid points for a manhattan connection between two points.\n *\n * @example\n *\n * [a]----[x]\n *         |\n *        [x]--->[b]\n *\n * @param  {Point} a\n * @param  {Point} b\n * @param  {String} directions\n *\n * @return {Array<Point>}\n */\nmodule.exports.getMidPoints = function(a, b, directions) {\n\n  directions = directions || 'h:h';\n\n  var xmid, ymid;\n\n  // one point, next to a\n  if (directions === 'h:v') {\n    return [ { x: b.x, y: a.y } ];\n  } else\n  // one point, above a\n  if (directions === 'v:h') {\n    return [ { x: a.x, y: b.y } ];\n  } else\n  // vertical edge xmid\n  if (directions === 'h:h') {\n    xmid = Math.round((b.x - a.x) / 2 + a.x);\n\n    return [\n      { x: xmid, y: a.y },\n      { x: xmid, y: b.y }\n    ];\n  } else\n  // horizontal edge ymid\n  if (directions === 'v:v') {\n    ymid = Math.round((b.y - a.y) / 2 + a.y);\n\n    return [\n      { x: a.x, y: ymid },\n      { x: b.x, y: ymid }\n    ];\n  } else {\n    throw new Error(\n      'unknown directions: <' + directions + '>: ' +\n      'directions must be specified as {a direction}:{b direction} (direction in h|v)');\n  }\n};\n\n\n/**\n * Create a connection between the two points according\n * to the manhattan layout (only horizontal and vertical) edges.\n *\n * @param {Point} a\n * @param {Point} b\n *\n * @param {String} [directions='h:h'] specifies manhattan directions for each point as {adirection}:{bdirection}.\n                   A directionfor a point is either `h` (horizontal) or `v` (vertical)\n *\n * @return {Array<Point>}\n */\nmodule.exports.connectPoints = function(a, b, directions) {\n\n  var points = [];\n\n  if (!LayoutUtil.pointsAligned(a, b)) {\n    points = this.getMidPoints(a, b, directions);\n  }\n\n  points.unshift(a);\n  points.push(b);\n\n  return points;\n};\n\n\n/**\n * Connect two rectangles using a manhattan layouted connection.\n *\n * @param {Bounds} source source rectangle\n * @param {Bounds} target target rectangle\n * @param {Point} [start] source docking\n * @param {Point} [end] target docking\n *\n * @return {Array<Point>} connection points\n */\nmodule.exports.connectRectangles = function(source, target, start, end, options) {\n\n  options = options || {};\n\n  var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);\n\n  var directions = this.getDirections(source, target, options.preferVertical);\n\n  start = start || LayoutUtil.getMidPoint(source);\n  end = end || LayoutUtil.getMidPoint(target);\n\n  // overlapping elements\n  if (!directions) {\n    return;\n  }\n\n  if (directions === 'h:h') {\n\n    switch (orientation) {\n      case 'top-right':\n      case 'right':\n      case 'bottom-right':\n        start = { original: start, x: source.x, y: start.y };\n        end = { original: end, x: target.x + target.width, y: end.y };\n        break;\n      case 'top-left':\n      case 'left':\n      case 'bottom-left':\n        start = { original: start, x: source.x + source.width, y: start.y };\n        end = { original: end, x: target.x, y: end.y };\n        break;\n    }\n  }\n\n  if (directions === 'v:v') {\n\n    switch (orientation) {\n      case 'top-left':\n      case 'top':\n      case 'top-right':\n        start = { original: start, x: start.x, y: source.y + source.height };\n        end = { original: end, x: end.x, y: target.y };\n        break;\n      case 'bottom-left':\n      case 'bottom':\n      case 'bottom-right':\n        start = { original: start, x: start.x, y: source.y };\n        end = { original: end, x: end.x, y: target.y + target.height };\n        break;\n    }\n  }\n\n  return this.connectPoints(start, end, directions);\n};\n\n/**\n * Repair the connection between two rectangles, of which one has been updated.\n *\n * @param {Bounds} source\n * @param {Bounds} target\n * @param {Point} [start]\n * @param {Point} [end]\n * @param {Array<Point>} waypoints\n * @param {Object} [hints]\n * @param {Boolean} hints.preferStraight\n * @param {Boolean} hints.preferVertical\n * @param {Boolean} hints.startChanged\n * @param {Boolean} hints.endChanged\n *\n * @return {Array<Point>} repaired waypoints\n */\nmodule.exports.repairConnection = function(source, target, start, end, waypoints, hints) {\n\n  if (isArray(start)) {\n    waypoints = start;\n    hints = end;\n\n    start = LayoutUtil.getMidPoint(source);\n    end = LayoutUtil.getMidPoint(target);\n  }\n\n  hints = hints || {};\n\n\n  var repairedWaypoints;\n\n  // just layout non-existing or simple connections\n  // attempt to render straight lines, if required\n  if (!waypoints || waypoints.length < 3) {\n\n    if (hints.preferStraight) {\n      // attempt to layout a straight line\n      repairedWaypoints = this.layoutStraight(source, target, start, end, hints);\n    }\n  } else {\n    // check if we layout from start or end\n    if (hints.endChanged) {\n      repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());\n      repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();\n    } else\n    if (hints.startChanged) {\n      repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);\n    }\n    // or whether nothing seems to have changed\n    else {\n      repairedWaypoints = waypoints;\n    }\n  }\n\n  // simply reconnect if nothing else worked\n  if (!repairedWaypoints) {\n    return this.connectRectangles(source, target, start, end, hints);\n  }\n\n  return repairedWaypoints;\n};\n\nfunction max(a, b) {\n  return Math.max(a, b);\n}\n\nfunction min(a, b) {\n  return Math.min(a, b);\n}\n\nfunction inRange(a, start, end) {\n  return a >= start && a <= end;\n}\n\nmodule.exports.layoutStraight = function(source, target, start, end, hints) {\n\n  var startX, endX, x,\n      startY, endY, y;\n\n  startX = max(source.x + 10, target.x + 10);\n  endX = min(source.x + source.width - 10, target.x + target.width - 10);\n\n  if (startX < endX) {\n\n    if (source.width === target.width) {\n\n      if (hints.endChanged && inRange(end.x, startX, endX)) {\n        x = end.x;\n      } else\n      if (inRange(start.x, startX, endX)) {\n        x = start.x;\n      }\n    }\n\n    if (x === undefined) {\n      if (source.width < target.width && inRange(start.x, startX, endX)) {\n        x = start.x;\n      } else\n      if (source.width > target.width && inRange(end.x, startX, endX)) {\n        x = end.x;\n      } else {\n        x = (startX + endX) / 2;\n      }\n    }\n  }\n\n  startY = max(source.y + 10, target.y + 10);\n  endY = min(source.y + source.height - 10, target.y + target.height - 10);\n\n  if (startY < endY) {\n\n    if (source.height === target.height) {\n      if (hints.endChanged && inRange(end.y, startY, endY)) {\n        y = end.y;\n      } else\n      if (inRange(start.y, startY, endY)) {\n        y = start.y;\n      }\n    }\n\n    if (y === undefined) {\n      if (source.height <= target.height && inRange(start.y, startY, endY)) {\n        y = start.y;\n      } else\n      if (target.height <= source.height && inRange(end.y, startY, endY)) {\n        y = end.y;\n      } else {\n        y = (startY + endY) / 2;\n      }\n    }\n  }\n\n  // cannot layout straight\n  if (x === undefined && y === undefined) {\n    return null;\n  }\n\n  return [\n    {\n      x: x !== undefined ? x : start.x,\n      y: y !== undefined ? y : start.y\n    },\n    {\n      x: x !== undefined ? x : end.x,\n      y: y !== undefined ? y : end.y\n    }\n  ];\n};\n\n\n/**\n * Repair a connection from one side that moved.\n *\n * @param  {Bounds} moved\n * @param  {Bounds} other\n * @param  {Point} newDocking\n * @param  {Array<Point>} points originalPoints from moved to other\n *\n * @return {Array<Point>} the repaired points between the two rectangles\n */\nmodule.exports._repairConnectionSide = function(moved, other, newDocking, points) {\n\n  function needsRelayout(moved, other, points) {\n\n    if (points.length < 3) {\n      return true;\n    }\n\n    if (points.length > 4) {\n      return false;\n    }\n\n    // relayout if two points overlap\n    // this is most likely due to\n    return !!find(points, function(p, idx) {\n      var q = points[idx - 1];\n\n      return q && Geometry.distance(p, q) < 3;\n    });\n  }\n\n  function repairBendpoint(candidate, oldPeer, newPeer) {\n\n    var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);\n\n    switch (alignment) {\n      case 'v':\n        // repair vertical alignment\n        return { x: candidate.x, y: newPeer.y };\n      case 'h':\n        // repair horizontal alignment\n        return { x: newPeer.x, y: candidate.y };\n    }\n\n    return { x: candidate.x, y: candidate. y };\n  }\n\n  function removeOverlapping(points, a, b) {\n    var i;\n\n    for (i = points.length - 2; i !== 0; i--) {\n\n      // intersects (?) break, remove all bendpoints up to this one and relayout\n      if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||\n          Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {\n\n        // return sliced old connection\n        return points.slice(i);\n      }\n    }\n\n    return points;\n  }\n\n\n  // (0) only repair what has layoutable bendpoints\n\n  // (1) if only one bendpoint and on shape moved onto other shapes axis\n  //     (horizontally / vertically), relayout\n\n  if (needsRelayout(moved, other, points)) {\n    return null;\n  }\n\n  var oldDocking = points[0],\n      newPoints = points.slice(),\n      slicedPoints;\n\n  // (2) repair only last line segment and only if it was layouted before\n\n  newPoints[0] = newDocking;\n  newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);\n\n\n  // (3) if shape intersects with any bendpoint after repair,\n  //     remove all segments up to this bendpoint and repair from there\n\n  slicedPoints = removeOverlapping(newPoints, moved, other);\n  if (slicedPoints !== newPoints) {\n    return this._repairConnectionSide(moved, other, newDocking, slicedPoints);\n  }\n\n  return newPoints;\n};\n\n/**\n * Returns the default manhattan directions connecting two rectangles.\n *\n * @param {Bounds} source\n * @param {Bounds} target\n * @param {Boolean} preferVertical\n *\n * @return {String}\n */\nmodule.exports.getDirections = function(source, target, preferVertical) {\n  var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);\n\n  switch (orientation) {\n    case 'intersect':\n      return null;\n\n    case 'top':\n    case 'bottom':\n      return 'v:v';\n\n    case 'left':\n    case 'right':\n      return 'h:h';\n\n    default:\n      return preferVertical ? 'v:v' : 'h:h';\n  }\n};","'use strict';\n\nvar assign = require(325),\n    inherits = require(195);\n\nvar Refs = require(356);\n\nvar parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),\n    labelRefs = new Refs({ name: 'label', enumerable: true }, { name: 'labelTarget' }),\n    outgoingRefs = new Refs({ name: 'outgoing', collection: true }, { name: 'source' }),\n    incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' });\n\n/**\n * @namespace djs.model\n */\n\n/**\n * @memberOf djs.model\n */\n\n/**\n * The basic graphical representation\n *\n * @class\n *\n * @abstract\n */\nfunction Base() {\n\n  /**\n   * The object that backs up the shape\n   *\n   * @name Base#businessObject\n   * @type Object\n   */\n  Object.defineProperty(this, 'businessObject', {\n    writable: true\n  });\n\n  /**\n   * The parent shape\n   *\n   * @name Base#parent\n   * @type Shape\n   */\n  parentRefs.bind(this, 'parent');\n\n  /**\n   * @name Base#label\n   * @type Label\n   */\n  labelRefs.bind(this, 'label');\n\n  /**\n   * The list of outgoing connections\n   *\n   * @name Base#outgoing\n   * @type Array<Connection>\n   */\n  outgoingRefs.bind(this, 'outgoing');\n\n  /**\n   * The list of outgoing connections\n   *\n   * @name Base#incoming\n   * @type Array<Connection>\n   */\n  incomingRefs.bind(this, 'incoming');\n}\n\n\n/**\n * A graphical object\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Shape() {\n  Base.call(this);\n\n  /**\n   * The list of children\n   *\n   * @name Shape#children\n   * @type Array<Base>\n   */\n  parentRefs.bind(this, 'children');\n}\n\ninherits(Shape, Base);\n\n\n/**\n * A root graphical object\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Root() {\n  Shape.call(this);\n}\n\ninherits(Root, Shape);\n\n\n/**\n * A label for an element\n *\n * @class\n * @constructor\n *\n * @extends Shape\n */\nfunction Label() {\n  Shape.call(this);\n\n  /**\n   * The labeled element\n   *\n   * @name Label#labelTarget\n   * @type Base\n   */\n  labelRefs.bind(this, 'labelTarget');\n}\n\ninherits(Label, Shape);\n\n\n/**\n * A connection between two elements\n *\n * @class\n * @constructor\n *\n * @extends Base\n */\nfunction Connection() {\n  Base.call(this);\n\n  /**\n   * The element this connection originates from\n   *\n   * @name Connection#source\n   * @type Base\n   */\n  outgoingRefs.bind(this, 'source');\n\n  /**\n   * The element this connection points to\n   *\n   * @name Connection#target\n   * @type Base\n   */\n  incomingRefs.bind(this, 'target');\n}\n\ninherits(Connection, Base);\n\n\nvar types = {\n  connection: Connection,\n  shape: Shape,\n  label: Label,\n  root: Root\n};\n\n/**\n * Creates a new model element of the specified type\n *\n * @method create\n *\n * @example\n *\n * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });\n * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });\n *\n * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ] });\n *\n * @param  {String} type lower-cased model name\n * @param  {Object} attrs attributes to initialize the new model instance with\n *\n * @return {Base} the new model instance\n */\nmodule.exports.create = function(type, attrs) {\n  var Type = types[type];\n  if (!Type) {\n    throw new Error('unknown type: <' + type + '>');\n  }\n  return assign(new Type(), attrs);\n};\n\n\nmodule.exports.Base = Base;\nmodule.exports.Root = Root;\nmodule.exports.Shape = Shape;\nmodule.exports.Connection = Connection;\nmodule.exports.Label = Label;","'use strict';\n\nvar Cursor = require(176),\n    ClickTrap = require(174),\n    domEvent = require(344),\n    Event = require(178);\n\nfunction substract(p1, p2) {\n  return {\n    x: p1.x - p2.x,\n    y: p1.y - p2.y\n  };\n}\n\nfunction length(point) {\n  return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));\n}\n\n\nvar THRESHOLD = 15;\n\n\nfunction MoveCanvas(eventBus, canvas) {\n\n  var container = canvas._container,\n      context;\n\n\n  function handleMove(event) {\n\n    var start = context.start,\n        position = Event.toPoint(event),\n        delta = substract(position, start);\n\n    if (!context.dragging && length(delta) > THRESHOLD) {\n      context.dragging = true;\n\n      // prevent mouse click in this\n      // interaction sequence\n      ClickTrap.install();\n\n      Cursor.set('move');\n    }\n\n    if (context.dragging) {\n\n      var lastPosition = context.last || context.start;\n\n      delta = substract(position, lastPosition);\n\n      canvas.scroll({\n        dx: delta.x,\n        dy: delta.y\n      });\n\n      context.last = position;\n    }\n\n    // prevent select\n    event.preventDefault();\n  }\n\n\n  function handleEnd(event) {\n    domEvent.unbind(document, 'mousemove', handleMove);\n    domEvent.unbind(document, 'mouseup', handleEnd);\n\n    context = null;\n\n    Cursor.unset();\n\n    // prevent select\n    Event.stopEvent(event);\n  }\n\n  function handleStart(event) {\n\n    // reject non-left left mouse button or modifier key\n    if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {\n      return;\n    }\n\n    context = {\n      start: Event.toPoint(event)\n    };\n\n    domEvent.bind(document, 'mousemove', handleMove);\n    domEvent.bind(document, 'mouseup', handleEnd);\n\n    // prevent select\n    Event.stopEvent(event);\n  }\n\n  domEvent.bind(container, 'mousedown', handleStart);\n}\n\n\nMoveCanvas.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = MoveCanvas;\n","module.exports = {\n  __init__: [ 'moveCanvas' ],\n  moveCanvas: [ 'type', require(169) ]\n};","module.exports = {\n  __depends__: [ require(163) ]\n};","'use strict';\n\nvar domEvent = require(344);\n\nvar hasPrimaryModifier = require(182).hasPrimaryModifier,\n    hasSecondaryModifier = require(182).hasSecondaryModifier;\n\nvar isMac = require(183).isMac;\n\n\nfunction ZoomScroll(events, canvas) {\n\n  var RANGE = { min: 0.2, max: 4 };\n\n  function cap(scale) {\n    return Math.max(RANGE.min, Math.min(RANGE.max, scale));\n  }\n\n  function reset() {\n    canvas.zoom('fit-viewport');\n  }\n\n  function zoom(direction, position) {\n\n    var currentZoom = canvas.zoom();\n    var factor = Math.pow(1 + Math.abs(direction) , direction > 0 ? 1 : -1);\n\n    canvas.zoom(cap(currentZoom * factor), position);\n  }\n\n  function scroll(delta) {\n    canvas.scroll(delta);\n  }\n\n  function init(element) {\n\n    domEvent.bind(element, 'wheel', function(event) {\n\n      event.preventDefault();\n\n      // mouse-event: SELECTION_KEY\n      // mouse-event: AND_KEY\n      var isVerticalScroll = hasPrimaryModifier(event),\n          isHorizontalScroll = hasSecondaryModifier(event);\n\n      var factor;\n\n      if (isVerticalScroll || isHorizontalScroll) {\n\n        if (isMac) {\n          factor = event.deltaMode === 0 ? 1.25 : 50;\n        } else {\n          factor = event.deltaMode === 0 ? 1/40 : 1/2;\n        }\n\n        var delta = {};\n\n        if (isHorizontalScroll) {\n          delta.dx = (factor * (event.deltaX || event.deltaY));\n        } else {\n          delta.dy = (factor * event.deltaY);\n        }\n\n        scroll(delta);\n      } else {\n        factor = (event.deltaMode === 0 ? 1/40 : 1/2);\n\n        var elementRect = element.getBoundingClientRect();\n\n        var offset =  {\n          x: event.clientX - elementRect.left,\n          y: event.clientY - elementRect.top\n        };\n\n        // zoom in relative to diagram {x,y} coordinates\n        zoom(event.deltaY * factor / (-5), offset);\n      }\n    });\n  }\n\n  events.on('canvas.init', function(e) {\n    init(canvas._container);\n  });\n\n  // API\n  this.zoom = zoom;\n  this.reset = reset;\n}\n\n\nZoomScroll.$inject = [ 'eventBus', 'canvas' ];\n\nmodule.exports = ZoomScroll;\n\n","module.exports = {\n  __init__: [ 'zoomScroll' ],\n  zoomScroll: [ 'type', require(172) ]\n};","'use strict';\n\nvar domEvent = require(344),\n    stopEvent = require(178).stopEvent;\n\nfunction trap(event) {\n  stopEvent(event);\n\n  toggle(false);\n}\n\nfunction toggle(active) {\n  domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);\n}\n\n/**\n * Installs a click trap that prevents a ghost click following a dragging operation.\n *\n * @return {Function} a function to immediately remove the installed trap.\n */\nfunction install() {\n\n  toggle(true);\n\n  return function() {\n    toggle(false);\n  };\n}\n\nmodule.exports.install = install;","'use strict';\n\n/**\n * Failsafe remove an element from a collection\n *\n * @param  {Array<Object>} [collection]\n * @param  {Object} [element]\n *\n * @return {Object} the element that got removed or undefined\n */\nmodule.exports.remove = function(collection, element) {\n\n  if (!collection || !element) {\n    return;\n  }\n\n  var idx = collection.indexOf(element);\n  if (idx === -1) {\n    return;\n  }\n\n  collection.splice(idx, 1);\n\n  return element;\n};\n\n/**\n * Fail save add an element to the given connection, ensuring\n * it does not yet exist.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n * @param {Number} idx\n */\nmodule.exports.add = function(collection, element, idx) {\n\n  if (!collection || !element) {\n    return;\n  }\n\n  if (isNaN(idx)) {\n    idx = -1;\n  }\n\n  var currentIdx = collection.indexOf(element);\n\n  if (currentIdx !== -1) {\n\n    if (currentIdx === idx) {\n      // nothing to do, position has not changed\n      return;\n    } else {\n\n      if (idx !== -1) {\n        // remove from current position\n        collection.splice(currentIdx, 1);\n      } else {\n        // already exists in collection\n        return;\n      }\n    }\n  }\n\n  if (idx !== -1) {\n    // insert at specified position\n    collection.splice(idx, 0, element);\n  } else {\n    // push to end\n    collection.push(element);\n  }\n};\n\n\n/**\n * Fail get the index of an element in a collection.\n *\n * @param {Array<Object>} collection\n * @param {Object} element\n *\n * @return {Number} the index or -1 if collection or element do\n *                  not exist or the element is not contained.\n */\nmodule.exports.indexOf = function(collection, element) {\n\n  if (!collection || !element) {\n    return -1;\n  }\n\n  return collection.indexOf(element);\n};\n","'use strict';\n\nvar domClasses = require(339);\n\nvar CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;\n\n\nmodule.exports.set = function(mode) {\n  var classes = domClasses(document.body);\n\n  classes.removeMatching(CURSOR_CLS_PATTERN);\n\n  if (mode) {\n    classes.add('djs-cursor-' + mode);\n  }\n};\n\nmodule.exports.unset = function() {\n  this.set(null);\n};","'use strict';\n\nvar isArray = require(316),\n    isNumber = require(319),\n    groupBy = require(205),\n    forEach = require(204);\n\n/**\n * Adds an element to a collection and returns true if the\n * element was added.\n *\n * @param {Array<Object>} elements\n * @param {Object} e\n * @param {Boolean} unique\n */\nfunction add(elements, e, unique) {\n  var canAdd = !unique || elements.indexOf(e) === -1;\n\n  if (canAdd) {\n    elements.push(e);\n  }\n\n  return canAdd;\n}\n\nfunction eachElement(elements, fn, depth) {\n\n  depth = depth || 0;\n\n  forEach(elements, function(s, i) {\n    var filter = fn(s, i, depth);\n\n    if (isArray(filter) && filter.length) {\n      eachElement(filter, fn, depth + 1);\n    }\n  });\n}\n\n/**\n * Collects self + child elements up to a given depth from a list of elements.\n *\n * @param  {Array<djs.model.Base>} elements the elements to select the children from\n * @param  {Boolean} unique whether to return a unique result set (no duplicates)\n * @param  {Number} maxDepth the depth to search through or -1 for infinite\n *\n * @return {Array<djs.model.Base>} found elements\n */\nfunction selfAndChildren(elements, unique, maxDepth) {\n  var result = [],\n      processedChildren = [];\n\n  eachElement(elements, function(element, i, depth) {\n    add(result, element, unique);\n\n    var children = element.children;\n\n    // max traversal depth not reached yet\n    if (maxDepth === -1 || depth < maxDepth) {\n\n      // children exist && children not yet processed\n      if (children && add(processedChildren, children, unique)) {\n        return children;\n      }\n    }\n  });\n\n  return result;\n}\n\n/**\n * Return self + direct children for a number of elements\n *\n * @param  {Array<djs.model.Base>} elements to query\n * @param  {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndDirectChildren(elements, allowDuplicates) {\n  return selfAndChildren(elements, !allowDuplicates, 1);\n}\n\n/**\n * Return self + ALL children for a number of elements\n *\n * @param  {Array<djs.model.Base>} elements to query\n * @param  {Boolean} allowDuplicates to allow duplicates in the result set\n *\n * @return {Array<djs.model.Base>} the collected elements\n */\nfunction selfAndAllChildren(elements, allowDuplicates) {\n  return selfAndChildren(elements, !allowDuplicates, -1);\n}\n\n/**\n * Gets the the closure fo all selected elements,\n * their connections and\n *\n * @param {Array<djs.model.Base>} elements\n * @return {Object} enclosure\n */\nfunction getClosure(elements) {\n\n  // original elements passed to this function\n  var topLevel = groupBy(elements, function(e) { return e.id; });\n\n  var allShapes = {},\n      allConnections = {},\n      enclosedElements = {},\n      enclosedConnections = {};\n\n  function handleConnection(c) {\n    if (topLevel[c.source.id] && topLevel[c.target.id]) {\n      topLevel[c.id] = c;\n    }\n\n    // not enclosed as a child, but maybe logically\n    // (connecting two moved elements?)\n    if (allShapes[c.source.id] && allShapes[c.target.id]) {\n      enclosedConnections[c.id] = enclosedElements[c.id] = c;\n    }\n\n    allConnections[c.id] = c;\n  }\n\n  function handleElement(element) {\n\n    enclosedElements[element.id] = element;\n\n    if (element.waypoints) {\n      // remember connection\n      enclosedConnections[element.id] = allConnections[element.id] = element;\n    } else {\n      // remember shape\n      allShapes[element.id] = element;\n\n      // remember all connections\n      forEach(element.incoming, handleConnection);\n\n      forEach(element.outgoing, handleConnection);\n\n      // recurse into children\n      return element.children;\n    }\n  }\n\n  eachElement(elements, handleElement);\n\n  return {\n    allShapes: allShapes,\n    allConnections: allConnections,\n    topLevel: topLevel,\n    enclosedConnections: enclosedConnections,\n    enclosedElements: enclosedElements\n  };\n}\n\n/**\n * Returns the surrounding bbox for all elements in the array or the element primitive.\n */\nfunction getBBox(elements, stopRecursion) {\n\n  stopRecursion = !!stopRecursion;\n  if (!isArray(elements)) {\n    elements = [elements];\n  }\n\n  var minX,\n      minY,\n      maxX,\n      maxY;\n\n  forEach(elements, function(element) {\n\n    // If element is a connection the bbox must be computed first\n    var bbox = element;\n    if (element.waypoints && !stopRecursion) {\n      bbox = getBBox(element.waypoints, true);\n    }\n\n    var x = bbox.x,\n        y = bbox.y,\n        height = bbox.height || 0,\n        width  = bbox.width  || 0;\n\n    if (x < minX || minX === undefined) {\n      minX = x;\n    }\n    if (y < minY || minY === undefined) {\n      minY = y;\n    }\n\n    if ((x + width) > maxX || maxX === undefined) {\n      maxX = x + width;\n    }\n    if ((y + height) > maxY || maxY === undefined) {\n      maxY = y + height;\n    }\n  });\n\n  return {\n    x: minX,\n    y: minY,\n    height: maxY - minY,\n    width: maxX - minX\n  };\n}\n\n\n/**\n * Returns all elements that are enclosed from the bounding box.\n *\n * @param {Array<Object>} elements List of Elements to search through\n * @param {Object} bbox the enclosing bbox.\n * <ul>\n *  <li>If bbox.(width|height) is not specified\n * the method returns all elements with element.x/y &gt; bbox.x/y\n * </li>\n *  <li>If only bbox.x or bbox.y is specified, method return all elements with\n *  e.x &gt; bbox.x or e.y &gt; bbox.y.</li>\n * </ul>\n *\n */\nfunction getEnclosedElements(elements, bbox) {\n\n  var filteredElements = {};\n\n  forEach(elements, function(element) {\n\n    var e = element;\n\n    if (e.waypoints) {\n      e = getBBox(e);\n    }\n\n    if (!isNumber(bbox.y) && (e.x > bbox.x)) {\n      filteredElements[element.id] = element;\n    }\n    if (!isNumber(bbox.x) && (e.y > bbox.y)) {\n      filteredElements[element.id] = element;\n    }\n    if (e.x > bbox.x && e.y > bbox.y) {\n      if (isNumber(bbox.width) && isNumber(bbox.height) &&\n          e.width  + e.x < bbox.width  + bbox.x &&\n          e.height + e.y < bbox.height + bbox.y) {\n\n        filteredElements[element.id] = element;\n      } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {\n        filteredElements[element.id] = element;\n      }\n    }\n  });\n\n  return filteredElements;\n}\n\n\n\nmodule.exports.eachElement = eachElement;\nmodule.exports.selfAndDirectChildren = selfAndDirectChildren;\nmodule.exports.selfAndAllChildren = selfAndAllChildren;\nmodule.exports.getBBox = getBBox;\nmodule.exports.getEnclosedElements = getEnclosedElements;\n\nmodule.exports.getClosure = getClosure;\n","'use strict';\n\nfunction __preventDefault(event) {\n  return event && event.preventDefault();\n}\n\nfunction __stopPropagation(event, immediate) {\n  if (!event) {\n    return;\n  }\n\n  if (event.stopPropagation) {\n    event.stopPropagation();\n  }\n\n  if (immediate && event.stopImmediatePropagation) {\n    event.stopImmediatePropagation();\n  }\n}\n\n\nfunction getOriginal(event) {\n  return event.originalEvent || event.srcEvent;\n}\n\nmodule.exports.getOriginal = getOriginal;\n\n\nfunction stopEvent(event, immediate) {\n  stopPropagation(event, immediate);\n  preventDefault(event);\n}\n\nmodule.exports.stopEvent = stopEvent;\n\n\nfunction preventDefault(event) {\n  __preventDefault(event);\n  __preventDefault(getOriginal(event));\n}\n\nmodule.exports.preventDefault = preventDefault;\n\n\nfunction stopPropagation(event, immediate) {\n  __stopPropagation(event, immediate);\n  __stopPropagation(getOriginal(event), immediate);\n}\n\nmodule.exports.stopPropagation = stopPropagation;\n\n\nfunction toPoint(event) {\n\n  if (event.pointers && event.pointers.length) {\n    event = event.pointers[0];\n  }\n\n  if (event.touches && event.touches.length) {\n    event = event.touches[0];\n  }\n\n  return event ? {\n    x: event.clientX,\n    y: event.clientY\n  } : null;\n}\n\nmodule.exports.toPoint = toPoint;\n","'use strict';\n\n/**\n * Computes the distance between two points\n *\n * @param  {Point}  p\n * @param  {Point}  q\n *\n * @return {Number}  distance\n */\nvar distance = module.exports.distance = function(p, q) {\n  return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));\n};\n\n/**\n * Returns true if the point r is on the line between p and y\n *\n * @param  {Point}  p\n * @param  {Point}  q\n * @param  {Point}  r\n *\n * @return {Boolean}\n */\nmodule.exports.pointsOnLine = function(p, q, r) {\n\n  if (!p || !q || !r) {\n    return false;\n  }\n\n  var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),\n      dist = distance(p, q);\n\n  // @see http://stackoverflow.com/a/907491/412190\n  return Math.abs(val / dist) < 5;\n};\n\nmodule.exports.pointInRect = function(p, rect, tolerance) {\n  tolerance = tolerance || 0;\n\n  return p.x > rect.x - tolerance &&\n         p.y > rect.y - tolerance &&\n         p.x < rect.x + rect.width + tolerance &&\n         p.y < rect.y + rect.height + tolerance;\n};","'use strict';\n\n/**\n * SVGs for elements are generated by the {@link GraphicsFactory}.\n *\n * This utility gives quick access to the important semantic\n * parts of an element.\n */\n\n/**\n * Returns the visual part of a diagram element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Snap<SVGElement>}\n */\nfunction getVisual(gfx) {\n  return gfx.select('.djs-visual');\n}\n\n/**\n * Returns the children for a given diagram element.\n *\n * @param {Snap<SVGElement>} gfx\n * @return {Snap<SVGElement>}\n */\nfunction getChildren(gfx) {\n  return gfx.parent().children()[1];\n}\n\n/**\n * Returns the visual bbox of an element\n *\n * @param {Snap<SVGElement>} gfx\n *\n * @return {Bounds}\n */\nfunction getBBox(gfx) {\n  return getVisual(gfx).select('*').getBBox();\n}\n\n\nmodule.exports.getVisual = getVisual;\nmodule.exports.getChildren = getChildren;\nmodule.exports.getBBox = getBBox;","'use strict';\n\n/**\n * Util that provides unique IDs.\n *\n * @class djs.util.IdGenerator\n * @constructor\n * @memberOf djs.util\n *\n * The ids can be customized via a given prefix and contain a random value to avoid collisions.\n *\n * @param {String} prefix a prefix to prepend to generated ids (for better readability)\n */\nfunction IdGenerator(prefix) {\n\n  this._counter = 0;\n  this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';\n}\n\nmodule.exports = IdGenerator;\n\n/**\n * Returns a next unique ID.\n *\n * @method djs.util.IdGenerator#next\n *\n * @returns {String} the id\n */\nIdGenerator.prototype.next = function() {\n  return this._prefix + (++this._counter);\n};\n","'use strict';\n\nvar getOriginalEvent = require(178).getOriginal;\n\nvar isMac = require(183).isMac;\n\n\nfunction isPrimaryButton(event) {\n  // button === 0 -> left áka primary mouse button\n  return !(getOriginalEvent(event) || event).button;\n}\n\nmodule.exports.isPrimaryButton = isPrimaryButton;\n\nmodule.exports.isMac = isMac;\n\nmodule.exports.hasPrimaryModifier = function(event) {\n  var originalEvent = getOriginalEvent(event) || event;\n\n  if (!isPrimaryButton(event)) {\n    return false;\n  }\n\n  // Use alt as primary modifier key for mac OS\n  if (isMac()) {\n    return originalEvent.altKey;\n  } else {\n    return originalEvent.ctrlKey;\n  }\n};\n\n\nmodule.exports.hasSecondaryModifier = function(event) {\n  var originalEvent = getOriginalEvent(event) || event;\n\n  return isPrimaryButton(event) && originalEvent.shiftKey;\n};\n","'use strict';\n\nmodule.exports.isMac = function isMac() {\n  return (/mac/i).test(navigator.platform);\n};","'use strict';\n\nvar isObject = require(320),\n    assign = require(325),\n    forEach = require(204),\n    reduce = require(208),\n    merge = require(328);\n\nvar Snap = require(188);\n\nvar DEFAULT_BOX_PADDING = 0;\n\nvar DEFAULT_LABEL_SIZE = {\n  width: 150,\n  height: 50\n};\n\n\nfunction parseAlign(align) {\n\n  var parts = align.split('-');\n\n  return {\n    horizontal: parts[0] || 'center',\n    vertical: parts[1] || 'top'\n  };\n}\n\nfunction parsePadding(padding) {\n\n  if (isObject(padding)) {\n    return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);\n  } else {\n    return {\n      top: padding,\n      left: padding,\n      right: padding,\n      bottom: padding\n    };\n  }\n}\n\nfunction getTextBBox(text, fakeText) {\n  fakeText.textContent = text;\n  return fakeText.getBBox();\n}\n\n\n/**\n * Layout the next line and return the layouted element.\n *\n * Alters the lines passed.\n *\n * @param  {Array<String>} lines\n * @return {Object} the line descriptor, an object { width, height, text }\n */\nfunction layoutNext(lines, maxWidth, fakeText) {\n\n  var originalLine = lines.shift(),\n      fitLine = originalLine;\n\n  var textBBox;\n\n  while (true) {\n    textBBox = getTextBBox(fitLine, fakeText);\n\n    textBBox.width = fitLine ? textBBox.width : 0;\n\n    // try to fit\n    if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {\n      return fit(lines, fitLine, originalLine, textBBox);\n    }\n\n\n    fitLine = shortenLine(fitLine, textBBox.width, maxWidth);\n  }\n}\n\nfunction fit(lines, fitLine, originalLine, textBBox) {\n  if (fitLine.length < originalLine.length) {\n    var nextLine = lines[0] || '',\n        remainder = originalLine.slice(fitLine.length).trim();\n\n    if (/-/s*$/.test(remainder)) {\n      nextLine = remainder.replace(/-/s*$/, '') + nextLine.replace(/^/s+/, '');\n    } else {\n      nextLine = remainder + ' ' + nextLine;\n    }\n\n    lines[0] = nextLine;\n  }\n  return { width: textBBox.width, height: textBBox.height, text: fitLine };\n}\n\n\n/**\n * Shortens a line based on spacing and hyphens.\n * Returns the shortened result on success.\n *\n * @param  {String} line\n * @param  {Number} maxLength the maximum characters of the string\n * @return {String} the shortened string\n */\nfunction semanticShorten(line, maxLength) {\n  var parts = line.split(/(/s|-)/g),\n      part,\n      shortenedParts = [],\n      length = 0;\n\n  // try to shorten via spaces + hyphens\n  if (parts.length > 1) {\n    while ((part = parts.shift())) {\n      if (part.length + length < maxLength) {\n        shortenedParts.push(part);\n        length += part.length;\n      } else {\n        // remove previous part, too if hyphen does not fit anymore\n        if (part === '-') {\n          shortenedParts.pop();\n        }\n\n        break;\n      }\n    }\n  }\n\n  return shortenedParts.join('');\n}\n\n\nfunction shortenLine(line, width, maxWidth) {\n  var length = Math.max(line.length * (maxWidth / width), 1);\n\n  // try to shorten semantically (i.e. based on spaces and hyphens)\n  var shortenedLine = semanticShorten(line, length);\n\n  if (!shortenedLine) {\n\n    // force shorten by cutting the long word\n    shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));\n  }\n\n  return shortenedLine;\n}\n\n\n/**\n * Creates a new label utility\n *\n * @param {Object} config\n * @param {Dimensions} config.size\n * @param {Number} config.padding\n * @param {Object} config.style\n * @param {String} config.align\n */\nfunction Text(config) {\n\n  this._config = assign({}, {\n    size: DEFAULT_LABEL_SIZE,\n    padding: DEFAULT_BOX_PADDING,\n    style: {},\n    align: 'center-top'\n  }, config || {});\n}\n\n\n/**\n * Create a label in the parent node.\n *\n * @method Text#createText\n *\n * @param {SVGElement} parent the parent to draw the label on\n * @param {String} text the text to render on the label\n * @param {Object} options\n * @param {String} options.align how to align in the bounding box.\n *                             Any of { 'center-middle', 'center-top' }, defaults to 'center-top'.\n * @param {String} options.style style to be applied to the text\n *\n * @return {SVGText} the text element created\n */\nText.prototype.createText = function(parent, text, options) {\n\n  var box = merge({}, this._config.size, options.box || {}),\n      style = merge({}, this._config.style, options.style || {}),\n      align = parseAlign(options.align || this._config.align),\n      padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);\n\n  var lines = text.split(//r?/n/g),\n      layouted = [];\n\n  var maxWidth = box.width - padding.left - padding.right;\n\n  // FF regression: ensure text is shown during rendering\n  // by attaching it directly to the body\n  var fakeText = parent.paper.text(0, 0, '').attr(style).node;\n\n  while (lines.length) {\n    layouted.push(layoutNext(lines, maxWidth, fakeText));\n  }\n\n  var totalHeight = reduce(layouted, function(sum, line, idx) {\n    return sum + line.height;\n  }, 0);\n\n  // the y position of the next line\n  var y, x;\n\n  switch (align.vertical) {\n    case 'middle':\n      y = (box.height - totalHeight) / 2 - layouted[0].height / 4;\n      break;\n\n    default:\n      y = padding.top;\n  }\n\n  var textElement = parent.text().attr(style);\n\n  forEach(layouted, function(line) {\n    y += line.height;\n\n    switch (align.horizontal) {\n      case 'left':\n        x = padding.left;\n        break;\n\n      case 'right':\n        x = (maxWidth - padding.right - line.width);\n        break;\n\n      default:\n        // aka center\n        x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);\n    }\n\n\n    var tspan = Snap.create('tspan', { x: x, y: y }).node;\n    tspan.textContent = line.text;\n\n    textElement.append(tspan);\n  });\n\n  // remove fake text\n  fakeText.parentNode.removeChild(fakeText);\n\n  return textElement;\n};\n\n\nmodule.exports = Text;","// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ┌────────────────────────────────────────────────────────────┐ //\n// │ Eve 0.4.2 - JavaScript Events Library                      │ //\n// ├────────────────────────────────────────────────────────────┤ //\n// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ //\n// └────────────────────────────────────────────────────────────┘ //\n\n(function (glob) {\n    var version = \"0.4.2\",\n        has = \"hasOwnProperty\",\n        separator = /[/.//]/,\n        comaseparator = //s*,/s*/,\n        wildcard = \"*\",\n        fun = function () {},\n        numsort = function (a, b) {\n            return a - b;\n        },\n        current_event,\n        stop,\n        events = {n: {}},\n        firstDefined = function () {\n            for (var i = 0, ii = this.length; i < ii; i++) {\n                if (typeof this[i] != \"undefined\") {\n                    return this[i];\n                }\n            }\n        },\n        lastDefined = function () {\n            var i = this.length;\n            while (--i) {\n                if (typeof this[i] != \"undefined\") {\n                    return this[i];\n                }\n            }\n        },\n    /*/\n     * eve\n     [ method ]\n\n     * Fires event with given `name`, given scope and other parameters.\n\n     > Arguments\n\n     - name (string) name of the *event*, dot (`.`) or slash (`/`) separated\n     - scope (object) context for the event handlers\n     - varargs (...) the rest of arguments will be sent to event handlers\n\n     = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.\n    /*/\n        eve = function (name, scope) {\n            name = String(name);\n            var e = events,\n                oldstop = stop,\n                args = Array.prototype.slice.call(arguments, 2),\n                listeners = eve.listeners(name),\n                z = 0,\n                f = false,\n                l,\n                indexed = [],\n                queue = {},\n                out = [],\n                ce = current_event,\n                errors = [];\n            out.firstDefined = firstDefined;\n            out.lastDefined = lastDefined;\n            current_event = name;\n            stop = 0;\n            for (var i = 0, ii = listeners.length; i < ii; i++) if (\"zIndex\" in listeners[i]) {\n                indexed.push(listeners[i].zIndex);\n                if (listeners[i].zIndex < 0) {\n                    queue[listeners[i].zIndex] = listeners[i];\n                }\n            }\n            indexed.sort(numsort);\n            while (indexed[z] < 0) {\n                l = queue[indexed[z++]];\n                out.push(l.apply(scope, args));\n                if (stop) {\n                    stop = oldstop;\n                    return out;\n                }\n            }\n            for (i = 0; i < ii; i++) {\n                l = listeners[i];\n                if (\"zIndex\" in l) {\n                    if (l.zIndex == indexed[z]) {\n                        out.push(l.apply(scope, args));\n                        if (stop) {\n                            break;\n                        }\n                        do {\n                            z++;\n                            l = queue[indexed[z]];\n                            l && out.push(l.apply(scope, args));\n                            if (stop) {\n                                break;\n                            }\n                        } while (l)\n                    } else {\n                        queue[l.zIndex] = l;\n                    }\n                } else {\n                    out.push(l.apply(scope, args));\n                    if (stop) {\n                        break;\n                    }\n                }\n            }\n            stop = oldstop;\n            current_event = ce;\n            return out;\n        };\n        // Undocumented. Debug only.\n        eve._events = events;\n    /*/\n     * eve.listeners\n     [ method ]\n\n     * Internal method which gives you array of all event handlers that will be triggered by the given `name`.\n\n     > Arguments\n\n     - name (string) name of the event, dot (`.`) or slash (`/`) separated\n\n     = (array) array of event handlers\n    /*/\n    eve.listeners = function (name) {\n        var names = name.split(separator),\n            e = events,\n            item,\n            items,\n            k,\n            i,\n            ii,\n            j,\n            jj,\n            nes,\n            es = [e],\n            out = [];\n        for (i = 0, ii = names.length; i < ii; i++) {\n            nes = [];\n            for (j = 0, jj = es.length; j < jj; j++) {\n                e = es[j].n;\n                items = [e[names[i]], e[wildcard]];\n                k = 2;\n                while (k--) {\n                    item = items[k];\n                    if (item) {\n                        nes.push(item);\n                        out = out.concat(item.f || []);\n                    }\n                }\n            }\n            es = nes;\n        }\n        return out;\n    };\n    \n    /*/\n     * eve.on\n     [ method ]\n     **\n     * Binds given event handler with a given name. You can use wildcards “`*`” for the names:\n     | eve.on(\"*.under.*\", f);\n     | eve(\"mouse.under.floor\"); // triggers f\n     * Use @eve to trigger the listener.\n     **\n     > Arguments\n     **\n     - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n     - f (function) event handler function\n     **\n     = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. \n     > Example:\n     | eve.on(\"mouse\", eatIt)(2);\n     | eve.on(\"mouse\", scream);\n     | eve.on(\"mouse\", catchIt)(1);\n     * This will ensure that `catchIt` function will be called before `eatIt`.\n     *\n     * If you want to put your handler before non-indexed handlers, specify a negative value.\n     * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.\n    /*/\n    eve.on = function (name, f) {\n        name = String(name);\n        if (typeof f != \"function\") {\n            return function () {};\n        }\n        var names = name.split(comaseparator);\n        for (var i = 0, ii = names.length; i < ii; i++) {\n            (function (name) {\n                var names = name.split(separator),\n                    e = events,\n                    exist;\n                for (var i = 0, ii = names.length; i < ii; i++) {\n                    e = e.n;\n                    e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});\n                }\n                e.f = e.f || [];\n                for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {\n                    exist = true;\n                    break;\n                }\n                !exist && e.f.push(f);\n            }(names[i]));\n        }\n        return function (zIndex) {\n            if (+zIndex == +zIndex) {\n                f.zIndex = +zIndex;\n            }\n        };\n    };\n    /*/\n     * eve.f\n     [ method ]\n     **\n     * Returns function that will fire given event with optional arguments.\n     * Arguments that will be passed to the result function will be also\n     * concated to the list of final arguments.\n     | el.onclick = eve.f(\"click\", 1, 2);\n     | eve.on(\"click\", function (a, b, c) {\n     |     console.log(a, b, c); // 1, 2, [event object]\n     | });\n     > Arguments\n     - event (string) event name\n     - varargs (…) and any other arguments\n     = (function) possible event handler function\n    /*/\n    eve.f = function (event) {\n        var attrs = [].slice.call(arguments, 1);\n        return function () {\n            eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));\n        };\n    };\n    /*/\n     * eve.stop\n     [ method ]\n     **\n     * Is used inside an event handler to stop the event, preventing any subsequent listeners from firing.\n    /*/\n    eve.stop = function () {\n        stop = 1;\n    };\n    /*/\n     * eve.nt\n     [ method ]\n     **\n     * Could be used inside event handler to figure out actual name of the event.\n     **\n     > Arguments\n     **\n     - subname (string) #optional subname of the event\n     **\n     = (string) name of the event, if `subname` is not specified\n     * or\n     = (boolean) `true`, if current event’s name contains `subname`\n    /*/\n    eve.nt = function (subname) {\n        if (subname) {\n            return new RegExp(\"(?://.|///|^)\" + subname + \"(?://.|///|$)\").test(current_event);\n        }\n        return current_event;\n    };\n    /*/\n     * eve.nts\n     [ method ]\n     **\n     * Could be used inside event handler to figure out actual name of the event.\n     **\n     **\n     = (array) names of the event\n    /*/\n    eve.nts = function () {\n        return current_event.split(separator);\n    };\n    /*/\n     * eve.off\n     [ method ]\n     **\n     * Removes given function from the list of event listeners assigned to given name.\n     * If no arguments specified all the events will be cleared.\n     **\n     > Arguments\n     **\n     - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n     - f (function) event handler function\n    /*/\n    /*/\n     * eve.unbind\n     [ method ]\n     **\n     * See @eve.off\n    /*/\n    eve.off = eve.unbind = function (name, f) {\n        if (!name) {\n            eve._events = events = {n: {}};\n            return;\n        }\n        var names = name.split(comaseparator);\n        if (names.length > 1) {\n            for (var i = 0, ii = names.length; i < ii; i++) {\n                eve.off(names[i], f);\n            }\n            return;\n        }\n        names = name.split(separator);\n        var e,\n            key,\n            splice,\n            i, ii, j, jj,\n            cur = [events];\n        for (i = 0, ii = names.length; i < ii; i++) {\n            for (j = 0; j < cur.length; j += splice.length - 2) {\n                splice = [j, 1];\n                e = cur[j].n;\n                if (names[i] != wildcard) {\n                    if (e[names[i]]) {\n                        splice.push(e[names[i]]);\n                    }\n                } else {\n                    for (key in e) if (e[has](key)) {\n                        splice.push(e[key]);\n                    }\n                }\n                cur.splice.apply(cur, splice);\n            }\n        }\n        for (i = 0, ii = cur.length; i < ii; i++) {\n            e = cur[i];\n            while (e.n) {\n                if (f) {\n                    if (e.f) {\n                        for (j = 0, jj = e.f.length; j < jj; j++) if (e.f[j] == f) {\n                            e.f.splice(j, 1);\n                            break;\n                        }\n                        !e.f.length && delete e.f;\n                    }\n                    for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n                        var funcs = e.n[key].f;\n                        for (j = 0, jj = funcs.length; j < jj; j++) if (funcs[j] == f) {\n                            funcs.splice(j, 1);\n                            break;\n                        }\n                        !funcs.length && delete e.n[key].f;\n                    }\n                } else {\n                    delete e.f;\n                    for (key in e.n) if (e.n[has](key) && e.n[key].f) {\n                        delete e.n[key].f;\n                    }\n                }\n                e = e.n;\n            }\n        }\n    };\n    /*/\n     * eve.once\n     [ method ]\n     **\n     * Binds given event handler with a given name to only run once then unbind itself.\n     | eve.once(\"login\", f);\n     | eve(\"login\"); // triggers f\n     | eve(\"login\"); // no listeners\n     * Use @eve to trigger the listener.\n     **\n     > Arguments\n     **\n     - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n     - f (function) event handler function\n     **\n     = (function) same return function as @eve.on\n    /*/\n    eve.once = function (name, f) {\n        var f2 = function () {\n            eve.unbind(name, f2);\n            return f.apply(this, arguments);\n        };\n        return eve.on(name, f2);\n    };\n    /*/\n     * eve.version\n     [ property (string) ]\n     **\n     * Current version of the library.\n    /*/\n    eve.version = version;\n    eve.toString = function () {\n        return \"You are running Eve \" + version;\n    };\n    (typeof module != \"undefined\" && module.exports) ? (module.exports = eve) : (typeof define === \"function\" && define.amd ? (define(\"eve\", [], function() { return eve; })) : (glob.eve = eve));\n})(this);\n","/*! Hammer.JS - v2.0.4 - 2014-09-28\r\n * http://hammerjs.github.io/\r\n *\r\n * Copyright (c) 2014 Jorik Tangelder;\r\n * Licensed under the MIT license */\r\n(function(window, document, exportName, undefined) {\r\n  'use strict';\r\n\r\nvar VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];\r\nvar TEST_ELEMENT = document.createElement('div');\r\n\r\nvar TYPE_FUNCTION = 'function';\r\n\r\nvar round = Math.round;\r\nvar abs = Math.abs;\r\nvar now = Date.now;\r\n\r\n/**\r\n * set a timeout with a given scope\r\n * @param {Function} fn\r\n * @param {Number} timeout\r\n * @param {Object} context\r\n * @returns {number}\r\n */\r\nfunction setTimeoutContext(fn, timeout, context) {\r\n    return setTimeout(bindFn(fn, context), timeout);\r\n}\r\n\r\n/**\r\n * if the argument is an array, we want to execute the fn on each entry\r\n * if it aint an array we don't want to do a thing.\r\n * this is used by all the methods that accept a single and array argument.\r\n * @param {*|Array} arg\r\n * @param {String} fn\r\n * @param {Object} [context]\r\n * @returns {Boolean}\r\n */\r\nfunction invokeArrayArg(arg, fn, context) {\r\n    if (Array.isArray(arg)) {\r\n        each(arg, context[fn], context);\r\n        return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n/**\r\n * walk objects and arrays\r\n * @param {Object} obj\r\n * @param {Function} iterator\r\n * @param {Object} context\r\n */\r\nfunction each(obj, iterator, context) {\r\n    var i;\r\n\r\n    if (!obj) {\r\n        return;\r\n    }\r\n\r\n    if (obj.forEach) {\r\n        obj.forEach(iterator, context);\r\n    } else if (obj.length !== undefined) {\r\n        i = 0;\r\n        while (i < obj.length) {\r\n            iterator.call(context, obj[i], i, obj);\r\n            i++;\r\n        }\r\n    } else {\r\n        for (i in obj) {\r\n            obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);\r\n        }\r\n    }\r\n}\r\n\r\n/**\r\n * extend object.\r\n * means that properties in dest will be overwritten by the ones in src.\r\n * @param {Object} dest\r\n * @param {Object} src\r\n * @param {Boolean} [merge]\r\n * @returns {Object} dest\r\n */\r\nfunction extend(dest, src, merge) {\r\n    var keys = Object.keys(src);\r\n    var i = 0;\r\n    while (i < keys.length) {\r\n        if (!merge || (merge && dest[keys[i]] === undefined)) {\r\n            dest[keys[i]] = src[keys[i]];\r\n        }\r\n        i++;\r\n    }\r\n    return dest;\r\n}\r\n\r\n/**\r\n * merge the values from src in the dest.\r\n * means that properties that exist in dest will not be overwritten by src\r\n * @param {Object} dest\r\n * @param {Object} src\r\n * @returns {Object} dest\r\n */\r\nfunction merge(dest, src) {\r\n    return extend(dest, src, true);\r\n}\r\n\r\n/**\r\n * simple class inheritance\r\n * @param {Function} child\r\n * @param {Function} base\r\n * @param {Object} [properties]\r\n */\r\nfunction inherit(child, base, properties) {\r\n    var baseP = base.prototype,\r\n        childP;\r\n\r\n    childP = child.prototype = Object.create(baseP);\r\n    childP.constructor = child;\r\n    childP._super = baseP;\r\n\r\n    if (properties) {\r\n        extend(childP, properties);\r\n    }\r\n}\r\n\r\n/**\r\n * simple function bind\r\n * @param {Function} fn\r\n * @param {Object} context\r\n * @returns {Function}\r\n */\r\nfunction bindFn(fn, context) {\r\n    return function boundFn() {\r\n        return fn.apply(context, arguments);\r\n    };\r\n}\r\n\r\n/**\r\n * let a boolean value also be a function that must return a boolean\r\n * this first item in args will be used as the context\r\n * @param {Boolean|Function} val\r\n * @param {Array} [args]\r\n * @returns {Boolean}\r\n */\r\nfunction boolOrFn(val, args) {\r\n    if (typeof val == TYPE_FUNCTION) {\r\n        return val.apply(args ? args[0] || undefined : undefined, args);\r\n    }\r\n    return val;\r\n}\r\n\r\n/**\r\n * use the val2 when val1 is undefined\r\n * @param {*} val1\r\n * @param {*} val2\r\n * @returns {*}\r\n */\r\nfunction ifUndefined(val1, val2) {\r\n    return (val1 === undefined) ? val2 : val1;\r\n}\r\n\r\n/**\r\n * addEventListener with multiple events at once\r\n * @param {EventTarget} target\r\n * @param {String} types\r\n * @param {Function} handler\r\n */\r\nfunction addEventListeners(target, types, handler) {\r\n    each(splitStr(types), function(type) {\r\n        target.addEventListener(type, handler, false);\r\n    });\r\n}\r\n\r\n/**\r\n * removeEventListener with multiple events at once\r\n * @param {EventTarget} target\r\n * @param {String} types\r\n * @param {Function} handler\r\n */\r\nfunction removeEventListeners(target, types, handler) {\r\n    each(splitStr(types), function(type) {\r\n        target.removeEventListener(type, handler, false);\r\n    });\r\n}\r\n\r\n/**\r\n * find if a node is in the given parent\r\n * @method hasParent\r\n * @param {HTMLElement} node\r\n * @param {HTMLElement} parent\r\n * @return {Boolean} found\r\n */\r\nfunction hasParent(node, parent) {\r\n    while (node) {\r\n        if (node == parent) {\r\n            return true;\r\n        }\r\n        node = node.parentNode;\r\n    }\r\n    return false;\r\n}\r\n\r\n/**\r\n * small indexOf wrapper\r\n * @param {String} str\r\n * @param {String} find\r\n * @returns {Boolean} found\r\n */\r\nfunction inStr(str, find) {\r\n    return str.indexOf(find) > -1;\r\n}\r\n\r\n/**\r\n * split string on whitespace\r\n * @param {String} str\r\n * @returns {Array} words\r\n */\r\nfunction splitStr(str) {\r\n    return str.trim().split(//s+/g);\r\n}\r\n\r\n/**\r\n * find if a array contains the object using indexOf or a simple polyFill\r\n * @param {Array} src\r\n * @param {String} find\r\n * @param {String} [findByKey]\r\n * @return {Boolean|Number} false when not found, or the index\r\n */\r\nfunction inArray(src, find, findByKey) {\r\n    if (src.indexOf && !findByKey) {\r\n        return src.indexOf(find);\r\n    } else {\r\n        var i = 0;\r\n        while (i < src.length) {\r\n            if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {\r\n                return i;\r\n            }\r\n            i++;\r\n        }\r\n        return -1;\r\n    }\r\n}\r\n\r\n/**\r\n * convert array-like objects to real arrays\r\n * @param {Object} obj\r\n * @returns {Array}\r\n */\r\nfunction toArray(obj) {\r\n    return Array.prototype.slice.call(obj, 0);\r\n}\r\n\r\n/**\r\n * unique array with objects based on a key (like 'id') or just by the array's value\r\n * @param {Array} src [{id:1},{id:2},{id:1}]\r\n * @param {String} [key]\r\n * @param {Boolean} [sort=False]\r\n * @returns {Array} [{id:1},{id:2}]\r\n */\r\nfunction uniqueArray(src, key, sort) {\r\n    var results = [];\r\n    var values = [];\r\n    var i = 0;\r\n\r\n    while (i < src.length) {\r\n        var val = key ? src[i][key] : src[i];\r\n        if (inArray(values, val) < 0) {\r\n            results.push(src[i]);\r\n        }\r\n        values[i] = val;\r\n        i++;\r\n    }\r\n\r\n    if (sort) {\r\n        if (!key) {\r\n            results = results.sort();\r\n        } else {\r\n            results = results.sort(function sortUniqueArray(a, b) {\r\n                return a[key] > b[key];\r\n            });\r\n        }\r\n    }\r\n\r\n    return results;\r\n}\r\n\r\n/**\r\n * get the prefixed property\r\n * @param {Object} obj\r\n * @param {String} property\r\n * @returns {String|Undefined} prefixed\r\n */\r\nfunction prefixed(obj, property) {\r\n    var prefix, prop;\r\n    var camelProp = property[0].toUpperCase() + property.slice(1);\r\n\r\n    var i = 0;\r\n    while (i < VENDOR_PREFIXES.length) {\r\n        prefix = VENDOR_PREFIXES[i];\r\n        prop = (prefix) ? prefix + camelProp : property;\r\n\r\n        if (prop in obj) {\r\n            return prop;\r\n        }\r\n        i++;\r\n    }\r\n    return undefined;\r\n}\r\n\r\n/**\r\n * get a unique id\r\n * @returns {number} uniqueId\r\n */\r\nvar _uniqueId = 1;\r\nfunction uniqueId() {\r\n    return _uniqueId++;\r\n}\r\n\r\n/**\r\n * get the window object of an element\r\n * @param {HTMLElement} element\r\n * @returns {DocumentView|Window}\r\n */\r\nfunction getWindowForElement(element) {\r\n    var doc = element.ownerDocument;\r\n    return (doc.defaultView || doc.parentWindow);\r\n}\r\n\r\nvar MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;\r\n\r\nvar SUPPORT_TOUCH = ('ontouchstart' in window);\r\nvar SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;\r\nvar SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);\r\n\r\nvar INPUT_TYPE_TOUCH = 'touch';\r\nvar INPUT_TYPE_PEN = 'pen';\r\nvar INPUT_TYPE_MOUSE = 'mouse';\r\nvar INPUT_TYPE_KINECT = 'kinect';\r\n\r\nvar COMPUTE_INTERVAL = 25;\r\n\r\nvar INPUT_START = 1;\r\nvar INPUT_MOVE = 2;\r\nvar INPUT_END = 4;\r\nvar INPUT_CANCEL = 8;\r\n\r\nvar DIRECTION_NONE = 1;\r\nvar DIRECTION_LEFT = 2;\r\nvar DIRECTION_RIGHT = 4;\r\nvar DIRECTION_UP = 8;\r\nvar DIRECTION_DOWN = 16;\r\n\r\nvar DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;\r\nvar DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;\r\nvar DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;\r\n\r\nvar PROPS_XY = ['x', 'y'];\r\nvar PROPS_CLIENT_XY = ['clientX', 'clientY'];\r\n\r\n/**\r\n * create new input type manager\r\n * @param {Manager} manager\r\n * @param {Function} callback\r\n * @returns {Input}\r\n * @constructor\r\n */\r\nfunction Input(manager, callback) {\r\n    var self = this;\r\n    this.manager = manager;\r\n    this.callback = callback;\r\n    this.element = manager.element;\r\n    this.target = manager.options.inputTarget;\r\n\r\n    // smaller wrapper around the handler, for the scope and the enabled state of the manager,\r\n    // so when disabled the input events are completely bypassed.\r\n    this.domHandler = function(ev) {\r\n        if (boolOrFn(manager.options.enable, [manager])) {\r\n            self.handler(ev);\r\n        }\r\n    };\r\n\r\n    this.init();\r\n\r\n}\r\n\r\nInput.prototype = {\r\n    /**\r\n     * should handle the inputEvent data and trigger the callback\r\n     * @virtual\r\n     */\r\n    handler: function() { },\r\n\r\n    /**\r\n     * bind the events\r\n     */\r\n    init: function() {\r\n        this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);\r\n        this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);\r\n        this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\r\n    },\r\n\r\n    /**\r\n     * unbind the events\r\n     */\r\n    destroy: function() {\r\n        this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);\r\n        this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);\r\n        this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);\r\n    }\r\n};\r\n\r\n/**\r\n * create new input type manager\r\n * called by the Manager constructor\r\n * @param {Hammer} manager\r\n * @returns {Input}\r\n */\r\nfunction createInputInstance(manager) {\r\n    var Type;\r\n    var inputClass = manager.options.inputClass;\r\n\r\n    if (inputClass) {\r\n        Type = inputClass;\r\n    } else if (SUPPORT_POINTER_EVENTS) {\r\n        Type = PointerEventInput;\r\n    } else if (SUPPORT_ONLY_TOUCH) {\r\n        Type = TouchInput;\r\n    } else if (!SUPPORT_TOUCH) {\r\n        Type = MouseInput;\r\n    } else {\r\n        Type = TouchMouseInput;\r\n    }\r\n    return new (Type)(manager, inputHandler);\r\n}\r\n\r\n/**\r\n * handle input events\r\n * @param {Manager} manager\r\n * @param {String} eventType\r\n * @param {Object} input\r\n */\r\nfunction inputHandler(manager, eventType, input) {\r\n    var pointersLen = input.pointers.length;\r\n    var changedPointersLen = input.changedPointers.length;\r\n    var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));\r\n    var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));\r\n\r\n    input.isFirst = !!isFirst;\r\n    input.isFinal = !!isFinal;\r\n\r\n    if (isFirst) {\r\n        manager.session = {};\r\n    }\r\n\r\n    // source event is the normalized value of the domEvents\r\n    // like 'touchstart, mouseup, pointerdown'\r\n    input.eventType = eventType;\r\n\r\n    // compute scale, rotation etc\r\n    computeInputData(manager, input);\r\n\r\n    // emit secret event\r\n    manager.emit('hammer.input', input);\r\n\r\n    manager.recognize(input);\r\n    manager.session.prevInput = input;\r\n}\r\n\r\n/**\r\n * extend the data with some usable properties like scale, rotate, velocity etc\r\n * @param {Object} manager\r\n * @param {Object} input\r\n */\r\nfunction computeInputData(manager, input) {\r\n    var session = manager.session;\r\n    var pointers = input.pointers;\r\n    var pointersLength = pointers.length;\r\n\r\n    // store the first input to calculate the distance and direction\r\n    if (!session.firstInput) {\r\n        session.firstInput = simpleCloneInputData(input);\r\n    }\r\n\r\n    // to compute scale and rotation we need to store the multiple touches\r\n    if (pointersLength > 1 && !session.firstMultiple) {\r\n        session.firstMultiple = simpleCloneInputData(input);\r\n    } else if (pointersLength === 1) {\r\n        session.firstMultiple = false;\r\n    }\r\n\r\n    var firstInput = session.firstInput;\r\n    var firstMultiple = session.firstMultiple;\r\n    var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;\r\n\r\n    var center = input.center = getCenter(pointers);\r\n    input.timeStamp = now();\r\n    input.deltaTime = input.timeStamp - firstInput.timeStamp;\r\n\r\n    input.angle = getAngle(offsetCenter, center);\r\n    input.distance = getDistance(offsetCenter, center);\r\n\r\n    computeDeltaXY(session, input);\r\n    input.offsetDirection = getDirection(input.deltaX, input.deltaY);\r\n\r\n    input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;\r\n    input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;\r\n\r\n    computeIntervalInputData(session, input);\r\n\r\n    // find the correct target\r\n    var target = manager.element;\r\n    if (hasParent(input.srcEvent.target, target)) {\r\n        target = input.srcEvent.target;\r\n    }\r\n    input.target = target;\r\n}\r\n\r\nfunction computeDeltaXY(session, input) {\r\n    var center = input.center;\r\n    var offset = session.offsetDelta || {};\r\n    var prevDelta = session.prevDelta || {};\r\n    var prevInput = session.prevInput || {};\r\n\r\n    if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {\r\n        prevDelta = session.prevDelta = {\r\n            x: prevInput.deltaX || 0,\r\n            y: prevInput.deltaY || 0\r\n        };\r\n\r\n        offset = session.offsetDelta = {\r\n            x: center.x,\r\n            y: center.y\r\n        };\r\n    }\r\n\r\n    input.deltaX = prevDelta.x + (center.x - offset.x);\r\n    input.deltaY = prevDelta.y + (center.y - offset.y);\r\n}\r\n\r\n/**\r\n * velocity is calculated every x ms\r\n * @param {Object} session\r\n * @param {Object} input\r\n */\r\nfunction computeIntervalInputData(session, input) {\r\n    var last = session.lastInterval || input,\r\n        deltaTime = input.timeStamp - last.timeStamp,\r\n        velocity, velocityX, velocityY, direction;\r\n\r\n    if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {\r\n        var deltaX = last.deltaX - input.deltaX;\r\n        var deltaY = last.deltaY - input.deltaY;\r\n\r\n        var v = getVelocity(deltaTime, deltaX, deltaY);\r\n        velocityX = v.x;\r\n        velocityY = v.y;\r\n        velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;\r\n        direction = getDirection(deltaX, deltaY);\r\n\r\n        session.lastInterval = input;\r\n    } else {\r\n        // use latest velocity info if it doesn't overtake a minimum period\r\n        velocity = last.velocity;\r\n        velocityX = last.velocityX;\r\n        velocityY = last.velocityY;\r\n        direction = last.direction;\r\n    }\r\n\r\n    input.velocity = velocity;\r\n    input.velocityX = velocityX;\r\n    input.velocityY = velocityY;\r\n    input.direction = direction;\r\n}\r\n\r\n/**\r\n * create a simple clone from the input used for storage of firstInput and firstMultiple\r\n * @param {Object} input\r\n * @returns {Object} clonedInputData\r\n */\r\nfunction simpleCloneInputData(input) {\r\n    // make a simple copy of the pointers because we will get a reference if we don't\r\n    // we only need clientXY for the calculations\r\n    var pointers = [];\r\n    var i = 0;\r\n    while (i < input.pointers.length) {\r\n        pointers[i] = {\r\n            clientX: round(input.pointers[i].clientX),\r\n            clientY: round(input.pointers[i].clientY)\r\n        };\r\n        i++;\r\n    }\r\n\r\n    return {\r\n        timeStamp: now(),\r\n        pointers: pointers,\r\n        center: getCenter(pointers),\r\n        deltaX: input.deltaX,\r\n        deltaY: input.deltaY\r\n    };\r\n}\r\n\r\n/**\r\n * get the center of all the pointers\r\n * @param {Array} pointers\r\n * @return {Object} center contains `x` and `y` properties\r\n */\r\nfunction getCenter(pointers) {\r\n    var pointersLength = pointers.length;\r\n\r\n    // no need to loop when only one touch\r\n    if (pointersLength === 1) {\r\n        return {\r\n            x: round(pointers[0].clientX),\r\n            y: round(pointers[0].clientY)\r\n        };\r\n    }\r\n\r\n    var x = 0, y = 0, i = 0;\r\n    while (i < pointersLength) {\r\n        x += pointers[i].clientX;\r\n        y += pointers[i].clientY;\r\n        i++;\r\n    }\r\n\r\n    return {\r\n        x: round(x / pointersLength),\r\n        y: round(y / pointersLength)\r\n    };\r\n}\r\n\r\n/**\r\n * calculate the velocity between two points. unit is in px per ms.\r\n * @param {Number} deltaTime\r\n * @param {Number} x\r\n * @param {Number} y\r\n * @return {Object} velocity `x` and `y`\r\n */\r\nfunction getVelocity(deltaTime, x, y) {\r\n    return {\r\n        x: x / deltaTime || 0,\r\n        y: y / deltaTime || 0\r\n    };\r\n}\r\n\r\n/**\r\n * get the direction between two points\r\n * @param {Number} x\r\n * @param {Number} y\r\n * @return {Number} direction\r\n */\r\nfunction getDirection(x, y) {\r\n    if (x === y) {\r\n        return DIRECTION_NONE;\r\n    }\r\n\r\n    if (abs(x) >= abs(y)) {\r\n        return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;\r\n    }\r\n    return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;\r\n}\r\n\r\n/**\r\n * calculate the absolute distance between two points\r\n * @param {Object} p1 {x, y}\r\n * @param {Object} p2 {x, y}\r\n * @param {Array} [props] containing x and y keys\r\n * @return {Number} distance\r\n */\r\nfunction getDistance(p1, p2, props) {\r\n    if (!props) {\r\n        props = PROPS_XY;\r\n    }\r\n    var x = p2[props[0]] - p1[props[0]],\r\n        y = p2[props[1]] - p1[props[1]];\r\n\r\n    return Math.sqrt((x * x) + (y * y));\r\n}\r\n\r\n/**\r\n * calculate the angle between two coordinates\r\n * @param {Object} p1\r\n * @param {Object} p2\r\n * @param {Array} [props] containing x and y keys\r\n * @return {Number} angle\r\n */\r\nfunction getAngle(p1, p2, props) {\r\n    if (!props) {\r\n        props = PROPS_XY;\r\n    }\r\n    var x = p2[props[0]] - p1[props[0]],\r\n        y = p2[props[1]] - p1[props[1]];\r\n    return Math.atan2(y, x) * 180 / Math.PI;\r\n}\r\n\r\n/**\r\n * calculate the rotation degrees between two pointersets\r\n * @param {Array} start array of pointers\r\n * @param {Array} end array of pointers\r\n * @return {Number} rotation\r\n */\r\nfunction getRotation(start, end) {\r\n    return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);\r\n}\r\n\r\n/**\r\n * calculate the scale factor between two pointersets\r\n * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out\r\n * @param {Array} start array of pointers\r\n * @param {Array} end array of pointers\r\n * @return {Number} scale\r\n */\r\nfunction getScale(start, end) {\r\n    return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);\r\n}\r\n\r\nvar MOUSE_INPUT_MAP = {\r\n    mousedown: INPUT_START,\r\n    mousemove: INPUT_MOVE,\r\n    mouseup: INPUT_END\r\n};\r\n\r\nvar MOUSE_ELEMENT_EVENTS = 'mousedown';\r\nvar MOUSE_WINDOW_EVENTS = 'mousemove mouseup';\r\n\r\n/**\r\n * Mouse events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction MouseInput() {\r\n    this.evEl = MOUSE_ELEMENT_EVENTS;\r\n    this.evWin = MOUSE_WINDOW_EVENTS;\r\n\r\n    this.allow = true; // used by Input.TouchMouse to disable mouse events\r\n    this.pressed = false; // mousedown state\r\n\r\n    Input.apply(this, arguments);\r\n}\r\n\r\ninherit(MouseInput, Input, {\r\n    /**\r\n     * handle mouse events\r\n     * @param {Object} ev\r\n     */\r\n    handler: function MEhandler(ev) {\r\n        var eventType = MOUSE_INPUT_MAP[ev.type];\r\n\r\n        // on start we want to have the left mouse button down\r\n        if (eventType & INPUT_START && ev.button === 0) {\r\n            this.pressed = true;\r\n        }\r\n\r\n        if (eventType & INPUT_MOVE && ev.which !== 1) {\r\n            eventType = INPUT_END;\r\n        }\r\n\r\n        // mouse must be down, and mouse events are allowed (see the TouchMouse input)\r\n        if (!this.pressed || !this.allow) {\r\n            return;\r\n        }\r\n\r\n        if (eventType & INPUT_END) {\r\n            this.pressed = false;\r\n        }\r\n\r\n        this.callback(this.manager, eventType, {\r\n            pointers: [ev],\r\n            changedPointers: [ev],\r\n            pointerType: INPUT_TYPE_MOUSE,\r\n            srcEvent: ev\r\n        });\r\n    }\r\n});\r\n\r\nvar POINTER_INPUT_MAP = {\r\n    pointerdown: INPUT_START,\r\n    pointermove: INPUT_MOVE,\r\n    pointerup: INPUT_END,\r\n    pointercancel: INPUT_CANCEL,\r\n    pointerout: INPUT_CANCEL\r\n};\r\n\r\n// in IE10 the pointer types is defined as an enum\r\nvar IE10_POINTER_TYPE_ENUM = {\r\n    2: INPUT_TYPE_TOUCH,\r\n    3: INPUT_TYPE_PEN,\r\n    4: INPUT_TYPE_MOUSE,\r\n    5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816\r\n};\r\n\r\nvar POINTER_ELEMENT_EVENTS = 'pointerdown';\r\nvar POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';\r\n\r\n// IE10 has prefixed support, and case-sensitive\r\nif (window.MSPointerEvent) {\r\n    POINTER_ELEMENT_EVENTS = 'MSPointerDown';\r\n    POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';\r\n}\r\n\r\n/**\r\n * Pointer events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction PointerEventInput() {\r\n    this.evEl = POINTER_ELEMENT_EVENTS;\r\n    this.evWin = POINTER_WINDOW_EVENTS;\r\n\r\n    Input.apply(this, arguments);\r\n\r\n    this.store = (this.manager.session.pointerEvents = []);\r\n}\r\n\r\ninherit(PointerEventInput, Input, {\r\n    /**\r\n     * handle mouse events\r\n     * @param {Object} ev\r\n     */\r\n    handler: function PEhandler(ev) {\r\n        var store = this.store;\r\n        var removePointer = false;\r\n\r\n        var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');\r\n        var eventType = POINTER_INPUT_MAP[eventTypeNormalized];\r\n        var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;\r\n\r\n        var isTouch = (pointerType == INPUT_TYPE_TOUCH);\r\n\r\n        // get index of the event in the store\r\n        var storeIndex = inArray(store, ev.pointerId, 'pointerId');\r\n\r\n        // start and mouse must be down\r\n        if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {\r\n            if (storeIndex < 0) {\r\n                store.push(ev);\r\n                storeIndex = store.length - 1;\r\n            }\r\n        } else if (eventType & (INPUT_END | INPUT_CANCEL)) {\r\n            removePointer = true;\r\n        }\r\n\r\n        // it not found, so the pointer hasn't been down (so it's probably a hover)\r\n        if (storeIndex < 0) {\r\n            return;\r\n        }\r\n\r\n        // update the event in the store\r\n        store[storeIndex] = ev;\r\n\r\n        this.callback(this.manager, eventType, {\r\n            pointers: store,\r\n            changedPointers: [ev],\r\n            pointerType: pointerType,\r\n            srcEvent: ev\r\n        });\r\n\r\n        if (removePointer) {\r\n            // remove from the store\r\n            store.splice(storeIndex, 1);\r\n        }\r\n    }\r\n});\r\n\r\nvar SINGLE_TOUCH_INPUT_MAP = {\r\n    touchstart: INPUT_START,\r\n    touchmove: INPUT_MOVE,\r\n    touchend: INPUT_END,\r\n    touchcancel: INPUT_CANCEL\r\n};\r\n\r\nvar SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';\r\nvar SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';\r\n\r\n/**\r\n * Touch events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction SingleTouchInput() {\r\n    this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;\r\n    this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;\r\n    this.started = false;\r\n\r\n    Input.apply(this, arguments);\r\n}\r\n\r\ninherit(SingleTouchInput, Input, {\r\n    handler: function TEhandler(ev) {\r\n        var type = SINGLE_TOUCH_INPUT_MAP[ev.type];\r\n\r\n        // should we handle the touch events?\r\n        if (type === INPUT_START) {\r\n            this.started = true;\r\n        }\r\n\r\n        if (!this.started) {\r\n            return;\r\n        }\r\n\r\n        var touches = normalizeSingleTouches.call(this, ev, type);\r\n\r\n        // when done, reset the started state\r\n        if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {\r\n            this.started = false;\r\n        }\r\n\r\n        this.callback(this.manager, type, {\r\n            pointers: touches[0],\r\n            changedPointers: touches[1],\r\n            pointerType: INPUT_TYPE_TOUCH,\r\n            srcEvent: ev\r\n        });\r\n    }\r\n});\r\n\r\n/**\r\n * @this {TouchInput}\r\n * @param {Object} ev\r\n * @param {Number} type flag\r\n * @returns {undefined|Array} [all, changed]\r\n */\r\nfunction normalizeSingleTouches(ev, type) {\r\n    var all = toArray(ev.touches);\r\n    var changed = toArray(ev.changedTouches);\r\n\r\n    if (type & (INPUT_END | INPUT_CANCEL)) {\r\n        all = uniqueArray(all.concat(changed), 'identifier', true);\r\n    }\r\n\r\n    return [all, changed];\r\n}\r\n\r\nvar TOUCH_INPUT_MAP = {\r\n    touchstart: INPUT_START,\r\n    touchmove: INPUT_MOVE,\r\n    touchend: INPUT_END,\r\n    touchcancel: INPUT_CANCEL\r\n};\r\n\r\nvar TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';\r\n\r\n/**\r\n * Multi-user touch events input\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction TouchInput() {\r\n    this.evTarget = TOUCH_TARGET_EVENTS;\r\n    this.targetIds = {};\r\n\r\n    Input.apply(this, arguments);\r\n}\r\n\r\ninherit(TouchInput, Input, {\r\n    handler: function MTEhandler(ev) {\r\n        var type = TOUCH_INPUT_MAP[ev.type];\r\n        var touches = getTouches.call(this, ev, type);\r\n        if (!touches) {\r\n            return;\r\n        }\r\n\r\n        this.callback(this.manager, type, {\r\n            pointers: touches[0],\r\n            changedPointers: touches[1],\r\n            pointerType: INPUT_TYPE_TOUCH,\r\n            srcEvent: ev\r\n        });\r\n    }\r\n});\r\n\r\n/**\r\n * @this {TouchInput}\r\n * @param {Object} ev\r\n * @param {Number} type flag\r\n * @returns {undefined|Array} [all, changed]\r\n */\r\nfunction getTouches(ev, type) {\r\n    var allTouches = toArray(ev.touches);\r\n    var targetIds = this.targetIds;\r\n\r\n    // when there is only one touch, the process can be simplified\r\n    if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {\r\n        targetIds[allTouches[0].identifier] = true;\r\n        return [allTouches, allTouches];\r\n    }\r\n\r\n    var i,\r\n        targetTouches,\r\n        changedTouches = toArray(ev.changedTouches),\r\n        changedTargetTouches = [],\r\n        target = this.target;\r\n\r\n    // get target touches from touches\r\n    targetTouches = allTouches.filter(function(touch) {\r\n        return hasParent(touch.target, target);\r\n    });\r\n\r\n    // collect touches\r\n    if (type === INPUT_START) {\r\n        i = 0;\r\n        while (i < targetTouches.length) {\r\n            targetIds[targetTouches[i].identifier] = true;\r\n            i++;\r\n        }\r\n    }\r\n\r\n    // filter changed touches to only contain touches that exist in the collected target ids\r\n    i = 0;\r\n    while (i < changedTouches.length) {\r\n        if (targetIds[changedTouches[i].identifier]) {\r\n            changedTargetTouches.push(changedTouches[i]);\r\n        }\r\n\r\n        // cleanup removed touches\r\n        if (type & (INPUT_END | INPUT_CANCEL)) {\r\n            delete targetIds[changedTouches[i].identifier];\r\n        }\r\n        i++;\r\n    }\r\n\r\n    if (!changedTargetTouches.length) {\r\n        return;\r\n    }\r\n\r\n    return [\r\n        // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'\r\n        uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),\r\n        changedTargetTouches\r\n    ];\r\n}\r\n\r\n/**\r\n * Combined touch and mouse input\r\n *\r\n * Touch has a higher priority then mouse, and while touching no mouse events are allowed.\r\n * This because touch devices also emit mouse events while doing a touch.\r\n *\r\n * @constructor\r\n * @extends Input\r\n */\r\nfunction TouchMouseInput() {\r\n    Input.apply(this, arguments);\r\n\r\n    var handler = bindFn(this.handler, this);\r\n    this.touch = new TouchInput(this.manager, handler);\r\n    this.mouse = new MouseInput(this.manager, handler);\r\n}\r\n\r\ninherit(TouchMouseInput, Input, {\r\n    /**\r\n     * handle mouse and touch events\r\n     * @param {Hammer} manager\r\n     * @param {String} inputEvent\r\n     * @param {Object} inputData\r\n     */\r\n    handler: function TMEhandler(manager, inputEvent, inputData) {\r\n        var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),\r\n            isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);\r\n\r\n        // when we're in a touch event, so  block all upcoming mouse events\r\n        // most mobile browser also emit mouseevents, right after touchstart\r\n        if (isTouch) {\r\n            this.mouse.allow = false;\r\n        } else if (isMouse && !this.mouse.allow) {\r\n            return;\r\n        }\r\n\r\n        // reset the allowMouse when we're done\r\n        if (inputEvent & (INPUT_END | INPUT_CANCEL)) {\r\n            this.mouse.allow = true;\r\n        }\r\n\r\n        this.callback(manager, inputEvent, inputData);\r\n    },\r\n\r\n    /**\r\n     * remove the event listeners\r\n     */\r\n    destroy: function destroy() {\r\n        this.touch.destroy();\r\n        this.mouse.destroy();\r\n    }\r\n});\r\n\r\nvar PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');\r\nvar NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;\r\n\r\n// magical touchAction value\r\nvar TOUCH_ACTION_COMPUTE = 'compute';\r\nvar TOUCH_ACTION_AUTO = 'auto';\r\nvar TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented\r\nvar TOUCH_ACTION_NONE = 'none';\r\nvar TOUCH_ACTION_PAN_X = 'pan-x';\r\nvar TOUCH_ACTION_PAN_Y = 'pan-y';\r\n\r\n/**\r\n * Touch Action\r\n * sets the touchAction property or uses the js alternative\r\n * @param {Manager} manager\r\n * @param {String} value\r\n * @constructor\r\n */\r\nfunction TouchAction(manager, value) {\r\n    this.manager = manager;\r\n    this.set(value);\r\n}\r\n\r\nTouchAction.prototype = {\r\n    /**\r\n     * set the touchAction value on the element or enable the polyfill\r\n     * @param {String} value\r\n     */\r\n    set: function(value) {\r\n        // find out the touch-action by the event handlers\r\n        if (value == TOUCH_ACTION_COMPUTE) {\r\n            value = this.compute();\r\n        }\r\n\r\n        if (NATIVE_TOUCH_ACTION) {\r\n            this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;\r\n        }\r\n        this.actions = value.toLowerCase().trim();\r\n    },\r\n\r\n    /**\r\n     * just re-set the touchAction value\r\n     */\r\n    update: function() {\r\n        this.set(this.manager.options.touchAction);\r\n    },\r\n\r\n    /**\r\n     * compute the value for the touchAction property based on the recognizer's settings\r\n     * @returns {String} value\r\n     */\r\n    compute: function() {\r\n        var actions = [];\r\n        each(this.manager.recognizers, function(recognizer) {\r\n            if (boolOrFn(recognizer.options.enable, [recognizer])) {\r\n                actions = actions.concat(recognizer.getTouchAction());\r\n            }\r\n        });\r\n        return cleanTouchActions(actions.join(' '));\r\n    },\r\n\r\n    /**\r\n     * this method is called on each input cycle and provides the preventing of the browser behavior\r\n     * @param {Object} input\r\n     */\r\n    preventDefaults: function(input) {\r\n        // not needed with native support for the touchAction property\r\n        if (NATIVE_TOUCH_ACTION) {\r\n            return;\r\n        }\r\n\r\n        var srcEvent = input.srcEvent;\r\n        var direction = input.offsetDirection;\r\n\r\n        // if the touch action did prevented once this session\r\n        if (this.manager.session.prevented) {\r\n            srcEvent.preventDefault();\r\n            return;\r\n        }\r\n\r\n        var actions = this.actions;\r\n        var hasNone = inStr(actions, TOUCH_ACTION_NONE);\r\n        var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\r\n        var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\r\n\r\n        if (hasNone ||\r\n            (hasPanY && direction & DIRECTION_HORIZONTAL) ||\r\n            (hasPanX && direction & DIRECTION_VERTICAL)) {\r\n            return this.preventSrc(srcEvent);\r\n        }\r\n    },\r\n\r\n    /**\r\n     * call preventDefault to prevent the browser's default behavior (scrolling in most cases)\r\n     * @param {Object} srcEvent\r\n     */\r\n    preventSrc: function(srcEvent) {\r\n        this.manager.session.prevented = true;\r\n        srcEvent.preventDefault();\r\n    }\r\n};\r\n\r\n/**\r\n * when the touchActions are collected they are not a valid value, so we need to clean things up. *\r\n * @param {String} actions\r\n * @returns {*}\r\n */\r\nfunction cleanTouchActions(actions) {\r\n    // none\r\n    if (inStr(actions, TOUCH_ACTION_NONE)) {\r\n        return TOUCH_ACTION_NONE;\r\n    }\r\n\r\n    var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);\r\n    var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);\r\n\r\n    // pan-x and pan-y can be combined\r\n    if (hasPanX && hasPanY) {\r\n        return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;\r\n    }\r\n\r\n    // pan-x OR pan-y\r\n    if (hasPanX || hasPanY) {\r\n        return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;\r\n    }\r\n\r\n    // manipulation\r\n    if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {\r\n        return TOUCH_ACTION_MANIPULATION;\r\n    }\r\n\r\n    return TOUCH_ACTION_AUTO;\r\n}\r\n\r\n/**\r\n * Recognizer flow explained; *\r\n * All recognizers have the initial state of POSSIBLE when a input session starts.\r\n * The definition of a input session is from the first input until the last input, with all it's movement in it. *\r\n * Example session for mouse-input: mousedown -> mousemove -> mouseup\r\n *\r\n * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed\r\n * which determines with state it should be.\r\n *\r\n * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to\r\n * POSSIBLE to give it another change on the next cycle.\r\n *\r\n *               Possible\r\n *                  |\r\n *            +-----+---------------+\r\n *            |                     |\r\n *      +-----+-----+               |\r\n *      |           |               |\r\n *   Failed      Cancelled          |\r\n *                          +-------+------+\r\n *                          |              |\r\n *                      Recognized       Began\r\n *                                         |\r\n *                                      Changed\r\n *                                         |\r\n *                                  Ended/Recognized\r\n */\r\nvar STATE_POSSIBLE = 1;\r\nvar STATE_BEGAN = 2;\r\nvar STATE_CHANGED = 4;\r\nvar STATE_ENDED = 8;\r\nvar STATE_RECOGNIZED = STATE_ENDED;\r\nvar STATE_CANCELLED = 16;\r\nvar STATE_FAILED = 32;\r\n\r\n/**\r\n * Recognizer\r\n * Every recognizer needs to extend from this class.\r\n * @constructor\r\n * @param {Object} options\r\n */\r\nfunction Recognizer(options) {\r\n    this.id = uniqueId();\r\n\r\n    this.manager = null;\r\n    this.options = merge(options || {}, this.defaults);\r\n\r\n    // default is enable true\r\n    this.options.enable = ifUndefined(this.options.enable, true);\r\n\r\n    this.state = STATE_POSSIBLE;\r\n\r\n    this.simultaneous = {};\r\n    this.requireFail = [];\r\n}\r\n\r\nRecognizer.prototype = {\r\n    /**\r\n     * @virtual\r\n     * @type {Object}\r\n     */\r\n    defaults: {},\r\n\r\n    /**\r\n     * set options\r\n     * @param {Object} options\r\n     * @return {Recognizer}\r\n     */\r\n    set: function(options) {\r\n        extend(this.options, options);\r\n\r\n        // also update the touchAction, in case something changed about the directions/enabled state\r\n        this.manager && this.manager.touchAction.update();\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * recognize simultaneous with an other recognizer.\r\n     * @param {Recognizer} otherRecognizer\r\n     * @returns {Recognizer} this\r\n     */\r\n    recognizeWith: function(otherRecognizer) {\r\n        if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {\r\n            return this;\r\n        }\r\n\r\n        var simultaneous = this.simultaneous;\r\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n        if (!simultaneous[otherRecognizer.id]) {\r\n            simultaneous[otherRecognizer.id] = otherRecognizer;\r\n            otherRecognizer.recognizeWith(this);\r\n        }\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * drop the simultaneous link. it doesnt remove the link on the other recognizer.\r\n     * @param {Recognizer} otherRecognizer\r\n     * @returns {Recognizer} this\r\n     */\r\n    dropRecognizeWith: function(otherRecognizer) {\r\n        if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {\r\n            return this;\r\n        }\r\n\r\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n        delete this.simultaneous[otherRecognizer.id];\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * recognizer can only run when an other is failing\r\n     * @param {Recognizer} otherRecognizer\r\n     * @returns {Recognizer} this\r\n     */\r\n    requireFailure: function(otherRecognizer) {\r\n        if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {\r\n            return this;\r\n        }\r\n\r\n        var requireFail = this.requireFail;\r\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n        if (inArray(requireFail, otherRecognizer) === -1) {\r\n            requireFail.push(otherRecognizer);\r\n            otherRecognizer.requireFailure(this);\r\n        }\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * drop the requireFailure link. it does not remove the link on the other recognizer.\r\n     * @param {Recognizer} otherRecognizer\r\n     * @returns {Recognizer} this\r\n     */\r\n    dropRequireFailure: function(otherRecognizer) {\r\n        if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {\r\n            return this;\r\n        }\r\n\r\n        otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);\r\n        var index = inArray(this.requireFail, otherRecognizer);\r\n        if (index > -1) {\r\n            this.requireFail.splice(index, 1);\r\n        }\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * has require failures boolean\r\n     * @returns {boolean}\r\n     */\r\n    hasRequireFailures: function() {\r\n        return this.requireFail.length > 0;\r\n    },\r\n\r\n    /**\r\n     * if the recognizer can recognize simultaneous with an other recognizer\r\n     * @param {Recognizer} otherRecognizer\r\n     * @returns {Boolean}\r\n     */\r\n    canRecognizeWith: function(otherRecognizer) {\r\n        return !!this.simultaneous[otherRecognizer.id];\r\n    },\r\n\r\n    /**\r\n     * You should use `tryEmit` instead of `emit` directly to check\r\n     * that all the needed recognizers has failed before emitting.\r\n     * @param {Object} input\r\n     */\r\n    emit: function(input) {\r\n        var self = this;\r\n        var state = this.state;\r\n\r\n        function emit(withState) {\r\n            self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);\r\n        }\r\n\r\n        // 'panstart' and 'panmove'\r\n        if (state < STATE_ENDED) {\r\n            emit(true);\r\n        }\r\n\r\n        emit(); // simple 'eventName' events\r\n\r\n        // panend and pancancel\r\n        if (state >= STATE_ENDED) {\r\n            emit(true);\r\n        }\r\n    },\r\n\r\n    /**\r\n     * Check that all the require failure recognizers has failed,\r\n     * if true, it emits a gesture event,\r\n     * otherwise, setup the state to FAILED.\r\n     * @param {Object} input\r\n     */\r\n    tryEmit: function(input) {\r\n        if (this.canEmit()) {\r\n            return this.emit(input);\r\n        }\r\n        // it's failing anyway\r\n        this.state = STATE_FAILED;\r\n    },\r\n\r\n    /**\r\n     * can we emit?\r\n     * @returns {boolean}\r\n     */\r\n    canEmit: function() {\r\n        var i = 0;\r\n        while (i < this.requireFail.length) {\r\n            if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {\r\n                return false;\r\n            }\r\n            i++;\r\n        }\r\n        return true;\r\n    },\r\n\r\n    /**\r\n     * update the recognizer\r\n     * @param {Object} inputData\r\n     */\r\n    recognize: function(inputData) {\r\n        // make a new copy of the inputData\r\n        // so we can change the inputData without messing up the other recognizers\r\n        var inputDataClone = extend({}, inputData);\r\n\r\n        // is is enabled and allow recognizing?\r\n        if (!boolOrFn(this.options.enable, [this, inputDataClone])) {\r\n            this.reset();\r\n            this.state = STATE_FAILED;\r\n            return;\r\n        }\r\n\r\n        // reset when we've reached the end\r\n        if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {\r\n            this.state = STATE_POSSIBLE;\r\n        }\r\n\r\n        this.state = this.process(inputDataClone);\r\n\r\n        // the recognizer has recognized a gesture\r\n        // so trigger an event\r\n        if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {\r\n            this.tryEmit(inputDataClone);\r\n        }\r\n    },\r\n\r\n    /**\r\n     * return the state of the recognizer\r\n     * the actual recognizing happens in this method\r\n     * @virtual\r\n     * @param {Object} inputData\r\n     * @returns {Const} STATE\r\n     */\r\n    process: function(inputData) { }, // jshint ignore:line\r\n\r\n    /**\r\n     * return the preferred touch-action\r\n     * @virtual\r\n     * @returns {Array}\r\n     */\r\n    getTouchAction: function() { },\r\n\r\n    /**\r\n     * called when the gesture isn't allowed to recognize\r\n     * like when another is being recognized or it is disabled\r\n     * @virtual\r\n     */\r\n    reset: function() { }\r\n};\r\n\r\n/**\r\n * get a usable string, used as event postfix\r\n * @param {Const} state\r\n * @returns {String} state\r\n */\r\nfunction stateStr(state) {\r\n    if (state & STATE_CANCELLED) {\r\n        return 'cancel';\r\n    } else if (state & STATE_ENDED) {\r\n        return 'end';\r\n    } else if (state & STATE_CHANGED) {\r\n        return 'move';\r\n    } else if (state & STATE_BEGAN) {\r\n        return 'start';\r\n    }\r\n    return '';\r\n}\r\n\r\n/**\r\n * direction cons to string\r\n * @param {Const} direction\r\n * @returns {String}\r\n */\r\nfunction directionStr(direction) {\r\n    if (direction == DIRECTION_DOWN) {\r\n        return 'down';\r\n    } else if (direction == DIRECTION_UP) {\r\n        return 'up';\r\n    } else if (direction == DIRECTION_LEFT) {\r\n        return 'left';\r\n    } else if (direction == DIRECTION_RIGHT) {\r\n        return 'right';\r\n    }\r\n    return '';\r\n}\r\n\r\n/**\r\n * get a recognizer by name if it is bound to a manager\r\n * @param {Recognizer|String} otherRecognizer\r\n * @param {Recognizer} recognizer\r\n * @returns {Recognizer}\r\n */\r\nfunction getRecognizerByNameIfManager(otherRecognizer, recognizer) {\r\n    var manager = recognizer.manager;\r\n    if (manager) {\r\n        return manager.get(otherRecognizer);\r\n    }\r\n    return otherRecognizer;\r\n}\r\n\r\n/**\r\n * This recognizer is just used as a base for the simple attribute recognizers.\r\n * @constructor\r\n * @extends Recognizer\r\n */\r\nfunction AttrRecognizer() {\r\n    Recognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(AttrRecognizer, Recognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof AttrRecognizer\r\n     */\r\n    defaults: {\r\n        /**\r\n         * @type {Number}\r\n         * @default 1\r\n         */\r\n        pointers: 1\r\n    },\r\n\r\n    /**\r\n     * Used to check if it the recognizer receives valid input, like input.distance > 10.\r\n     * @memberof AttrRecognizer\r\n     * @param {Object} input\r\n     * @returns {Boolean} recognized\r\n     */\r\n    attrTest: function(input) {\r\n        var optionPointers = this.options.pointers;\r\n        return optionPointers === 0 || input.pointers.length === optionPointers;\r\n    },\r\n\r\n    /**\r\n     * Process the input and return the state for the recognizer\r\n     * @memberof AttrRecognizer\r\n     * @param {Object} input\r\n     * @returns {*} State\r\n     */\r\n    process: function(input) {\r\n        var state = this.state;\r\n        var eventType = input.eventType;\r\n\r\n        var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);\r\n        var isValid = this.attrTest(input);\r\n\r\n        // on cancel input and we've recognized before, return STATE_CANCELLED\r\n        if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {\r\n            return state | STATE_CANCELLED;\r\n        } else if (isRecognized || isValid) {\r\n            if (eventType & INPUT_END) {\r\n                return state | STATE_ENDED;\r\n            } else if (!(state & STATE_BEGAN)) {\r\n                return STATE_BEGAN;\r\n            }\r\n            return state | STATE_CHANGED;\r\n        }\r\n        return STATE_FAILED;\r\n    }\r\n});\r\n\r\n/**\r\n * Pan\r\n * Recognized when the pointer is down and moved in the allowed direction.\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction PanRecognizer() {\r\n    AttrRecognizer.apply(this, arguments);\r\n\r\n    this.pX = null;\r\n    this.pY = null;\r\n}\r\n\r\ninherit(PanRecognizer, AttrRecognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof PanRecognizer\r\n     */\r\n    defaults: {\r\n        event: 'pan',\r\n        threshold: 10,\r\n        pointers: 1,\r\n        direction: DIRECTION_ALL\r\n    },\r\n\r\n    getTouchAction: function() {\r\n        var direction = this.options.direction;\r\n        var actions = [];\r\n        if (direction & DIRECTION_HORIZONTAL) {\r\n            actions.push(TOUCH_ACTION_PAN_Y);\r\n        }\r\n        if (direction & DIRECTION_VERTICAL) {\r\n            actions.push(TOUCH_ACTION_PAN_X);\r\n        }\r\n        return actions;\r\n    },\r\n\r\n    directionTest: function(input) {\r\n        var options = this.options;\r\n        var hasMoved = true;\r\n        var distance = input.distance;\r\n        var direction = input.direction;\r\n        var x = input.deltaX;\r\n        var y = input.deltaY;\r\n\r\n        // lock to axis?\r\n        if (!(direction & options.direction)) {\r\n            if (options.direction & DIRECTION_HORIZONTAL) {\r\n                direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;\r\n                hasMoved = x != this.pX;\r\n                distance = Math.abs(input.deltaX);\r\n            } else {\r\n                direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;\r\n                hasMoved = y != this.pY;\r\n                distance = Math.abs(input.deltaY);\r\n            }\r\n        }\r\n        input.direction = direction;\r\n        return hasMoved && distance > options.threshold && direction & options.direction;\r\n    },\r\n\r\n    attrTest: function(input) {\r\n        return AttrRecognizer.prototype.attrTest.call(this, input) &&\r\n            (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));\r\n    },\r\n\r\n    emit: function(input) {\r\n        this.pX = input.deltaX;\r\n        this.pY = input.deltaY;\r\n\r\n        var direction = directionStr(input.direction);\r\n        if (direction) {\r\n            this.manager.emit(this.options.event + direction, input);\r\n        }\r\n\r\n        this._super.emit.call(this, input);\r\n    }\r\n});\r\n\r\n/**\r\n * Pinch\r\n * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction PinchRecognizer() {\r\n    AttrRecognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(PinchRecognizer, AttrRecognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof PinchRecognizer\r\n     */\r\n    defaults: {\r\n        event: 'pinch',\r\n        threshold: 0,\r\n        pointers: 2\r\n    },\r\n\r\n    getTouchAction: function() {\r\n        return [TOUCH_ACTION_NONE];\r\n    },\r\n\r\n    attrTest: function(input) {\r\n        return this._super.attrTest.call(this, input) &&\r\n            (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);\r\n    },\r\n\r\n    emit: function(input) {\r\n        this._super.emit.call(this, input);\r\n        if (input.scale !== 1) {\r\n            var inOut = input.scale < 1 ? 'in' : 'out';\r\n            this.manager.emit(this.options.event + inOut, input);\r\n        }\r\n    }\r\n});\r\n\r\n/**\r\n * Press\r\n * Recognized when the pointer is down for x ms without any movement.\r\n * @constructor\r\n * @extends Recognizer\r\n */\r\nfunction PressRecognizer() {\r\n    Recognizer.apply(this, arguments);\r\n\r\n    this._timer = null;\r\n    this._input = null;\r\n}\r\n\r\ninherit(PressRecognizer, Recognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof PressRecognizer\r\n     */\r\n    defaults: {\r\n        event: 'press',\r\n        pointers: 1,\r\n        time: 500, // minimal time of the pointer to be pressed\r\n        threshold: 5 // a minimal movement is ok, but keep it low\r\n    },\r\n\r\n    getTouchAction: function() {\r\n        return [TOUCH_ACTION_AUTO];\r\n    },\r\n\r\n    process: function(input) {\r\n        var options = this.options;\r\n        var validPointers = input.pointers.length === options.pointers;\r\n        var validMovement = input.distance < options.threshold;\r\n        var validTime = input.deltaTime > options.time;\r\n\r\n        this._input = input;\r\n\r\n        // we only allow little movement\r\n        // and we've reached an end event, so a tap is possible\r\n        if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {\r\n            this.reset();\r\n        } else if (input.eventType & INPUT_START) {\r\n            this.reset();\r\n            this._timer = setTimeoutContext(function() {\r\n                this.state = STATE_RECOGNIZED;\r\n                this.tryEmit();\r\n            }, options.time, this);\r\n        } else if (input.eventType & INPUT_END) {\r\n            return STATE_RECOGNIZED;\r\n        }\r\n        return STATE_FAILED;\r\n    },\r\n\r\n    reset: function() {\r\n        clearTimeout(this._timer);\r\n    },\r\n\r\n    emit: function(input) {\r\n        if (this.state !== STATE_RECOGNIZED) {\r\n            return;\r\n        }\r\n\r\n        if (input && (input.eventType & INPUT_END)) {\r\n            this.manager.emit(this.options.event + 'up', input);\r\n        } else {\r\n            this._input.timeStamp = now();\r\n            this.manager.emit(this.options.event, this._input);\r\n        }\r\n    }\r\n});\r\n\r\n/**\r\n * Rotate\r\n * Recognized when two or more pointer are moving in a circular motion.\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction RotateRecognizer() {\r\n    AttrRecognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(RotateRecognizer, AttrRecognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof RotateRecognizer\r\n     */\r\n    defaults: {\r\n        event: 'rotate',\r\n        threshold: 0,\r\n        pointers: 2\r\n    },\r\n\r\n    getTouchAction: function() {\r\n        return [TOUCH_ACTION_NONE];\r\n    },\r\n\r\n    attrTest: function(input) {\r\n        return this._super.attrTest.call(this, input) &&\r\n            (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);\r\n    }\r\n});\r\n\r\n/**\r\n * Swipe\r\n * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.\r\n * @constructor\r\n * @extends AttrRecognizer\r\n */\r\nfunction SwipeRecognizer() {\r\n    AttrRecognizer.apply(this, arguments);\r\n}\r\n\r\ninherit(SwipeRecognizer, AttrRecognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof SwipeRecognizer\r\n     */\r\n    defaults: {\r\n        event: 'swipe',\r\n        threshold: 10,\r\n        velocity: 0.65,\r\n        direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,\r\n        pointers: 1\r\n    },\r\n\r\n    getTouchAction: function() {\r\n        return PanRecognizer.prototype.getTouchAction.call(this);\r\n    },\r\n\r\n    attrTest: function(input) {\r\n        var direction = this.options.direction;\r\n        var velocity;\r\n\r\n        if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {\r\n            velocity = input.velocity;\r\n        } else if (direction & DIRECTION_HORIZONTAL) {\r\n            velocity = input.velocityX;\r\n        } else if (direction & DIRECTION_VERTICAL) {\r\n            velocity = input.velocityY;\r\n        }\r\n\r\n        return this._super.attrTest.call(this, input) &&\r\n            direction & input.direction &&\r\n            input.distance > this.options.threshold &&\r\n            abs(velocity) > this.options.velocity && input.eventType & INPUT_END;\r\n    },\r\n\r\n    emit: function(input) {\r\n        var direction = directionStr(input.direction);\r\n        if (direction) {\r\n            this.manager.emit(this.options.event + direction, input);\r\n        }\r\n\r\n        this.manager.emit(this.options.event, input);\r\n    }\r\n});\r\n\r\n/**\r\n * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur\r\n * between the given interval and position. The delay option can be used to recognize multi-taps without firing\r\n * a single tap.\r\n *\r\n * The eventData from the emitted event contains the property `tapCount`, which contains the amount of\r\n * multi-taps being recognized.\r\n * @constructor\r\n * @extends Recognizer\r\n */\r\nfunction TapRecognizer() {\r\n    Recognizer.apply(this, arguments);\r\n\r\n    // previous time and center,\r\n    // used for tap counting\r\n    this.pTime = false;\r\n    this.pCenter = false;\r\n\r\n    this._timer = null;\r\n    this._input = null;\r\n    this.count = 0;\r\n}\r\n\r\ninherit(TapRecognizer, Recognizer, {\r\n    /**\r\n     * @namespace\r\n     * @memberof PinchRecognizer\r\n     */\r\n    defaults: {\r\n        event: 'tap',\r\n        pointers: 1,\r\n        taps: 1,\r\n        interval: 300, // max time between the multi-tap taps\r\n        time: 250, // max time of the pointer to be down (like finger on the screen)\r\n        threshold: 2, // a minimal movement is ok, but keep it low\r\n        posThreshold: 10 // a multi-tap can be a bit off the initial position\r\n    },\r\n\r\n    getTouchAction: function() {\r\n        return [TOUCH_ACTION_MANIPULATION];\r\n    },\r\n\r\n    process: function(input) {\r\n        var options = this.options;\r\n\r\n        var validPointers = input.pointers.length === options.pointers;\r\n        var validMovement = input.distance < options.threshold;\r\n        var validTouchTime = input.deltaTime < options.time;\r\n\r\n        this.reset();\r\n\r\n        if ((input.eventType & INPUT_START) && (this.count === 0)) {\r\n            return this.failTimeout();\r\n        }\r\n\r\n        // we only allow little movement\r\n        // and we've reached an end event, so a tap is possible\r\n        if (validMovement && validTouchTime && validPointers) {\r\n            if (input.eventType != INPUT_END) {\r\n                return this.failTimeout();\r\n            }\r\n\r\n            var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;\r\n            var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;\r\n\r\n            this.pTime = input.timeStamp;\r\n            this.pCenter = input.center;\r\n\r\n            if (!validMultiTap || !validInterval) {\r\n                this.count = 1;\r\n            } else {\r\n                this.count += 1;\r\n            }\r\n\r\n            this._input = input;\r\n\r\n            // if tap count matches we have recognized it,\r\n            // else it has began recognizing...\r\n            var tapCount = this.count % options.taps;\r\n            if (tapCount === 0) {\r\n                // no failing requirements, immediately trigger the tap event\r\n                // or wait as long as the multitap interval to trigger\r\n                if (!this.hasRequireFailures()) {\r\n                    return STATE_RECOGNIZED;\r\n                } else {\r\n                    this._timer = setTimeoutContext(function() {\r\n                        this.state = STATE_RECOGNIZED;\r\n                        this.tryEmit();\r\n                    }, options.interval, this);\r\n                    return STATE_BEGAN;\r\n                }\r\n            }\r\n        }\r\n        return STATE_FAILED;\r\n    },\r\n\r\n    failTimeout: function() {\r\n        this._timer = setTimeoutContext(function() {\r\n            this.state = STATE_FAILED;\r\n        }, this.options.interval, this);\r\n        return STATE_FAILED;\r\n    },\r\n\r\n    reset: function() {\r\n        clearTimeout(this._timer);\r\n    },\r\n\r\n    emit: function() {\r\n        if (this.state == STATE_RECOGNIZED ) {\r\n            this._input.tapCount = this.count;\r\n            this.manager.emit(this.options.event, this._input);\r\n        }\r\n    }\r\n});\r\n\r\n/**\r\n * Simple way to create an manager with a default set of recognizers.\r\n * @param {HTMLElement} element\r\n * @param {Object} [options]\r\n * @constructor\r\n */\r\nfunction Hammer(element, options) {\r\n    options = options || {};\r\n    options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);\r\n    return new Manager(element, options);\r\n}\r\n\r\n/**\r\n * @const {string}\r\n */\r\nHammer.VERSION = '2.0.4';\r\n\r\n/**\r\n * default settings\r\n * @namespace\r\n */\r\nHammer.defaults = {\r\n    /**\r\n     * set if DOM events are being triggered.\r\n     * But this is slower and unused by simple implementations, so disabled by default.\r\n     * @type {Boolean}\r\n     * @default false\r\n     */\r\n    domEvents: false,\r\n\r\n    /**\r\n     * The value for the touchAction property/fallback.\r\n     * When set to `compute` it will magically set the correct value based on the added recognizers.\r\n     * @type {String}\r\n     * @default compute\r\n     */\r\n    touchAction: TOUCH_ACTION_COMPUTE,\r\n\r\n    /**\r\n     * @type {Boolean}\r\n     * @default true\r\n     */\r\n    enable: true,\r\n\r\n    /**\r\n     * EXPERIMENTAL FEATURE -- can be removed/changed\r\n     * Change the parent input target element.\r\n     * If Null, then it is being set the to main element.\r\n     * @type {Null|EventTarget}\r\n     * @default null\r\n     */\r\n    inputTarget: null,\r\n\r\n    /**\r\n     * force an input class\r\n     * @type {Null|Function}\r\n     * @default null\r\n     */\r\n    inputClass: null,\r\n\r\n    /**\r\n     * Default recognizer setup when calling `Hammer()`\r\n     * When creating a new Manager these will be skipped.\r\n     * @type {Array}\r\n     */\r\n    preset: [\r\n        // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]\r\n        [RotateRecognizer, { enable: false }],\r\n        [PinchRecognizer, { enable: false }, ['rotate']],\r\n        [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }],\r\n        [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']],\r\n        [TapRecognizer],\r\n        [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']],\r\n        [PressRecognizer]\r\n    ],\r\n\r\n    /**\r\n     * Some CSS properties can be used to improve the working of Hammer.\r\n     * Add them to this method and they will be set when creating a new Manager.\r\n     * @namespace\r\n     */\r\n    cssProps: {\r\n        /**\r\n         * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.\r\n         * @type {String}\r\n         * @default 'none'\r\n         */\r\n        userSelect: 'none',\r\n\r\n        /**\r\n         * Disable the Windows Phone grippers when pressing an element.\r\n         * @type {String}\r\n         * @default 'none'\r\n         */\r\n        touchSelect: 'none',\r\n\r\n        /**\r\n         * Disables the default callout shown when you touch and hold a touch target.\r\n         * On iOS, when you touch and hold a touch target such as a link, Safari displays\r\n         * a callout containing information about the link. This property allows you to disable that callout.\r\n         * @type {String}\r\n         * @default 'none'\r\n         */\r\n        touchCallout: 'none',\r\n\r\n        /**\r\n         * Specifies whether zooming is enabled. Used by IE10>\r\n         * @type {String}\r\n         * @default 'none'\r\n         */\r\n        contentZooming: 'none',\r\n\r\n        /**\r\n         * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.\r\n         * @type {String}\r\n         * @default 'none'\r\n         */\r\n        userDrag: 'none',\r\n\r\n        /**\r\n         * Overrides the highlight color shown when the user taps a link or a JavaScript\r\n         * clickable element in iOS. This property obeys the alpha value, if specified.\r\n         * @type {String}\r\n         * @default 'rgba(0,0,0,0)'\r\n         */\r\n        tapHighlightColor: 'rgba(0,0,0,0)'\r\n    }\r\n};\r\n\r\nvar STOP = 1;\r\nvar FORCED_STOP = 2;\r\n\r\n/**\r\n * Manager\r\n * @param {HTMLElement} element\r\n * @param {Object} [options]\r\n * @constructor\r\n */\r\nfunction Manager(element, options) {\r\n    options = options || {};\r\n\r\n    this.options = merge(options, Hammer.defaults);\r\n    this.options.inputTarget = this.options.inputTarget || element;\r\n\r\n    this.handlers = {};\r\n    this.session = {};\r\n    this.recognizers = [];\r\n\r\n    this.element = element;\r\n    this.input = createInputInstance(this);\r\n    this.touchAction = new TouchAction(this, this.options.touchAction);\r\n\r\n    toggleCssProps(this, true);\r\n\r\n    each(options.recognizers, function(item) {\r\n        var recognizer = this.add(new (item[0])(item[1]));\r\n        item[2] && recognizer.recognizeWith(item[2]);\r\n        item[3] && recognizer.requireFailure(item[3]);\r\n    }, this);\r\n}\r\n\r\nManager.prototype = {\r\n    /**\r\n     * set options\r\n     * @param {Object} options\r\n     * @returns {Manager}\r\n     */\r\n    set: function(options) {\r\n        extend(this.options, options);\r\n\r\n        // Options that need a little more setup\r\n        if (options.touchAction) {\r\n            this.touchAction.update();\r\n        }\r\n        if (options.inputTarget) {\r\n            // Clean up existing event listeners and reinitialize\r\n            this.input.destroy();\r\n            this.input.target = options.inputTarget;\r\n            this.input.init();\r\n        }\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * stop recognizing for this session.\r\n     * This session will be discarded, when a new [input]start event is fired.\r\n     * When forced, the recognizer cycle is stopped immediately.\r\n     * @param {Boolean} [force]\r\n     */\r\n    stop: function(force) {\r\n        this.session.stopped = force ? FORCED_STOP : STOP;\r\n    },\r\n\r\n    /**\r\n     * run the recognizers!\r\n     * called by the inputHandler function on every movement of the pointers (touches)\r\n     * it walks through all the recognizers and tries to detect the gesture that is being made\r\n     * @param {Object} inputData\r\n     */\r\n    recognize: function(inputData) {\r\n        var session = this.session;\r\n        if (session.stopped) {\r\n            return;\r\n        }\r\n\r\n        // run the touch-action polyfill\r\n        this.touchAction.preventDefaults(inputData);\r\n\r\n        var recognizer;\r\n        var recognizers = this.recognizers;\r\n\r\n        // this holds the recognizer that is being recognized.\r\n        // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED\r\n        // if no recognizer is detecting a thing, it is set to `null`\r\n        var curRecognizer = session.curRecognizer;\r\n\r\n        // reset when the last recognizer is recognized\r\n        // or when we're in a new session\r\n        if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {\r\n            curRecognizer = session.curRecognizer = null;\r\n        }\r\n\r\n        var i = 0;\r\n        while (i < recognizers.length) {\r\n            recognizer = recognizers[i];\r\n\r\n            // find out if we are allowed try to recognize the input for this one.\r\n            // 1.   allow if the session is NOT forced stopped (see the .stop() method)\r\n            // 2.   allow if we still haven't recognized a gesture in this session, or the this recognizer is the one\r\n            //      that is being recognized.\r\n            // 3.   allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.\r\n            //      this can be setup with the `recognizeWith()` method on the recognizer.\r\n            if (session.stopped !== FORCED_STOP && ( // 1\r\n                    !curRecognizer || recognizer == curRecognizer || // 2\r\n                    recognizer.canRecognizeWith(curRecognizer))) { // 3\r\n                recognizer.recognize(inputData);\r\n            } else {\r\n                recognizer.reset();\r\n            }\r\n\r\n            // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the\r\n            // current active recognizer. but only if we don't already have an active recognizer\r\n            if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {\r\n                curRecognizer = session.curRecognizer = recognizer;\r\n            }\r\n            i++;\r\n        }\r\n    },\r\n\r\n    /**\r\n     * get a recognizer by its event name.\r\n     * @param {Recognizer|String} recognizer\r\n     * @returns {Recognizer|Null}\r\n     */\r\n    get: function(recognizer) {\r\n        if (recognizer instanceof Recognizer) {\r\n            return recognizer;\r\n        }\r\n\r\n        var recognizers = this.recognizers;\r\n        for (var i = 0; i < recognizers.length; i++) {\r\n            if (recognizers[i].options.event == recognizer) {\r\n                return recognizers[i];\r\n            }\r\n        }\r\n        return null;\r\n    },\r\n\r\n    /**\r\n     * add a recognizer to the manager\r\n     * existing recognizers with the same event name will be removed\r\n     * @param {Recognizer} recognizer\r\n     * @returns {Recognizer|Manager}\r\n     */\r\n    add: function(recognizer) {\r\n        if (invokeArrayArg(recognizer, 'add', this)) {\r\n            return this;\r\n        }\r\n\r\n        // remove existing\r\n        var existing = this.get(recognizer.options.event);\r\n        if (existing) {\r\n            this.remove(existing);\r\n        }\r\n\r\n        this.recognizers.push(recognizer);\r\n        recognizer.manager = this;\r\n\r\n        this.touchAction.update();\r\n        return recognizer;\r\n    },\r\n\r\n    /**\r\n     * remove a recognizer by name or instance\r\n     * @param {Recognizer|String} recognizer\r\n     * @returns {Manager}\r\n     */\r\n    remove: function(recognizer) {\r\n        if (invokeArrayArg(recognizer, 'remove', this)) {\r\n            return this;\r\n        }\r\n\r\n        var recognizers = this.recognizers;\r\n        recognizer = this.get(recognizer);\r\n        recognizers.splice(inArray(recognizers, recognizer), 1);\r\n\r\n        this.touchAction.update();\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * bind event\r\n     * @param {String} events\r\n     * @param {Function} handler\r\n     * @returns {EventEmitter} this\r\n     */\r\n    on: function(events, handler) {\r\n        var handlers = this.handlers;\r\n        each(splitStr(events), function(event) {\r\n            handlers[event] = handlers[event] || [];\r\n            handlers[event].push(handler);\r\n        });\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * unbind event, leave emit blank to remove all handlers\r\n     * @param {String} events\r\n     * @param {Function} [handler]\r\n     * @returns {EventEmitter} this\r\n     */\r\n    off: function(events, handler) {\r\n        var handlers = this.handlers;\r\n        each(splitStr(events), function(event) {\r\n            if (!handler) {\r\n                delete handlers[event];\r\n            } else {\r\n                handlers[event].splice(inArray(handlers[event], handler), 1);\r\n            }\r\n        });\r\n        return this;\r\n    },\r\n\r\n    /**\r\n     * emit event to the listeners\r\n     * @param {String} event\r\n     * @param {Object} data\r\n     */\r\n    emit: function(event, data) {\r\n        // we also want to trigger dom events\r\n        if (this.options.domEvents) {\r\n            triggerDomEvent(event, data);\r\n        }\r\n\r\n        // no handlers, so skip it all\r\n        var handlers = this.handlers[event] && this.handlers[event].slice();\r\n        if (!handlers || !handlers.length) {\r\n            return;\r\n        }\r\n\r\n        data.type = event;\r\n        data.preventDefault = function() {\r\n            data.srcEvent.preventDefault();\r\n        };\r\n\r\n        var i = 0;\r\n        while (i < handlers.length) {\r\n            handlers[i](data);\r\n            i++;\r\n        }\r\n    },\r\n\r\n    /**\r\n     * destroy the manager and unbinds all events\r\n     * it doesn't unbind dom events, that is the user own responsibility\r\n     */\r\n    destroy: function() {\r\n        this.element && toggleCssProps(this, false);\r\n\r\n        this.handlers = {};\r\n        this.session = {};\r\n        this.input.destroy();\r\n        this.element = null;\r\n    }\r\n};\r\n\r\n/**\r\n * add/remove the css properties as defined in manager.options.cssProps\r\n * @param {Manager} manager\r\n * @param {Boolean} add\r\n */\r\nfunction toggleCssProps(manager, add) {\r\n    var element = manager.element;\r\n    each(manager.options.cssProps, function(value, name) {\r\n        element.style[prefixed(element.style, name)] = add ? value : '';\r\n    });\r\n}\r\n\r\n/**\r\n * trigger dom event\r\n * @param {String} event\r\n * @param {Object} data\r\n */\r\nfunction triggerDomEvent(event, data) {\r\n    var gestureEvent = document.createEvent('Event');\r\n    gestureEvent.initEvent(event, true, true);\r\n    gestureEvent.gesture = data;\r\n    data.target.dispatchEvent(gestureEvent);\r\n}\r\n\r\nextend(Hammer, {\r\n    INPUT_START: INPUT_START,\r\n    INPUT_MOVE: INPUT_MOVE,\r\n    INPUT_END: INPUT_END,\r\n    INPUT_CANCEL: INPUT_CANCEL,\r\n\r\n    STATE_POSSIBLE: STATE_POSSIBLE,\r\n    STATE_BEGAN: STATE_BEGAN,\r\n    STATE_CHANGED: STATE_CHANGED,\r\n    STATE_ENDED: STATE_ENDED,\r\n    STATE_RECOGNIZED: STATE_RECOGNIZED,\r\n    STATE_CANCELLED: STATE_CANCELLED,\r\n    STATE_FAILED: STATE_FAILED,\r\n\r\n    DIRECTION_NONE: DIRECTION_NONE,\r\n    DIRECTION_LEFT: DIRECTION_LEFT,\r\n    DIRECTION_RIGHT: DIRECTION_RIGHT,\r\n    DIRECTION_UP: DIRECTION_UP,\r\n    DIRECTION_DOWN: DIRECTION_DOWN,\r\n    DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,\r\n    DIRECTION_VERTICAL: DIRECTION_VERTICAL,\r\n    DIRECTION_ALL: DIRECTION_ALL,\r\n\r\n    Manager: Manager,\r\n    Input: Input,\r\n    TouchAction: TouchAction,\r\n\r\n    TouchInput: TouchInput,\r\n    MouseInput: MouseInput,\r\n    PointerEventInput: PointerEventInput,\r\n    TouchMouseInput: TouchMouseInput,\r\n    SingleTouchInput: SingleTouchInput,\r\n\r\n    Recognizer: Recognizer,\r\n    AttrRecognizer: AttrRecognizer,\r\n    Tap: TapRecognizer,\r\n    Pan: PanRecognizer,\r\n    Swipe: SwipeRecognizer,\r\n    Pinch: PinchRecognizer,\r\n    Rotate: RotateRecognizer,\r\n    Press: PressRecognizer,\r\n\r\n    on: addEventListeners,\r\n    off: removeEventListeners,\r\n    each: each,\r\n    merge: merge,\r\n    extend: extend,\r\n    inherit: inherit,\r\n    bindFn: bindFn,\r\n    prefixed: prefixed\r\n});\r\n\r\nif (typeof define == TYPE_FUNCTION && define.amd) {\r\n    define(function() {\r\n        return Hammer;\r\n    });\r\n} else if (typeof module != 'undefined' && module.exports) {\r\n    module.exports = Hammer;\r\n} else {\r\n    window[exportName] = Hammer;\r\n}\r\n\r\n})(window, document, 'Hammer');\r\n","// Snap.svg 0.3.0\n// \n// Copyright (c) 2013 – 2014 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// \n// build: 2014-09-08\n\n(function (glob, factory) {\n    // AMD support\n    if (typeof define === \"function\" && define.amd) {\n        // Define as an anonymous module\n        define([\"eve\"], function( eve ) {\n            return factory(glob, eve);\n        });\n    } else if (typeof exports !== 'undefined') {\n        // Next for Node.js or CommonJS\n        var eve = require(185);\n        module.exports = factory(glob, eve);\n    } else {\n        // Browser globals (glob is window)\n        // Snap adds itself to window\n        factory(glob, glob.eve);\n    }\n}(window || this, function (window, eve) {\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nvar mina = (function (eve) {\n    var animations = {},\n    requestAnimFrame = window.requestAnimationFrame       ||\n                       window.webkitRequestAnimationFrame ||\n                       window.mozRequestAnimationFrame    ||\n                       window.oRequestAnimationFrame      ||\n                       window.msRequestAnimationFrame     ||\n                       function (callback) {\n                           setTimeout(callback, 16);\n                       },\n    isArray = Array.isArray || function (a) {\n        return a instanceof Array ||\n            Object.prototype.toString.call(a) == \"[object Array]\";\n    },\n    idgen = 0,\n    idprefix = \"M\" + (+new Date).toString(36),\n    ID = function () {\n        return idprefix + (idgen++).toString(36);\n    },\n    diff = function (a, b, A, B) {\n        if (isArray(a)) {\n            res = [];\n            for (var i = 0, ii = a.length; i < ii; i++) {\n                res[i] = diff(a[i], b, A[i], B);\n            }\n            return res;\n        }\n        var dif = (A - a) / (B - b);\n        return function (bb) {\n            return a + dif * (bb - b);\n        };\n    },\n    timer = Date.now || function () {\n        return +new Date;\n    },\n    sta = function (val) {\n        var a = this;\n        if (val == null) {\n            return a.s;\n        }\n        var ds = a.s - val;\n        a.b += a.dur * ds;\n        a.B += a.dur * ds;\n        a.s = val;\n    },\n    speed = function (val) {\n        var a = this;\n        if (val == null) {\n            return a.spd;\n        }\n        a.spd = val;\n    },\n    duration = function (val) {\n        var a = this;\n        if (val == null) {\n            return a.dur;\n        }\n        a.s = a.s * val / a.dur;\n        a.dur = val;\n    },\n    stopit = function () {\n        var a = this;\n        delete animations[a.id];\n        a.update();\n        eve(\"mina.stop.\" + a.id, a);\n    },\n    pause = function () {\n        var a = this;\n        if (a.pdif) {\n            return;\n        }\n        delete animations[a.id];\n        a.update();\n        a.pdif = a.get() - a.b;\n    },\n    resume = function () {\n        var a = this;\n        if (!a.pdif) {\n            return;\n        }\n        a.b = a.get() - a.pdif;\n        delete a.pdif;\n        animations[a.id] = a;\n    },\n    update = function () {\n        var a = this,\n            res;\n        if (isArray(a.start)) {\n            res = [];\n            for (var j = 0, jj = a.start.length; j < jj; j++) {\n                res[j] = +a.start[j] +\n                    (a.end[j] - a.start[j]) * a.easing(a.s);\n            }\n        } else {\n            res = +a.start + (a.end - a.start) * a.easing(a.s);\n        }\n        a.set(res);\n    },\n    frame = function () {\n        var len = 0;\n        for (var i in animations) if (animations.hasOwnProperty(i)) {\n            var a = animations[i],\n                b = a.get(),\n                res;\n            len++;\n            a.s = (b - a.b) / (a.dur / a.spd);\n            if (a.s >= 1) {\n                delete animations[i];\n                a.s = 1;\n                len--;\n                (function (a) {\n                    setTimeout(function () {\n                        eve(\"mina.finish.\" + a.id, a);\n                    });\n                }(a));\n            }\n            a.update();\n        }\n        len && requestAnimFrame(frame);\n    },\n    /*/\n     * mina\n     [ method ]\n     **\n     * Generic animation of numbers\n     **\n     - a (number) start _slave_ number\n     - A (number) end _slave_ number\n     - b (number) start _master_ number (start time in general case)\n     - B (number) end _master_ number (end time in gereal case)\n     - get (function) getter of _master_ number (see @mina.time)\n     - set (function) setter of _slave_ number\n     - easing (function) #optional easing function, default is @mina.linear\n     = (object) animation descriptor\n     o {\n     o         id (string) animation id,\n     o         start (number) start _slave_ number,\n     o         end (number) end _slave_ number,\n     o         b (number) start _master_ number,\n     o         s (number) animation status (0..1),\n     o         dur (number) animation duration,\n     o         spd (number) animation speed,\n     o         get (function) getter of _master_ number (see @mina.time),\n     o         set (function) setter of _slave_ number,\n     o         easing (function) easing function, default is @mina.linear,\n     o         status (function) status getter/setter,\n     o         speed (function) speed getter/setter,\n     o         duration (function) duration getter/setter,\n     o         stop (function) animation stopper\n     o         pause (function) pauses the animation\n     o         resume (function) resumes the animation\n     o         update (function) calles setter with the right value of the animation\n     o }\n    /*/\n    mina = function (a, A, b, B, get, set, easing) {\n        var anim = {\n            id: ID(),\n            start: a,\n            end: A,\n            b: b,\n            s: 0,\n            dur: B - b,\n            spd: 1,\n            get: get,\n            set: set,\n            easing: easing || mina.linear,\n            status: sta,\n            speed: speed,\n            duration: duration,\n            stop: stopit,\n            pause: pause,\n            resume: resume,\n            update: update\n        };\n        animations[anim.id] = anim;\n        var len = 0, i;\n        for (i in animations) if (animations.hasOwnProperty(i)) {\n            len++;\n            if (len == 2) {\n                break;\n            }\n        }\n        len == 1 && requestAnimFrame(frame);\n        return anim;\n    };\n    /*/\n     * mina.time\n     [ method ]\n     **\n     * Returns the current time. Equivalent to:\n     | function () {\n     |     return (new Date).getTime();\n     | }\n    /*/\n    mina.time = timer;\n    /*/\n     * mina.getById\n     [ method ]\n     **\n     * Returns an animation by its id\n     - id (string) animation's id\n     = (object) See @mina\n    /*/\n    mina.getById = function (id) {\n        return animations[id] || null;\n    };\n\n    /*/\n     * mina.linear\n     [ method ]\n     **\n     * Default linear easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.linear = function (n) {\n        return n;\n    };\n    /*/\n     * mina.easeout\n     [ method ]\n     **\n     * Easeout easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.easeout = function (n) {\n        return Math.pow(n, 1.7);\n    };\n    /*/\n     * mina.easein\n     [ method ]\n     **\n     * Easein easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.easein = function (n) {\n        return Math.pow(n, .48);\n    };\n    /*/\n     * mina.easeinout\n     [ method ]\n     **\n     * Easeinout easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.easeinout = function (n) {\n        if (n == 1) {\n            return 1;\n        }\n        if (n == 0) {\n            return 0;\n        }\n        var q = .48 - n / 1.04,\n            Q = Math.sqrt(.1734 + q * q),\n            x = Q - q,\n            X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),\n            y = -Q - q,\n            Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),\n            t = X + Y + .5;\n        return (1 - t) * 3 * t * t + t * t * t;\n    };\n    /*/\n     * mina.backin\n     [ method ]\n     **\n     * Backin easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.backin = function (n) {\n        if (n == 1) {\n            return 1;\n        }\n        var s = 1.70158;\n        return n * n * ((s + 1) * n - s);\n    };\n    /*/\n     * mina.backout\n     [ method ]\n     **\n     * Backout easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.backout = function (n) {\n        if (n == 0) {\n            return 0;\n        }\n        n = n - 1;\n        var s = 1.70158;\n        return n * n * ((s + 1) * n + s) + 1;\n    };\n    /*/\n     * mina.elastic\n     [ method ]\n     **\n     * Elastic easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.elastic = function (n) {\n        if (n == !!n) {\n            return n;\n        }\n        return Math.pow(2, -10 * n) * Math.sin((n - .075) *\n            (2 * Math.PI) / .3) + 1;\n    };\n    /*/\n     * mina.bounce\n     [ method ]\n     **\n     * Bounce easing\n     - n (number) input 0..1\n     = (number) output 0..1\n    /*/\n    mina.bounce = function (n) {\n        var s = 7.5625,\n            p = 2.75,\n            l;\n        if (n < (1 / p)) {\n            l = s * n * n;\n        } else {\n            if (n < (2 / p)) {\n                n -= (1.5 / p);\n                l = s * n * n + .75;\n            } else {\n                if (n < (2.5 / p)) {\n                    n -= (2.25 / p);\n                    l = s * n * n + .9375;\n                } else {\n                    n -= (2.625 / p);\n                    l = s * n * n + .984375;\n                }\n            }\n        }\n        return l;\n    };\n    window.mina = mina;\n    return mina;\n})(typeof eve == \"undefined\" ? function () {} : eve);\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nvar Snap = (function(root) {\nSnap.version = \"0.3.0\";\n/*/\n * Snap\n [ method ]\n **\n * Creates a drawing surface or wraps existing SVG element.\n **\n - width (number|string) width of surface\n - height (number|string) height of surface\n * or\n - DOM (SVGElement) element to be wrapped into Snap structure\n * or\n - array (array) array of elements (will return set of elements)\n * or\n - query (string) CSS query selector\n = (object) @Element\n/*/\nfunction Snap(w, h) {\n    if (w) {\n        if (w.tagName) {\n            return wrap(w);\n        }\n        if (is(w, \"array\") && Snap.set) {\n            return Snap.set.apply(Snap, w);\n        }\n        if (w instanceof Element) {\n            return w;\n        }\n        if (h == null) {\n            w = glob.doc.querySelector(w);\n            return wrap(w);\n        }\n    }\n    w = w == null ? \"100%\" : w;\n    h = h == null ? \"100%\" : h;\n    return new Paper(w, h);\n}\nSnap.toString = function () {\n    return \"Snap v\" + this.version;\n};\nSnap._ = {};\nvar glob = {\n    win: root.window,\n    doc: root.window.document\n};\nSnap._.glob = glob;\nvar has = \"hasOwnProperty\",\n    Str = String,\n    toFloat = parseFloat,\n    toInt = parseInt,\n    math = Math,\n    mmax = math.max,\n    mmin = math.min,\n    abs = math.abs,\n    pow = math.pow,\n    PI = math.PI,\n    round = math.round,\n    E = \"\",\n    S = \" \",\n    objectToString = Object.prototype.toString,\n    ISURL = /^url/(['\"]?([^/)]+?)['\"]?/)$/i,\n    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,\n    bezierrg = /^(?:cubic-)?bezier/(([^,]+),([^,]+),([^,]+),([^/)]+)/)/,\n    reURLValue = /^url/(#?([^)]+)/)$/,\n    separator = Snap._.separator = /[,/s]+/,\n    whitespace = /[/s]/g,\n    commaSpaces = /[/s]*,[/s]*/,\n    hsrg = {hs: 1, rg: 1},\n    pathCommand = /([a-z])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n    tCommand = /([rstm])[/s,]*((-?/d*/.?/d*(?:e[/-+]?/d+)?[/s]*,?[/s]*)+)/ig,\n    pathValues = /(-?/d*/.?/d*(?:e[/-+]?//d+)?)[/s]*,?[/s]*/ig,\n    idgen = 0,\n    idprefix = \"S\" + (+new Date).toString(36),\n    ID = function (el) {\n        return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);\n    },\n    xlink = \"http://www.w3.org/1999/xlink\",\n    xmlns = \"http://www.w3.org/2000/svg\",\n    hub = {},\n    URL = Snap.url = function (url) {\n        return \"url('#\" + url + \"')\";\n    };\n\nfunction $(el, attr) {\n    if (attr) {\n        if (el == \"#text\") {\n            el = glob.doc.createTextNode(attr.text || \"\");\n        }\n        if (typeof el == \"string\") {\n            el = $(el);\n        }\n        if (typeof attr == \"string\") {\n            if (attr.substring(0, 6) == \"xlink:\") {\n                return el.getAttributeNS(xlink, attr.substring(6));\n            }\n            if (attr.substring(0, 4) == \"xml:\") {\n                return el.getAttributeNS(xmlns, attr.substring(4));\n            }\n            return el.getAttribute(attr);\n        }\n        for (var key in attr) if (attr[has](key)) {\n            var val = Str(attr[key]);\n            if (val) {\n                if (key.substring(0, 6) == \"xlink:\") {\n                    el.setAttributeNS(xlink, key.substring(6), val);\n                } else if (key.substring(0, 4) == \"xml:\") {\n                    el.setAttributeNS(xmlns, key.substring(4), val);\n                } else {\n                    el.setAttribute(key, val);\n                }\n            } else {\n                el.removeAttribute(key);\n            }\n        }\n    } else {\n        el = glob.doc.createElementNS(xmlns, el);\n    }\n    return el;\n}\nSnap._.$ = $;\nSnap._.id = ID;\nfunction getAttrs(el) {\n    var attrs = el.attributes,\n        name,\n        out = {};\n    for (var i = 0; i < attrs.length; i++) {\n        if (attrs[i].namespaceURI == xlink) {\n            name = \"xlink:\";\n        } else {\n            name = \"\";\n        }\n        name += attrs[i].name;\n        out[name] = attrs[i].textContent;\n    }\n    return out;\n}\nfunction is(o, type) {\n    type = Str.prototype.toLowerCase.call(type);\n    if (type == \"finite\") {\n        return isFinite(o);\n    }\n    if (type == \"array\" &&\n        (o instanceof Array || Array.isArray && Array.isArray(o))) {\n        return true;\n    }\n    return  (type == \"null\" && o === null) ||\n            (type == typeof o && o !== null) ||\n            (type == \"object\" && o === Object(o)) ||\n            objectToString.call(o).slice(8, -1).toLowerCase() == type;\n}\n/*/\n * Snap.format\n [ method ]\n **\n * Replaces construction of type `{<name>}` to the corresponding argument\n **\n - token (string) string to format\n - json (object) object which properties are used as a replacement\n = (string) formatted string\n > Usage\n | // this draws a rectangular shape equivalent to \"M10,20h40v50h-40z\"\n | paper.path(Snap.format(\"M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z\", {\n |     x: 10,\n |     y: 20,\n |     dim: {\n |         width: 40,\n |         height: 50,\n |         \"negative width\": -40\n |     }\n | }));\n/*/\nSnap.format = (function () {\n    var tokenRegex = //{([^/}]+)/}/g,\n        objNotationRegex = /(?:(?:^|/.)(.+?)(?=/[|/.|$|/()|/[('|\")(.+?)/2/])(/(/))?/g, // matches .xxxxx or [\"xxxxx\"] to run over object properties\n        replacer = function (all, key, obj) {\n            var res = obj;\n            key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {\n                name = name || quotedName;\n                if (res) {\n                    if (name in res) {\n                        res = res[name];\n                    }\n                    typeof res == \"function\" && isFunc && (res = res());\n                }\n            });\n            res = (res == null || res == obj ? all : res) + \"\";\n            return res;\n        };\n    return function (str, obj) {\n        return Str(str).replace(tokenRegex, function (all, key) {\n            return replacer(all, key, obj);\n        });\n    };\n})();\nfunction clone(obj) {\n    if (typeof obj == \"function\" || Object(obj) !== obj) {\n        return obj;\n    }\n    var res = new obj.constructor;\n    for (var key in obj) if (obj[has](key)) {\n        res[key] = clone(obj[key]);\n    }\n    return res;\n}\nSnap._.clone = clone;\nfunction repush(array, item) {\n    for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) {\n        return array.push(array.splice(i, 1)[0]);\n    }\n}\nfunction cacher(f, scope, postprocessor) {\n    function newf() {\n        var arg = Array.prototype.slice.call(arguments, 0),\n            args = arg.join(\"/u2400\"),\n            cache = newf.cache = newf.cache || {},\n            count = newf.count = newf.count || [];\n        if (cache[has](args)) {\n            repush(count, args);\n            return postprocessor ? postprocessor(cache[args]) : cache[args];\n        }\n        count.length >= 1e3 && delete cache[count.shift()];\n        count.push(args);\n        cache[args] = f.apply(scope, arg);\n        return postprocessor ? postprocessor(cache[args]) : cache[args];\n    }\n    return newf;\n}\nSnap._.cacher = cacher;\nfunction angle(x1, y1, x2, y2, x3, y3) {\n    if (x3 == null) {\n        var x = x1 - x2,\n            y = y1 - y2;\n        if (!x && !y) {\n            return 0;\n        }\n        return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;\n    } else {\n        return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);\n    }\n}\nfunction rad(deg) {\n    return deg % 360 * PI / 180;\n}\nfunction deg(rad) {\n    return rad * 180 / PI % 360;\n}\nfunction x_y() {\n    return this.x + S + this.y;\n}\nfunction x_y_w_h() {\n    return this.x + S + this.y + S + this.width + \" /xd7 \" + this.height;\n}\n\n/*/\n * Snap.rad\n [ method ]\n **\n * Transform angle to radians\n - deg (number) angle in degrees\n = (number) angle in radians\n/*/\nSnap.rad = rad;\n/*/\n * Snap.deg\n [ method ]\n **\n * Transform angle to degrees\n - rad (number) angle in radians\n = (number) angle in degrees\n/*/\nSnap.deg = deg;\n/*/\n * Snap.angle\n [ method ]\n **\n * Returns an angle between two or three points\n > Parameters\n - x1 (number) x coord of first point\n - y1 (number) y coord of first point\n - x2 (number) x coord of second point\n - y2 (number) y coord of second point\n - x3 (number) #optional x coord of third point\n - y3 (number) #optional y coord of third point\n = (number) angle in degrees\n/*/\nSnap.angle = angle;\n/*/\n * Snap.is\n [ method ]\n **\n * Handy replacement for the `typeof` operator\n - o (…) any object or primitive\n - type (string) name of the type, e.g., `string`, `function`, `number`, etc.\n = (boolean) `true` if given value is of given type\n/*/\nSnap.is = is;\n/*/\n * Snap.snapTo\n [ method ]\n **\n * Snaps given value to given grid\n - values (array|number) given array of values or step of the grid\n - value (number) value to adjust\n - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`.\n = (number) adjusted value\n/*/\nSnap.snapTo = function (values, value, tolerance) {\n    tolerance = is(tolerance, \"finite\") ? tolerance : 10;\n    if (is(values, \"array\")) {\n        var i = values.length;\n        while (i--) if (abs(values[i] - value) <= tolerance) {\n            return values[i];\n        }\n    } else {\n        values = +values;\n        var rem = value % values;\n        if (rem < tolerance) {\n            return value - rem;\n        }\n        if (rem > values - tolerance) {\n            return value - rem + values;\n        }\n    }\n    return value;\n};\n// Colour\n/*/\n * Snap.getRGB\n [ method ]\n **\n * Parses color string as RGB object\n - color (string) color string in one of the following formats:\n # <ul>\n #     <li>Color name (<code>red</code>, <code>green</code>, <code>cornflowerblue</code>, etc)</li>\n #     <li>#••• — shortened HTML color: (<code>#000</code>, <code>#fc0</code>, etc.)</li>\n #     <li>#•••••• — full length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li>\n #     <li>rgb(•••, •••, •••) — red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li>\n #     <li>rgba(•••, •••, •••, •••) — also with opacity</li>\n #     <li>rgb(•••%, •••%, •••%) — same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li>\n #     <li>rgba(•••%, •••%, •••%, •••%) — also with opacity</li>\n #     <li>hsb(•••, •••, •••) — hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li>\n #     <li>hsba(•••, •••, •••, •••) — also with opacity</li>\n #     <li>hsb(•••%, •••%, •••%) — same as above, but in %</li>\n #     <li>hsba(•••%, •••%, •••%, •••%) — also with opacity</li>\n #     <li>hsl(•••, •••, •••) — hue, saturation and luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li>\n #     <li>hsla(•••, •••, •••, •••) — also with opacity</li>\n #     <li>hsl(•••%, •••%, •••%) — same as above, but in %</li>\n #     <li>hsla(•••%, •••%, •••%, •••%) — also with opacity</li>\n # </ul>\n * Note that `%` can be used any time: `rgb(20%, 255, 50%)`.\n = (object) RGB object in the following format:\n o {\n o     r (number) red,\n o     g (number) green,\n o     b (number) blue,\n o     hex (string) color in HTML/CSS format: #••••••,\n o     error (boolean) true if string can't be parsed\n o }\n/*/\nSnap.getRGB = cacher(function (colour) {\n    if (!colour || !!((colour = Str(colour)).indexOf(\"-\") + 1)) {\n        return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n    }\n    if (colour == \"none\") {\n        return {r: -1, g: -1, b: -1, hex: \"none\", toString: rgbtoString};\n    }\n    !(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == \"#\") && (colour = toHex(colour));\n    if (!colour) {\n        return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n    }\n    var res,\n        red,\n        green,\n        blue,\n        opacity,\n        t,\n        values,\n        rgb = colour.match(colourRegExp);\n    if (rgb) {\n        if (rgb[2]) {\n            blue = toInt(rgb[2].substring(5), 16);\n            green = toInt(rgb[2].substring(3, 5), 16);\n            red = toInt(rgb[2].substring(1, 3), 16);\n        }\n        if (rgb[3]) {\n            blue = toInt((t = rgb[3].charAt(3)) + t, 16);\n            green = toInt((t = rgb[3].charAt(2)) + t, 16);\n            red = toInt((t = rgb[3].charAt(1)) + t, 16);\n        }\n        if (rgb[4]) {\n            values = rgb[4].split(commaSpaces);\n            red = toFloat(values[0]);\n            values[0].slice(-1) == \"%\" && (red *= 2.55);\n            green = toFloat(values[1]);\n            values[1].slice(-1) == \"%\" && (green *= 2.55);\n            blue = toFloat(values[2]);\n            values[2].slice(-1) == \"%\" && (blue *= 2.55);\n            rgb[1].toLowerCase().slice(0, 4) == \"rgba\" && (opacity = toFloat(values[3]));\n            values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n        }\n        if (rgb[5]) {\n            values = rgb[5].split(commaSpaces);\n            red = toFloat(values[0]);\n            values[0].slice(-1) == \"%\" && (red /= 100);\n            green = toFloat(values[1]);\n            values[1].slice(-1) == \"%\" && (green /= 100);\n            blue = toFloat(values[2]);\n            values[2].slice(-1) == \"%\" && (blue /= 100);\n            (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n            rgb[1].toLowerCase().slice(0, 4) == \"hsba\" && (opacity = toFloat(values[3]));\n            values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n            return Snap.hsb2rgb(red, green, blue, opacity);\n        }\n        if (rgb[6]) {\n            values = rgb[6].split(commaSpaces);\n            red = toFloat(values[0]);\n            values[0].slice(-1) == \"%\" && (red /= 100);\n            green = toFloat(values[1]);\n            values[1].slice(-1) == \"%\" && (green /= 100);\n            blue = toFloat(values[2]);\n            values[2].slice(-1) == \"%\" && (blue /= 100);\n            (values[0].slice(-3) == \"deg\" || values[0].slice(-1) == \"/xb0\") && (red /= 360);\n            rgb[1].toLowerCase().slice(0, 4) == \"hsla\" && (opacity = toFloat(values[3]));\n            values[3] && values[3].slice(-1) == \"%\" && (opacity /= 100);\n            return Snap.hsl2rgb(red, green, blue, opacity);\n        }\n        red = mmin(math.round(red), 255);\n        green = mmin(math.round(green), 255);\n        blue = mmin(math.round(blue), 255);\n        opacity = mmin(mmax(opacity, 0), 1);\n        rgb = {r: red, g: green, b: blue, toString: rgbtoString};\n        rgb.hex = \"#\" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);\n        rgb.opacity = is(opacity, \"finite\") ? opacity : 1;\n        return rgb;\n    }\n    return {r: -1, g: -1, b: -1, hex: \"none\", error: 1, toString: rgbtoString};\n}, Snap);\n// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.\n/*/\n * Snap.hsb\n [ method ]\n **\n * Converts HSB values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - b (number) value or brightness\n = (string) hex representation of the color\n/*/\nSnap.hsb = cacher(function (h, s, b) {\n    return Snap.hsb2rgb(h, s, b).hex;\n});\n/*/\n * Snap.hsl\n [ method ]\n **\n * Converts HSL values to a hex representation of the color\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (string) hex representation of the color\n/*/\nSnap.hsl = cacher(function (h, s, l) {\n    return Snap.hsl2rgb(h, s, l).hex;\n});\n/*/\n * Snap.rgb\n [ method ]\n **\n * Converts RGB values to a hex representation of the color\n - r (number) red\n - g (number) green\n - b (number) blue\n = (string) hex representation of the color\n/*/\nSnap.rgb = cacher(function (r, g, b, o) {\n    if (is(o, \"finite\")) {\n        var round = math.round;\n        return \"rgba(\" + [round(r), round(g), round(b), +o.toFixed(2)] + \")\";\n    }\n    return \"#\" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);\n});\nvar toHex = function (color) {\n    var i = glob.doc.getElementsByTagName(\"head\")[0] || glob.doc.getElementsByTagName(\"svg\")[0],\n        red = \"rgb(255, 0, 0)\";\n    toHex = cacher(function (color) {\n        if (color.toLowerCase() == \"red\") {\n            return red;\n        }\n        i.style.color = red;\n        i.style.color = color;\n        var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue(\"color\");\n        return out == red ? null : out;\n    });\n    return toHex(color);\n},\nhsbtoString = function () {\n    return \"hsb(\" + [this.h, this.s, this.b] + \")\";\n},\nhsltoString = function () {\n    return \"hsl(\" + [this.h, this.s, this.l] + \")\";\n},\nrgbtoString = function () {\n    return this.opacity == 1 || this.opacity == null ?\n            this.hex :\n            \"rgba(\" + [this.r, this.g, this.b, this.opacity] + \")\";\n},\nprepareRGB = function (r, g, b) {\n    if (g == null && is(r, \"object\") && \"r\" in r && \"g\" in r && \"b\" in r) {\n        b = r.b;\n        g = r.g;\n        r = r.r;\n    }\n    if (g == null && is(r, string)) {\n        var clr = Snap.getRGB(r);\n        r = clr.r;\n        g = clr.g;\n        b = clr.b;\n    }\n    if (r > 1 || g > 1 || b > 1) {\n        r /= 255;\n        g /= 255;\n        b /= 255;\n    }\n\n    return [r, g, b];\n},\npackageRGB = function (r, g, b, o) {\n    r = math.round(r * 255);\n    g = math.round(g * 255);\n    b = math.round(b * 255);\n    var rgb = {\n        r: r,\n        g: g,\n        b: b,\n        opacity: is(o, \"finite\") ? o : 1,\n        hex: Snap.rgb(r, g, b),\n        toString: rgbtoString\n    };\n    is(o, \"finite\") && (rgb.opacity = o);\n    return rgb;\n};\n// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()?\n/*/\n * Snap.color\n [ method ]\n **\n * Parses the color string and returns an object featuring the color's component values\n - clr (string) color string in one of the supported formats (see @Snap.getRGB)\n = (object) Combined RGB/HSB object in the following format:\n o {\n o     r (number) red,\n o     g (number) green,\n o     b (number) blue,\n o     hex (string) color in HTML/CSS format: #••••••,\n o     error (boolean) `true` if string can't be parsed,\n o     h (number) hue,\n o     s (number) saturation,\n o     v (number) value (brightness),\n o     l (number) lightness\n o }\n/*/\nSnap.color = function (clr) {\n    var rgb;\n    if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"b\" in clr) {\n        rgb = Snap.hsb2rgb(clr);\n        clr.r = rgb.r;\n        clr.g = rgb.g;\n        clr.b = rgb.b;\n        clr.opacity = 1;\n        clr.hex = rgb.hex;\n    } else if (is(clr, \"object\") && \"h\" in clr && \"s\" in clr && \"l\" in clr) {\n        rgb = Snap.hsl2rgb(clr);\n        clr.r = rgb.r;\n        clr.g = rgb.g;\n        clr.b = rgb.b;\n        clr.opacity = 1;\n        clr.hex = rgb.hex;\n    } else {\n        if (is(clr, \"string\")) {\n            clr = Snap.getRGB(clr);\n        }\n        if (is(clr, \"object\") && \"r\" in clr && \"g\" in clr && \"b\" in clr && !(\"error\" in clr)) {\n            rgb = Snap.rgb2hsl(clr);\n            clr.h = rgb.h;\n            clr.s = rgb.s;\n            clr.l = rgb.l;\n            rgb = Snap.rgb2hsb(clr);\n            clr.v = rgb.b;\n        } else {\n            clr = {hex: \"none\"};\n            clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;\n            clr.error = 1;\n        }\n    }\n    clr.toString = rgbtoString;\n    return clr;\n};\n/*/\n * Snap.hsb2rgb\n [ method ]\n **\n * Converts HSB values to an RGB object\n - h (number) hue\n - s (number) saturation\n - v (number) value or brightness\n = (object) RGB object in the following format:\n o {\n o     r (number) red,\n o     g (number) green,\n o     b (number) blue,\n o     hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsb2rgb = function (h, s, v, o) {\n    if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"b\" in h) {\n        v = h.b;\n        s = h.s;\n        h = h.h;\n        o = h.o;\n    }\n    h *= 360;\n    var R, G, B, X, C;\n    h = (h % 360) / 60;\n    C = v * s;\n    X = C * (1 - abs(h % 2 - 1));\n    R = G = B = v - C;\n\n    h = ~~h;\n    R += [C, X, 0, 0, X, C][h];\n    G += [X, C, C, X, 0, 0][h];\n    B += [0, 0, X, C, C, X][h];\n    return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.hsl2rgb\n [ method ]\n **\n * Converts HSL values to an RGB object\n - h (number) hue\n - s (number) saturation\n - l (number) luminosity\n = (object) RGB object in the following format:\n o {\n o     r (number) red,\n o     g (number) green,\n o     b (number) blue,\n o     hex (string) color in HTML/CSS format: #••••••\n o }\n/*/\nSnap.hsl2rgb = function (h, s, l, o) {\n    if (is(h, \"object\") && \"h\" in h && \"s\" in h && \"l\" in h) {\n        l = h.l;\n        s = h.s;\n        h = h.h;\n    }\n    if (h > 1 || s > 1 || l > 1) {\n        h /= 360;\n        s /= 100;\n        l /= 100;\n    }\n    h *= 360;\n    var R, G, B, X, C;\n    h = (h % 360) / 60;\n    C = 2 * s * (l < .5 ? l : 1 - l);\n    X = C * (1 - abs(h % 2 - 1));\n    R = G = B = l - C / 2;\n\n    h = ~~h;\n    R += [C, X, 0, 0, X, C][h];\n    G += [X, C, C, X, 0, 0][h];\n    B += [0, 0, X, C, C, X][h];\n    return packageRGB(R, G, B, o);\n};\n/*/\n * Snap.rgb2hsb\n [ method ]\n **\n * Converts RGB values to an HSB object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSB object in the following format:\n o {\n o     h (number) hue,\n o     s (number) saturation,\n o     b (number) brightness\n o }\n/*/\nSnap.rgb2hsb = function (r, g, b) {\n    b = prepareRGB(r, g, b);\n    r = b[0];\n    g = b[1];\n    b = b[2];\n\n    var H, S, V, C;\n    V = mmax(r, g, b);\n    C = V - mmin(r, g, b);\n    H = (C == 0 ? null :\n         V == r ? (g - b) / C :\n         V == g ? (b - r) / C + 2 :\n                  (r - g) / C + 4\n        );\n    H = ((H + 360) % 6) * 60 / 360;\n    S = C == 0 ? 0 : C / V;\n    return {h: H, s: S, b: V, toString: hsbtoString};\n};\n/*/\n * Snap.rgb2hsl\n [ method ]\n **\n * Converts RGB values to an HSL object\n - r (number) red\n - g (number) green\n - b (number) blue\n = (object) HSL object in the following format:\n o {\n o     h (number) hue,\n o     s (number) saturation,\n o     l (number) luminosity\n o }\n/*/\nSnap.rgb2hsl = function (r, g, b) {\n    b = prepareRGB(r, g, b);\n    r = b[0];\n    g = b[1];\n    b = b[2];\n\n    var H, S, L, M, m, C;\n    M = mmax(r, g, b);\n    m = mmin(r, g, b);\n    C = M - m;\n    H = (C == 0 ? null :\n         M == r ? (g - b) / C :\n         M == g ? (b - r) / C + 2 :\n                  (r - g) / C + 4);\n    H = ((H + 360) % 6) * 60 / 360;\n    L = (M + m) / 2;\n    S = (C == 0 ? 0 :\n         L < .5 ? C / (2 * L) :\n                  C / (2 - 2 * L));\n    return {h: H, s: S, l: L, toString: hsltoString};\n};\n\n// Transformations\n// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ [\"M10,10\",\"L90,90\"], [\"M90,10\",\"L10,90\"] ] Otherwise how is each command structured?\n/*/\n * Snap.parsePathString\n [ method ]\n **\n * Utility method\n **\n * Parses given path string into an array of arrays of path segments\n - pathString (string|array) path string or array of segments (in the last case it is returned straight away)\n = (array) array of segments\n/*/\nSnap.parsePathString = function (pathString) {\n    if (!pathString) {\n        return null;\n    }\n    var pth = Snap.path(pathString);\n    if (pth.arr) {\n        return Snap.path.clone(pth.arr);\n    }\n\n    var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},\n        data = [];\n    if (is(pathString, \"array\") && is(pathString[0], \"array\")) { // rough assumption\n        data = Snap.path.clone(pathString);\n    }\n    if (!data.length) {\n        Str(pathString).replace(pathCommand, function (a, b, c) {\n            var params = [],\n                name = b.toLowerCase();\n            c.replace(pathValues, function (a, b) {\n                b && params.push(+b);\n            });\n            if (name == \"m\" && params.length > 2) {\n                data.push([b].concat(params.splice(0, 2)));\n                name = \"l\";\n                b = b == \"m\" ? \"l\" : \"L\";\n            }\n            if (name == \"o\" && params.length == 1) {\n                data.push([b, params[0]]);\n            }\n            if (name == \"r\") {\n                data.push([b].concat(params));\n            } else while (params.length >= paramCounts[name]) {\n                data.push([b].concat(params.splice(0, paramCounts[name])));\n                if (!paramCounts[name]) {\n                    break;\n                }\n            }\n        });\n    }\n    data.toString = Snap.path.toString;\n    pth.arr = Snap.path.clone(data);\n    return data;\n};\n/*/\n * Snap.parseTransformString\n [ method ]\n **\n * Utility method\n **\n * Parses given transform string into an array of transformations\n - TString (string|array) transform string or array of transformations (in the last case it is returned straight away)\n = (array) array of transformations\n/*/\nvar parseTransformString = Snap.parseTransformString = function (TString) {\n    if (!TString) {\n        return null;\n    }\n    var paramCounts = {r: 3, s: 4, t: 2, m: 6},\n        data = [];\n    if (is(TString, \"array\") && is(TString[0], \"array\")) { // rough assumption\n        data = Snap.path.clone(TString);\n    }\n    if (!data.length) {\n        Str(TString).replace(tCommand, function (a, b, c) {\n            var params = [],\n                name = b.toLowerCase();\n            c.replace(pathValues, function (a, b) {\n                b && params.push(+b);\n            });\n            data.push([b].concat(params));\n        });\n    }\n    data.toString = Snap.path.toString;\n    return data;\n};\nfunction svgTransform2string(tstr) {\n    var res = [];\n    tstr = tstr.replace(/(?:^|/s)(/w+)/(([^)]+)/)/g, function (all, name, params) {\n        params = params.split(//s*,/s*|/s+/);\n        if (name == \"rotate\" && params.length == 1) {\n            params.push(0, 0);\n        }\n        if (name == \"scale\") {\n            if (params.length > 2) {\n                params = params.slice(0, 2);\n            } else if (params.length == 2) {\n                params.push(0, 0);\n            }\n            if (params.length == 1) {\n                params.push(params[0], 0, 0);\n            }\n        }\n        if (name == \"skewX\") {\n            res.push([\"m\", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);\n        } else if (name == \"skewY\") {\n            res.push([\"m\", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);\n        } else {\n            res.push([name.charAt(0)].concat(params));\n        }\n        return all;\n    });\n    return res;\n}\nSnap._.svgTransform2string = svgTransform2string;\nSnap._.rgTransform = /^[a-z][/s]*-?/.?/d/i;\nfunction transform2matrix(tstr, bbox) {\n    var tdata = parseTransformString(tstr),\n        m = new Snap.Matrix;\n    if (tdata) {\n        for (var i = 0, ii = tdata.length; i < ii; i++) {\n            var t = tdata[i],\n                tlen = t.length,\n                command = Str(t[0]).toLowerCase(),\n                absolute = t[0] != command,\n                inver = absolute ? m.invert() : 0,\n                x1,\n                y1,\n                x2,\n                y2,\n                bb;\n            if (command == \"t\" && tlen == 2){\n                m.translate(t[1], 0);\n            } else if (command == \"t\" && tlen == 3) {\n                if (absolute) {\n                    x1 = inver.x(0, 0);\n                    y1 = inver.y(0, 0);\n                    x2 = inver.x(t[1], t[2]);\n                    y2 = inver.y(t[1], t[2]);\n                    m.translate(x2 - x1, y2 - y1);\n                } else {\n                    m.translate(t[1], t[2]);\n                }\n            } else if (command == \"r\") {\n                if (tlen == 2) {\n                    bb = bb || bbox;\n                    m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n                } else if (tlen == 4) {\n                    if (absolute) {\n                        x2 = inver.x(t[2], t[3]);\n                        y2 = inver.y(t[2], t[3]);\n                        m.rotate(t[1], x2, y2);\n                    } else {\n                        m.rotate(t[1], t[2], t[3]);\n                    }\n                }\n            } else if (command == \"s\") {\n                if (tlen == 2 || tlen == 3) {\n                    bb = bb || bbox;\n                    m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);\n                } else if (tlen == 4) {\n                    if (absolute) {\n                        x2 = inver.x(t[2], t[3]);\n                        y2 = inver.y(t[2], t[3]);\n                        m.scale(t[1], t[1], x2, y2);\n                    } else {\n                        m.scale(t[1], t[1], t[2], t[3]);\n                    }\n                } else if (tlen == 5) {\n                    if (absolute) {\n                        x2 = inver.x(t[3], t[4]);\n                        y2 = inver.y(t[3], t[4]);\n                        m.scale(t[1], t[2], x2, y2);\n                    } else {\n                        m.scale(t[1], t[2], t[3], t[4]);\n                    }\n                }\n            } else if (command == \"m\" && tlen == 7) {\n                m.add(t[1], t[2], t[3], t[4], t[5], t[6]);\n            }\n        }\n    }\n    return m;\n}\nSnap._.transform2matrix = transform2matrix;\nSnap._unit2px = unit2px;\nvar contains = glob.doc.contains || glob.doc.compareDocumentPosition ?\n    function (a, b) {\n        var adown = a.nodeType == 9 ? a.documentElement : a,\n            bup = b && b.parentNode;\n            return a == bup || !!(bup && bup.nodeType == 1 && (\n                adown.contains ?\n                    adown.contains(bup) :\n                    a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16\n            ));\n    } :\n    function (a, b) {\n        if (b) {\n            while (b) {\n                b = b.parentNode;\n                if (b == a) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    };\nfunction getSomeDefs(el) {\n    var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||\n            (el.node.parentNode && wrap(el.node.parentNode)) ||\n            Snap.select(\"svg\") ||\n            Snap(0, 0),\n        pdefs = p.select(\"defs\"),\n        defs  = pdefs == null ? false : pdefs.node;\n    if (!defs) {\n        defs = make(\"defs\", p.node).node;\n    }\n    return defs;\n}\nfunction getSomeSVG(el) {\n    return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select(\"svg\");\n}\nSnap._.getSomeDefs = getSomeDefs;\nSnap._.getSomeSVG = getSomeSVG;\nfunction unit2px(el, name, value) {\n    var svg = getSomeSVG(el).node,\n        out = {},\n        mgr = svg.querySelector(\".svg---mgr\");\n    if (!mgr) {\n        mgr = $(\"rect\");\n        $(mgr, {x: -9e9, y: -9e9, width: 10, height: 10, \"class\": \"svg---mgr\", fill: \"none\"});\n        svg.appendChild(mgr);\n    }\n    function getW(val) {\n        if (val == null) {\n            return E;\n        }\n        if (val == +val) {\n            return val;\n        }\n        $(mgr, {width: val});\n        try {\n            return mgr.getBBox().width;\n        } catch (e) {\n            return 0;\n        }\n    }\n    function getH(val) {\n        if (val == null) {\n            return E;\n        }\n        if (val == +val) {\n            return val;\n        }\n        $(mgr, {height: val});\n        try {\n            return mgr.getBBox().height;\n        } catch (e) {\n            return 0;\n        }\n    }\n    function set(nam, f) {\n        if (name == null) {\n            out[nam] = f(el.attr(nam) || 0);\n        } else if (nam == name) {\n            out = f(value == null ? el.attr(nam) || 0 : value);\n        }\n    }\n    switch (el.type) {\n        case \"rect\":\n            set(\"rx\", getW);\n            set(\"ry\", getH);\n        case \"image\":\n            set(\"width\", getW);\n            set(\"height\", getH);\n        case \"text\":\n            set(\"x\", getW);\n            set(\"y\", getH);\n        break;\n        case \"circle\":\n            set(\"cx\", getW);\n            set(\"cy\", getH);\n            set(\"r\", getW);\n        break;\n        case \"ellipse\":\n            set(\"cx\", getW);\n            set(\"cy\", getH);\n            set(\"rx\", getW);\n            set(\"ry\", getH);\n        break;\n        case \"line\":\n            set(\"x1\", getW);\n            set(\"x2\", getW);\n            set(\"y1\", getH);\n            set(\"y2\", getH);\n        break;\n        case \"marker\":\n            set(\"refX\", getW);\n            set(\"markerWidth\", getW);\n            set(\"refY\", getH);\n            set(\"markerHeight\", getH);\n        break;\n        case \"radialGradient\":\n            set(\"fx\", getW);\n            set(\"fy\", getH);\n        break;\n        case \"tspan\":\n            set(\"dx\", getW);\n            set(\"dy\", getH);\n        break;\n        default:\n            set(name, getW);\n    }\n    svg.removeChild(mgr);\n    return out;\n}\n/*/\n * Snap.select\n [ method ]\n **\n * Wraps a DOM element specified by CSS selector as @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.select = function (query) {\n    query = Str(query).replace(/([^//]):/g, \"$1//:\");\n    return wrap(glob.doc.querySelector(query));\n};\n/*/\n * Snap.selectAll\n [ method ]\n **\n * Wraps DOM elements specified by CSS selector as set or array of @Element\n - query (string) CSS selector of the element\n = (Element) the current element\n/*/\nSnap.selectAll = function (query) {\n    var nodelist = glob.doc.querySelectorAll(query),\n        set = (Snap.set || Array)();\n    for (var i = 0; i < nodelist.length; i++) {\n        set.push(wrap(nodelist[i]));\n    }\n    return set;\n};\n\nfunction add2group(list) {\n    if (!is(list, \"array\")) {\n        list = Array.prototype.slice.call(arguments, 0);\n    }\n    var i = 0,\n        j = 0,\n        node = this.node;\n    while (this[i]) delete this[i++];\n    for (i = 0; i < list.length; i++) {\n        if (list[i].type == \"set\") {\n            list[i].forEach(function (el) {\n                node.appendChild(el.node);\n            });\n        } else {\n            node.appendChild(list[i].node);\n        }\n    }\n    var children = node.childNodes;\n    for (i = 0; i < children.length; i++) {\n        this[j++] = wrap(children[i]);\n    }\n    return this;\n}\n// Hub garbage collector every 10s\nsetInterval(function () {\n    for (var key in hub) if (hub[has](key)) {\n        var el = hub[key],\n            node = el.node;\n        if (el.type != \"svg\" && !node.ownerSVGElement || el.type == \"svg\" && (!node.parentNode || \"ownerSVGElement\" in node.parentNode && !node.ownerSVGElement)) {\n            delete hub[key];\n        }\n    }\n}, 1e4);\nfunction Element(el) {\n    if (el.snap in hub) {\n        return hub[el.snap];\n    }\n    var svg;\n    try {\n        svg = el.ownerSVGElement;\n    } catch(e) {}\n    /*/\n     * Element.node\n     [ property (object) ]\n     **\n     * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.\n     > Usage\n     | // draw a circle at coordinate 10,10 with radius of 10\n     | var c = paper.circle(10, 10, 10);\n     | c.node.onclick = function () {\n     |     c.attr(\"fill\", \"red\");\n     | };\n    /*/\n    this.node = el;\n    if (svg) {\n        this.paper = new Paper(svg);\n    }\n    /*/\n     * Element.type\n     [ property (string) ]\n     **\n     * SVG tag name of the given element.\n    /*/\n    this.type = el.tagName;\n    var id = this.id = ID(this);\n    this.anims = {};\n    this._ = {\n        transform: []\n    };\n    el.snap = id;\n    hub[id] = this;\n    if (this.type == \"g\") {\n        this.add = add2group;\n    }\n    if (this.type in {g: 1, mask: 1, pattern: 1, symbol: 1}) {\n        for (var method in Paper.prototype) if (Paper.prototype[has](method)) {\n            this[method] = Paper.prototype[method];\n        }\n    }\n}\n   /*/\n     * Element.attr\n     [ method ]\n     **\n     * Gets or sets given attributes of the element.\n     **\n     - params (object) contains key-value pairs of attributes you want to set\n     * or\n     - param (string) name of the attribute\n     = (Element) the current element\n     * or\n     = (string) value of attribute\n     > Usage\n     | el.attr({\n     |     fill: \"#fc0\",\n     |     stroke: \"#000\",\n     |     strokeWidth: 2, // CamelCase...\n     |     \"fill-opacity\": 0.5, // or dash-separated names\n     |     width: \"*=2\" // prefixed values\n     | });\n     | console.log(el.attr(\"fill\")); // #fc0\n     * Prefixed values in format `\"+=10\"` supported. All four operations\n     * (`+`, `-`, `*` and `/`) could be used. Optionally you can use units for `+`\n     * and `-`: `\"+=2em\"`.\n    /*/\n    Element.prototype.attr = function (params, value) {\n        var el = this,\n            node = el.node;\n        if (!params) {\n            return el;\n        }\n        if (is(params, \"string\")) {\n            if (arguments.length > 1) {\n                var json = {};\n                json[params] = value;\n                params = json;\n            } else {\n                return eve(\"snap.util.getattr.\" + params, el).firstDefined();\n            }\n        }\n        for (var att in params) {\n            if (params[has](att)) {\n                eve(\"snap.util.attr.\" + att, el, params[att]);\n            }\n        }\n        return el;\n    };\n/*/\n * Snap.parse\n [ method ]\n **\n * Parses SVG fragment and converts it into a @Fragment\n **\n - svg (string) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.parse = function (svg) {\n    var f = glob.doc.createDocumentFragment(),\n        full = true,\n        div = glob.doc.createElement(\"div\");\n    svg = Str(svg);\n    if (!svg.match(/^/s*</s*svg(?:/s|>)/)) {\n        svg = \"<svg>\" + svg + \"</svg>\";\n        full = false;\n    }\n    div.innerHTML = svg;\n    svg = div.getElementsByTagName(\"svg\")[0];\n    if (svg) {\n        if (full) {\n            f = svg;\n        } else {\n            while (svg.firstChild) {\n                f.appendChild(svg.firstChild);\n            }\n            div.innerHTML = E;\n        }\n    }\n    return new Fragment(f);\n};\nfunction Fragment(frag) {\n    this.node = frag;\n}\n// SIERRA Snap.fragment() could especially use a code example\n/*/\n * Snap.fragment\n [ method ]\n **\n * Creates a DOM fragment from a given list of elements or strings\n **\n - varargs (…) SVG string\n = (Fragment) the @Fragment\n/*/\nSnap.fragment = function () {\n    var args = Array.prototype.slice.call(arguments, 0),\n        f = glob.doc.createDocumentFragment();\n    for (var i = 0, ii = args.length; i < ii; i++) {\n        var item = args[i];\n        if (item.node && item.node.nodeType) {\n            f.appendChild(item.node);\n        }\n        if (item.nodeType) {\n            f.appendChild(item);\n        }\n        if (typeof item == \"string\") {\n            f.appendChild(Snap.parse(item).node);\n        }\n    }\n    return new Fragment(f);\n};\n\nfunction make(name, parent) {\n    var res = $(name);\n    parent.appendChild(res);\n    var el = wrap(res);\n    return el;\n}\nfunction Paper(w, h) {\n    var res,\n        desc,\n        defs,\n        proto = Paper.prototype;\n    if (w && w.tagName == \"svg\") {\n        if (w.snap in hub) {\n            return hub[w.snap];\n        }\n        var doc = w.ownerDocument;\n        res = new Element(w);\n        desc = w.getElementsByTagName(\"desc\")[0];\n        defs = w.getElementsByTagName(\"defs\")[0];\n        if (!desc) {\n            desc = $(\"desc\");\n            desc.appendChild(doc.createTextNode(\"Created with Snap\"));\n            res.node.appendChild(desc);\n        }\n        if (!defs) {\n            defs = $(\"defs\");\n            res.node.appendChild(defs);\n        }\n        res.defs = defs;\n        for (var key in proto) if (proto[has](key)) {\n            res[key] = proto[key];\n        }\n        res.paper = res.root = res;\n    } else {\n        res = make(\"svg\", glob.doc.body);\n        $(res.node, {\n            height: h,\n            version: 1.1,\n            width: w,\n            xmlns: xmlns\n        });\n    }\n    return res;\n}\nfunction wrap(dom) {\n    if (!dom) {\n        return dom;\n    }\n    if (dom instanceof Element || dom instanceof Fragment) {\n        return dom;\n    }\n    if (dom.tagName && dom.tagName.toLowerCase() == \"svg\") {\n        return new Paper(dom);\n    }\n    if (dom.tagName && dom.tagName.toLowerCase() == \"object\" && dom.type == \"image/svg+xml\") {\n        return new Paper(dom.contentDocument.getElementsByTagName(\"svg\")[0]);\n    }\n    return new Element(dom);\n}\n\nSnap._.make = make;\nSnap._.wrap = wrap;\n/*/\n * Paper.el\n [ method ]\n **\n * Creates an element on paper with a given name and no attributes\n **\n - name (string) tag name\n - attr (object) attributes\n = (Element) the current element\n > Usage\n | var c = paper.circle(10, 10, 10); // is the same as...\n | var c = paper.el(\"circle\").attr({\n |     cx: 10,\n |     cy: 10,\n |     r: 10\n | });\n | // and the same as\n | var c = paper.el(\"circle\", {\n |     cx: 10,\n |     cy: 10,\n |     r: 10\n | });\n/*/\nPaper.prototype.el = function (name, attr) {\n    var el = make(name, this.node);\n    attr && el.attr(attr);\n    return el;\n};\n// default\neve.on(\"snap.util.getattr\", function () {\n    var att = eve.nt();\n    att = att.substring(att.lastIndexOf(\".\") + 1);\n    var css = att.replace(/[A-Z]/g, function (letter) {\n        return \"-\" + letter.toLowerCase();\n    });\n    if (cssAttr[has](css)) {\n        return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);\n    } else {\n        return $(this.node, att);\n    }\n});\nvar cssAttr = {\n    \"alignment-baseline\": 0,\n    \"baseline-shift\": 0,\n    \"clip\": 0,\n    \"clip-path\": 0,\n    \"clip-rule\": 0,\n    \"color\": 0,\n    \"color-interpolation\": 0,\n    \"color-interpolation-filters\": 0,\n    \"color-profile\": 0,\n    \"color-rendering\": 0,\n    \"cursor\": 0,\n    \"direction\": 0,\n    \"display\": 0,\n    \"dominant-baseline\": 0,\n    \"enable-background\": 0,\n    \"fill\": 0,\n    \"fill-opacity\": 0,\n    \"fill-rule\": 0,\n    \"filter\": 0,\n    \"flood-color\": 0,\n    \"flood-opacity\": 0,\n    \"font\": 0,\n    \"font-family\": 0,\n    \"font-size\": 0,\n    \"font-size-adjust\": 0,\n    \"font-stretch\": 0,\n    \"font-style\": 0,\n    \"font-variant\": 0,\n    \"font-weight\": 0,\n    \"glyph-orientation-horizontal\": 0,\n    \"glyph-orientation-vertical\": 0,\n    \"image-rendering\": 0,\n    \"kerning\": 0,\n    \"letter-spacing\": 0,\n    \"lighting-color\": 0,\n    \"marker\": 0,\n    \"marker-end\": 0,\n    \"marker-mid\": 0,\n    \"marker-start\": 0,\n    \"mask\": 0,\n    \"opacity\": 0,\n    \"overflow\": 0,\n    \"pointer-events\": 0,\n    \"shape-rendering\": 0,\n    \"stop-color\": 0,\n    \"stop-opacity\": 0,\n    \"stroke\": 0,\n    \"stroke-dasharray\": 0,\n    \"stroke-dashoffset\": 0,\n    \"stroke-linecap\": 0,\n    \"stroke-linejoin\": 0,\n    \"stroke-miterlimit\": 0,\n    \"stroke-opacity\": 0,\n    \"stroke-width\": 0,\n    \"text-anchor\": 0,\n    \"text-decoration\": 0,\n    \"text-rendering\": 0,\n    \"unicode-bidi\": 0,\n    \"visibility\": 0,\n    \"word-spacing\": 0,\n    \"writing-mode\": 0\n};\n\neve.on(\"snap.util.attr\", function (value) {\n    var att = eve.nt(),\n        attr = {};\n    att = att.substring(att.lastIndexOf(\".\") + 1);\n    attr[att] = value;\n    var style = att.replace(/-(/w)/gi, function (all, letter) {\n            return letter.toUpperCase();\n        }),\n        css = att.replace(/[A-Z]/g, function (letter) {\n            return \"-\" + letter.toLowerCase();\n        });\n    if (cssAttr[has](css)) {\n        this.node.style[style] = value == null ? E : value;\n    } else {\n        $(this.node, attr);\n    }\n});\n(function (proto) {}(Paper.prototype));\n\n// simple ajax\n/*/\n * Snap.ajax\n [ method ]\n **\n * Simple implementation of Ajax\n **\n - url (string) URL\n - postData (object|string) data for post request\n - callback (function) callback\n - scope (object) #optional scope of callback\n * or\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n = (XMLHttpRequest) the XMLHttpRequest object, just in case\n/*/\nSnap.ajax = function (url, postData, callback, scope){\n    var req = new XMLHttpRequest,\n        id = ID();\n    if (req) {\n        if (is(postData, \"function\")) {\n            scope = callback;\n            callback = postData;\n            postData = null;\n        } else if (is(postData, \"object\")) {\n            var pd = [];\n            for (var key in postData) if (postData.hasOwnProperty(key)) {\n                pd.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(postData[key]));\n            }\n            postData = pd.join(\"&\");\n        }\n        req.open((postData ? \"POST\" : \"GET\"), url, true);\n        if (postData) {\n            req.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n            req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n        }\n        if (callback) {\n            eve.once(\"snap.ajax.\" + id + \".0\", callback);\n            eve.once(\"snap.ajax.\" + id + \".200\", callback);\n            eve.once(\"snap.ajax.\" + id + \".304\", callback);\n        }\n        req.onreadystatechange = function() {\n            if (req.readyState != 4) return;\n            eve(\"snap.ajax.\" + id + \".\" + req.status, scope, req);\n        };\n        if (req.readyState == 4) {\n            return req;\n        }\n        req.send(postData);\n        return req;\n    }\n};\n/*/\n * Snap.load\n [ method ]\n **\n * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)\n **\n - url (string) URL\n - callback (function) callback\n - scope (object) #optional scope of callback\n/*/\nSnap.load = function (url, callback, scope) {\n    Snap.ajax(url, function (req) {\n        var f = Snap.parse(req.responseText);\n        scope ? callback.call(scope, f) : callback(f);\n    });\n};\nvar getOffset = function (elem) {\n    var box = elem.getBoundingClientRect(),\n        doc = elem.ownerDocument,\n        body = doc.body,\n        docElem = doc.documentElement,\n        clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,\n        top  = box.top  + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop ) - clientTop,\n        left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;\n    return {\n        y: top,\n        x: left\n    };\n};\n/*/\n * Snap.getElementByPoint\n [ method ]\n **\n * Returns you topmost element under given point.\n **\n = (object) Snap element object\n - x (number) x coordinate from the top left corner of the window\n - y (number) y coordinate from the top left corner of the window\n > Usage\n | Snap.getElementByPoint(mouseX, mouseY).attr({stroke: \"#f00\"});\n/*/\nSnap.getElementByPoint = function (x, y) {\n    var paper = this,\n        svg = paper.canvas,\n        target = glob.doc.elementFromPoint(x, y);\n    if (glob.win.opera && target.tagName == \"svg\") {\n        var so = getOffset(target),\n            sr = target.createSVGRect();\n        sr.x = x - so.x;\n        sr.y = y - so.y;\n        sr.width = sr.height = 1;\n        var hits = target.getIntersectionList(sr, null);\n        if (hits.length) {\n            target = hits[hits.length - 1];\n        }\n    }\n    if (!target) {\n        return null;\n    }\n    return wrap(target);\n};\n/*/\n * Snap.plugin\n [ method ]\n **\n * Let you write plugins. You pass in a function with four arguments, like this:\n | Snap.plugin(function (Snap, Element, Paper, global, Fragment) {\n |     Snap.newmethod = function () {};\n |     Element.prototype.newmethod = function () {};\n |     Paper.prototype.newmethod = function () {};\n | });\n * Inside the function you have access to all main objects (and their\n * prototypes). This allow you to extend anything you want.\n **\n - f (function) your plugin body\n/*/\nSnap.plugin = function (f) {\n    f(Snap, Element, Paper, glob, Fragment);\n};\nglob.win.Snap = Snap;\nreturn Snap;\n}(window || this));\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n    var elproto = Element.prototype,\n        is = Snap.is,\n        Str = String,\n        unit2px = Snap._unit2px,\n        $ = Snap._.$,\n        make = Snap._.make,\n        getSomeDefs = Snap._.getSomeDefs,\n        has = \"hasOwnProperty\",\n        wrap = Snap._.wrap;\n    /*/\n     * Element.getBBox\n     [ method ]\n     **\n     * Returns the bounding box descriptor for the given element\n     **\n     = (object) bounding box descriptor:\n     o {\n     o     cx: (number) x of the center,\n     o     cy: (number) x of the center,\n     o     h: (number) height,\n     o     height: (number) height,\n     o     path: (string) path command for the box,\n     o     r0: (number) radius of a circle that fully encloses the box,\n     o     r1: (number) radius of the smallest circle that can be enclosed,\n     o     r2: (number) radius of the largest circle that can be enclosed,\n     o     vb: (string) box as a viewbox command,\n     o     w: (number) width,\n     o     width: (number) width,\n     o     x2: (number) x of the right side,\n     o     x: (number) x of the left side,\n     o     y2: (number) y of the bottom edge,\n     o     y: (number) y of the top edge\n     o }\n    /*/\n    elproto.getBBox = function (isWithoutTransform) {\n        if (!Snap.Matrix || !Snap.path) {\n            return this.node.getBBox();\n        }\n        var el = this,\n            m = new Snap.Matrix;\n        if (el.removed) {\n            return Snap._.box();\n        }\n        while (el.type == \"use\") {\n            if (!isWithoutTransform) {\n                m = m.add(el.transform().localMatrix.translate(el.attr(\"x\") || 0, el.attr(\"y\") || 0));\n            }\n            if (el.original) {\n                el = el.original;\n            } else {\n                var href = el.attr(\"xlink:href\");\n                el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf(\"#\") + 1));\n            }\n        }\n        var _ = el._,\n            pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;\n        try {\n            if (isWithoutTransform) {\n                _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());\n                return Snap._.box(_.bboxwt);\n            } else {\n                el.realPath = pathfinder(el);\n                el.matrix = el.transform().localMatrix;\n                _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));\n                return Snap._.box(_.bbox);\n            }\n        } catch (e) {\n            // Firefox doesn’t give you bbox of hidden element\n            return Snap._.box();\n        }\n    };\n    var propString = function () {\n        return this.string;\n    };\n    function extractTransform(el, tstr) {\n        if (tstr == null) {\n            var doReturn = true;\n            if (el.type == \"linearGradient\" || el.type == \"radialGradient\") {\n                tstr = el.node.getAttribute(\"gradientTransform\");\n            } else if (el.type == \"pattern\") {\n                tstr = el.node.getAttribute(\"patternTransform\");\n            } else {\n                tstr = el.node.getAttribute(\"transform\");\n            }\n            if (!tstr) {\n                return new Snap.Matrix;\n            }\n            tstr = Snap._.svgTransform2string(tstr);\n        } else {\n            if (!Snap._.rgTransform.test(tstr)) {\n                tstr = Snap._.svgTransform2string(tstr);\n            } else {\n                tstr = Str(tstr).replace(//.{3}|/u2026/g, el._.transform || E);\n            }\n            if (is(tstr, \"array\")) {\n                tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);\n            }\n            el._.transform = tstr;\n        }\n        var m = Snap._.transform2matrix(tstr, el.getBBox(1));\n        if (doReturn) {\n            return m;\n        } else {\n            el.matrix = m;\n        }\n    }\n    /*/\n     * Element.transform\n     [ method ]\n     **\n     * Gets or sets transformation of the element\n     **\n     - tstr (string) transform string in Snap or SVG format\n     = (Element) the current element\n     * or\n     = (object) transformation descriptor:\n     o {\n     o     string (string) transform string,\n     o     globalMatrix (Matrix) matrix of all transformations applied to element or its parents,\n     o     localMatrix (Matrix) matrix of transformations applied only to the element,\n     o     diffMatrix (Matrix) matrix of difference between global and local transformations,\n     o     global (string) global transformation as string,\n     o     local (string) local transformation as string,\n     o     toString (function) returns `string` property\n     o }\n    /*/\n    elproto.transform = function (tstr) {\n        var _ = this._;\n        if (tstr == null) {\n            var papa = this,\n                global = new Snap.Matrix(this.node.getCTM()),\n                local = extractTransform(this),\n                ms = [local],\n                m = new Snap.Matrix,\n                i,\n                localString = local.toTransformString(),\n                string = Str(local) == Str(this.matrix) ?\n                            Str(_.transform) : localString;\n            while (papa.type != \"svg\" && (papa = papa.parent())) {\n                ms.push(extractTransform(papa));\n            }\n            i = ms.length;\n            while (i--) {\n                m.add(ms[i]);\n            }\n            return {\n                string: string,\n                globalMatrix: global,\n                totalMatrix: m,\n                localMatrix: local,\n                diffMatrix: global.clone().add(local.invert()),\n                global: global.toTransformString(),\n                total: m.toTransformString(),\n                local: localString,\n                toString: propString\n            };\n        }\n        if (tstr instanceof Snap.Matrix) {\n            this.matrix = tstr;\n            this._.transform = tstr.toTransformString();\n        } else {\n            extractTransform(this, tstr);\n        }\n\n        if (this.node) {\n            if (this.type == \"linearGradient\" || this.type == \"radialGradient\") {\n                $(this.node, {gradientTransform: this.matrix});\n            } else if (this.type == \"pattern\") {\n                $(this.node, {patternTransform: this.matrix});\n            } else {\n                $(this.node, {transform: this.matrix});\n            }\n        }\n\n        return this;\n    };\n    /*/\n     * Element.parent\n     [ method ]\n     **\n     * Returns the element's parent\n     **\n     = (Element) the parent element\n    /*/\n    elproto.parent = function () {\n        return wrap(this.node.parentNode);\n    };\n    /*/\n     * Element.append\n     [ method ]\n     **\n     * Appends the given element to current one\n     **\n     - el (Element|Set) element to append\n     = (Element) the parent element\n    /*/\n    /*/\n     * Element.add\n     [ method ]\n     **\n     * See @Element.append\n    /*/\n    elproto.append = elproto.add = function (el) {\n        if (el) {\n            if (el.type == \"set\") {\n                var it = this;\n                el.forEach(function (el) {\n                    it.add(el);\n                });\n                return this;\n            }\n            el = wrap(el);\n            this.node.appendChild(el.node);\n            el.paper = this.paper;\n        }\n        return this;\n    };\n    /*/\n     * Element.appendTo\n     [ method ]\n     **\n     * Appends the current element to the given one\n     **\n     - el (Element) parent element to append to\n     = (Element) the child element\n    /*/\n    elproto.appendTo = function (el) {\n        if (el) {\n            el = wrap(el);\n            el.append(this);\n        }\n        return this;\n    };\n    /*/\n     * Element.prepend\n     [ method ]\n     **\n     * Prepends the given element to the current one\n     **\n     - el (Element) element to prepend\n     = (Element) the parent element\n    /*/\n    elproto.prepend = function (el) {\n        if (el) {\n            if (el.type == \"set\") {\n                var it = this,\n                    first;\n                el.forEach(function (el) {\n                    if (first) {\n                        first.after(el);\n                    } else {\n                        it.prepend(el);\n                    }\n                    first = el;\n                });\n                return this;\n            }\n            el = wrap(el);\n            var parent = el.parent();\n            this.node.insertBefore(el.node, this.node.firstChild);\n            this.add && this.add();\n            el.paper = this.paper;\n            this.parent() && this.parent().add();\n            parent && parent.add();\n        }\n        return this;\n    };\n    /*/\n     * Element.prependTo\n     [ method ]\n     **\n     * Prepends the current element to the given one\n     **\n     - el (Element) parent element to prepend to\n     = (Element) the child element\n    /*/\n    elproto.prependTo = function (el) {\n        el = wrap(el);\n        el.prepend(this);\n        return this;\n    };\n    /*/\n     * Element.before\n     [ method ]\n     **\n     * Inserts given element before the current one\n     **\n     - el (Element) element to insert\n     = (Element) the parent element\n    /*/\n    elproto.before = function (el) {\n        if (el.type == \"set\") {\n            var it = this;\n            el.forEach(function (el) {\n                var parent = el.parent();\n                it.node.parentNode.insertBefore(el.node, it.node);\n                parent && parent.add();\n            });\n            this.parent().add();\n            return this;\n        }\n        el = wrap(el);\n        var parent = el.parent();\n        this.node.parentNode.insertBefore(el.node, this.node);\n        this.parent() && this.parent().add();\n        parent && parent.add();\n        el.paper = this.paper;\n        return this;\n    };\n    /*/\n     * Element.after\n     [ method ]\n     **\n     * Inserts given element after the current one\n     **\n     - el (Element) element to insert\n     = (Element) the parent element\n    /*/\n    elproto.after = function (el) {\n        el = wrap(el);\n        var parent = el.parent();\n        if (this.node.nextSibling) {\n            this.node.parentNode.insertBefore(el.node, this.node.nextSibling);\n        } else {\n            this.node.parentNode.appendChild(el.node);\n        }\n        this.parent() && this.parent().add();\n        parent && parent.add();\n        el.paper = this.paper;\n        return this;\n    };\n    /*/\n     * Element.insertBefore\n     [ method ]\n     **\n     * Inserts the element after the given one\n     **\n     - el (Element) element next to whom insert to\n     = (Element) the parent element\n    /*/\n    elproto.insertBefore = function (el) {\n        el = wrap(el);\n        var parent = this.parent();\n        el.node.parentNode.insertBefore(this.node, el.node);\n        this.paper = el.paper;\n        parent && parent.add();\n        el.parent() && el.parent().add();\n        return this;\n    };\n    /*/\n     * Element.insertAfter\n     [ method ]\n     **\n     * Inserts the element after the given one\n     **\n     - el (Element) element next to whom insert to\n     = (Element) the parent element\n    /*/\n    elproto.insertAfter = function (el) {\n        el = wrap(el);\n        var parent = this.parent();\n        el.node.parentNode.insertBefore(this.node, el.node.nextSibling);\n        this.paper = el.paper;\n        parent && parent.add();\n        el.parent() && el.parent().add();\n        return this;\n    };\n    /*/\n     * Element.remove\n     [ method ]\n     **\n     * Removes element from the DOM\n     = (Element) the detached element\n    /*/\n    elproto.remove = function () {\n        var parent = this.parent();\n        this.node.parentNode && this.node.parentNode.removeChild(this.node);\n        delete this.paper;\n        this.removed = true;\n        parent && parent.add();\n        return this;\n    };\n    /*/\n     * Element.select\n     [ method ]\n     **\n     * Gathers the nested @Element matching the given set of CSS selectors\n     **\n     - query (string) CSS selector\n     = (Element) result of query selection\n    /*/\n    elproto.select = function (query) {\n        query = Str(query).replace(/([^//]):/g, \"$1//:\");\n        return wrap(this.node.querySelector(query));\n    };\n    /*/\n     * Element.selectAll\n     [ method ]\n     **\n     * Gathers nested @Element objects matching the given set of CSS selectors\n     **\n     - query (string) CSS selector\n     = (Set|array) result of query selection\n    /*/\n    elproto.selectAll = function (query) {\n        var nodelist = this.node.querySelectorAll(query),\n            set = (Snap.set || Array)();\n        for (var i = 0; i < nodelist.length; i++) {\n            set.push(wrap(nodelist[i]));\n        }\n        return set;\n    };\n    /*/\n     * Element.asPX\n     [ method ]\n     **\n     * Returns given attribute of the element as a `px` value (not %, em, etc.)\n     **\n     - attr (string) attribute name\n     - value (string) #optional attribute value\n     = (Element) result of query selection\n    /*/\n    elproto.asPX = function (attr, value) {\n        if (value == null) {\n            value = this.attr(attr);\n        }\n        return +unit2px(this, attr, value);\n    };\n    // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.\n    /*/\n     * Element.use\n     [ method ]\n     **\n     * Creates a `<use>` element linked to the current element\n     **\n     = (Element) the `<use>` element\n    /*/\n    elproto.use = function () {\n        var use,\n            id = this.node.id;\n        if (!id) {\n            id = this.id;\n            $(this.node, {\n                id: id\n            });\n        }\n        if (this.type == \"linearGradient\" || this.type == \"radialGradient\" ||\n            this.type == \"pattern\") {\n            use = make(this.type, this.node.parentNode);\n        } else {\n            use = make(\"use\", this.node.parentNode);\n        }\n        $(use.node, {\n            \"xlink:href\": \"#\" + id\n        });\n        use.original = this;\n        return use;\n    };\n    function fixids(el) {\n        var els = el.selectAll(\"*\"),\n            it,\n            url = /^/s*url/((\"|'|)(.*)/1/)/s*$/,\n            ids = [],\n            uses = {};\n        function urltest(it, name) {\n            var val = $(it.node, name);\n            val = val && val.match(url);\n            val = val && val[2];\n            if (val && val.charAt() == \"#\") {\n                val = val.substring(1);\n            } else {\n                return;\n            }\n            if (val) {\n                uses[val] = (uses[val] || []).concat(function (id) {\n                    var attr = {};\n                    attr[name] = URL(id);\n                    $(it.node, attr);\n                });\n            }\n        }\n        function linktest(it) {\n            var val = $(it.node, \"xlink:href\");\n            if (val && val.charAt() == \"#\") {\n                val = val.substring(1);\n            } else {\n                return;\n            }\n            if (val) {\n                uses[val] = (uses[val] || []).concat(function (id) {\n                    it.attr(\"xlink:href\", \"#\" + id);\n                });\n            }\n        }\n        for (var i = 0, ii = els.length; i < ii; i++) {\n            it = els[i];\n            urltest(it, \"fill\");\n            urltest(it, \"stroke\");\n            urltest(it, \"filter\");\n            urltest(it, \"mask\");\n            urltest(it, \"clip-path\");\n            linktest(it);\n            var oldid = $(it.node, \"id\");\n            if (oldid) {\n                $(it.node, {id: it.id});\n                ids.push({\n                    old: oldid,\n                    id: it.id\n                });\n            }\n        }\n        for (i = 0, ii = ids.length; i < ii; i++) {\n            var fs = uses[ids[i].old];\n            if (fs) {\n                for (var j = 0, jj = fs.length; j < jj; j++) {\n                    fs[j](ids[i].id);\n                }\n            }\n        }\n    }\n    /*/\n     * Element.clone\n     [ method ]\n     **\n     * Creates a clone of the element and inserts it after the element\n     **\n     = (Element) the clone\n    /*/\n    elproto.clone = function () {\n        var clone = wrap(this.node.cloneNode(true));\n        if ($(clone.node, \"id\")) {\n            $(clone.node, {id: clone.id});\n        }\n        fixids(clone);\n        clone.insertAfter(this);\n        return clone;\n    };\n    /*/\n     * Element.toDefs\n     [ method ]\n     **\n     * Moves element to the shared `<defs>` area\n     **\n     = (Element) the element\n    /*/\n    elproto.toDefs = function () {\n        var defs = getSomeDefs(this);\n        defs.appendChild(this.node);\n        return this;\n    };\n    /*/\n     * Element.toPattern\n     [ method ]\n     **\n     * Creates a `<pattern>` element from the current element\n     **\n     * To create a pattern you have to specify the pattern rect:\n     - x (string|number)\n     - y (string|number)\n     - width (string|number)\n     - height (string|number)\n     = (Element) the `<pattern>` element\n     * You can use pattern later on as an argument for `fill` attribute:\n     | var p = paper.path(\"M10-5-10,15M15,0,0,15M0-5-20,15\").attr({\n     |         fill: \"none\",\n     |         stroke: \"#bada55\",\n     |         strokeWidth: 5\n     |     }).pattern(0, 0, 10, 10),\n     |     c = paper.circle(200, 200, 100);\n     | c.attr({\n     |     fill: p\n     | });\n    /*/\n    elproto.pattern = elproto.toPattern = function (x, y, width, height) {\n        var p = make(\"pattern\", getSomeDefs(this));\n        if (x == null) {\n            x = this.getBBox();\n        }\n        if (is(x, \"object\") && \"x\" in x) {\n            y = x.y;\n            width = x.width;\n            height = x.height;\n            x = x.x;\n        }\n        $(p.node, {\n            x: x,\n            y: y,\n            width: width,\n            height: height,\n            patternUnits: \"userSpaceOnUse\",\n            id: p.id,\n            viewBox: [x, y, width, height].join(\" \")\n        });\n        p.node.appendChild(this.node);\n        return p;\n    };\n// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path.\n// SIERRA Element.marker(): I suggest the method should accept default reference point values.  Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where?  Couldn't they also be assigned default values?\n    /*/\n     * Element.marker\n     [ method ]\n     **\n     * Creates a `<marker>` element from the current element\n     **\n     * To create a marker you have to specify the bounding rect and reference point:\n     - x (number)\n     - y (number)\n     - width (number)\n     - height (number)\n     - refX (number)\n     - refY (number)\n     = (Element) the `<marker>` element\n     * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end.\n    /*/\n    // TODO add usage for markers\n    elproto.marker = function (x, y, width, height, refX, refY) {\n        var p = make(\"marker\", getSomeDefs(this));\n        if (x == null) {\n            x = this.getBBox();\n        }\n        if (is(x, \"object\") && \"x\" in x) {\n            y = x.y;\n            width = x.width;\n            height = x.height;\n            refX = x.refX || x.cx;\n            refY = x.refY || x.cy;\n            x = x.x;\n        }\n        $(p.node, {\n            viewBox: [x, y, width, height].join(\" \"),\n            markerWidth: width,\n            markerHeight: height,\n            orient: \"auto\",\n            refX: refX || 0,\n            refY: refY || 0,\n            id: p.id\n        });\n        p.node.appendChild(this.node);\n        return p;\n    };\n    // animation\n    function slice(from, to, f) {\n        return function (arr) {\n            var res = arr.slice(from, to);\n            if (res.length == 1) {\n                res = res[0];\n            }\n            return f ? f(res) : res;\n        };\n    }\n    var Animation = function (attr, ms, easing, callback) {\n        if (typeof easing == \"function\" && !easing.length) {\n            callback = easing;\n            easing = mina.linear;\n        }\n        this.attr = attr;\n        this.dur = ms;\n        easing && (this.easing = easing);\n        callback && (this.callback = callback);\n    };\n    Snap._.Animation = Animation;\n    /*/\n     * Snap.animation\n     [ method ]\n     **\n     * Creates an animation object\n     **\n     - attr (object) attributes of final destination\n     - duration (number) duration of the animation, in milliseconds\n     - easing (function) #optional one of easing functions of @mina or custom one\n     - callback (function) #optional callback function that fires when animation ends\n     = (object) animation object\n    /*/\n    Snap.animation = function (attr, ms, easing, callback) {\n        return new Animation(attr, ms, easing, callback);\n    };\n    /*/\n     * Element.inAnim\n     [ method ]\n     **\n     * Returns a set of animations that may be able to manipulate the current element\n     **\n     = (object) in format:\n     o {\n     o     anim (object) animation object,\n     o     mina (object) @mina object,\n     o     curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished,\n     o     status (function) gets or sets the status of the animation,\n     o     stop (function) stops the animation\n     o }\n    /*/\n    elproto.inAnim = function () {\n        var el = this,\n            res = [];\n        for (var id in el.anims) if (el.anims[has](id)) {\n            (function (a) {\n                res.push({\n                    anim: new Animation(a._attrs, a.dur, a.easing, a._callback),\n                    mina: a,\n                    curStatus: a.status(),\n                    status: function (val) {\n                        return a.status(val);\n                    },\n                    stop: function () {\n                        a.stop();\n                    }\n                });\n            }(el.anims[id]));\n        }\n        return res;\n    };\n    /*/\n     * Snap.animate\n     [ method ]\n     **\n     * Runs generic animation of one number into another with a caring function\n     **\n     - from (number|array) number or array of numbers\n     - to (number|array) number or array of numbers\n     - setter (function) caring function that accepts one number argument\n     - duration (number) duration, in milliseconds\n     - easing (function) #optional easing function from @mina or custom\n     - callback (function) #optional callback function to execute when animation ends\n     = (object) animation object in @mina format\n     o {\n     o     id (string) animation id, consider it read-only,\n     o     duration (function) gets or sets the duration of the animation,\n     o     easing (function) easing,\n     o     speed (function) gets or sets the speed of the animation,\n     o     status (function) gets or sets the status of the animation,\n     o     stop (function) stops the animation\n     o }\n     | var rect = Snap().rect(0, 0, 10, 10);\n     | Snap.animate(0, 10, function (val) {\n     |     rect.attr({\n     |         x: val\n     |     });\n     | }, 1000);\n     | // in given context is equivalent to\n     | rect.animate({x: 10}, 1000);\n    /*/\n    Snap.animate = function (from, to, setter, ms, easing, callback) {\n        if (typeof easing == \"function\" && !easing.length) {\n            callback = easing;\n            easing = mina.linear;\n        }\n        var now = mina.time(),\n            anim = mina(from, to, now, now + ms, mina.time, setter, easing);\n        callback && eve.once(\"mina.finish.\" + anim.id, callback);\n        return anim;\n    };\n    /*/\n     * Element.stop\n     [ method ]\n     **\n     * Stops all the animations for the current element\n     **\n     = (Element) the current element\n    /*/\n    elproto.stop = function () {\n        var anims = this.inAnim();\n        for (var i = 0, ii = anims.length; i < ii; i++) {\n            anims[i].stop();\n        }\n        return this;\n    };\n    /*/\n     * Element.animate\n     [ method ]\n     **\n     * Animates the given attributes of the element\n     **\n     - attrs (object) key-value pairs of destination attributes\n     - duration (number) duration of the animation in milliseconds\n     - easing (function) #optional easing function from @mina or custom\n     - callback (function) #optional callback function that executes when the animation ends\n     = (Element) the current element\n    /*/\n    elproto.animate = function (attrs, ms, easing, callback) {\n        if (typeof easing == \"function\" && !easing.length) {\n            callback = easing;\n            easing = mina.linear;\n        }\n        if (attrs instanceof Animation) {\n            callback = attrs.callback;\n            easing = attrs.easing;\n            ms = easing.dur;\n            attrs = attrs.attr;\n        }\n        var fkeys = [], tkeys = [], keys = {}, from, to, f, eq,\n            el = this;\n        for (var key in attrs) if (attrs[has](key)) {\n            if (el.equal) {\n                eq = el.equal(key, Str(attrs[key]));\n                from = eq.from;\n                to = eq.to;\n                f = eq.f;\n            } else {\n                from = +el.attr(key);\n                to = +attrs[key];\n            }\n            var len = is(from, \"array\") ? from.length : 1;\n            keys[key] = slice(fkeys.length, fkeys.length + len, f);\n            fkeys = fkeys.concat(from);\n            tkeys = tkeys.concat(to);\n        }\n        var now = mina.time(),\n            anim = mina(fkeys, tkeys, now, now + ms, mina.time, function (val) {\n                var attr = {};\n                for (var key in keys) if (keys[has](key)) {\n                    attr[key] = keys[key](val);\n                }\n                el.attr(attr);\n            }, easing);\n        el.anims[anim.id] = anim;\n        anim._attrs = attrs;\n        anim._callback = callback;\n        eve(\"snap.animcreated.\" + el.id, anim);\n        eve.once(\"mina.finish.\" + anim.id, function () {\n            delete el.anims[anim.id];\n            callback && callback.call(el);\n        });\n        eve.once(\"mina.stop.\" + anim.id, function () {\n            delete el.anims[anim.id];\n        });\n        return el;\n    };\n    var eldata = {};\n    /*/\n     * Element.data\n     [ method ]\n     **\n     * Adds or retrieves given value associated with given key. (Don’t confuse\n     * with `data-` attributes)\n     *\n     * See also @Element.removeData\n     - key (string) key to store data\n     - value (any) #optional value to store\n     = (object) @Element\n     * or, if value is not specified:\n     = (any) value\n     > Usage\n     | for (var i = 0, i < 5, i++) {\n     |     paper.circle(10 + 15 * i, 10, 10)\n     |          .attr({fill: \"#000\"})\n     |          .data(\"i\", i)\n     |          .click(function () {\n     |             alert(this.data(\"i\"));\n     |          });\n     | }\n    /*/\n    elproto.data = function (key, value) {\n        var data = eldata[this.id] = eldata[this.id] || {};\n        if (arguments.length == 0){\n            eve(\"snap.data.get.\" + this.id, this, data, null);\n            return data;\n        }\n        if (arguments.length == 1) {\n            if (Snap.is(key, \"object\")) {\n                for (var i in key) if (key[has](i)) {\n                    this.data(i, key[i]);\n                }\n                return this;\n            }\n            eve(\"snap.data.get.\" + this.id, this, data[key], key);\n            return data[key];\n        }\n        data[key] = value;\n        eve(\"snap.data.set.\" + this.id, this, value, key);\n        return this;\n    };\n    /*/\n     * Element.removeData\n     [ method ]\n     **\n     * Removes value associated with an element by given key.\n     * If key is not provided, removes all the data of the element.\n     - key (string) #optional key\n     = (object) @Element\n    /*/\n    elproto.removeData = function (key) {\n        if (key == null) {\n            eldata[this.id] = {};\n        } else {\n            eldata[this.id] && delete eldata[this.id][key];\n        }\n        return this;\n    };\n    /*/\n     * Element.outerSVG\n     [ method ]\n     **\n     * Returns SVG code for the element, equivalent to HTML's `outerHTML`.\n     *\n     * See also @Element.innerSVG\n     = (string) SVG code for the element\n    /*/\n    /*/\n     * Element.toString\n     [ method ]\n     **\n     * See @Element.outerSVG\n    /*/\n    elproto.outerSVG = elproto.toString = toString(1);\n    /*/\n     * Element.innerSVG\n     [ method ]\n     **\n     * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML`\n     = (string) SVG code for the element\n    /*/\n    elproto.innerSVG = toString();\n    function toString(type) {\n        return function () {\n            var res = type ? \"<\" + this.type : \"\",\n                attr = this.node.attributes,\n                chld = this.node.childNodes;\n            if (type) {\n                for (var i = 0, ii = attr.length; i < ii; i++) {\n                    res += \" \" + attr[i].name + '=\"' +\n                            attr[i].value.replace(/\"/g, '//\"') + '\"';\n                }\n            }\n            if (chld.length) {\n                type && (res += \">\");\n                for (i = 0, ii = chld.length; i < ii; i++) {\n                    if (chld[i].nodeType == 3) {\n                        res += chld[i].nodeValue;\n                    } else if (chld[i].nodeType == 1) {\n                        res += wrap(chld[i]).toString();\n                    }\n                }\n                type && (res += \"</\" + this.type + \">\");\n            } else {\n                type && (res += \"/>\");\n            }\n            return res;\n        };\n    }\n    elproto.toDataURL = function () {\n        if (window && window.btoa) {\n            var bb = this.getBBox(),\n                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>', {\n                x: +bb.x.toFixed(3),\n                y: +bb.y.toFixed(3),\n                width: +bb.width.toFixed(3),\n                height: +bb.height.toFixed(3),\n                contents: this.outerSVG()\n            });\n            return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(svg)));\n        }\n    };\n    /*/\n     * Fragment.select\n     [ method ]\n     **\n     * See @Element.select\n    /*/\n    Fragment.prototype.select = elproto.select;\n    /*/\n     * Fragment.selectAll\n     [ method ]\n     **\n     * See @Element.selectAll\n    /*/\n    Fragment.prototype.selectAll = elproto.selectAll;\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n    var objectToString = Object.prototype.toString,\n        Str = String,\n        math = Math,\n        E = \"\";\n    function Matrix(a, b, c, d, e, f) {\n        if (b == null && objectToString.call(a) == \"[object SVGMatrix]\") {\n            this.a = a.a;\n            this.b = a.b;\n            this.c = a.c;\n            this.d = a.d;\n            this.e = a.e;\n            this.f = a.f;\n            return;\n        }\n        if (a != null) {\n            this.a = +a;\n            this.b = +b;\n            this.c = +c;\n            this.d = +d;\n            this.e = +e;\n            this.f = +f;\n        } else {\n            this.a = 1;\n            this.b = 0;\n            this.c = 0;\n            this.d = 1;\n            this.e = 0;\n            this.f = 0;\n        }\n    }\n    (function (matrixproto) {\n        /*/\n         * Matrix.add\n         [ method ]\n         **\n         * Adds the given matrix to existing one\n         - a (number)\n         - b (number)\n         - c (number)\n         - d (number)\n         - e (number)\n         - f (number)\n         * or\n         - matrix (object) @Matrix\n        /*/\n        matrixproto.add = function (a, b, c, d, e, f) {\n            var out = [[], [], []],\n                m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],\n                matrix = [[a, c, e], [b, d, f], [0, 0, 1]],\n                x, y, z, res;\n\n            if (a && a instanceof Matrix) {\n                matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];\n            }\n\n            for (x = 0; x < 3; x++) {\n                for (y = 0; y < 3; y++) {\n                    res = 0;\n                    for (z = 0; z < 3; z++) {\n                        res += m[x][z] * matrix[z][y];\n                    }\n                    out[x][y] = res;\n                }\n            }\n            this.a = out[0][0];\n            this.b = out[1][0];\n            this.c = out[0][1];\n            this.d = out[1][1];\n            this.e = out[0][2];\n            this.f = out[1][2];\n            return this;\n        };\n        /*/\n         * Matrix.invert\n         [ method ]\n         **\n         * Returns an inverted version of the matrix\n         = (object) @Matrix\n        /*/\n        matrixproto.invert = function () {\n            var me = this,\n                x = me.a * me.d - me.b * me.c;\n            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);\n        };\n        /*/\n         * Matrix.clone\n         [ method ]\n         **\n         * Returns a copy of the matrix\n         = (object) @Matrix\n        /*/\n        matrixproto.clone = function () {\n            return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);\n        };\n        /*/\n         * Matrix.translate\n         [ method ]\n         **\n         * Translate the matrix\n         - x (number) horizontal offset distance\n         - y (number) vertical offset distance\n        /*/\n        matrixproto.translate = function (x, y) {\n            return this.add(1, 0, 0, 1, x, y);\n        };\n        /*/\n         * Matrix.scale\n         [ method ]\n         **\n         * Scales the matrix\n         - x (number) amount to be scaled, with `1` resulting in no change\n         - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.)\n         - cx (number) #optional horizontal origin point from which to scale\n         - cy (number) #optional vertical origin point from which to scale\n         * Default cx, cy is the middle point of the element.\n        /*/\n        matrixproto.scale = function (x, y, cx, cy) {\n            y == null && (y = x);\n            (cx || cy) && this.add(1, 0, 0, 1, cx, cy);\n            this.add(x, 0, 0, y, 0, 0);\n            (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);\n            return this;\n        };\n        /*/\n         * Matrix.rotate\n         [ method ]\n         **\n         * Rotates the matrix\n         - a (number) angle of rotation, in degrees\n         - x (number) horizontal origin point from which to rotate\n         - y (number) vertical origin point from which to rotate\n        /*/\n        matrixproto.rotate = function (a, x, y) {\n            a = Snap.rad(a);\n            x = x || 0;\n            y = y || 0;\n            var cos = +math.cos(a).toFixed(9),\n                sin = +math.sin(a).toFixed(9);\n            this.add(cos, sin, -sin, cos, x, y);\n            return this.add(1, 0, 0, 1, -x, -y);\n        };\n        /*/\n         * Matrix.x\n         [ method ]\n         **\n         * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y\n         - x (number)\n         - y (number)\n         = (number) x\n        /*/\n        matrixproto.x = function (x, y) {\n            return x * this.a + y * this.c + this.e;\n        };\n        /*/\n         * Matrix.y\n         [ method ]\n         **\n         * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x\n         - x (number)\n         - y (number)\n         = (number) y\n        /*/\n        matrixproto.y = function (x, y) {\n            return x * this.b + y * this.d + this.f;\n        };\n        matrixproto.get = function (i) {\n            return +this[Str.fromCharCode(97 + i)].toFixed(4);\n        };\n        matrixproto.toString = function () {\n            return \"matrix(\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + \")\";\n        };\n        matrixproto.offset = function () {\n            return [this.e.toFixed(4), this.f.toFixed(4)];\n        };\n        function norm(a) {\n            return a[0] * a[0] + a[1] * a[1];\n        }\n        function normalize(a) {\n            var mag = math.sqrt(norm(a));\n            a[0] && (a[0] /= mag);\n            a[1] && (a[1] /= mag);\n        }\n        /*/\n         * Matrix.determinant\n         [ method ]\n         **\n         * Finds determinant of the given matrix.\n         = (number) determinant\n        /*/\n        matrixproto.determinant = function () {\n            return this.a * this.d - this.b * this.c;\n        };\n        /*/\n         * Matrix.split\n         [ method ]\n         **\n         * Splits matrix into primitive transformations\n         = (object) in format:\n         o dx (number) translation by x\n         o dy (number) translation by y\n         o scalex (number) scale by x\n         o scaley (number) scale by y\n         o shear (number) shear\n         o rotate (number) rotation in deg\n         o isSimple (boolean) could it be represented via simple transformations\n        /*/\n        matrixproto.split = function () {\n            var out = {};\n            // translation\n            out.dx = this.e;\n            out.dy = this.f;\n\n            // scale and shear\n            var row = [[this.a, this.c], [this.b, this.d]];\n            out.scalex = math.sqrt(norm(row[0]));\n            normalize(row[0]);\n\n            out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];\n            row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];\n\n            out.scaley = math.sqrt(norm(row[1]));\n            normalize(row[1]);\n            out.shear /= out.scaley;\n\n            if (this.determinant() < 0) {\n                out.scalex = -out.scalex;\n            }\n\n            // rotation\n            var sin = -row[0][1],\n                cos = row[1][1];\n            if (cos < 0) {\n                out.rotate = Snap.deg(math.acos(cos));\n                if (sin < 0) {\n                    out.rotate = 360 - out.rotate;\n                }\n            } else {\n                out.rotate = Snap.deg(math.asin(sin));\n            }\n\n            out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);\n            out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;\n            out.noRotation = !+out.shear.toFixed(9) && !out.rotate;\n            return out;\n        };\n        /*/\n         * Matrix.toTransformString\n         [ method ]\n         **\n         * Returns transform string that represents given matrix\n         = (string) transform string\n        /*/\n        matrixproto.toTransformString = function (shorter) {\n            var s = shorter || this.split();\n            if (!+s.shear.toFixed(9)) {\n                s.scalex = +s.scalex.toFixed(4);\n                s.scaley = +s.scaley.toFixed(4);\n                s.rotate = +s.rotate.toFixed(4);\n                return  (s.dx || s.dy ? \"t\" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) + \n                        (s.scalex != 1 || s.scaley != 1 ? \"s\" + [s.scalex, s.scaley, 0, 0] : E) +\n                        (s.rotate ? \"r\" + [+s.rotate.toFixed(4), 0, 0] : E);\n            } else {\n                return \"m\" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];\n            }\n        };\n    })(Matrix.prototype);\n    /*/\n     * Snap.Matrix\n     [ method ]\n     **\n     * Matrix constructor, extend on your own risk.\n     * To create matrices use @Snap.matrix.\n    /*/\n    Snap.Matrix = Matrix;\n    /*/\n     * Snap.matrix\n     [ method ]\n     **\n     * Utility method\n     **\n     * Returns a matrix based on the given parameters\n     - a (number)\n     - b (number)\n     - c (number)\n     - d (number)\n     - e (number)\n     - f (number)\n     * or\n     - svgMatrix (SVGMatrix)\n     = (object) @Matrix\n    /*/\n    Snap.matrix = function (a, b, c, d, e, f) {\n        return new Matrix(a, b, c, d, e, f);\n    };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n    var has = \"hasOwnProperty\",\n        make = Snap._.make,\n        wrap = Snap._.wrap,\n        is = Snap.is,\n        getSomeDefs = Snap._.getSomeDefs,\n        reURLValue = /^url/(#?([^)]+)/)$/,\n        $ = Snap._.$,\n        URL = Snap.url,\n        Str = String,\n        separator = Snap._.separator,\n        E = \"\";\n    // Attributes event handlers\n    eve.on(\"snap.util.attr.mask\", function (value) {\n        if (value instanceof Element || value instanceof Fragment) {\n            eve.stop();\n            if (value instanceof Fragment && value.node.childNodes.length == 1) {\n                value = value.node.firstChild;\n                getSomeDefs(this).appendChild(value);\n                value = wrap(value);\n            }\n            if (value.type == \"mask\") {\n                var mask = value;\n            } else {\n                mask = make(\"mask\", getSomeDefs(this));\n                mask.node.appendChild(value.node);\n            }\n            !mask.node.id && $(mask.node, {\n                id: mask.id\n            });\n            $(this.node, {\n                mask: URL(mask.id)\n            });\n        }\n    });\n    (function (clipIt) {\n        eve.on(\"snap.util.attr.clip\", clipIt);\n        eve.on(\"snap.util.attr.clip-path\", clipIt);\n        eve.on(\"snap.util.attr.clipPath\", clipIt);\n    }(function (value) {\n        if (value instanceof Element || value instanceof Fragment) {\n            eve.stop();\n            if (value.type == \"clipPath\") {\n                var clip = value;\n            } else {\n                clip = make(\"clipPath\", getSomeDefs(this));\n                clip.node.appendChild(value.node);\n                !clip.node.id && $(clip.node, {\n                    id: clip.id\n                });\n            }\n            $(this.node, {\n                \"clip-path\": URL(clip.node.id || clip.id)\n            });\n        }\n    }));\n    function fillStroke(name) {\n        return function (value) {\n            eve.stop();\n            if (value instanceof Fragment && value.node.childNodes.length == 1 &&\n                (value.node.firstChild.tagName == \"radialGradient\" ||\n                value.node.firstChild.tagName == \"linearGradient\" ||\n                value.node.firstChild.tagName == \"pattern\")) {\n                value = value.node.firstChild;\n                getSomeDefs(this).appendChild(value);\n                value = wrap(value);\n            }\n            if (value instanceof Element) {\n                if (value.type == \"radialGradient\" || value.type == \"linearGradient\"\n                   || value.type == \"pattern\") {\n                    if (!value.node.id) {\n                        $(value.node, {\n                            id: value.id\n                        });\n                    }\n                    var fill = URL(value.node.id);\n                } else {\n                    fill = value.attr(name);\n                }\n            } else {\n                fill = Snap.color(value);\n                if (fill.error) {\n                    var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);\n                    if (grad) {\n                        if (!grad.node.id) {\n                            $(grad.node, {\n                                id: grad.id\n                            });\n                        }\n                        fill = URL(grad.node.id);\n                    } else {\n                        fill = value;\n                    }\n                } else {\n                    fill = Str(fill);\n                }\n            }\n            var attrs = {};\n            attrs[name] = fill;\n            $(this.node, attrs);\n            this.node.style[name] = E;\n        };\n    }\n    eve.on(\"snap.util.attr.fill\", fillStroke(\"fill\"));\n    eve.on(\"snap.util.attr.stroke\", fillStroke(\"stroke\"));\n    var gradrg = /^([lr])(?:/(([^)]*)/))?(.*)$/i;\n    eve.on(\"snap.util.grad.parse\", function parseGrad(string) {\n        string = Str(string);\n        var tokens = string.match(gradrg);\n        if (!tokens) {\n            return null;\n        }\n        var type = tokens[1],\n            params = tokens[2],\n            stops = tokens[3];\n        params = params.split(//s*,/s*/).map(function (el) {\n            return +el == el ? +el : el;\n        });\n        if (params.length == 1 && params[0] == 0) {\n            params = [];\n        }\n        stops = stops.split(\"-\");\n        stops = stops.map(function (el) {\n            el = el.split(\":\");\n            var out = {\n                color: el[0]\n            };\n            if (el[1]) {\n                out.offset = parseFloat(el[1]);\n            }\n            return out;\n        });\n        return {\n            type: type,\n            params: params,\n            stops: stops\n        };\n    });\n\n    eve.on(\"snap.util.attr.d\", function (value) {\n        eve.stop();\n        if (is(value, \"array\") && is(value[0], \"array\")) {\n            value = Snap.path.toString.call(value);\n        }\n        value = Str(value);\n        if (value.match(/[ruo]/i)) {\n            value = Snap.path.toAbsolute(value);\n        }\n        $(this.node, {d: value});\n    })(-1);\n    eve.on(\"snap.util.attr.#text\", function (value) {\n        eve.stop();\n        value = Str(value);\n        var txt = glob.doc.createTextNode(value);\n        while (this.node.firstChild) {\n            this.node.removeChild(this.node.firstChild);\n        }\n        this.node.appendChild(txt);\n    })(-1);\n    eve.on(\"snap.util.attr.path\", function (value) {\n        eve.stop();\n        this.attr({d: value});\n    })(-1);\n    eve.on(\"snap.util.attr.class\", function (value) {\n        eve.stop();\n        this.node.className.baseVal = value;\n    })(-1);\n    eve.on(\"snap.util.attr.viewBox\", function (value) {\n        var vb;\n        if (is(value, \"object\") && \"x\" in value) {\n            vb = [value.x, value.y, value.width, value.height].join(\" \");\n        } else if (is(value, \"array\")) {\n            vb = value.join(\" \");\n        } else {\n            vb = value;\n        }\n        $(this.node, {\n            viewBox: vb\n        });\n        eve.stop();\n    })(-1);\n    eve.on(\"snap.util.attr.transform\", function (value) {\n        this.transform(value);\n        eve.stop();\n    })(-1);\n    eve.on(\"snap.util.attr.r\", function (value) {\n        if (this.type == \"rect\") {\n            eve.stop();\n            $(this.node, {\n                rx: value,\n                ry: value\n            });\n        }\n    })(-1);\n    eve.on(\"snap.util.attr.textpath\", function (value) {\n        eve.stop();\n        if (this.type == \"text\") {\n            var id, tp, node;\n            if (!value && this.textPath) {\n                tp = this.textPath;\n                while (tp.node.firstChild) {\n                    this.node.appendChild(tp.node.firstChild);\n                }\n                tp.remove();\n                delete this.textPath;\n                return;\n            }\n            if (is(value, \"string\")) {\n                var defs = getSomeDefs(this),\n                    path = wrap(defs.parentNode).path(value);\n                defs.appendChild(path.node);\n                id = path.id;\n                path.attr({id: id});\n            } else {\n                value = wrap(value);\n                if (value instanceof Element) {\n                    id = value.attr(\"id\");\n                    if (!id) {\n                        id = value.id;\n                        value.attr({id: id});\n                    }\n                }\n            }\n            if (id) {\n                tp = this.textPath;\n                node = this.node;\n                if (tp) {\n                    tp.attr({\"xlink:href\": \"#\" + id});\n                } else {\n                    tp = $(\"textPath\", {\n                        \"xlink:href\": \"#\" + id\n                    });\n                    while (node.firstChild) {\n                        tp.appendChild(node.firstChild);\n                    }\n                    node.appendChild(tp);\n                    this.textPath = wrap(tp);\n                }\n            }\n        }\n    })(-1);\n    eve.on(\"snap.util.attr.text\", function (value) {\n        if (this.type == \"text\") {\n            var i = 0,\n                node = this.node,\n                tuner = function (chunk) {\n                    var out = $(\"tspan\");\n                    if (is(chunk, \"array\")) {\n                        for (var i = 0; i < chunk.length; i++) {\n                            out.appendChild(tuner(chunk[i]));\n                        }\n                    } else {\n                        out.appendChild(glob.doc.createTextNode(chunk));\n                    }\n                    out.normalize && out.normalize();\n                    return out;\n                };\n            while (node.firstChild) {\n                node.removeChild(node.firstChild);\n            }\n            var tuned = tuner(value);\n            while (tuned.firstChild) {\n                node.appendChild(tuned.firstChild);\n            }\n        }\n        eve.stop();\n    })(-1);\n    function setFontSize(value) {\n        eve.stop();\n        if (value == +value) {\n            value += \"px\";\n        }\n        this.node.style.fontSize = value;\n    }\n    eve.on(\"snap.util.attr.fontSize\", setFontSize)(-1);\n    eve.on(\"snap.util.attr.font-size\", setFontSize)(-1);\n\n\n    eve.on(\"snap.util.getattr.transform\", function () {\n        eve.stop();\n        return this.transform();\n    })(-1);\n    eve.on(\"snap.util.getattr.textpath\", function () {\n        eve.stop();\n        return this.textPath;\n    })(-1);\n    // Markers\n    (function () {\n        function getter(end) {\n            return function () {\n                eve.stop();\n                var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue(\"marker-\" + end);\n                if (style == \"none\") {\n                    return style;\n                } else {\n                    return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));\n                }\n            };\n        }\n        function setter(end) {\n            return function (value) {\n                eve.stop();\n                var name = \"marker\" + end.charAt(0).toUpperCase() + end.substring(1);\n                if (value == \"\" || !value) {\n                    this.node.style[name] = \"none\";\n                    return;\n                }\n                if (value.type == \"marker\") {\n                    var id = value.node.id;\n                    if (!id) {\n                        $(value.node, {id: value.id});\n                    }\n                    this.node.style[name] = URL(id);\n                    return;\n                }\n            };\n        }\n        eve.on(\"snap.util.getattr.marker-end\", getter(\"end\"))(-1);\n        eve.on(\"snap.util.getattr.markerEnd\", getter(\"end\"))(-1);\n        eve.on(\"snap.util.getattr.marker-start\", getter(\"start\"))(-1);\n        eve.on(\"snap.util.getattr.markerStart\", getter(\"start\"))(-1);\n        eve.on(\"snap.util.getattr.marker-mid\", getter(\"mid\"))(-1);\n        eve.on(\"snap.util.getattr.markerMid\", getter(\"mid\"))(-1);\n        eve.on(\"snap.util.attr.marker-end\", setter(\"end\"))(-1);\n        eve.on(\"snap.util.attr.markerEnd\", setter(\"end\"))(-1);\n        eve.on(\"snap.util.attr.marker-start\", setter(\"start\"))(-1);\n        eve.on(\"snap.util.attr.markerStart\", setter(\"start\"))(-1);\n        eve.on(\"snap.util.attr.marker-mid\", setter(\"mid\"))(-1);\n        eve.on(\"snap.util.attr.markerMid\", setter(\"mid\"))(-1);\n    }());\n    eve.on(\"snap.util.getattr.r\", function () {\n        if (this.type == \"rect\" && $(this.node, \"rx\") == $(this.node, \"ry\")) {\n            eve.stop();\n            return $(this.node, \"rx\");\n        }\n    })(-1);\n    function textExtract(node) {\n        var out = [];\n        var children = node.childNodes;\n        for (var i = 0, ii = children.length; i < ii; i++) {\n            var chi = children[i];\n            if (chi.nodeType == 3) {\n                out.push(chi.nodeValue);\n            }\n            if (chi.tagName == \"tspan\") {\n                if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {\n                    out.push(chi.firstChild.nodeValue);\n                } else {\n                    out.push(textExtract(chi));\n                }\n            }\n        }\n        return out;\n    }\n    eve.on(\"snap.util.getattr.text\", function () {\n        if (this.type == \"text\" || this.type == \"tspan\") {\n            eve.stop();\n            var out = textExtract(this.node);\n            return out.length == 1 ? out[0] : out;\n        }\n    })(-1);\n    eve.on(\"snap.util.getattr.#text\", function () {\n        return this.node.textContent;\n    })(-1);\n    eve.on(\"snap.util.getattr.viewBox\", function () {\n        eve.stop();\n        var vb = $(this.node, \"viewBox\");\n        if (vb) {\n            vb = vb.split(separator);\n            return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);\n        } else {\n            return;\n        }\n    })(-1);\n    eve.on(\"snap.util.getattr.points\", function () {\n        var p = $(this.node, \"points\");\n        eve.stop();\n        if (p) {\n            return p.split(separator);\n        } else {\n            return;\n        }\n    })(-1);\n    eve.on(\"snap.util.getattr.path\", function () {\n        var p = $(this.node, \"d\");\n        eve.stop();\n        return p;\n    })(-1);\n    eve.on(\"snap.util.getattr.class\", function () {\n        return this.node.className.baseVal;\n    })(-1);\n    function getFontSize() {\n        eve.stop();\n        return this.node.style.fontSize;\n    }\n    eve.on(\"snap.util.getattr.fontSize\", getFontSize)(-1);\n    eve.on(\"snap.util.getattr.font-size\", getFontSize)(-1);\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob, Fragment) {\n    var proto = Paper.prototype,\n        is = Snap.is;\n    /*/\n     * Paper.rect\n     [ method ]\n     *\n     * Draws a rectangle\n     **\n     - x (number) x coordinate of the top left corner\n     - y (number) y coordinate of the top left corner\n     - width (number) width\n     - height (number) height\n     - rx (number) #optional horizontal radius for rounded corners, default is 0\n     - ry (number) #optional vertical radius for rounded corners, default is rx or 0\n     = (object) the `rect` element\n     **\n     > Usage\n     | // regular rectangle\n     | var c = paper.rect(10, 10, 50, 50);\n     | // rectangle with rounded corners\n     | var c = paper.rect(40, 40, 50, 50, 10);\n    /*/\n    proto.rect = function (x, y, w, h, rx, ry) {\n        var attr;\n        if (ry == null) {\n            ry = rx;\n        }\n        if (is(x, \"object\") && x == \"[object Object]\") {\n            attr = x;\n        } else if (x != null) {\n            attr = {\n                x: x,\n                y: y,\n                width: w,\n                height: h\n            };\n            if (rx != null) {\n                attr.rx = rx;\n                attr.ry = ry;\n            }\n        }\n        return this.el(\"rect\", attr);\n    };\n    /*/\n     * Paper.circle\n     [ method ]\n     **\n     * Draws a circle\n     **\n     - x (number) x coordinate of the centre\n     - y (number) y coordinate of the centre\n     - r (number) radius\n     = (object) the `circle` element\n     **\n     > Usage\n     | var c = paper.circle(50, 50, 40);\n    /*/\n    proto.circle = function (cx, cy, r) {\n        var attr;\n        if (is(cx, \"object\") && cx == \"[object Object]\") {\n            attr = cx;\n        } else if (cx != null) {\n            attr = {\n                cx: cx,\n                cy: cy,\n                r: r\n            };\n        }\n        return this.el(\"circle\", attr);\n    };\n\n    var preload = (function () {\n        function onerror() {\n            this.parentNode.removeChild(this);\n        }\n        return function (src, f) {\n            var img = glob.doc.createElement(\"img\"),\n                body = glob.doc.body;\n            img.style.cssText = \"position:absolute;left:-9999em;top:-9999em\";\n            img.onload = function () {\n                f.call(img);\n                img.onload = img.onerror = null;\n                body.removeChild(img);\n            };\n            img.onerror = onerror;\n            body.appendChild(img);\n            img.src = src;\n        };\n    }());\n\n    /*/\n     * Paper.image\n     [ method ]\n     **\n     * Places an image on the surface\n     **\n     - src (string) URI of the source image\n     - x (number) x offset position\n     - y (number) y offset position\n     - width (number) width of the image\n     - height (number) height of the image\n     = (object) the `image` element\n     * or\n     = (object) Snap element object with type `image`\n     **\n     > Usage\n     | var c = paper.image(\"apple.png\", 10, 10, 80, 80);\n    /*/\n    proto.image = function (src, x, y, width, height) {\n        var el = this.el(\"image\");\n        if (is(src, \"object\") && \"src\" in src) {\n            el.attr(src);\n        } else if (src != null) {\n            var set = {\n                \"xlink:href\": src,\n                preserveAspectRatio: \"none\"\n            };\n            if (x != null && y != null) {\n                set.x = x;\n                set.y = y;\n            }\n            if (width != null && height != null) {\n                set.width = width;\n                set.height = height;\n            } else {\n                preload(src, function () {\n                    Snap._.$(el.node, {\n                        width: this.offsetWidth,\n                        height: this.offsetHeight\n                    });\n                });\n            }\n            Snap._.$(el.node, set);\n        }\n        return el;\n    };\n    /*/\n     * Paper.ellipse\n     [ method ]\n     **\n     * Draws an ellipse\n     **\n     - x (number) x coordinate of the centre\n     - y (number) y coordinate of the centre\n     - rx (number) horizontal radius\n     - ry (number) vertical radius\n     = (object) the `ellipse` element\n     **\n     > Usage\n     | var c = paper.ellipse(50, 50, 40, 20);\n    /*/\n    proto.ellipse = function (cx, cy, rx, ry) {\n        var attr;\n        if (is(cx, \"object\") && cx == \"[object Object]\") {\n            attr = cx;\n        } else if (cx != null) {\n            attr ={\n                cx: cx,\n                cy: cy,\n                rx: rx,\n                ry: ry\n            };\n        }\n        return this.el(\"ellipse\", attr);\n    };\n    // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.\n    /*/\n     * Paper.path\n     [ method ]\n     **\n     * Creates a `<path>` element using the given string as the path's definition\n     - pathString (string) #optional path string in SVG format\n     * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example:\n     | \"M10,20L30,40\"\n     * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.\n     *\n     # <p>Here is short list of commands available, for more details see <a href=\"http://www.w3.org/TR/SVG/paths.html#PathData\" title=\"Details of a path's data attribute's format are described in the SVG specification.\">SVG path string format</a> or <a href=\"https://developer.mozilla.org/en/SVG/Tutorial/Paths\">article about path strings at MDN</a>.</p>\n     # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody>\n     # <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr>\n     # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr>\n     # <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr>\n     # <tr><td>H</td><td>horizontal lineto</td><td>x+</td></tr>\n     # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr>\n     # <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr>\n     # <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr>\n     # <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x y)+</td></tr>\n     # <tr><td>T</td><td>smooth quadratic Bézier curveto</td><td>(x y)+</td></tr>\n     # <tr><td>A</td><td>elliptical arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr>\n     # <tr><td>R</td><td><a href=\"http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline\">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>\n     * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.\n     * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point.\n     > Usage\n     | var c = paper.path(\"M10 10L90 90\");\n     | // draw a diagonal line:\n     | // move to 10,10, line to 90,90\n    /*/\n    proto.path = function (d) {\n        var attr;\n        if (is(d, \"object\") && !is(d, \"array\")) {\n            attr = d;\n        } else if (d) {\n            attr = {d: d};\n        }\n        return this.el(\"path\", attr);\n    };\n    /*/\n     * Paper.g\n     [ method ]\n     **\n     * Creates a group element\n     **\n     - varargs (…) #optional elements to nest within the group\n     = (object) the `g` element\n     **\n     > Usage\n     | var c1 = paper.circle(),\n     |     c2 = paper.rect(),\n     |     g = paper.g(c2, c1); // note that the order of elements is different\n     * or\n     | var c1 = paper.circle(),\n     |     c2 = paper.rect(),\n     |     g = paper.g();\n     | g.add(c2, c1);\n    /*/\n    /*/\n     * Paper.group\n     [ method ]\n     **\n     * See @Paper.g\n    /*/\n    proto.group = proto.g = function (first) {\n        var attr,\n            el = this.el(\"g\");\n        if (arguments.length == 1 && first && !first.type) {\n            el.attr(first);\n        } else if (arguments.length) {\n            el.add(Array.prototype.slice.call(arguments, 0));\n        }\n        return el;\n    };\n    /*/\n     * Paper.svg\n     [ method ]\n     **\n     * Creates a nested SVG element.\n     - x (number) @optional X of the element\n     - y (number) @optional Y of the element\n     - width (number) @optional width of the element\n     - height (number) @optional height of the element\n     - vbx (number) @optional viewbox X\n     - vby (number) @optional viewbox Y\n     - vbw (number) @optional viewbox width\n     - vbh (number) @optional viewbox height\n     **\n     = (object) the `svg` element\n     **\n    /*/\n    proto.svg = function (x, y, width, height, vbx, vby, vbw, vbh) {\n        var attrs = {};\n        if (is(x, \"object\") && y == null) {\n            attrs = x;\n        } else {\n            if (x != null) {\n                attrs.x = x;\n            }\n            if (y != null) {\n                attrs.y = y;\n            }\n            if (width != null) {\n                attrs.width = width;\n            }\n            if (height != null) {\n                attrs.height = height;\n            }\n            if (vbx != null && vby != null && vbw != null && vbh != null) {\n                attrs.viewBox = [vbx, vby, vbw, vbh];\n            }\n        }\n        return this.el(\"svg\", attrs);\n    };\n    /*/\n     * Paper.mask\n     [ method ]\n     **\n     * Equivalent in behaviour to @Paper.g, except it’s a mask.\n     **\n     = (object) the `mask` element\n     **\n    /*/\n    proto.mask = function (first) {\n        var attr,\n            el = this.el(\"mask\");\n        if (arguments.length == 1 && first && !first.type) {\n            el.attr(first);\n        } else if (arguments.length) {\n            el.add(Array.prototype.slice.call(arguments, 0));\n        }\n        return el;\n    };\n    /*/\n     * Paper.ptrn\n     [ method ]\n     **\n     * Equivalent in behaviour to @Paper.g, except it’s a pattern.\n     - x (number) @optional X of the element\n     - y (number) @optional Y of the element\n     - width (number) @optional width of the element\n     - height (number) @optional height of the element\n     - vbx (number) @optional viewbox X\n     - vby (number) @optional viewbox Y\n     - vbw (number) @optional viewbox width\n     - vbh (number) @optional viewbox height\n     **\n     = (object) the `pattern` element\n     **\n    /*/\n    proto.ptrn = function (x, y, width, height, vx, vy, vw, vh) {\n        if (is(x, \"object\")) {\n            var attr = x;\n        } else {\n            attr = {patternUnits: \"userSpaceOnUse\"};\n            if (x) {\n                attr.x = x;\n            }\n            if (y) {\n                attr.y = y;\n            }\n            if (width != null) {\n                attr.width = width;\n            }\n            if (height != null) {\n                attr.height = height;\n            }\n            if (vx != null && vy != null && vw != null && vh != null) {\n                attr.viewBox = [vx, vy, vw, vh];\n            }\n        }\n        return this.el(\"pattern\", attr);\n    };\n    /*/\n     * Paper.use\n     [ method ]\n     **\n     * Creates a <use> element.\n     - id (string) @optional id of element to link\n     * or\n     - id (Element) @optional element to link\n     **\n     = (object) the `use` element\n     **\n    /*/\n    proto.use = function (id) {\n        if (id != null) {\n            if (id instanceof Element) {\n                if (!id.attr(\"id\")) {\n                    id.attr({id: Snap._.id(id)});\n                }\n                id = id.attr(\"id\");\n            }\n            if (String(id).charAt() == \"#\") {\n                id = id.substring(1);\n            }\n            return this.el(\"use\", {\"xlink:href\": \"#\" + id});\n        } else {\n            return Element.prototype.use.call(this);\n        }\n    };\n    /*/\n     * Paper.symbol\n     [ method ]\n     **\n     * Creates a <symbol> element.\n     - vbx (number) @optional viewbox X\n     - vby (number) @optional viewbox Y\n     - vbw (number) @optional viewbox width\n     - vbh (number) @optional viewbox height\n     = (object) the `symbol` element\n     **\n    /*/\n    proto.symbol = function (vx, vy, vw, vh) {\n        var attr = {};\n        if (vx != null && vy != null && vw != null && vh != null) {\n            attr.viewBox = [vx, vy, vw, vh];\n        }\n\n        return this.el(\"symbol\", attr);\n    };\n    /*/\n     * Paper.text\n     [ method ]\n     **\n     * Draws a text string\n     **\n     - x (number) x coordinate position\n     - y (number) y coordinate position\n     - text (string|array) The text string to draw or array of strings to nest within separate `<tspan>` elements\n     = (object) the `text` element\n     **\n     > Usage\n     | var t1 = paper.text(50, 50, \"Snap\");\n     | var t2 = paper.text(50, 50, [\"S\",\"n\",\"a\",\"p\"]);\n     | // Text path usage\n     | t1.attr({textpath: \"M10,10L100,100\"});\n     | // or\n     | var pth = paper.path(\"M10,10L100,100\");\n     | t1.attr({textpath: pth});\n    /*/\n    proto.text = function (x, y, text) {\n        var attr = {};\n        if (is(x, \"object\")) {\n            attr = x;\n        } else if (x != null) {\n            attr = {\n                x: x,\n                y: y,\n                text: text || \"\"\n            };\n        }\n        return this.el(\"text\", attr);\n    };\n    /*/\n     * Paper.line\n     [ method ]\n     **\n     * Draws a line\n     **\n     - x1 (number) x coordinate position of the start\n     - y1 (number) y coordinate position of the start\n     - x2 (number) x coordinate position of the end\n     - y2 (number) y coordinate position of the end\n     = (object) the `line` element\n     **\n     > Usage\n     | var t1 = paper.line(50, 50, 100, 100);\n    /*/\n    proto.line = function (x1, y1, x2, y2) {\n        var attr = {};\n        if (is(x1, \"object\")) {\n            attr = x1;\n        } else if (x1 != null) {\n            attr = {\n                x1: x1,\n                x2: x2,\n                y1: y1,\n                y2: y2\n            };\n        }\n        return this.el(\"line\", attr);\n    };\n    /*/\n     * Paper.polyline\n     [ method ]\n     **\n     * Draws a polyline\n     **\n     - points (array) array of points\n     * or\n     - varargs (…) points\n     = (object) the `polyline` element\n     **\n     > Usage\n     | var p1 = paper.polyline([10, 10, 100, 100]);\n     | var p2 = paper.polyline(10, 10, 100, 100);\n    /*/\n    proto.polyline = function (points) {\n        if (arguments.length > 1) {\n            points = Array.prototype.slice.call(arguments, 0);\n        }\n        var attr = {};\n        if (is(points, \"object\") && !is(points, \"array\")) {\n            attr = points;\n        } else if (points != null) {\n            attr = {points: points};\n        }\n        return this.el(\"polyline\", attr);\n    };\n    /*/\n     * Paper.polygon\n     [ method ]\n     **\n     * Draws a polygon. See @Paper.polyline\n    /*/\n    proto.polygon = function (points) {\n        if (arguments.length > 1) {\n            points = Array.prototype.slice.call(arguments, 0);\n        }\n        var attr = {};\n        if (is(points, \"object\") && !is(points, \"array\")) {\n            attr = points;\n        } else if (points != null) {\n            attr = {points: points};\n        }\n        return this.el(\"polygon\", attr);\n    };\n    // gradients\n    (function () {\n        var $ = Snap._.$;\n        // gradients' helpers\n        function Gstops() {\n            return this.selectAll(\"stop\");\n        }\n        function GaddStop(color, offset) {\n            var stop = $(\"stop\"),\n                attr = {\n                    offset: +offset + \"%\"\n                };\n            color = Snap.color(color);\n            attr[\"stop-color\"] = color.hex;\n            if (color.opacity < 1) {\n                attr[\"stop-opacity\"] = color.opacity;\n            }\n            $(stop, attr);\n            this.node.appendChild(stop);\n            return this;\n        }\n        function GgetBBox() {\n            if (this.type == \"linearGradient\") {\n                var x1 = $(this.node, \"x1\") || 0,\n                    x2 = $(this.node, \"x2\") || 1,\n                    y1 = $(this.node, \"y1\") || 0,\n                    y2 = $(this.node, \"y2\") || 0;\n                return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));\n            } else {\n                var cx = this.node.cx || .5,\n                    cy = this.node.cy || .5,\n                    r = this.node.r || 0;\n                return Snap._.box(cx - r, cy - r, r * 2, r * 2);\n            }\n        }\n        function gradient(defs, str) {\n            var grad = eve(\"snap.util.grad.parse\", null, str).firstDefined(),\n                el;\n            if (!grad) {\n                return null;\n            }\n            grad.params.unshift(defs);\n            if (grad.type.toLowerCase() == \"l\") {\n                el = gradientLinear.apply(0, grad.params);\n            } else {\n                el = gradientRadial.apply(0, grad.params);\n            }\n            if (grad.type != grad.type.toLowerCase()) {\n                $(el.node, {\n                    gradientUnits: \"userSpaceOnUse\"\n                });\n            }\n            var stops = grad.stops,\n                len = stops.length,\n                start = 0,\n                j = 0;\n            function seed(i, end) {\n                var step = (end - start) / (i - j);\n                for (var k = j; k < i; k++) {\n                    stops[k].offset = +(+start + step * (k - j)).toFixed(2);\n                }\n                j = i;\n                start = end;\n            }\n            len--;\n            for (var i = 0; i < len; i++) if (\"offset\" in stops[i]) {\n                seed(i, stops[i].offset);\n            }\n            stops[len].offset = stops[len].offset || 100;\n            seed(len, stops[len].offset);\n            for (i = 0; i <= len; i++) {\n                var stop = stops[i];\n                el.addStop(stop.color, stop.offset);\n            }\n            return el;\n        }\n        function gradientLinear(defs, x1, y1, x2, y2) {\n            var el = Snap._.make(\"linearGradient\", defs);\n            el.stops = Gstops;\n            el.addStop = GaddStop;\n            el.getBBox = GgetBBox;\n            if (x1 != null) {\n                $(el.node, {\n                    x1: x1,\n                    y1: y1,\n                    x2: x2,\n                    y2: y2\n                });\n            }\n            return el;\n        }\n        function gradientRadial(defs, cx, cy, r, fx, fy) {\n            var el = Snap._.make(\"radialGradient\", defs);\n            el.stops = Gstops;\n            el.addStop = GaddStop;\n            el.getBBox = GgetBBox;\n            if (cx != null) {\n                $(el.node, {\n                    cx: cx,\n                    cy: cy,\n                    r: r\n                });\n            }\n            if (fx != null && fy != null) {\n                $(el.node, {\n                    fx: fx,\n                    fy: fy\n                });\n            }\n            return el;\n        }\n        /*/\n         * Paper.gradient\n         [ method ]\n         **\n         * Creates a gradient element\n         **\n         - gradient (string) gradient descriptor\n         > Gradient Descriptor\n         * The gradient descriptor is an expression formatted as\n         * follows: `<type>(<coords>)<colors>`.  The `<type>` can be\n         * either linear or radial.  The uppercase `L` or `R` letters\n         * indicate absolute coordinates offset from the SVG surface.\n         * Lowercase `l` or `r` letters indicate coordinates\n         * calculated relative to the element to which the gradient is\n         * applied.  Coordinates specify a linear gradient vector as\n         * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,\n         * `r` and optional `fx`, `fy` specifying a focal point away\n         * from the center of the circle. Specify `<colors>` as a list\n         * of dash-separated CSS color values.  Each color may be\n         * followed by a custom offset value, separated with a colon\n         * character.\n         > Examples\n         * Linear gradient, relative from top-left corner to bottom-right\n         * corner, from black through red to white:\n         | var g = paper.gradient(\"l(0, 0, 1, 1)#000-#f00-#fff\");\n         * Linear gradient, absolute from (0, 0) to (100, 100), from black\n         * through red at 25% to white:\n         | var g = paper.gradient(\"L(0, 0, 100, 100)#000-#f00:25-#fff\");\n         * Radial gradient, relative from the center of the element with radius\n         * half the width, from black to white:\n         | var g = paper.gradient(\"r(0.5, 0.5, 0.5)#000-#fff\");\n         * To apply the gradient:\n         | paper.circle(50, 50, 40).attr({\n         |     fill: g\n         | });\n         = (object) the `gradient` element\n        /*/\n        proto.gradient = function (str) {\n            return gradient(this.defs, str);\n        };\n        proto.gradientLinear = function (x1, y1, x2, y2) {\n            return gradientLinear(this.defs, x1, y1, x2, y2);\n        };\n        proto.gradientRadial = function (cx, cy, r, fx, fy) {\n            return gradientRadial(this.defs, cx, cy, r, fx, fy);\n        };\n        /*/\n         * Paper.toString\n         [ method ]\n         **\n         * Returns SVG code for the @Paper\n         = (string) SVG code for the @Paper\n        /*/\n        proto.toString = function () {\n            var doc = this.node.ownerDocument,\n                f = doc.createDocumentFragment(),\n                d = doc.createElement(\"div\"),\n                svg = this.node.cloneNode(true),\n                res;\n            f.appendChild(d);\n            d.appendChild(svg);\n            Snap._.$(svg, {xmlns: \"http://www.w3.org/2000/svg\"});\n            res = d.innerHTML;\n            f.removeChild(f.firstChild);\n            return res;\n        };\n        /*/\n         * Paper.toDataURL\n         [ method ]\n         **\n         * Returns SVG code for the @Paper as Data URI string.\n         = (string) Data URI string\n        /*/\n        proto.toDataURL = function () {\n            if (window && window.btoa) {\n                return \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(this)));\n            }\n        };\n        /*/\n         * Paper.clear\n         [ method ]\n         **\n         * Removes all child nodes of the paper, except <defs>.\n        /*/\n        proto.clear = function () {\n            var node = this.node.firstChild,\n                next;\n            while (node) {\n                next = node.nextSibling;\n                if (node.tagName != \"defs\") {\n                    node.parentNode.removeChild(node);\n                } else {\n                    proto.clear.call({node: node});\n                }\n                node = next;\n            }\n        };\n    }());\n});\n\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n    var elproto = Element.prototype,\n        is = Snap.is,\n        clone = Snap._.clone,\n        has = \"hasOwnProperty\",\n        p2s = /,?([a-z]),?/gi,\n        toFloat = parseFloat,\n        math = Math,\n        PI = math.PI,\n        mmin = math.min,\n        mmax = math.max,\n        pow = math.pow,\n        abs = math.abs;\n    function paths(ps) {\n        var p = paths.ps = paths.ps || {};\n        if (p[ps]) {\n            p[ps].sleep = 100;\n        } else {\n            p[ps] = {\n                sleep: 100\n            };\n        }\n        setTimeout(function () {\n            for (var key in p) if (p[has](key) && key != ps) {\n                p[key].sleep--;\n                !p[key].sleep && delete p[key];\n            }\n        });\n        return p[ps];\n    }\n    function box(x, y, width, height) {\n        if (x == null) {\n            x = y = width = height = 0;\n        }\n        if (y == null) {\n            y = x.y;\n            width = x.width;\n            height = x.height;\n            x = x.x;\n        }\n        return {\n            x: x,\n            y: y,\n            width: width,\n            w: width,\n            height: height,\n            h: height,\n            x2: x + width,\n            y2: y + height,\n            cx: x + width / 2,\n            cy: y + height / 2,\n            r1: math.min(width, height) / 2,\n            r2: math.max(width, height) / 2,\n            r0: math.sqrt(width * width + height * height) / 2,\n            path: rectPath(x, y, width, height),\n            vb: [x, y, width, height].join(\" \")\n        };\n    }\n    function toString() {\n        return this.join(\",\").replace(p2s, \"$1\");\n    }\n    function pathClone(pathArray) {\n        var res = clone(pathArray);\n        res.toString = toString;\n        return res;\n    }\n    function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {\n        if (length == null) {\n            return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);\n        } else {\n            return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,\n                getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));\n        }\n    }\n    function getLengthFactory(istotal, subpath) {\n        function O(val) {\n            return +(+val).toFixed(3);\n        }\n        return Snap._.cacher(function (path, length, onlystart) {\n            if (path instanceof Element) {\n                path = path.attr(\"d\");\n            }\n            path = path2curve(path);\n            var x, y, p, l, sp = \"\", subpaths = {}, point,\n                len = 0;\n            for (var i = 0, ii = path.length; i < ii; i++) {\n                p = path[i];\n                if (p[0] == \"M\") {\n                    x = +p[1];\n                    y = +p[2];\n                } else {\n                    l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n                    if (len + l > length) {\n                        if (subpath && !subpaths.start) {\n                            point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n                            sp += [\n                                \"C\" + O(point.start.x),\n                                O(point.start.y),\n                                O(point.m.x),\n                                O(point.m.y),\n                                O(point.x),\n                                O(point.y)\n                            ];\n                            if (onlystart) {return sp;}\n                            subpaths.start = sp;\n                            sp = [\n                                \"M\" + O(point.x),\n                                O(point.y) + \"C\" + O(point.n.x),\n                                O(point.n.y),\n                                O(point.end.x),\n                                O(point.end.y),\n                                O(p[5]),\n                                O(p[6])\n                            ].join();\n                            len += l;\n                            x = +p[5];\n                            y = +p[6];\n                            continue;\n                        }\n                        if (!istotal && !subpath) {\n                            point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);\n                            return point;\n                        }\n                    }\n                    len += l;\n                    x = +p[5];\n                    y = +p[6];\n                }\n                sp += p.shift() + p;\n            }\n            subpaths.end = sp;\n            point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);\n            return point;\n        }, null, Snap._.clone);\n    }\n    var getTotalLength = getLengthFactory(1),\n        getPointAtLength = getLengthFactory(),\n        getSubpathsAtLength = getLengthFactory(0, 1);\n    function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n        var t1 = 1 - t,\n            t13 = pow(t1, 3),\n            t12 = pow(t1, 2),\n            t2 = t * t,\n            t3 = t2 * t,\n            x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,\n            y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,\n            mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),\n            my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),\n            nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),\n            ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),\n            ax = t1 * p1x + t * c1x,\n            ay = t1 * p1y + t * c1y,\n            cx = t1 * c2x + t * p2x,\n            cy = t1 * c2y + t * p2y,\n            alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);\n        // (mx > nx || my < ny) && (alpha += 180);\n        return {\n            x: x,\n            y: y,\n            m: {x: mx, y: my},\n            n: {x: nx, y: ny},\n            start: {x: ax, y: ay},\n            end: {x: cx, y: cy},\n            alpha: alpha\n        };\n    }\n    function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n        if (!Snap.is(p1x, \"array\")) {\n            p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n        }\n        var bbox = curveDim.apply(null, p1x);\n        return box(\n            bbox.min.x,\n            bbox.min.y,\n            bbox.max.x - bbox.min.x,\n            bbox.max.y - bbox.min.y\n        );\n    }\n    function isPointInsideBBox(bbox, x, y) {\n        return  x >= bbox.x &&\n                x <= bbox.x + bbox.width &&\n                y >= bbox.y &&\n                y <= bbox.y + bbox.height;\n    }\n    function isBBoxIntersect(bbox1, bbox2) {\n        bbox1 = box(bbox1);\n        bbox2 = box(bbox2);\n        return isPointInsideBBox(bbox2, bbox1.x, bbox1.y)\n            || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y)\n            || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2)\n            || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2)\n            || isPointInsideBBox(bbox1, bbox2.x, bbox2.y)\n            || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y)\n            || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2)\n            || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2)\n            || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x\n                || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)\n            && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y\n                || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n    }\n    function base3(t, p1, p2, p3, p4) {\n        var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,\n            t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n        return t * t2 - 3 * p1 + 3 * p2;\n    }\n    function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {\n        if (z == null) {\n            z = 1;\n        }\n        z = z > 1 ? 1 : z < 0 ? 0 : z;\n        var z2 = z / 2,\n            n = 12,\n            Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],\n            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],\n            sum = 0;\n        for (var i = 0; i < n; i++) {\n            var ct = z2 * Tvalues[i] + z2,\n                xbase = base3(ct, x1, x2, x3, x4),\n                ybase = base3(ct, y1, y2, y3, y4),\n                comb = xbase * xbase + ybase * ybase;\n            sum += Cvalues[i] * math.sqrt(comb);\n        }\n        return z2 * sum;\n    }\n    function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {\n        if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {\n            return;\n        }\n        var t = 1,\n            step = t / 2,\n            t2 = t - step,\n            l,\n            e = .01;\n        l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n        while (abs(l - ll) > e) {\n            step /= 2;\n            t2 += (l < ll ? 1 : -1) * step;\n            l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);\n        }\n        return t2;\n    }\n    function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n        if (\n            mmax(x1, x2) < mmin(x3, x4) ||\n            mmin(x1, x2) > mmax(x3, x4) ||\n            mmax(y1, y2) < mmin(y3, y4) ||\n            mmin(y1, y2) > mmax(y3, y4)\n        ) {\n            return;\n        }\n        var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),\n            ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),\n            denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n\n        if (!denominator) {\n            return;\n        }\n        var px = nx / denominator,\n            py = ny / denominator,\n            px2 = +px.toFixed(2),\n            py2 = +py.toFixed(2);\n        if (\n            px2 < +mmin(x1, x2).toFixed(2) ||\n            px2 > +mmax(x1, x2).toFixed(2) ||\n            px2 < +mmin(x3, x4).toFixed(2) ||\n            px2 > +mmax(x3, x4).toFixed(2) ||\n            py2 < +mmin(y1, y2).toFixed(2) ||\n            py2 > +mmax(y1, y2).toFixed(2) ||\n            py2 < +mmin(y3, y4).toFixed(2) ||\n            py2 > +mmax(y3, y4).toFixed(2)\n        ) {\n            return;\n        }\n        return {x: px, y: py};\n    }\n    function inter(bez1, bez2) {\n        return interHelper(bez1, bez2);\n    }\n    function interCount(bez1, bez2) {\n        return interHelper(bez1, bez2, 1);\n    }\n    function interHelper(bez1, bez2, justCount) {\n        var bbox1 = bezierBBox(bez1),\n            bbox2 = bezierBBox(bez2);\n        if (!isBBoxIntersect(bbox1, bbox2)) {\n            return justCount ? 0 : [];\n        }\n        var l1 = bezlen.apply(0, bez1),\n            l2 = bezlen.apply(0, bez2),\n            n1 = ~~(l1 / 8),\n            n2 = ~~(l2 / 8),\n            dots1 = [],\n            dots2 = [],\n            xy = {},\n            res = justCount ? 0 : [];\n        for (var i = 0; i < n1 + 1; i++) {\n            var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n            dots1.push({x: p.x, y: p.y, t: i / n1});\n        }\n        for (i = 0; i < n2 + 1; i++) {\n            p = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n            dots2.push({x: p.x, y: p.y, t: i / n2});\n        }\n        for (i = 0; i < n1; i++) {\n            for (var j = 0; j < n2; j++) {\n                var di = dots1[i],\n                    di1 = dots1[i + 1],\n                    dj = dots2[j],\n                    dj1 = dots2[j + 1],\n                    ci = abs(di1.x - di.x) < .001 ? \"y\" : \"x\",\n                    cj = abs(dj1.x - dj.x) < .001 ? \"y\" : \"x\",\n                    is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n                if (is) {\n                    if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {\n                        continue;\n                    }\n                    xy[is.x.toFixed(4)] = is.y.toFixed(4);\n                    var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),\n                        t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n                    if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n                        if (justCount) {\n                            res++;\n                        } else {\n                            res.push({\n                                x: is.x,\n                                y: is.y,\n                                t1: t1,\n                                t2: t2\n                            });\n                        }\n                    }\n                }\n            }\n        }\n        return res;\n    }\n    function pathIntersection(path1, path2) {\n        return interPathHelper(path1, path2);\n    }\n    function pathIntersectionNumber(path1, path2) {\n        return interPathHelper(path1, path2, 1);\n    }\n    function interPathHelper(path1, path2, justCount) {\n        path1 = path2curve(path1);\n        path2 = path2curve(path2);\n        var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,\n            res = justCount ? 0 : [];\n        for (var i = 0, ii = path1.length; i < ii; i++) {\n            var pi = path1[i];\n            if (pi[0] == \"M\") {\n                x1 = x1m = pi[1];\n                y1 = y1m = pi[2];\n            } else {\n                if (pi[0] == \"C\") {\n                    bez1 = [x1, y1].concat(pi.slice(1));\n                    x1 = bez1[6];\n                    y1 = bez1[7];\n                } else {\n                    bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n                    x1 = x1m;\n                    y1 = y1m;\n                }\n                for (var j = 0, jj = path2.length; j < jj; j++) {\n                    var pj = path2[j];\n                    if (pj[0] == \"M\") {\n                        x2 = x2m = pj[1];\n                        y2 = y2m = pj[2];\n                    } else {\n                        if (pj[0] == \"C\") {\n                            bez2 = [x2, y2].concat(pj.slice(1));\n                            x2 = bez2[6];\n                            y2 = bez2[7];\n                        } else {\n                            bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n                            x2 = x2m;\n                            y2 = y2m;\n                        }\n                        var intr = interHelper(bez1, bez2, justCount);\n                        if (justCount) {\n                            res += intr;\n                        } else {\n                            for (var k = 0, kk = intr.length; k < kk; k++) {\n                                intr[k].segment1 = i;\n                                intr[k].segment2 = j;\n                                intr[k].bez1 = bez1;\n                                intr[k].bez2 = bez2;\n                            }\n                            res = res.concat(intr);\n                        }\n                    }\n                }\n            }\n        }\n        return res;\n    }\n    function isPointInsidePath(path, x, y) {\n        var bbox = pathBBox(path);\n        return isPointInsideBBox(bbox, x, y) &&\n               interPathHelper(path, [[\"M\", x, y], [\"H\", bbox.x2 + 10]], 1) % 2 == 1;\n    }\n    function pathBBox(path) {\n        var pth = paths(path);\n        if (pth.bbox) {\n            return clone(pth.bbox);\n        }\n        if (!path) {\n            return box();\n        }\n        path = path2curve(path);\n        var x = 0, \n            y = 0,\n            X = [],\n            Y = [],\n            p;\n        for (var i = 0, ii = path.length; i < ii; i++) {\n            p = path[i];\n            if (p[0] == \"M\") {\n                x = p[1];\n                y = p[2];\n                X.push(x);\n                Y.push(y);\n            } else {\n                var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);\n                X = X.concat(dim.min.x, dim.max.x);\n                Y = Y.concat(dim.min.y, dim.max.y);\n                x = p[5];\n                y = p[6];\n            }\n        }\n        var xmin = mmin.apply(0, X),\n            ymin = mmin.apply(0, Y),\n            xmax = mmax.apply(0, X),\n            ymax = mmax.apply(0, Y),\n            bb = box(xmin, ymin, xmax - xmin, ymax - ymin);\n        pth.bbox = clone(bb);\n        return bb;\n    }\n    function rectPath(x, y, w, h, r) {\n        if (r) {\n            return [\n                [\"M\", +x + (+r), y],\n                [\"l\", w - r * 2, 0],\n                [\"a\", r, r, 0, 0, 1, r, r],\n                [\"l\", 0, h - r * 2],\n                [\"a\", r, r, 0, 0, 1, -r, r],\n                [\"l\", r * 2 - w, 0],\n                [\"a\", r, r, 0, 0, 1, -r, -r],\n                [\"l\", 0, r * 2 - h],\n                [\"a\", r, r, 0, 0, 1, r, -r],\n                [\"z\"]\n            ];\n        }\n        var res = [[\"M\", x, y], [\"l\", w, 0], [\"l\", 0, h], [\"l\", -w, 0], [\"z\"]];\n        res.toString = toString;\n        return res;\n    }\n    function ellipsePath(x, y, rx, ry, a) {\n        if (a == null && ry == null) {\n            ry = rx;\n        }\n        x = +x;\n        y = +y;\n        rx = +rx;\n        ry = +ry;\n        if (a != null) {\n            var rad = Math.PI / 180,\n                x1 = x + rx * Math.cos(-ry * rad),\n                x2 = x + rx * Math.cos(-a * rad),\n                y1 = y + rx * Math.sin(-ry * rad),\n                y2 = y + rx * Math.sin(-a * rad),\n                res = [[\"M\", x1, y1], [\"A\", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];\n        } else {\n            res = [\n                [\"M\", x, y],\n                [\"m\", 0, -ry],\n                [\"a\", rx, ry, 0, 1, 1, 0, 2 * ry],\n                [\"a\", rx, ry, 0, 1, 1, 0, -2 * ry],\n                [\"z\"]\n            ];\n        }\n        res.toString = toString;\n        return res;\n    }\n    var unit2px = Snap._unit2px,\n        getPath = {\n        path: function (el) {\n            return el.attr(\"path\");\n        },\n        circle: function (el) {\n            var attr = unit2px(el);\n            return ellipsePath(attr.cx, attr.cy, attr.r);\n        },\n        ellipse: function (el) {\n            var attr = unit2px(el);\n            return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);\n        },\n        rect: function (el) {\n            var attr = unit2px(el);\n            return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);\n        },\n        image: function (el) {\n            var attr = unit2px(el);\n            return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);\n        },\n        line: function (el) {\n            return \"M\" + [el.attr(\"x1\") || 0, el.attr(\"y1\") || 0, el.attr(\"x2\"), el.attr(\"y2\")];\n        },\n        polyline: function (el) {\n            return \"M\" + el.attr(\"points\");\n        },\n        polygon: function (el) {\n            return \"M\" + el.attr(\"points\") + \"z\";\n        },\n        deflt: function (el) {\n            var bbox = el.node.getBBox();\n            return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);\n        }\n    };\n    function pathToRelative(pathArray) {\n        var pth = paths(pathArray),\n            lowerCase = String.prototype.toLowerCase;\n        if (pth.rel) {\n            return pathClone(pth.rel);\n        }\n        if (!Snap.is(pathArray, \"array\") || !Snap.is(pathArray && pathArray[0], \"array\")) {\n            pathArray = Snap.parsePathString(pathArray);\n        }\n        var res = [],\n            x = 0,\n            y = 0,\n            mx = 0,\n            my = 0,\n            start = 0;\n        if (pathArray[0][0] == \"M\") {\n            x = pathArray[0][1];\n            y = pathArray[0][2];\n            mx = x;\n            my = y;\n            start++;\n            res.push([\"M\", x, y]);\n        }\n        for (var i = start, ii = pathArray.length; i < ii; i++) {\n            var r = res[i] = [],\n                pa = pathArray[i];\n            if (pa[0] != lowerCase.call(pa[0])) {\n                r[0] = lowerCase.call(pa[0]);\n                switch (r[0]) {\n                    case \"a\":\n                        r[1] = pa[1];\n                        r[2] = pa[2];\n                        r[3] = pa[3];\n                        r[4] = pa[4];\n                        r[5] = pa[5];\n                        r[6] = +(pa[6] - x).toFixed(3);\n                        r[7] = +(pa[7] - y).toFixed(3);\n                        break;\n                    case \"v\":\n                        r[1] = +(pa[1] - y).toFixed(3);\n                        break;\n                    case \"m\":\n                        mx = pa[1];\n                        my = pa[2];\n                    default:\n                        for (var j = 1, jj = pa.length; j < jj; j++) {\n                            r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);\n                        }\n                }\n            } else {\n                r = res[i] = [];\n                if (pa[0] == \"m\") {\n                    mx = pa[1] + x;\n                    my = pa[2] + y;\n                }\n                for (var k = 0, kk = pa.length; k < kk; k++) {\n                    res[i][k] = pa[k];\n                }\n            }\n            var len = res[i].length;\n            switch (res[i][0]) {\n                case \"z\":\n                    x = mx;\n                    y = my;\n                    break;\n                case \"h\":\n                    x += +res[i][len - 1];\n                    break;\n                case \"v\":\n                    y += +res[i][len - 1];\n                    break;\n                default:\n                    x += +res[i][len - 2];\n                    y += +res[i][len - 1];\n            }\n        }\n        res.toString = toString;\n        pth.rel = pathClone(res);\n        return res;\n    }\n    function pathToAbsolute(pathArray) {\n        var pth = paths(pathArray);\n        if (pth.abs) {\n            return pathClone(pth.abs);\n        }\n        if (!is(pathArray, \"array\") || !is(pathArray && pathArray[0], \"array\")) { // rough assumption\n            pathArray = Snap.parsePathString(pathArray);\n        }\n        if (!pathArray || !pathArray.length) {\n            return [[\"M\", 0, 0]];\n        }\n        var res = [],\n            x = 0,\n            y = 0,\n            mx = 0,\n            my = 0,\n            start = 0,\n            pa0;\n        if (pathArray[0][0] == \"M\") {\n            x = +pathArray[0][1];\n            y = +pathArray[0][2];\n            mx = x;\n            my = y;\n            start++;\n            res[0] = [\"M\", x, y];\n        }\n        var crz = pathArray.length == 3 &&\n            pathArray[0][0] == \"M\" &&\n            pathArray[1][0].toUpperCase() == \"R\" &&\n            pathArray[2][0].toUpperCase() == \"Z\";\n        for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {\n            res.push(r = []);\n            pa = pathArray[i];\n            pa0 = pa[0];\n            if (pa0 != pa0.toUpperCase()) {\n                r[0] = pa0.toUpperCase();\n                switch (r[0]) {\n                    case \"A\":\n                        r[1] = pa[1];\n                        r[2] = pa[2];\n                        r[3] = pa[3];\n                        r[4] = pa[4];\n                        r[5] = pa[5];\n                        r[6] = +pa[6] + x;\n                        r[7] = +pa[7] + y;\n                        break;\n                    case \"V\":\n                        r[1] = +pa[1] + y;\n                        break;\n                    case \"H\":\n                        r[1] = +pa[1] + x;\n                        break;\n                    case \"R\":\n                        var dots = [x, y].concat(pa.slice(1));\n                        for (var j = 2, jj = dots.length; j < jj; j++) {\n                            dots[j] = +dots[j] + x;\n                            dots[++j] = +dots[j] + y;\n                        }\n                        res.pop();\n                        res = res.concat(catmullRom2bezier(dots, crz));\n                        break;\n                    case \"O\":\n                        res.pop();\n                        dots = ellipsePath(x, y, pa[1], pa[2]);\n                        dots.push(dots[0]);\n                        res = res.concat(dots);\n                        break;\n                    case \"U\":\n                        res.pop();\n                        res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n                        r = [\"U\"].concat(res[res.length - 1].slice(-2));\n                        break;\n                    case \"M\":\n                        mx = +pa[1] + x;\n                        my = +pa[2] + y;\n                    default:\n                        for (j = 1, jj = pa.length; j < jj; j++) {\n                            r[j] = +pa[j] + ((j % 2) ? x : y);\n                        }\n                }\n            } else if (pa0 == \"R\") {\n                dots = [x, y].concat(pa.slice(1));\n                res.pop();\n                res = res.concat(catmullRom2bezier(dots, crz));\n                r = [\"R\"].concat(pa.slice(-2));\n            } else if (pa0 == \"O\") {\n                res.pop();\n                dots = ellipsePath(x, y, pa[1], pa[2]);\n                dots.push(dots[0]);\n                res = res.concat(dots);\n            } else if (pa0 == \"U\") {\n                res.pop();\n                res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));\n                r = [\"U\"].concat(res[res.length - 1].slice(-2));\n            } else {\n                for (var k = 0, kk = pa.length; k < kk; k++) {\n                    r[k] = pa[k];\n                }\n            }\n            pa0 = pa0.toUpperCase();\n            if (pa0 != \"O\") {\n                switch (r[0]) {\n                    case \"Z\":\n                        x = +mx;\n                        y = +my;\n                        break;\n                    case \"H\":\n                        x = r[1];\n                        break;\n                    case \"V\":\n                        y = r[1];\n                        break;\n                    case \"M\":\n                        mx = r[r.length - 2];\n                        my = r[r.length - 1];\n                    default:\n                        x = r[r.length - 2];\n                        y = r[r.length - 1];\n                }\n            }\n        }\n        res.toString = toString;\n        pth.abs = pathClone(res);\n        return res;\n    }\n    function l2c(x1, y1, x2, y2) {\n        return [x1, y1, x2, y2, x2, y2];\n    }\n    function q2c(x1, y1, ax, ay, x2, y2) {\n        var _13 = 1 / 3,\n            _23 = 2 / 3;\n        return [\n                _13 * x1 + _23 * ax,\n                _13 * y1 + _23 * ay,\n                _13 * x2 + _23 * ax,\n                _13 * y2 + _23 * ay,\n                x2,\n                y2\n            ];\n    }\n    function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {\n        // for more information of where this math came from visit:\n        // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n        var _120 = PI * 120 / 180,\n            rad = PI / 180 * (+angle || 0),\n            res = [],\n            xy,\n            rotate = Snap._.cacher(function (x, y, rad) {\n                var X = x * math.cos(rad) - y * math.sin(rad),\n                    Y = x * math.sin(rad) + y * math.cos(rad);\n                return {x: X, y: Y};\n            });\n        if (!recursive) {\n            xy = rotate(x1, y1, -rad);\n            x1 = xy.x;\n            y1 = xy.y;\n            xy = rotate(x2, y2, -rad);\n            x2 = xy.x;\n            y2 = xy.y;\n            var cos = math.cos(PI / 180 * angle),\n                sin = math.sin(PI / 180 * angle),\n                x = (x1 - x2) / 2,\n                y = (y1 - y2) / 2;\n            var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n            if (h > 1) {\n                h = math.sqrt(h);\n                rx = h * rx;\n                ry = h * ry;\n            }\n            var rx2 = rx * rx,\n                ry2 = ry * ry,\n                k = (large_arc_flag == sweep_flag ? -1 : 1) *\n                    math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),\n                cx = k * rx * y / ry + (x1 + x2) / 2,\n                cy = k * -ry * x / rx + (y1 + y2) / 2,\n                f1 = math.asin(((y1 - cy) / ry).toFixed(9)),\n                f2 = math.asin(((y2 - cy) / ry).toFixed(9));\n\n            f1 = x1 < cx ? PI - f1 : f1;\n            f2 = x2 < cx ? PI - f2 : f2;\n            f1 < 0 && (f1 = PI * 2 + f1);\n            f2 < 0 && (f2 = PI * 2 + f2);\n            if (sweep_flag && f1 > f2) {\n                f1 = f1 - PI * 2;\n            }\n            if (!sweep_flag && f2 > f1) {\n                f2 = f2 - PI * 2;\n            }\n        } else {\n            f1 = recursive[0];\n            f2 = recursive[1];\n            cx = recursive[2];\n            cy = recursive[3];\n        }\n        var df = f2 - f1;\n        if (abs(df) > _120) {\n            var f2old = f2,\n                x2old = x2,\n                y2old = y2;\n            f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);\n            x2 = cx + rx * math.cos(f2);\n            y2 = cy + ry * math.sin(f2);\n            res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);\n        }\n        df = f2 - f1;\n        var c1 = math.cos(f1),\n            s1 = math.sin(f1),\n            c2 = math.cos(f2),\n            s2 = math.sin(f2),\n            t = math.tan(df / 4),\n            hx = 4 / 3 * rx * t,\n            hy = 4 / 3 * ry * t,\n            m1 = [x1, y1],\n            m2 = [x1 + hx * s1, y1 - hy * c1],\n            m3 = [x2 + hx * s2, y2 - hy * c2],\n            m4 = [x2, y2];\n        m2[0] = 2 * m1[0] - m2[0];\n        m2[1] = 2 * m1[1] - m2[1];\n        if (recursive) {\n            return [m2, m3, m4].concat(res);\n        } else {\n            res = [m2, m3, m4].concat(res).join().split(\",\");\n            var newres = [];\n            for (var i = 0, ii = res.length; i < ii; i++) {\n                newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;\n            }\n            return newres;\n        }\n    }\n    function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n        var t1 = 1 - t;\n        return {\n            x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,\n            y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y\n        };\n    }\n    \n    // Returns bounding box of cubic bezier curve.\n    // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html\n    // Original version: NISHIO Hirokazu\n    // Modifications: https://github.com/timo22345\n    function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {\n        var tvalues = [],\n            bounds = [[], []],\n            a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n        for (var i = 0; i < 2; ++i) {\n            if (i == 0) {\n                b = 6 * x0 - 12 * x1 + 6 * x2;\n                a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n                c = 3 * x1 - 3 * x0;\n            } else {\n                b = 6 * y0 - 12 * y1 + 6 * y2;\n                a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n                c = 3 * y1 - 3 * y0;\n            }\n            if (abs(a) < 1e-12) {\n                if (abs(b) < 1e-12) {\n                    continue;\n                }\n                t = -c / b;\n                if (0 < t && t < 1) {\n                    tvalues.push(t);\n                }\n                continue;\n            }\n            b2ac = b * b - 4 * c * a;\n            sqrtb2ac = math.sqrt(b2ac);\n            if (b2ac < 0) {\n                continue;\n            }\n            t1 = (-b + sqrtb2ac) / (2 * a);\n            if (0 < t1 && t1 < 1) {\n                tvalues.push(t1);\n            }\n            t2 = (-b - sqrtb2ac) / (2 * a);\n            if (0 < t2 && t2 < 1) {\n                tvalues.push(t2);\n            }\n        }\n\n        var x, y, j = tvalues.length,\n            jlen = j,\n            mt;\n        while (j--) {\n            t = tvalues[j];\n            mt = 1 - t;\n            bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n            bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n        }\n\n        bounds[0][jlen] = x0;\n        bounds[1][jlen] = y0;\n        bounds[0][jlen + 1] = x3;\n        bounds[1][jlen + 1] = y3;\n        bounds[0].length = bounds[1].length = jlen + 2;\n\n\n        return {\n          min: {x: mmin.apply(0, bounds[0]), y: mmin.apply(0, bounds[1])},\n          max: {x: mmax.apply(0, bounds[0]), y: mmax.apply(0, bounds[1])}\n        };\n    }\n\n    function path2curve(path, path2) {\n        var pth = !path2 && paths(path);\n        if (!path2 && pth.curve) {\n            return pathClone(pth.curve);\n        }\n        var p = pathToAbsolute(path),\n            p2 = path2 && pathToAbsolute(path2),\n            attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n            attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},\n            processPath = function (path, d, pcom) {\n                var nx, ny;\n                if (!path) {\n                    return [\"C\", d.x, d.y, d.x, d.y, d.x, d.y];\n                }\n                !(path[0] in {T: 1, Q: 1}) && (d.qx = d.qy = null);\n                switch (path[0]) {\n                    case \"M\":\n                        d.X = path[1];\n                        d.Y = path[2];\n                        break;\n                    case \"A\":\n                        path = [\"C\"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));\n                        break;\n                    case \"S\":\n                        if (pcom == \"C\" || pcom == \"S\") { // In \"S\" case we have to take into account, if the previous command is C/S.\n                            nx = d.x * 2 - d.bx;          // And reflect the previous\n                            ny = d.y * 2 - d.by;          // command's control point relative to the current point.\n                        }\n                        else {                            // or some else or nothing\n                            nx = d.x;\n                            ny = d.y;\n                        }\n                        path = [\"C\", nx, ny].concat(path.slice(1));\n                        break;\n                    case \"T\":\n                        if (pcom == \"Q\" || pcom == \"T\") { // In \"T\" case we have to take into account, if the previous command is Q/T.\n                            d.qx = d.x * 2 - d.qx;        // And make a reflection similar\n                            d.qy = d.y * 2 - d.qy;        // to case \"S\".\n                        }\n                        else {                            // or something else or nothing\n                            d.qx = d.x;\n                            d.qy = d.y;\n                        }\n                        path = [\"C\"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));\n                        break;\n                    case \"Q\":\n                        d.qx = path[1];\n                        d.qy = path[2];\n                        path = [\"C\"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));\n                        break;\n                    case \"L\":\n                        path = [\"C\"].concat(l2c(d.x, d.y, path[1], path[2]));\n                        break;\n                    case \"H\":\n                        path = [\"C\"].concat(l2c(d.x, d.y, path[1], d.y));\n                        break;\n                    case \"V\":\n                        path = [\"C\"].concat(l2c(d.x, d.y, d.x, path[1]));\n                        break;\n                    case \"Z\":\n                        path = [\"C\"].concat(l2c(d.x, d.y, d.X, d.Y));\n                        break;\n                }\n                return path;\n            },\n            fixArc = function (pp, i) {\n                if (pp[i].length > 7) {\n                    pp[i].shift();\n                    var pi = pp[i];\n                    while (pi.length) {\n                        pcoms1[i] = \"A\"; // if created multiple C:s, their original seg is saved\n                        p2 && (pcoms2[i] = \"A\"); // the same as above\n                        pp.splice(i++, 0, [\"C\"].concat(pi.splice(0, 6)));\n                    }\n                    pp.splice(i, 1);\n                    ii = mmax(p.length, p2 && p2.length || 0);\n                }\n            },\n            fixM = function (path1, path2, a1, a2, i) {\n                if (path1 && path2 && path1[i][0] == \"M\" && path2[i][0] != \"M\") {\n                    path2.splice(i, 0, [\"M\", a2.x, a2.y]);\n                    a1.bx = 0;\n                    a1.by = 0;\n                    a1.x = path1[i][1];\n                    a1.y = path1[i][2];\n                    ii = mmax(p.length, p2 && p2.length || 0);\n                }\n            },\n            pcoms1 = [], // path commands of original path p\n            pcoms2 = [], // path commands of original path p2\n            pfirst = \"\", // temporary holder for original path command\n            pcom = \"\"; // holder for previous path command of original path\n        for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {\n            p[i] && (pfirst = p[i][0]); // save current path command\n\n            if (pfirst != \"C\") // C is not saved yet, because it may be result of conversion\n            {\n                pcoms1[i] = pfirst; // Save current path command\n                i && ( pcom = pcoms1[i - 1]); // Get previous path command pcom\n            }\n            p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath\n\n            if (pcoms1[i] != \"A\" && pfirst == \"C\") pcoms1[i] = \"C\"; // A is the only command\n            // which may produce multiple C:s\n            // so we have to make sure that C is also C in original path\n\n            fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1\n\n            if (p2) { // the same procedures is done to p2\n                p2[i] && (pfirst = p2[i][0]);\n                if (pfirst != \"C\") {\n                    pcoms2[i] = pfirst;\n                    i && (pcom = pcoms2[i - 1]);\n                }\n                p2[i] = processPath(p2[i], attrs2, pcom);\n\n                if (pcoms2[i] != \"A\" && pfirst == \"C\") {\n                    pcoms2[i] = \"C\";\n                }\n\n                fixArc(p2, i);\n            }\n            fixM(p, p2, attrs, attrs2, i);\n            fixM(p2, p, attrs2, attrs, i);\n            var seg = p[i],\n                seg2 = p2 && p2[i],\n                seglen = seg.length,\n                seg2len = p2 && seg2.length;\n            attrs.x = seg[seglen - 2];\n            attrs.y = seg[seglen - 1];\n            attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;\n            attrs.by = toFloat(seg[seglen - 3]) || attrs.y;\n            attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);\n            attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);\n            attrs2.x = p2 && seg2[seg2len - 2];\n            attrs2.y = p2 && seg2[seg2len - 1];\n        }\n        if (!p2) {\n            pth.curve = pathClone(p);\n        }\n        return p2 ? [p, p2] : p;\n    }\n    function mapPath(path, matrix) {\n        if (!matrix) {\n            return path;\n        }\n        var x, y, i, j, ii, jj, pathi;\n        path = path2curve(path);\n        for (i = 0, ii = path.length; i < ii; i++) {\n            pathi = path[i];\n            for (j = 1, jj = pathi.length; j < jj; j += 2) {\n                x = matrix.x(pathi[j], pathi[j + 1]);\n                y = matrix.y(pathi[j], pathi[j + 1]);\n                pathi[j] = x;\n                pathi[j + 1] = y;\n            }\n        }\n        return path;\n    }\n\n    // http://schepers.cc/getting-to-the-point\n    function catmullRom2bezier(crp, z) {\n        var d = [];\n        for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {\n            var p = [\n                        {x: +crp[i - 2], y: +crp[i - 1]},\n                        {x: +crp[i],     y: +crp[i + 1]},\n                        {x: +crp[i + 2], y: +crp[i + 3]},\n                        {x: +crp[i + 4], y: +crp[i + 5]}\n                    ];\n            if (z) {\n                if (!i) {\n                    p[0] = {x: +crp[iLen - 2], y: +crp[iLen - 1]};\n                } else if (iLen - 4 == i) {\n                    p[3] = {x: +crp[0], y: +crp[1]};\n                } else if (iLen - 2 == i) {\n                    p[2] = {x: +crp[0], y: +crp[1]};\n                    p[3] = {x: +crp[2], y: +crp[3]};\n                }\n            } else {\n                if (iLen - 4 == i) {\n                    p[3] = p[2];\n                } else if (!i) {\n                    p[0] = {x: +crp[i], y: +crp[i + 1]};\n                }\n            }\n            d.push([\"C\",\n                  (-p[0].x + 6 * p[1].x + p[2].x) / 6,\n                  (-p[0].y + 6 * p[1].y + p[2].y) / 6,\n                  (p[1].x + 6 * p[2].x - p[3].x) / 6,\n                  (p[1].y + 6*p[2].y - p[3].y) / 6,\n                  p[2].x,\n                  p[2].y\n            ]);\n        }\n\n        return d;\n    }\n\n    // export\n    Snap.path = paths;\n\n    /*/\n     * Snap.path.getTotalLength\n     [ method ]\n     **\n     * Returns the length of the given path in pixels\n     **\n     - path (string) SVG path string\n     **\n     = (number) length\n    /*/\n    Snap.path.getTotalLength = getTotalLength;\n    /*/\n     * Snap.path.getPointAtLength\n     [ method ]\n     **\n     * Returns the coordinates of the point located at the given length along the given path\n     **\n     - path (string) SVG path string\n     - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n     **\n     = (object) representation of the point:\n     o {\n     o     x: (number) x coordinate,\n     o     y: (number) y coordinate,\n     o     alpha: (number) angle of derivative\n     o }\n    /*/\n    Snap.path.getPointAtLength = getPointAtLength;\n    /*/\n     * Snap.path.getSubpath\n     [ method ]\n     **\n     * Returns the subpath of a given path between given start and end lengths\n     **\n     - path (string) SVG path string\n     - from (number) length, in pixels, from the start of the path to the start of the segment\n     - to (number) length, in pixels, from the start of the path to the end of the segment\n     **\n     = (string) path string definition for the segment\n    /*/\n    Snap.path.getSubpath = function (path, from, to) {\n        if (this.getTotalLength(path) - to < 1e-6) {\n            return getSubpathsAtLength(path, from).end;\n        }\n        var a = getSubpathsAtLength(path, to, 1);\n        return from ? getSubpathsAtLength(a, from).end : a;\n    };\n    /*/\n     * Element.getTotalLength\n     [ method ]\n     **\n     * Returns the length of the path in pixels (only works for `path` elements)\n     = (number) length\n    /*/\n    elproto.getTotalLength = function () {\n        if (this.node.getTotalLength) {\n            return this.node.getTotalLength();\n        }\n    };\n    // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length?\n    /*/\n     * Element.getPointAtLength\n     [ method ]\n     **\n     * Returns coordinates of the point located at the given length on the given path (only works for `path` elements)\n     **\n     - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps\n     **\n     = (object) representation of the point:\n     o {\n     o     x: (number) x coordinate,\n     o     y: (number) y coordinate,\n     o     alpha: (number) angle of derivative\n     o }\n    /*/\n    elproto.getPointAtLength = function (length) {\n        return getPointAtLength(this.attr(\"d\"), length);\n    };\n    // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear.\n    /*/\n     * Element.getSubpath\n     [ method ]\n     **\n     * Returns subpath of a given element from given start and end lengths (only works for `path` elements)\n     **\n     - from (number) length, in pixels, from the start of the path to the start of the segment\n     - to (number) length, in pixels, from the start of the path to the end of the segment\n     **\n     = (string) path string definition for the segment\n    /*/\n    elproto.getSubpath = function (from, to) {\n        return Snap.path.getSubpath(this.attr(\"d\"), from, to);\n    };\n    Snap._.box = box;\n    /*/\n     * Snap.path.findDotsAtSegment\n     [ method ]\n     **\n     * Utility method\n     **\n     * Finds dot coordinates on the given cubic beziér curve at the given t\n     - p1x (number) x of the first point of the curve\n     - p1y (number) y of the first point of the curve\n     - c1x (number) x of the first anchor of the curve\n     - c1y (number) y of the first anchor of the curve\n     - c2x (number) x of the second anchor of the curve\n     - c2y (number) y of the second anchor of the curve\n     - p2x (number) x of the second point of the curve\n     - p2y (number) y of the second point of the curve\n     - t (number) position on the curve (0..1)\n     = (object) point information in format:\n     o {\n     o     x: (number) x coordinate of the point,\n     o     y: (number) y coordinate of the point,\n     o     m: {\n     o         x: (number) x coordinate of the left anchor,\n     o         y: (number) y coordinate of the left anchor\n     o     },\n     o     n: {\n     o         x: (number) x coordinate of the right anchor,\n     o         y: (number) y coordinate of the right anchor\n     o     },\n     o     start: {\n     o         x: (number) x coordinate of the start of the curve,\n     o         y: (number) y coordinate of the start of the curve\n     o     },\n     o     end: {\n     o         x: (number) x coordinate of the end of the curve,\n     o         y: (number) y coordinate of the end of the curve\n     o     },\n     o     alpha: (number) angle of the curve derivative at the point\n     o }\n    /*/\n    Snap.path.findDotsAtSegment = findDotsAtSegment;\n    /*/\n     * Snap.path.bezierBBox\n     [ method ]\n     **\n     * Utility method\n     **\n     * Returns the bounding box of a given cubic beziér curve\n     - p1x (number) x of the first point of the curve\n     - p1y (number) y of the first point of the curve\n     - c1x (number) x of the first anchor of the curve\n     - c1y (number) y of the first anchor of the curve\n     - c2x (number) x of the second anchor of the curve\n     - c2y (number) y of the second anchor of the curve\n     - p2x (number) x of the second point of the curve\n     - p2y (number) y of the second point of the curve\n     * or\n     - bez (array) array of six points for beziér curve\n     = (object) bounding box\n     o {\n     o     x: (number) x coordinate of the left top point of the box,\n     o     y: (number) y coordinate of the left top point of the box,\n     o     x2: (number) x coordinate of the right bottom point of the box,\n     o     y2: (number) y coordinate of the right bottom point of the box,\n     o     width: (number) width of the box,\n     o     height: (number) height of the box\n     o }\n    /*/\n    Snap.path.bezierBBox = bezierBBox;\n    /*/\n     * Snap.path.isPointInsideBBox\n     [ method ]\n     **\n     * Utility method\n     **\n     * Returns `true` if given point is inside bounding box\n     - bbox (string) bounding box\n     - x (string) x coordinate of the point\n     - y (string) y coordinate of the point\n     = (boolean) `true` if point is inside\n    /*/\n    Snap.path.isPointInsideBBox = isPointInsideBBox;\n    /*/\n     * Snap.path.isBBoxIntersect\n     [ method ]\n     **\n     * Utility method\n     **\n     * Returns `true` if two bounding boxes intersect\n     - bbox1 (string) first bounding box\n     - bbox2 (string) second bounding box\n     = (boolean) `true` if bounding boxes intersect\n    /*/\n    Snap.path.isBBoxIntersect = isBBoxIntersect;\n    /*/\n     * Snap.path.intersection\n     [ method ]\n     **\n     * Utility method\n     **\n     * Finds intersections of two paths\n     - path1 (string) path string\n     - path2 (string) path string\n     = (array) dots of intersection\n     o [\n     o     {\n     o         x: (number) x coordinate of the point,\n     o         y: (number) y coordinate of the point,\n     o         t1: (number) t value for segment of path1,\n     o         t2: (number) t value for segment of path2,\n     o         segment1: (number) order number for segment of path1,\n     o         segment2: (number) order number for segment of path2,\n     o         bez1: (array) eight coordinates representing beziér curve for the segment of path1,\n     o         bez2: (array) eight coordinates representing beziér curve for the segment of path2\n     o     }\n     o ]\n    /*/\n    Snap.path.intersection = pathIntersection;\n    Snap.path.intersectionNumber = pathIntersectionNumber;\n    /*/\n     * Snap.path.isPointInside\n     [ method ]\n     **\n     * Utility method\n     **\n     * Returns `true` if given point is inside a given closed path.\n     *\n     * Note: fill mode doesn’t affect the result of this method.\n     - path (string) path string\n     - x (number) x of the point\n     - y (number) y of the point\n     = (boolean) `true` if point is inside the path\n    /*/\n    Snap.path.isPointInside = isPointInsidePath;\n    /*/\n     * Snap.path.getBBox\n     [ method ]\n     **\n     * Utility method\n     **\n     * Returns the bounding box of a given path\n     - path (string) path string\n     = (object) bounding box\n     o {\n     o     x: (number) x coordinate of the left top point of the box,\n     o     y: (number) y coordinate of the left top point of the box,\n     o     x2: (number) x coordinate of the right bottom point of the box,\n     o     y2: (number) y coordinate of the right bottom point of the box,\n     o     width: (number) width of the box,\n     o     height: (number) height of the box\n     o }\n    /*/\n    Snap.path.getBBox = pathBBox;\n    Snap.path.get = getPath;\n    /*/\n     * Snap.path.toRelative\n     [ method ]\n     **\n     * Utility method\n     **\n     * Converts path coordinates into relative values\n     - path (string) path string\n     = (array) path string\n    /*/\n    Snap.path.toRelative = pathToRelative;\n    /*/\n     * Snap.path.toAbsolute\n     [ method ]\n     **\n     * Utility method\n     **\n     * Converts path coordinates into absolute values\n     - path (string) path string\n     = (array) path string\n    /*/\n    Snap.path.toAbsolute = pathToAbsolute;\n    /*/\n     * Snap.path.toCubic\n     [ method ]\n     **\n     * Utility method\n     **\n     * Converts path to a new path where all segments are cubic beziér curves\n     - pathString (string|array) path string or array of segments\n     = (array) array of segments\n    /*/\n    Snap.path.toCubic = path2curve;\n    /*/\n     * Snap.path.map\n     [ method ]\n     **\n     * Transform the path string with the given matrix\n     - path (string) path string\n     - matrix (object) see @Matrix\n     = (string) transformed path string\n    /*/\n    Snap.path.map = mapPath;\n    Snap.path.toString = toString;\n    Snap.path.clone = pathClone;\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n    var elproto = Element.prototype,\n    has = \"hasOwnProperty\",\n    supportsTouch = \"createTouch\" in glob.doc,\n    events = [\n        \"click\", \"dblclick\", \"mousedown\", \"mousemove\", \"mouseout\",\n        \"mouseover\", \"mouseup\", \"touchstart\", \"touchmove\", \"touchend\",\n        \"touchcancel\"\n    ],\n    touchMap = {\n        mousedown: \"touchstart\",\n        mousemove: \"touchmove\",\n        mouseup: \"touchend\"\n    },\n    getScroll = function (xy, el) {\n        var name = xy == \"y\" ? \"scrollTop\" : \"scrollLeft\",\n            doc = el && el.node ? el.node.ownerDocument : glob.doc;\n        return doc[name in doc.documentElement ? \"documentElement\" : \"body\"][name];\n    },\n    preventDefault = function () {\n        this.returnValue = false;\n    },\n    preventTouch = function () {\n        return this.originalEvent.preventDefault();\n    },\n    stopPropagation = function () {\n        this.cancelBubble = true;\n    },\n    stopTouch = function () {\n        return this.originalEvent.stopPropagation();\n    },\n    addEvent = (function () {\n        if (glob.doc.addEventListener) {\n            return function (obj, type, fn, element) {\n                var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,\n                    f = function (e) {\n                        var scrollY = getScroll(\"y\", element),\n                            scrollX = getScroll(\"x\", element);\n                        if (supportsTouch && touchMap[has](type)) {\n                            for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {\n                                if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {\n                                    var olde = e;\n                                    e = e.targetTouches[i];\n                                    e.originalEvent = olde;\n                                    e.preventDefault = preventTouch;\n                                    e.stopPropagation = stopTouch;\n                                    break;\n                                }\n                            }\n                        }\n                        var x = e.clientX + scrollX,\n                            y = e.clientY + scrollY;\n                        return fn.call(element, e, x, y);\n                    };\n\n                if (type !== realName) {\n                    obj.addEventListener(type, f, false);\n                }\n\n                obj.addEventListener(realName, f, false);\n\n                return function () {\n                    if (type !== realName) {\n                        obj.removeEventListener(type, f, false);\n                    }\n\n                    obj.removeEventListener(realName, f, false);\n                    return true;\n                };\n            };\n        } else if (glob.doc.attachEvent) {\n            return function (obj, type, fn, element) {\n                var f = function (e) {\n                    e = e || element.node.ownerDocument.window.event;\n                    var scrollY = getScroll(\"y\", element),\n                        scrollX = getScroll(\"x\", element),\n                        x = e.clientX + scrollX,\n                        y = e.clientY + scrollY;\n                    e.preventDefault = e.preventDefault || preventDefault;\n                    e.stopPropagation = e.stopPropagation || stopPropagation;\n                    return fn.call(element, e, x, y);\n                };\n                obj.attachEvent(\"on\" + type, f);\n                var detacher = function () {\n                    obj.detachEvent(\"on\" + type, f);\n                    return true;\n                };\n                return detacher;\n            };\n        }\n    })(),\n    drag = [],\n    dragMove = function (e) {\n        var x = e.clientX,\n            y = e.clientY,\n            scrollY = getScroll(\"y\"),\n            scrollX = getScroll(\"x\"),\n            dragi,\n            j = drag.length;\n        while (j--) {\n            dragi = drag[j];\n            if (supportsTouch) {\n                var i = e.touches && e.touches.length,\n                    touch;\n                while (i--) {\n                    touch = e.touches[i];\n                    if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {\n                        x = touch.clientX;\n                        y = touch.clientY;\n                        (e.originalEvent ? e.originalEvent : e).preventDefault();\n                        break;\n                    }\n                }\n            } else {\n                e.preventDefault();\n            }\n            var node = dragi.el.node,\n                o,\n                next = node.nextSibling,\n                parent = node.parentNode,\n                display = node.style.display;\n            // glob.win.opera && parent.removeChild(node);\n            // node.style.display = \"none\";\n            // o = dragi.el.paper.getElementByPoint(x, y);\n            // node.style.display = display;\n            // glob.win.opera && (next ? parent.insertBefore(node, next) : parent.appendChild(node));\n            // o && eve(\"snap.drag.over.\" + dragi.el.id, dragi.el, o);\n            x += scrollX;\n            y += scrollY;\n            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);\n        }\n    },\n    dragUp = function (e) {\n        Snap.unmousemove(dragMove).unmouseup(dragUp);\n        var i = drag.length,\n            dragi;\n        while (i--) {\n            dragi = drag[i];\n            dragi.el._drag = {};\n            eve(\"snap.drag.end.\" + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);\n        }\n        drag = [];\n    };\n    /*/\n     * Element.click\n     [ method ]\n     **\n     * Adds a click event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.unclick\n     [ method ]\n     **\n     * Removes a click event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.dblclick\n     [ method ]\n     **\n     * Adds a double click event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.undblclick\n     [ method ]\n     **\n     * Removes a double click event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.mousedown\n     [ method ]\n     **\n     * Adds a mousedown event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.unmousedown\n     [ method ]\n     **\n     * Removes a mousedown event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.mousemove\n     [ method ]\n     **\n     * Adds a mousemove event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.unmousemove\n     [ method ]\n     **\n     * Removes a mousemove event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.mouseout\n     [ method ]\n     **\n     * Adds a mouseout event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.unmouseout\n     [ method ]\n     **\n     * Removes a mouseout event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.mouseover\n     [ method ]\n     **\n     * Adds a mouseover event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.unmouseover\n     [ method ]\n     **\n     * Removes a mouseover event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.mouseup\n     [ method ]\n     **\n     * Adds a mouseup event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.unmouseup\n     [ method ]\n     **\n     * Removes a mouseup event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.touchstart\n     [ method ]\n     **\n     * Adds a touchstart event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.untouchstart\n     [ method ]\n     **\n     * Removes a touchstart event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.touchmove\n     [ method ]\n     **\n     * Adds a touchmove event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.untouchmove\n     [ method ]\n     **\n     * Removes a touchmove event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.touchend\n     [ method ]\n     **\n     * Adds a touchend event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.untouchend\n     [ method ]\n     **\n     * Removes a touchend event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    \n    /*/\n     * Element.touchcancel\n     [ method ]\n     **\n     * Adds a touchcancel event handler to the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    /*/\n     * Element.untouchcancel\n     [ method ]\n     **\n     * Removes a touchcancel event handler from the element\n     - handler (function) handler for the event\n     = (object) @Element\n    /*/\n    for (var i = events.length; i--;) {\n        (function (eventName) {\n            Snap[eventName] = elproto[eventName] = function (fn, scope) {\n                if (Snap.is(fn, \"function\")) {\n                    this.events = this.events || [];\n                    this.events.push({\n                        name: eventName,\n                        f: fn,\n                        unbind: addEvent(this.node || document, eventName, fn, scope || this)\n                    });\n                }\n                return this;\n            };\n            Snap[\"un\" + eventName] =\n            elproto[\"un\" + eventName] = function (fn) {\n                var events = this.events || [],\n                    l = events.length;\n                while (l--) if (events[l].name == eventName &&\n                               (events[l].f == fn || !fn)) {\n                    events[l].unbind();\n                    events.splice(l, 1);\n                    !events.length && delete this.events;\n                    return this;\n                }\n                return this;\n            };\n        })(events[i]);\n    }\n    /*/\n     * Element.hover\n     [ method ]\n     **\n     * Adds hover event handlers to the element\n     - f_in (function) handler for hover in\n     - f_out (function) handler for hover out\n     - icontext (object) #optional context for hover in handler\n     - ocontext (object) #optional context for hover out handler\n     = (object) @Element\n    /*/\n    elproto.hover = function (f_in, f_out, scope_in, scope_out) {\n        return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);\n    };\n    /*/\n     * Element.unhover\n     [ method ]\n     **\n     * Removes hover event handlers from the element\n     - f_in (function) handler for hover in\n     - f_out (function) handler for hover out\n     = (object) @Element\n    /*/\n    elproto.unhover = function (f_in, f_out) {\n        return this.unmouseover(f_in).unmouseout(f_out);\n    };\n    var draggable = [];\n    // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture.\n    // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from?\n    // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason.\n    // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?\n    /*/\n     * Element.drag\n     [ method ]\n     **\n     * Adds event handlers for an element's drag gesture\n     **\n     - onmove (function) handler for moving\n     - onstart (function) handler for drag start\n     - onend (function) handler for drag end\n     - mcontext (object) #optional context for moving handler\n     - scontext (object) #optional context for drag start handler\n     - econtext (object) #optional context for drag end handler\n     * Additionaly following `drag` events are triggered: `drag.start.<id>` on start, \n     * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element is dragged over another element \n     * `drag.over.<id>` fires as well.\n     *\n     * Start event and start handler are called in specified context or in context of the element with following parameters:\n     o x (number) x position of the mouse\n     o y (number) y position of the mouse\n     o event (object) DOM event object\n     * Move event and move handler are called in specified context or in context of the element with following parameters:\n     o dx (number) shift by x from the start point\n     o dy (number) shift by y from the start point\n     o x (number) x position of the mouse\n     o y (number) y position of the mouse\n     o event (object) DOM event object\n     * End event and end handler are called in specified context or in context of the element with following parameters:\n     o event (object) DOM event object\n     = (object) @Element\n    /*/\n    elproto.drag = function (onmove, onstart, onend, move_scope, start_scope, end_scope) {\n        if (!arguments.length) {\n            var origTransform;\n            return this.drag(function (dx, dy) {\n                this.attr({\n                    transform: origTransform + (origTransform ? \"T\" : \"t\") + [dx, dy]\n                });\n            }, function () {\n                origTransform = this.transform().local;\n            });\n        }\n        function start(e, x, y) {\n            (e.originalEvent || e).preventDefault();\n            this._drag.x = x;\n            this._drag.y = y;\n            this._drag.id = e.identifier;\n            !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);\n            drag.push({el: this, move_scope: move_scope, start_scope: start_scope, end_scope: end_scope});\n            onstart && eve.on(\"snap.drag.start.\" + this.id, onstart);\n            onmove && eve.on(\"snap.drag.move.\" + this.id, onmove);\n            onend && eve.on(\"snap.drag.end.\" + this.id, onend);\n            eve(\"snap.drag.start.\" + this.id, start_scope || move_scope || this, x, y, e);\n        }\n        this._drag = {};\n        draggable.push({el: this, start: start});\n        this.mousedown(start);\n        return this;\n    };\n    /*\n     * Element.onDragOver\n     [ method ]\n     **\n     * Shortcut to assign event handler for `drag.over.<id>` event, where `id` is the element's `id` (see @Element.id)\n     - f (function) handler for event, first argument would be the element you are dragging over\n    /*/\n    // elproto.onDragOver = function (f) {\n    //     f ? eve.on(\"snap.drag.over.\" + this.id, f) : eve.unbind(\"snap.drag.over.\" + this.id);\n    // };\n    /*/\n     * Element.undrag\n     [ method ]\n     **\n     * Removes all drag event handlers from the given element\n    /*/\n    elproto.undrag = function () {\n        var i = draggable.length;\n        while (i--) if (draggable[i].el == this) {\n            this.unmousedown(draggable[i].start);\n            draggable.splice(i, 1);\n            eve.unbind(\"snap.drag.*.\" + this.id);\n        }\n        !draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);\n        return this;\n    };\n});\n// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.\n// \n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// \n// http://www.apache.org/licenses/LICENSE-2.0\n// \n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nSnap.plugin(function (Snap, Element, Paper, glob) {\n    var elproto = Element.prototype,\n        pproto = Paper.prototype,\n        rgurl = /^/s*url/((.+)/)/,\n        Str = String,\n        $ = Snap._.$;\n    Snap.filter = {};\n    /*/\n     * Paper.filter\n     [ method ]\n     **\n     * Creates a `<filter>` element\n     **\n     - filstr (string) SVG fragment of filter provided as a string\n     = (object) @Element\n     * Note: It is recommended to use filters embedded into the page inside an empty SVG element.\n     > Usage\n     | var f = paper.filter('<feGaussianBlur stdDeviation=\"2\"/>'),\n     |     c = paper.circle(10, 10, 10).attr({\n     |         filter: f\n     |     });\n    /*/\n    pproto.filter = function (filstr) {\n        var paper = this;\n        if (paper.type != \"svg\") {\n            paper = paper.paper;\n        }\n        var f = Snap.parse(Str(filstr)),\n            id = Snap._.id(),\n            width = paper.node.offsetWidth,\n            height = paper.node.offsetHeight,\n            filter = $(\"filter\");\n        $(filter, {\n            id: id,\n            filterUnits: \"userSpaceOnUse\"\n        });\n        filter.appendChild(f.node);\n        paper.defs.appendChild(filter);\n        return new Element(filter);\n    };\n    \n    eve.on(\"snap.util.getattr.filter\", function () {\n        eve.stop();\n        var p = $(this.node, \"filter\");\n        if (p) {\n            var match = Str(p).match(rgurl);\n            return match && Snap.select(match[1]);\n        }\n    });\n    eve.on(\"snap.util.attr.filter\", function (value) {\n        if (value instanceof Element && value.type == \"filter\") {\n            eve.stop();\n            var id = value.node.id;\n            if (!id) {\n                $(value.node, {id: value.id});\n                id = value.id;\n            }\n            $(this.node, {\n                filter: Snap.url(id)\n            });\n        }\n        if (!value || value == \"none\") {\n            eve.stop();\n            this.node.removeAttribute(\"filter\");\n        }\n    });\n    /*/\n     * Snap.filter.blur\n     [ method ]\n     **\n     * Returns an SVG markup string for the blur filter\n     **\n     - x (number) amount of horizontal blur, in pixels\n     - y (number) #optional amount of vertical blur, in pixels\n     = (string) filter representation\n     > Usage\n     | var f = paper.filter(Snap.filter.blur(5, 10)),\n     |     c = paper.circle(10, 10, 10).attr({\n     |         filter: f\n     |     });\n    /*/\n    Snap.filter.blur = function (x, y) {\n        if (x == null) {\n            x = 2;\n        }\n        var def = y == null ? x : [x, y];\n        return Snap.format('/<feGaussianBlur stdDeviation=\"{def}\"/>', {\n            def: def\n        });\n    };\n    Snap.filter.blur.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.shadow\n     [ method ]\n     **\n     * Returns an SVG markup string for the shadow filter\n     **\n     - dx (number) #optional horizontal shift of the shadow, in pixels\n     - dy (number) #optional vertical shift of the shadow, in pixels\n     - blur (number) #optional amount of blur\n     - color (string) #optional color of the shadow\n     - opacity (number) #optional `0..1` opacity of the shadow\n     * or\n     - dx (number) #optional horizontal shift of the shadow, in pixels\n     - dy (number) #optional vertical shift of the shadow, in pixels\n     - color (string) #optional color of the shadow\n     - opacity (number) #optional `0..1` opacity of the shadow\n     * which makes blur default to `4`. Or\n     - dx (number) #optional horizontal shift of the shadow, in pixels\n     - dy (number) #optional vertical shift of the shadow, in pixels\n     - opacity (number) #optional `0..1` opacity of the shadow\n     = (string) filter representation\n     > Usage\n     | var f = paper.filter(Snap.filter.shadow(0, 2, 3)),\n     |     c = paper.circle(10, 10, 10).attr({\n     |         filter: f\n     |     });\n    /*/\n    Snap.filter.shadow = function (dx, dy, blur, color, opacity) {\n        if (typeof blur == \"string\") {\n            color = blur;\n            opacity = color;\n            blur = 4;\n        }\n        if (typeof color != \"string\") {\n            opacity = color;\n            color = \"#000\";\n        }\n        color = color || \"#000\";\n        if (blur == null) {\n            blur = 4;\n        }\n        if (opacity == null) {\n            opacity = 1;\n        }\n        if (dx == null) {\n            dx = 0;\n            dy = 2;\n        }\n        if (dy == null) {\n            dy = dx;\n        }\n        color = Snap.color(color);\n        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>', {\n            color: color,\n            dx: dx,\n            dy: dy,\n            blur: blur,\n            opacity: opacity\n        });\n    };\n    Snap.filter.shadow.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.grayscale\n     [ method ]\n     **\n     * Returns an SVG markup string for the grayscale filter\n     **\n     - amount (number) amount of filter (`0..1`)\n     = (string) filter representation\n    /*/\n    Snap.filter.grayscale = function (amount) {\n        if (amount == null) {\n            amount = 1;\n        }\n        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\"/>', {\n            a: 0.2126 + 0.7874 * (1 - amount),\n            b: 0.7152 - 0.7152 * (1 - amount),\n            c: 0.0722 - 0.0722 * (1 - amount),\n            d: 0.2126 - 0.2126 * (1 - amount),\n            e: 0.7152 + 0.2848 * (1 - amount),\n            f: 0.0722 - 0.0722 * (1 - amount),\n            g: 0.2126 - 0.2126 * (1 - amount),\n            h: 0.0722 + 0.9278 * (1 - amount)\n        });\n    };\n    Snap.filter.grayscale.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.sepia\n     [ method ]\n     **\n     * Returns an SVG markup string for the sepia filter\n     **\n     - amount (number) amount of filter (`0..1`)\n     = (string) filter representation\n    /*/\n    Snap.filter.sepia = function (amount) {\n        if (amount == null) {\n            amount = 1;\n        }\n        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\"/>', {\n            a: 0.393 + 0.607 * (1 - amount),\n            b: 0.769 - 0.769 * (1 - amount),\n            c: 0.189 - 0.189 * (1 - amount),\n            d: 0.349 - 0.349 * (1 - amount),\n            e: 0.686 + 0.314 * (1 - amount),\n            f: 0.168 - 0.168 * (1 - amount),\n            g: 0.272 - 0.272 * (1 - amount),\n            h: 0.534 - 0.534 * (1 - amount),\n            i: 0.131 + 0.869 * (1 - amount)\n        });\n    };\n    Snap.filter.sepia.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.saturate\n     [ method ]\n     **\n     * Returns an SVG markup string for the saturate filter\n     **\n     - amount (number) amount of filter (`0..1`)\n     = (string) filter representation\n    /*/\n    Snap.filter.saturate = function (amount) {\n        if (amount == null) {\n            amount = 1;\n        }\n        return Snap.format('<feColorMatrix type=\"saturate\" values=\"{amount}\"/>', {\n            amount: 1 - amount\n        });\n    };\n    Snap.filter.saturate.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.hueRotate\n     [ method ]\n     **\n     * Returns an SVG markup string for the hue-rotate filter\n     **\n     - angle (number) angle of rotation\n     = (string) filter representation\n    /*/\n    Snap.filter.hueRotate = function (angle) {\n        angle = angle || 0;\n        return Snap.format('<feColorMatrix type=\"hueRotate\" values=\"{angle}\"/>', {\n            angle: angle\n        });\n    };\n    Snap.filter.hueRotate.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.invert\n     [ method ]\n     **\n     * Returns an SVG markup string for the invert filter\n     **\n     - amount (number) amount of filter (`0..1`)\n     = (string) filter representation\n    /*/\n    Snap.filter.invert = function (amount) {\n        if (amount == null) {\n            amount = 1;\n        }\n        return Snap.format('<feComponentTransfer><feFuncR type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncG type=\"table\" tableValues=\"{amount} {amount2}\"/><feFuncB type=\"table\" tableValues=\"{amount} {amount2}\"/></feComponentTransfer>', {\n            amount: amount,\n            amount2: 1 - amount\n        });\n    };\n    Snap.filter.invert.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.brightness\n     [ method ]\n     **\n     * Returns an SVG markup string for the brightness filter\n     **\n     - amount (number) amount of filter (`0..1`)\n     = (string) filter representation\n    /*/\n    Snap.filter.brightness = function (amount) {\n        if (amount == null) {\n            amount = 1;\n        }\n        return Snap.format('<feComponentTransfer><feFuncR type=\"linear\" slope=\"{amount}\"/><feFuncG type=\"linear\" slope=\"{amount}\"/><feFuncB type=\"linear\" slope=\"{amount}\"/></feComponentTransfer>', {\n            amount: amount\n        });\n    };\n    Snap.filter.brightness.toString = function () {\n        return this();\n    };\n    /*/\n     * Snap.filter.contrast\n     [ method ]\n     **\n     * Returns an SVG markup string for the contrast filter\n     **\n     - amount (number) amount of filter (`0..1`)\n     = (string) filter representation\n    /*/\n    Snap.filter.contrast = function (amount) {\n        if (amount == null) {\n            amount = 1;\n        }\n        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>', {\n            amount: amount,\n            amount2: .5 - amount / 2\n        });\n    };\n    Snap.filter.contrast.toString = function () {\n        return this();\n    };\n});\n\nreturn Snap;\n}));","'use strict';\n\nvar snapsvg = module.exports = require(187);\n\nsnapsvg.plugin(function(Snap, Element) {\n\n  /*/\n   * Element.children\n   [ method ]\n   **\n   * Returns array of all the children of the element.\n   = (array) array of Elements\n  /*/\n  Element.prototype.children = function () {\n      var out = [],\n          ch = this.node.childNodes;\n      for (var i = 0, ii = ch.length; i < ii; i++) {\n          out[i] = new Snap(ch[i]);\n      }\n      return out;\n  };\n});\n\n\n/**\n * @class ClassPlugin\n *\n * Extends snapsvg with methods to add and remove classes\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n  function split(str) {\n    return str.split(//s+/);\n  }\n\n  function join(array) {\n    return array.join(' ');\n  }\n\n  function getClasses(e) {\n    return split(e.attr('class') || '');\n  }\n\n  function setClasses(e, classes) {\n    e.attr('class', join(classes));\n  }\n\n  /**\n   * @method snapsvg.Element#addClass\n   *\n   * @example\n   *\n   * e.attr('class', 'selector');\n   *\n   * e.addClass('foo bar'); // adds classes foo and bar\n   * e.attr('class'); // -> 'selector foo bar'\n   *\n   * e.addClass('fooBar');\n   * e.attr('class'); // -> 'selector foo bar fooBar'\n   *\n   * @param {String} cls classes to be added to the element\n   *\n   * @return {snapsvg.Element} the element (this)\n   */\n  Element.prototype.addClass = function(cls) {\n    var current = getClasses(this),\n        add = split(cls),\n        i, e;\n\n    for (i = 0, e; !!(e = add[i]); i++) {\n      if (current.indexOf(e) === -1) {\n        current.push(e);\n      }\n    }\n\n    setClasses(this, current);\n\n    return this;\n  };\n\n  /**\n   * @method snapsvg.Element#hasClass\n   *\n   * @param  {String}  cls the class to query for\n   * @return {Boolean} returns true if the element has the given class\n   */\n  Element.prototype.hasClass = function(cls) {\n    if (!cls) {\n      throw new Error('[snapsvg] syntax: hasClass(clsStr)');\n    }\n\n    return getClasses(this).indexOf(cls) !== -1;\n  };\n\n  /**\n   * @method snapsvg.Element#removeClass\n   *\n   * @example\n   *\n   * e.attr('class', 'foo bar');\n   *\n   * e.removeClass('foo');\n   * e.attr('class'); // -> 'bar'\n   *\n   * e.removeClass('foo bar'); // removes classes foo and bar\n   * e.attr('class'); // -> ''\n   *\n   * @param {String} cls classes to be removed from element\n   *\n   * @return {snapsvg.Element} the element (this)\n   */\n  Element.prototype.removeClass = function(cls) {\n    var current = getClasses(this),\n        remove = split(cls),\n        i, e, idx;\n\n    for (i = 0, e; !!(e = remove[i]); i++) {\n      idx = current.indexOf(e);\n\n      if (idx !== -1) {\n        // remove element from array\n        current.splice(idx, 1);\n      }\n    }\n\n    setClasses(this, current);\n\n    return this;\n  };\n\n});\n\n/**\n * @class TranslatePlugin\n *\n * Extends snapsvg with methods to translate elements\n */\nsnapsvg.plugin(function (Snap, Element, Paper, global) {\n\n  /*\n   * @method snapsvg.Element#translate\n   *\n   * @example\n   *\n   * e.translate(10, 20);\n   *\n   * // sets transform matrix to translate(10, 20)\n   *\n   * @param {Number} x translation\n   * @param {Number} y translation\n   *\n   * @return {snapsvg.Element} the element (this)\n   */\n  Element.prototype.translate = function(x, y) {\n    var matrix = new Snap.Matrix();\n    matrix.translate(x, y);\n    return this.transform(matrix);\n  };\n});\n\n\n/**\n * @class CreatePlugin\n *\n * Create an svg element without attaching it to the dom\n */\nsnapsvg.plugin(function(Snap) {\n\n  Snap.create = function(name, attrs) {\n    return Snap._.wrap(Snap._.$(name, attrs));\n  };\n});\n\n\n/**\n * @class CreatSnapAtPlugin\n *\n * Extends snap.svg with a method to create a SVG element\n * at a specific position in the DOM.\n */\nsnapsvg.plugin(function(Snap, Element, Paper, global) {\n\n  /*\n   * @method snapsvg.createSnapAt\n   *\n   * @example\n   *\n   * snapsvg.createSnapAt(parentNode, 200, 200);\n   *\n   * @param {Number} width of svg\n   * @param {Number} height of svg\n   * @param {Object} parentNode svg Element will be child of this\n   *\n   * @return {snapsvg.Element} the newly created wrapped SVG element instance\n   */\n  Snap.createSnapAt = function(width, height, parentNode) {\n\n    var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n    svg.setAttribute('width', width);\n    svg.setAttribute('height', height);\n    if (!parentNode) {\n      parentNode = document.body;\n    }\n    parentNode.appendChild(svg);\n\n    return new Snap(svg);\n  };\n});","\r\nvar isArray = function(obj) {\r\n  return Object.prototype.toString.call(obj) === '[object Array]';\r\n};\r\n\r\nvar annotate = function() {\r\n  var args = Array.prototype.slice.call(arguments);\r\n  \r\n  if (args.length === 1 && isArray(args[0])) {\r\n    args = args[0];\r\n  }\r\n\r\n  var fn = args.pop();\r\n\r\n  fn.$inject = args;\r\n\r\n  return fn;\r\n};\r\n\r\n\r\n// Current limitations:\r\n// - can't put into \"function arg\" comments\r\n// function /* (no parenthesis like this) */ (){}\r\n// function abc( /* xx (no parenthesis like this) */ a, b) {}\r\n//\r\n// Just put the comment before function or inside:\r\n// /* (((this is fine))) */ function(a, b) {}\r\n// function abc(a) { /* (((this is fine))) */}\r\n\r\nvar FN_ARGS = /^function/s*[^/(]*/(/s*([^/)]*)/)/m;\r\nvar FN_ARG = ////*([^/*]*)/*///m;\r\n\r\nvar parse = function(fn) {\r\n  if (typeof fn !== 'function') {\r\n    throw new Error('Cannot annotate \"' + fn + '\". Expected a function!');\r\n  }\r\n\r\n  var match = fn.toString().match(FN_ARGS);\r\n  return match[1] && match[1].split(',').map(function(arg) {\r\n    match = arg.match(FN_ARG);\r\n    return match ? match[1].trim() : arg.trim();\r\n  }) || [];\r\n};\r\n\r\n\r\nexports.annotate = annotate;\r\nexports.parse = parse;\r\nexports.isArray = isArray;\r\n","module.exports = {\r\n  annotate: require(189).annotate,\r\n  Module: require(192),\r\n  Injector: require(191)\r\n};\r\n","var Module = require(192);\r\nvar autoAnnotate = require(189).parse;\r\nvar annotate = require(189).annotate;\r\nvar isArray = require(189).isArray;\r\n\r\n\r\nvar Injector = function(modules, parent) {\r\n  parent = parent || {\r\n    get: function(name) {\r\n      currentlyResolving.push(name);\r\n      throw error('No provider for \"' + name + '\"!');\r\n    }\r\n  };\r\n\r\n  var currentlyResolving = [];\r\n  var providers = this._providers = Object.create(parent._providers || null);\r\n  var instances = this._instances = Object.create(null);\r\n\r\n  var self = instances.injector = this;\r\n\r\n  var error = function(msg) {\r\n    var stack = currentlyResolving.join(' -> ');\r\n    currentlyResolving.length = 0;\r\n    return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);\r\n  };\r\n\r\n  var get = function(name) {\r\n    if (!providers[name] && name.indexOf('.') !== -1) {\r\n      var parts = name.split('.');\r\n      var pivot = get(parts.shift());\r\n\r\n      while(parts.length) {\r\n        pivot = pivot[parts.shift()];\r\n      }\r\n\r\n      return pivot;\r\n    }\r\n\r\n    if (Object.hasOwnProperty.call(instances, name)) {\r\n      return instances[name];\r\n    }\r\n\r\n    if (Object.hasOwnProperty.call(providers, name)) {\r\n      if (currentlyResolving.indexOf(name) !== -1) {\r\n        currentlyResolving.push(name);\r\n        throw error('Cannot resolve circular dependency!');\r\n      }\r\n\r\n      currentlyResolving.push(name);\r\n      instances[name] = providers[name][0](providers[name][1]);\r\n      currentlyResolving.pop();\r\n\r\n      return instances[name];\r\n    }\r\n\r\n    return parent.get(name);\r\n  };\r\n\r\n  var instantiate = function(Type) {\r\n    var instance = Object.create(Type.prototype);\r\n    var returned = invoke(Type, instance);\r\n\r\n    return typeof returned === 'object' ? returned : instance;\r\n  };\r\n\r\n  var invoke = function(fn, context) {\r\n    if (typeof fn !== 'function') {\r\n      if (isArray(fn)) {\r\n        fn = annotate(fn.slice());\r\n      } else {\r\n        throw new Error('Cannot invoke \"' + fn + '\". Expected a function!');\r\n      }\r\n    }\r\n\r\n    var inject = fn.$inject && fn.$inject || autoAnnotate(fn);\r\n    var dependencies = inject.map(function(dep) {\r\n      return get(dep);\r\n    });\r\n\r\n    // TODO(vojta): optimize without apply\r\n    return fn.apply(context, dependencies);\r\n  };\r\n\r\n\r\n  var createPrivateInjectorFactory = function(privateChildInjector) {\r\n    return annotate(function(key) {\r\n      return privateChildInjector.get(key);\r\n    });\r\n  };\r\n\r\n  var createChild = function(modules, forceNewInstances) {\r\n    if (forceNewInstances && forceNewInstances.length) {\r\n      var fromParentModule = Object.create(null);\r\n      var matchedScopes = Object.create(null);\r\n\r\n      var privateInjectorsCache = [];\r\n      var privateChildInjectors = [];\r\n      var privateChildFactories = [];\r\n\r\n      var provider;\r\n      var cacheIdx;\r\n      var privateChildInjector;\r\n      var privateChildInjectorFactory;\r\n      for (var name in providers) {\r\n        provider = providers[name];\r\n\r\n        if (forceNewInstances.indexOf(name) !== -1) {\r\n          if (provider[2] === 'private') {\r\n            cacheIdx = privateInjectorsCache.indexOf(provider[3]);\r\n            if (cacheIdx === -1) {\r\n              privateChildInjector = provider[3].createChild([], forceNewInstances);\r\n              privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);\r\n              privateInjectorsCache.push(provider[3]);\r\n              privateChildInjectors.push(privateChildInjector);\r\n              privateChildFactories.push(privateChildInjectorFactory);\r\n              fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];\r\n            } else {\r\n              fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];\r\n            }\r\n          } else {\r\n            fromParentModule[name] = [provider[2], provider[1]];\r\n          }\r\n          matchedScopes[name] = true;\r\n        }\r\n\r\n        if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {\r\n          forceNewInstances.forEach(function(scope) {\r\n            if (provider[1].$scope.indexOf(scope) !== -1) {\r\n              fromParentModule[name] = [provider[2], provider[1]];\r\n              matchedScopes[scope] = true;\r\n            }\r\n          });\r\n        }\r\n      }\r\n\r\n      forceNewInstances.forEach(function(scope) {\r\n        if (!matchedScopes[scope]) {\r\n          throw new Error('No provider for \"' + scope + '\". Cannot use provider from the parent!');\r\n        }\r\n      });\r\n\r\n      modules.unshift(fromParentModule);\r\n    }\r\n\r\n    return new Injector(modules, self);\r\n  };\r\n\r\n  var factoryMap = {\r\n    factory: invoke,\r\n    type: instantiate,\r\n    value: function(value) {\r\n      return value;\r\n    }\r\n  };\r\n\r\n  modules.forEach(function(module) {\r\n\r\n    function arrayUnwrap(type, value) {\r\n      if (type !== 'value' && isArray(value)) {\r\n        value = annotate(value.slice());\r\n      }\r\n\r\n      return value;\r\n    }\r\n\r\n    // TODO(vojta): handle wrong inputs (modules)\r\n    if (module instanceof Module) {\r\n      module.forEach(function(provider) {\r\n        var name = provider[0];\r\n        var type = provider[1];\r\n        var value = provider[2];\r\n\r\n        providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n      });\r\n    } else if (typeof module === 'object') {\r\n      if (module.__exports__) {\r\n        var clonedModule = Object.keys(module).reduce(function(m, key) {\r\n          if (key.substring(0, 2) !== '__') {\r\n            m[key] = module[key];\r\n          }\r\n          return m;\r\n        }, Object.create(null));\r\n\r\n        var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);\r\n        var getFromPrivateInjector = annotate(function(key) {\r\n          return privateInjector.get(key);\r\n        });\r\n        module.__exports__.forEach(function(key) {\r\n          providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];\r\n        });\r\n      } else {\r\n        Object.keys(module).forEach(function(name) {\r\n          if (module[name][2] === 'private') {\r\n            providers[name] = module[name];\r\n            return;\r\n          }\r\n\r\n          var type = module[name][0];\r\n          var value = module[name][1];\r\n\r\n          providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];\r\n        });\r\n      }\r\n    }\r\n  });\r\n\r\n  // public API\r\n  this.get = get;\r\n  this.invoke = invoke;\r\n  this.instantiate = instantiate;\r\n  this.createChild = createChild;\r\n};\r\n\r\nmodule.exports = Injector;\r\n","var Module = function() {\r\n  var providers = [];\r\n\r\n  this.factory = function(name, factory) {\r\n    providers.push([name, 'factory', factory]);\r\n    return this;\r\n  };\r\n\r\n  this.value = function(name, value) {\r\n    providers.push([name, 'value', value]);\r\n    return this;\r\n  };\r\n\r\n  this.type = function(name, type) {\r\n    providers.push([name, 'type', type]);\r\n    return this;\r\n  };\r\n\r\n  this.forEach = function(iterator) {\r\n    providers.forEach(iterator);\r\n  };\r\n};\r\n\r\nmodule.exports = Module;\r\n","'use strict';\n\nvar hat = require(194);\n\n\n/**\n * Create a new id generator / cache instance.\n *\n * You may optionally provide a seed that is used internally.\n *\n * @param {Seed} seed\n */\nfunction Ids(seed) {\n  seed = seed || [ 128, 36, 1 ];\n  this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;\n}\n\nmodule.exports = Ids;\n\n/**\n * Generate a next id.\n *\n * @param {Object} [element] element to bind the id to\n *\n * @return {String} id\n */\nIds.prototype.next = function(element) {\n  return this._seed(element || true);\n};\n\n/**\n * Generate a next id with a given prefix.\n *\n * @param {Object} [element] element to bind the id to\n *\n * @return {String} id\n */\nIds.prototype.nextPrefixed = function(prefix, element) {\n  var id;\n\n  do {\n    id = prefix + this.next(true);\n  } while (this.assigned(id));\n\n  // claim {prefix}{random}\n  this.claim(id, element);\n\n  // return\n  return id;\n};\n\n/**\n * Manually claim an existing id.\n *\n * @param {String} id\n * @param {String} [element] element the id is claimed by\n */\nIds.prototype.claim = function(id, element) {\n  this._seed.set(id, element || true);\n};\n\n/**\n * Returns true if the given id has already been assigned.\n *\n * @param  {String} id\n * @return {Boolean}\n */\nIds.prototype.assigned = function(id) {\n  return this._seed.get(id) || false;\n};","var hat = module.exports = function (bits, base) {\n    if (!base) base = 16;\n    if (bits === undefined) bits = 128;\n    if (bits <= 0) return '0';\n    \n    var digits = Math.log(Math.pow(2, bits)) / Math.log(base);\n    for (var i = 2; digits === Infinity; i *= 2) {\n        digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;\n    }\n    \n    var rem = digits - Math.floor(digits);\n    \n    var res = '';\n    \n    for (var i = 0; i < Math.floor(digits); i++) {\n        var x = Math.floor(Math.random() * base).toString(base);\n        res = x + res;\n    }\n    \n    if (rem) {\n        var b = Math.pow(base, rem);\n        var x = Math.floor(Math.random() * b).toString(base);\n        res = x + res;\n    }\n    \n    var parsed = parseInt(res, base);\n    if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {\n        return hat(bits, base)\n    }\n    else return res;\n};\n\nhat.rack = function (bits, base, expandBy) {\n    var fn = function (data) {\n        var iters = 0;\n        do {\n            if (iters ++ > 10) {\n                if (expandBy) bits += expandBy;\n                else throw new Error('too many ID collisions, use more bits')\n            }\n            \n            var id = hat(bits, base);\n        } while (Object.hasOwnProperty.call(hats, id));\n        \n        hats[id] = data;\n        return id;\n    };\n    var hats = fn.hats = {};\n    \n    fn.get = function (id) {\n        return fn.hats[id];\n    };\n    \n    fn.set = function (id, value) {\n        fn.hats[id] = value;\n        return fn;\n    };\n    \n    fn.bits = bits || 128;\n    fn.base = base || 16;\n    return fn;\n};\n","if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n","var baseFlatten = require(240),\n    isIterateeCall = require(295);\n\n/**\n * Flattens a nested array. If `isDeep` is `true` the array is recursively\n * flattened, otherwise it is only flattened a single level.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, 3, [4]]]);\n * // => [1, 2, 3, [4]]\n *\n * // using `isDeep`\n * _.flatten([1, [2, 3, [4]]], true);\n * // => [1, 2, 3, 4]\n */\nfunction flatten(array, isDeep, guard) {\n  var length = array ? array.length : 0;\n  if (guard && isIterateeCall(array, isDeep, guard)) {\n    isDeep = false;\n  }\n  return length ? baseFlatten(array, isDeep) : [];\n}\n\nmodule.exports = flatten;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n  var length = array ? array.length : 0;\n  return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n","var baseCallback = require(229),\n    baseUniq = require(264),\n    isIterateeCall = require(295),\n    sortedUniq = require(311);\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * for equality comparisons, in which only the first occurence of each element\n * is kept. Providing `true` for `isSorted` performs a faster search algorithm\n * for sorted arrays. If an iteratee function is provided it is invoked for\n * each element in the array to generate the criterion by which uniqueness\n * is computed. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index, array).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias unique\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {boolean} [isSorted] Specify the array is sorted.\n * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new duplicate-value-free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n *\n * // using `isSorted`\n * _.uniq([1, 1, 2], true);\n * // => [1, 2]\n *\n * // using an iteratee function\n * _.uniq([1, 2.5, 1.5, 2], function(n) {\n *   return this.floor(n);\n * }, Math);\n * // => [1, 2.5]\n *\n * // using the `_.property` callback shorthand\n * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nfunction uniq(array, isSorted, iteratee, thisArg) {\n  var length = array ? array.length : 0;\n  if (!length) {\n    return [];\n  }\n  if (isSorted != null && typeof isSorted != 'boolean') {\n    thisArg = iteratee;\n    iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;\n    isSorted = false;\n  }\n  iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);\n  return (isSorted)\n    ? sortedUniq(array, iteratee)\n    : baseUniq(array, iteratee);\n}\n\nmodule.exports = uniq;\n","module.exports = require(198);\n","var LazyWrapper = require(217),\n    LodashWrapper = require(218),\n    baseLodash = require(250),\n    isArray = require(316),\n    isObjectLike = require(299),\n    wrapperClone = require(314);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a `lodash` object which wraps `value` to enable implicit chaining.\n * Methods that operate on and return arrays, collections, and functions can\n * be chained together. Methods that return a boolean or single value will\n * automatically end the chain returning the unwrapped value. Explicit chaining\n * may be enabled using `_.chain`. The execution of chained methods is lazy,\n * that is, execution is deferred until `_#value` is implicitly or explicitly\n * called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization that merges iteratees to avoid creating intermediate\n * arrays and reduce the number of iteratee executions.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,\n * `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,\n * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,\n * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,\n * and `where`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,\n * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,\n * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`,\n * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`,\n * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,\n * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,\n * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,\n * `keysIn`, `map`, `mapValues`, `matches`, `matchesProperty`, `memoize`,\n * `merge`, `mixin`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,\n * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,\n * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `reverse`,\n * `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`,\n * `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`,\n * `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, `transform`,\n * `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, `where`,\n * `without`, `wrap`, `xor`, `zip`, and `zipObject`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,\n * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,\n * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,\n * `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`,\n * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`\n * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`,\n * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `isTypedArray`,\n * `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, `noConflict`,\n * `noop`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`,\n * `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`,\n * `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,\n * `uniqueId`, `value`, and `words`\n *\n * The wrapper method `sample` will return a wrapped value when `n` is provided,\n * otherwise an unwrapped value is returned.\n *\n * @name _\n * @constructor\n * @category Chain\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // returns an unwrapped value\n * wrapped.reduce(function(total, n) {\n *   return total + n;\n * });\n * // => 6\n *\n * // returns a wrapped value\n * var squares = wrapped.map(function(n) {\n *   return n * n;\n * });\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n  if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n    if (value instanceof LodashWrapper) {\n      return value;\n    }\n    if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {\n      return wrapperClone(value);\n    }\n  }\n  return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\n\nmodule.exports = lodash;\n","var arrayEvery = require(222),\n    baseCallback = require(229),\n    baseEvery = require(236),\n    isArray = require(316),\n    isIterateeCall = require(295);\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * The predicate is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias all\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n *  else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n *   { 'user': 'barney', 'active': false },\n *   { 'user': 'fred',   'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.every(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, thisArg) {\n  var func = isArray(collection) ? arrayEvery : baseEvery;\n  if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n    predicate = null;\n  }\n  if (typeof predicate != 'function' || thisArg !== undefined) {\n    predicate = baseCallback(predicate, thisArg, 3);\n  }\n  return func(collection, predicate);\n}\n\nmodule.exports = every;\n","var arrayFilter = require(223),\n    baseCallback = require(229),\n    baseFilter = require(237),\n    isArray = require(316);\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias select\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * _.filter([4, 5, 6], function(n) {\n *   return n % 2 == 0;\n * });\n * // => [4, 6]\n *\n * var users = [\n *   { 'user': 'barney', 'age': 36, 'active': true },\n *   { 'user': 'fred',   'age': 40, 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.filter(users, 'active', false), 'user');\n * // => ['fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.filter(users, 'active'), 'user');\n * // => ['barney']\n */\nfunction filter(collection, predicate, thisArg) {\n  var func = isArray(collection) ? arrayFilter : baseFilter;\n  predicate = baseCallback(predicate, thisArg, 3);\n  return func(collection, predicate);\n}\n\nmodule.exports = filter;\n","var baseEach = require(235),\n    createFind = require(279);\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias detect\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'age': 36, 'active': true },\n *   { 'user': 'fred',    'age': 40, 'active': false },\n *   { 'user': 'pebbles', 'age': 1,  'active': true }\n * ];\n *\n * _.result(_.find(users, function(chr) {\n *   return chr.age < 40;\n * }), 'user');\n * // => 'barney'\n *\n * // using the `_.matches` callback shorthand\n * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');\n * // => 'pebbles'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.result(_.find(users, 'active', false), 'user');\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.result(_.find(users, 'active'), 'user');\n * // => 'barney'\n */\nvar find = createFind(baseEach);\n\nmodule.exports = find;\n","var arrayEach = require(221),\n    baseEach = require(235),\n    createForEach = require(280);\n\n/**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection). Iteratee functions may exit iteration early\n * by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`\n * may be used for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array|Object|string} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(n) {\n *   console.log(n);\n * }).value();\n * // => logs each value from left to right and returns the array\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {\n *   console.log(n, key);\n * });\n * // => logs each value-key pair and returns the object (iteration order is not guaranteed)\n */\nvar forEach = createForEach(arrayEach, baseEach);\n\nmodule.exports = forEach;\n","var createAggregator = require(272);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is an array of the elements responsible for generating the key.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n *   return Math.floor(n);\n * });\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n *   return this.floor(n);\n * }, Math);\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * // using the `_.property` callback shorthand\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n  if (hasOwnProperty.call(result, key)) {\n    result[key].push(value);\n  } else {\n    result[key] = [value];\n  }\n});\n\nmodule.exports = groupBy;\n","var baseIndexOf = require(245),\n    getLength = require(290),\n    isArray = require(316),\n    isIterateeCall = require(295),\n    isLength = require(298),\n    isString = require(322),\n    values = require(331);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection` using\n * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it is used as the offset\n * from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @alias contains, include\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {*} target The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n * @returns {boolean} Returns `true` if a matching element is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n * // => true\n *\n * _.includes('pebbles', 'eb');\n * // => true\n */\nfunction includes(collection, target, fromIndex, guard) {\n  var length = collection ? getLength(collection) : 0;\n  if (!isLength(length)) {\n    collection = values(collection);\n    length = collection.length;\n  }\n  if (!length) {\n    return false;\n  }\n  if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {\n    fromIndex = 0;\n  } else {\n    fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);\n  }\n  return (typeof collection == 'string' || !isArray(collection) && isString(collection))\n    ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)\n    : (baseIndexOf(collection, target, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","var arrayMap = require(224),\n    baseCallback = require(229),\n    baseMap = require(251),\n    isArray = require(316);\n\n/**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,\n * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,\n * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,\n * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,\n * `sum`, `uniq`, and `words`\n *\n * @static\n * @memberOf _\n * @alias collect\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function timesThree(n) {\n *   return n * 3;\n * }\n *\n * _.map([1, 2], timesThree);\n * // => [3, 6]\n *\n * _.map({ 'a': 1, 'b': 2 }, timesThree);\n * // => [3, 6] (iteration order is not guaranteed)\n *\n * var users = [\n *   { 'user': 'barney' },\n *   { 'user': 'fred' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee, thisArg) {\n  var func = isArray(collection) ? arrayMap : baseMap;\n  iteratee = baseCallback(iteratee, thisArg, 3);\n  return func(collection, iteratee);\n}\n\nmodule.exports = map;\n","var arrayReduce = require(225),\n    baseEach = require(235),\n    createReduce = require(283);\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` through `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not provided the first element of `collection` is used as the initial\n * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as interatees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`\n *\n * @static\n * @memberOf _\n * @alias foldl, inject\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.reduce([1, 2], function(total, n) {\n *   return total + n;\n * });\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {\n *   result[key] = n * 3;\n *   return result;\n * }, {});\n * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)\n */\nvar reduce = createReduce(arrayReduce, baseEach);\n\nmodule.exports = reduce;\n","var getLength = require(290),\n    isLength = require(298),\n    keys = require(326);\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable properties for objects.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the size of `collection`.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n  var length = collection ? getLength(collection) : 0;\n  return isLength(length) ? length : keys(collection).length;\n}\n\nmodule.exports = size;\n","var arraySome = require(226),\n    baseCallback = require(229),\n    baseSome = require(261),\n    isArray = require(316),\n    isIterateeCall = require(295);\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * The function returns as soon as it finds a passing value and does not iterate\n * over the entire collection. The predicate is bound to `thisArg` and invoked\n * with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias any\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n *   { 'user': 'barney', 'active': true },\n *   { 'user': 'fred',   'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.some(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, thisArg) {\n  var func = isArray(collection) ? arraySome : baseSome;\n  if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n    predicate = null;\n  }\n  if (typeof predicate != 'function' || thisArg !== undefined) {\n    predicate = baseCallback(predicate, thisArg, 3);\n  }\n  return func(collection, predicate);\n}\n\nmodule.exports = some;\n","var baseCallback = require(229),\n    baseMap = require(251),\n    baseSortBy = require(262),\n    compareAscending = require(269),\n    isIterateeCall = require(295);\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection through `iteratee`. This method performs\n * a stable sort, that is, it preserves the original sort order of equal elements.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n *  per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * _.sortBy([1, 2, 3], function(n) {\n *   return Math.sin(n);\n * });\n * // => [3, 1, 2]\n *\n * _.sortBy([1, 2, 3], function(n) {\n *   return this.sin(n);\n * }, Math);\n * // => [3, 1, 2]\n *\n * var users = [\n *   { 'user': 'fred' },\n *   { 'user': 'pebbles' },\n *   { 'user': 'barney' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.sortBy(users, 'user'), 'user');\n * // => ['barney', 'fred', 'pebbles']\n */\nfunction sortBy(collection, iteratee, thisArg) {\n  if (collection == null) {\n    return [];\n  }\n  if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n    iteratee = null;\n  }\n  var index = -1;\n  iteratee = baseCallback(iteratee, thisArg, 3);\n\n  var result = baseMap(collection, function(value, key, collection) {\n    return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };\n  });\n  return baseSortBy(result, compareAscending);\n}\n\nmodule.exports = sortBy;\n","var isNative = require(318);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeNow = isNative(nativeNow = Date.now) && nativeNow;\n\n/**\n * Gets the number of milliseconds that have elapsed since the Unix epoch\n * (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @category Date\n * @example\n *\n * _.defer(function(stamp) {\n *   console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\nvar now = nativeNow || function() {\n  return new Date().getTime();\n};\n\nmodule.exports = now;\n","var createWrapper = require(284),\n    replaceHolders = require(307),\n    restParam = require(216);\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n    PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and prepends any additional `_.bind` arguments to those provided to the\n * bound function.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind` this method does not set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var greet = function(greeting, punctuation) {\n *   return greeting + ' ' + this.user + punctuation;\n * };\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // using placeholders\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\nvar bind = restParam(function(func, thisArg, partials) {\n  var bitmask = BIND_FLAG;\n  if (partials.length) {\n    var holders = replaceHolders(partials, bind.placeholder);\n    bitmask |= PARTIAL_FLAG;\n  }\n  return createWrapper(func, bitmask, thisArg, partials, holders);\n});\n\n// Assign default placeholders.\nbind.placeholder = {};\n\nmodule.exports = bind;\n","var isObject = require(320),\n    now = require(212);\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that delays invoking `func` until after `wait` milliseconds\n * have elapsed since the last time it was invoked. The created function comes\n * with a `cancel` method to cancel delayed invocations. Provide an options\n * object to indicate that `func` should be invoked on the leading and/or\n * trailing edge of the `wait` timeout. Subsequent calls to the debounced\n * function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n *  edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n *  delayed before it is invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n *  edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // avoid costly calculations while the window size is in flux\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }));\n *\n * // ensure `batchLog` is invoked once after 1 second of debounced calls\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', _.debounce(batchLog, 250, {\n *   'maxWait': 1000\n * }));\n *\n * // cancel a debounced call\n * var todoChanges = _.debounce(batchLog, 1000);\n * Object.observe(models.todo, todoChanges);\n *\n * Object.observe(models, function(changes) {\n *   if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n *     todoChanges.cancel();\n *   }\n * }, ['delete']);\n *\n * // ...at some point `models.todo` is changed\n * models.todo.completed = true;\n *\n * // ...before 1 second has passed `models.todo` is deleted\n * // which cancels the debounced `todoChanges` call\n * delete models.todo;\n */\nfunction debounce(func, wait, options) {\n  var args,\n      maxTimeoutId,\n      result,\n      stamp,\n      thisArg,\n      timeoutId,\n      trailingCall,\n      lastCalled = 0,\n      maxWait = false,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  wait = wait < 0 ? 0 : (+wait || 0);\n  if (options === true) {\n    var leading = true;\n    trailing = false;\n  } else if (isObject(options)) {\n    leading = options.leading;\n    maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n    trailing = 'trailing' in options ? options.trailing : trailing;\n  }\n\n  function cancel() {\n    if (timeoutId) {\n      clearTimeout(timeoutId);\n    }\n    if (maxTimeoutId) {\n      clearTimeout(maxTimeoutId);\n    }\n    maxTimeoutId = timeoutId = trailingCall = undefined;\n  }\n\n  function delayed() {\n    var remaining = wait - (now() - stamp);\n    if (remaining <= 0 || remaining > wait) {\n      if (maxTimeoutId) {\n        clearTimeout(maxTimeoutId);\n      }\n      var isCalled = trailingCall;\n      maxTimeoutId = timeoutId = trailingCall = undefined;\n      if (isCalled) {\n        lastCalled = now();\n        result = func.apply(thisArg, args);\n        if (!timeoutId && !maxTimeoutId) {\n          args = thisArg = null;\n        }\n      }\n    } else {\n      timeoutId = setTimeout(delayed, remaining);\n    }\n  }\n\n  function maxDelayed() {\n    if (timeoutId) {\n      clearTimeout(timeoutId);\n    }\n    maxTimeoutId = timeoutId = trailingCall = undefined;\n    if (trailing || (maxWait !== wait)) {\n      lastCalled = now();\n      result = func.apply(thisArg, args);\n      if (!timeoutId && !maxTimeoutId) {\n        args = thisArg = null;\n      }\n    }\n  }\n\n  function debounced() {\n    args = arguments;\n    stamp = now();\n    thisArg = this;\n    trailingCall = trailing && (timeoutId || !leading);\n\n    if (maxWait === false) {\n      var leadingCall = leading && !timeoutId;\n    } else {\n      if (!maxTimeoutId && !leading) {\n        lastCalled = stamp;\n      }\n      var remaining = maxWait - (stamp - lastCalled),\n          isCalled = remaining <= 0 || remaining > maxWait;\n\n      if (isCalled) {\n        if (maxTimeoutId) {\n          maxTimeoutId = clearTimeout(maxTimeoutId);\n        }\n        lastCalled = stamp;\n        result = func.apply(thisArg, args);\n      }\n      else if (!maxTimeoutId) {\n        maxTimeoutId = setTimeout(maxDelayed, remaining);\n      }\n    }\n    if (isCalled && timeoutId) {\n      timeoutId = clearTimeout(timeoutId);\n    }\n    else if (!timeoutId && wait !== maxWait) {\n      timeoutId = setTimeout(delayed, wait);\n    }\n    if (leadingCall) {\n      isCalled = true;\n      result = func.apply(thisArg, args);\n    }\n    if (isCalled && !timeoutId && !maxTimeoutId) {\n      args = thisArg = null;\n    }\n    return result;\n  }\n  debounced.cancel = cancel;\n  return debounced;\n}\n\nmodule.exports = debounce;\n","var baseDelay = require(233),\n    restParam = require(216);\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it is invoked.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke the function with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n *   console.log(text);\n * }, 'deferred');\n * // logs 'deferred' after one or more milliseconds\n */\nvar defer = restParam(function(func, args) {\n  return baseDelay(func, 1, args);\n});\n\nmodule.exports = defer;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n *   return what + ' ' + _.initial(names).join(', ') +\n *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction restParam(func, start) {\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n  return function() {\n    var args = arguments,\n        index = -1,\n        length = nativeMax(args.length - start, 0),\n        rest = Array(length);\n\n    while (++index < length) {\n      rest[index] = args[start + index];\n    }\n    switch (start) {\n      case 0: return func.call(this, rest);\n      case 1: return func.call(this, args[0], rest);\n      case 2: return func.call(this, args[0], args[1], rest);\n    }\n    var otherArgs = Array(start + 1);\n    index = -1;\n    while (++index < start) {\n      otherArgs[index] = args[index];\n    }\n    otherArgs[start] = rest;\n    return func.apply(this, otherArgs);\n  };\n}\n\nmodule.exports = restParam;\n","var baseCreate = require(232),\n    baseLodash = require(250);\n\n/** Used as references for `-Infinity` and `Infinity`. */\nvar POSITIVE_INFINITY = Number.POSITIVE_INFINITY;\n\n/**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @param {*} value The value to wrap.\n */\nfunction LazyWrapper(value) {\n  this.__wrapped__ = value;\n  this.__actions__ = null;\n  this.__dir__ = 1;\n  this.__dropCount__ = 0;\n  this.__filtered__ = false;\n  this.__iteratees__ = null;\n  this.__takeCount__ = POSITIVE_INFINITY;\n  this.__views__ = null;\n}\n\nLazyWrapper.prototype = baseCreate(baseLodash.prototype);\nLazyWrapper.prototype.constructor = LazyWrapper;\n\nmodule.exports = LazyWrapper;\n","var baseCreate = require(232),\n    baseLodash = require(250);\n\n/**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable chaining for all wrapper methods.\n * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.\n */\nfunction LodashWrapper(value, chainAll, actions) {\n  this.__wrapped__ = value;\n  this.__actions__ = actions || [];\n  this.__chain__ = !!chainAll;\n}\n\nLodashWrapper.prototype = baseCreate(baseLodash.prototype);\nLodashWrapper.prototype.constructor = LodashWrapper;\n\nmodule.exports = LodashWrapper;\n","var cachePush = require('./cachePush'),\n    isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n *\n * Creates a cache object to store unique values.\n *\n * @private\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var length = values ? values.length : 0;\n\n  this.data = { 'hash': nativeCreate(null), 'set': new Set };\n  while (length--) {\n    this.push(values[length]);\n  }\n}\n\n// Add functions to the `Set` cache.\nSetCache.prototype.push = cachePush;\n\nmodule.exports = SetCache;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction arrayCopy(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\nmodule.exports = arrayCopy;\n","/**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array.length;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\nmodule.exports = arrayEach;\n","/**\n * A specialized version of `_.every` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n *  else `false`.\n */\nfunction arrayEvery(array, predicate) {\n  var index = -1,\n      length = array.length;\n\n  while (++index < length) {\n    if (!predicate(array[index], index, array)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nmodule.exports = arrayEvery;\n","/**\n * A specialized version of `_.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n  var index = -1,\n      length = array.length,\n      resIndex = -1,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (predicate(value, index, array)) {\n      result[++resIndex] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * A specialized version of `_.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * A specialized version of `_.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initFromArray] Specify using the first element of `array`\n *  as the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initFromArray) {\n  var index = -1,\n      length = array.length;\n\n  if (initFromArray && length) {\n    accumulator = array[++index];\n  }\n  while (++index < length) {\n    accumulator = iteratee(accumulator, array[index], index, array);\n  }\n  return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * A specialized version of `_.some` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array.length;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nmodule.exports = arraySome;\n","var getSymbols = require(291),\n    keys = require(326);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * A specialized version of `_.assign` for customizing assigned values without\n * support for argument juggling, multiple sources, and `this` binding `customizer`\n * functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n */\nfunction assignWith(object, source, customizer) {\n  var props = keys(source);\n  push.apply(props, getSymbols(source));\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index],\n        value = object[key],\n        result = customizer(value, source[key], key, object, source);\n\n    if ((result === result ? (result !== value) : (value === value)) ||\n        (value === undefined && !(key in object))) {\n      object[key] = result;\n    }\n  }\n  return object;\n}\n\nmodule.exports = assignWith;\n","var baseCopy = require(231),\n    getSymbols = require(291),\n    isNative = require(318),\n    keys = require(326);\n\n/** Native method references. */\nvar preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;\n\n/** Used as `baseAssign`. */\nvar nativeAssign = (function() {\n  // Avoid `Object.assign` in Firefox 34-37 which have an early implementation\n  // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344\n  // for more details.\n  //\n  // Use `Object.preventExtensions` on a plain object instead of simply using\n  // `Object('x')` because Chrome and IE fail to throw an error when attempting\n  // to assign values to readonly indexes of strings.\n  var func = preventExtensions && isNative(func = Object.assign) && func;\n  try {\n    if (func) {\n      var object = preventExtensions({ '1': 0 });\n      object[0] = 1;\n    }\n  } catch(e) {\n    // Only attempt in strict mode.\n    try { func(object, 'xo'); } catch(e) {}\n    return !object[1] && func;\n  }\n  return false;\n}());\n\n/**\n * The base implementation of `_.assign` without support for argument juggling,\n * multiple sources, and `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nvar baseAssign = nativeAssign || function(object, source) {\n  return source == null\n    ? object\n    : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));\n};\n\nmodule.exports = baseAssign;\n","var baseMatches = require(252),\n    baseMatchesProperty = require(253),\n    bindCallback = require(266),\n    identity = require(335),\n    property = require(337);\n\n/**\n * The base implementation of `_.callback` which supports specifying the\n * number of arguments to provide to `func`.\n *\n * @private\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction baseCallback(func, thisArg, argCount) {\n  var type = typeof func;\n  if (type == 'function') {\n    return thisArg === undefined\n      ? func\n      : bindCallback(func, thisArg, argCount);\n  }\n  if (func == null) {\n    return identity;\n  }\n  if (type == 'object') {\n    return baseMatches(func);\n  }\n  return thisArg === undefined\n    ? property(func)\n    : baseMatchesProperty(func, thisArg);\n}\n\nmodule.exports = baseCallback;\n","/**\n * The base implementation of `compareAscending` which compares values and\n * sorts them in ascending order without guaranteeing a stable sort.\n *\n * @private\n * @param {*} value The value to compare to `other`.\n * @param {*} other The value to compare to `value`.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction baseCompareAscending(value, other) {\n  if (value !== other) {\n    var valIsReflexive = value === value,\n        othIsReflexive = other === other;\n\n    if (value > other || !valIsReflexive || (value === undefined && othIsReflexive)) {\n      return 1;\n    }\n    if (value < other || !othIsReflexive || (other === undefined && valIsReflexive)) {\n      return -1;\n    }\n  }\n  return 0;\n}\n\nmodule.exports = baseCompareAscending;\n","/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction baseCopy(source, props, object) {\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n    object[key] = source[key];\n  }\n  return object;\n}\n\nmodule.exports = baseCopy;\n","var isObject = require('../lang/isObject');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n  function Object() {}\n  return function(prototype) {\n    if (isObject(prototype)) {\n      Object.prototype = prototype;\n      var result = new Object;\n      Object.prototype = null;\n    }\n    return result || global.Object();\n  };\n}());\n\nmodule.exports = baseCreate;\n","/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts an index\n * of where to slice the arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Object} args The arguments provide to `func`.\n * @returns {number} Returns the timer id.\n */\nfunction baseDelay(func, wait, args) {\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n","var baseIndexOf = require(245),\n    cacheIndexOf = require(267),\n    createCache = require(277);\n\n/**\n * The base implementation of `_.difference` which accepts a single array\n * of values to exclude.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values) {\n  var length = array ? array.length : 0,\n      result = [];\n\n  if (!length) {\n    return result;\n  }\n  var index = -1,\n      indexOf = baseIndexOf,\n      isCommon = true,\n      cache = (isCommon && values.length >= 200) ? createCache(values) : null,\n      valuesLength = values.length;\n\n  if (cache) {\n    indexOf = cacheIndexOf;\n    isCommon = false;\n    values = cache;\n  }\n  outer:\n  while (++index < length) {\n    var value = array[index];\n\n    if (isCommon && value === value) {\n      var valuesIndex = valuesLength;\n      while (valuesIndex--) {\n        if (values[valuesIndex] === value) {\n          continue outer;\n        }\n      }\n      result.push(value);\n    }\n    else if (indexOf(values, value, 0) < 0) {\n      result.push(value);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseDifference;\n","var baseForOwn = require(243),\n    createBaseEach = require(274);\n\n/**\n * The base implementation of `_.forEach` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object|string} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require(235);\n\n/**\n * The base implementation of `_.every` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n *  else `false`\n */\nfunction baseEvery(collection, predicate) {\n  var result = true;\n  baseEach(collection, function(value, index, collection) {\n    result = !!predicate(value, index, collection);\n    return result;\n  });\n  return result;\n}\n\nmodule.exports = baseEvery;\n","var baseEach = require(235);\n\n/**\n * The base implementation of `_.filter` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n  var result = [];\n  baseEach(collection, function(value, index, collection) {\n    if (predicate(value, index, collection)) {\n      result.push(value);\n    }\n  });\n  return result;\n}\n\nmodule.exports = baseFilter;\n","/**\n * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,\n * without support for callback shorthands and `this` binding, which iterates\n * over `collection` using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @param {boolean} [retKey] Specify returning the key of the found element\n *  instead of the element itself.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFind(collection, predicate, eachFunc, retKey) {\n  var result;\n  eachFunc(collection, function(value, key, collection) {\n    if (predicate(value, key, collection)) {\n      result = retKey ? key : value;\n      return false;\n    }\n  });\n  return result;\n}\n\nmodule.exports = baseFind;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromRight) {\n  var length = array.length,\n      index = fromRight ? length : -1;\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var isArguments = require(315),\n    isArray = require(316),\n    isArrayLike = require(293),\n    isObjectLike = require(299);\n\n/**\n * The base implementation of `_.flatten` with added support for restricting\n * flattening and specifying the start index.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, isDeep, isStrict) {\n  var index = -1,\n      length = array.length,\n      resIndex = -1,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (isObjectLike(value) && isArrayLike(value) &&\n        (isStrict || isArray(value) || isArguments(value))) {\n      if (isDeep) {\n        // Recursively flatten arrays (susceptible to call stack limits).\n        value = baseFlatten(value, isDeep, isStrict);\n      }\n      var valIndex = -1,\n          valLength = value.length;\n\n      while (++valIndex < valLength) {\n        result[++resIndex] = value[valIndex];\n      }\n    } else if (!isStrict) {\n      result[++resIndex] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseFlatten;\n","var createBaseFor = require(275);\n\n/**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require(241),\n    keysIn = require(327);\n\n/**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForIn(object, iteratee) {\n  return baseFor(object, iteratee, keysIn);\n}\n\nmodule.exports = baseForIn;\n","var baseFor = require(241),\n    keys = require(326);\n\n/**\n * The base implementation of `_.forOwn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var toObject = require(312);\n\n/**\n * The base implementation of `get` without support for string paths\n * and default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path of the property to get.\n * @param {string} [pathKey] The key representation of path.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path, pathKey) {\n  if (object == null) {\n    return;\n  }\n  if (pathKey !== undefined && pathKey in toObject(object)) {\n    path = [pathKey];\n  }\n  var index = -1,\n      length = path.length;\n\n  while (object != null && ++index < length) {\n    object = object[path[index]];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var indexOfNaN = require(292);\n\n/**\n * The base implementation of `_.indexOf` without support for binary searches.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  if (value !== value) {\n    return indexOfNaN(array, fromIndex);\n  }\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = baseIndexOf;\n","var baseIsEqualDeep = require(247);\n\n/**\n * The base implementation of `_.isEqual` without support for `this` binding\n * `customizer` functions.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {\n  // Exit early for identical values.\n  if (value === other) {\n    return true;\n  }\n  var valType = typeof value,\n      othType = typeof other;\n\n  // Exit early for unlike primitive values.\n  if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||\n      value == null || other == null) {\n    // Return `false` unless both values are `NaN`.\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);\n}\n\nmodule.exports = baseIsEqual;\n","var equalArrays = require(285),\n    equalByTag = require(286),\n    equalObjects = require(287),\n    isArray = require(316),\n    isTypedArray = require(323);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA=[]] Tracks traversed `value` objects.\n * @param {Array} [stackB=[]] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = objToString.call(object);\n    if (objTag == argsTag) {\n      objTag = objectTag;\n    } else if (objTag != objectTag) {\n      objIsArr = isTypedArray(object);\n    }\n  }\n  if (!othIsArr) {\n    othTag = objToString.call(other);\n    if (othTag == argsTag) {\n      othTag = objectTag;\n    } else if (othTag != objectTag) {\n      othIsArr = isTypedArray(other);\n    }\n  }\n  var objIsObj = objTag == objectTag,\n      othIsObj = othTag == objectTag,\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !(objIsArr || objIsObj)) {\n    return equalByTag(object, other, objTag);\n  }\n  if (!isLoose) {\n    var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (valWrapped || othWrapped) {\n      return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  // For more information on detecting circular references see https://es5.github.io/#JO.\n  stackA || (stackA = []);\n  stackB || (stackB = []);\n\n  var length = stackA.length;\n  while (length--) {\n    if (stackA[length] == object) {\n      return stackB[length] == other;\n    }\n  }\n  // Add `object` and `other` to the stack of traversed objects.\n  stackA.push(object);\n  stackB.push(other);\n\n  var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);\n\n  stackA.pop();\n  stackB.pop();\n\n  return result;\n}\n\nmodule.exports = baseIsEqualDeep;\n","/**\n * The base implementation of `_.isFunction` without support for environments\n * with incorrect `typeof` results.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n */\nfunction baseIsFunction(value) {\n  // Avoid a Chakra JIT bug in compatibility modes of IE 11.\n  // See https://github.com/jashkenas/underscore/issues/1621 for more details.\n  return typeof value == 'function' || false;\n}\n\nmodule.exports = baseIsFunction;\n","var baseIsEqual = require(246);\n\n/**\n * The base implementation of `_.isMatch` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The source property names to match.\n * @param {Array} values The source values to match.\n * @param {Array} strictCompareFlags Strict comparison flags for source values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, props, values, strictCompareFlags, customizer) {\n  var index = -1,\n      length = props.length,\n      noCustomizer = !customizer;\n\n  while (++index < length) {\n    if ((noCustomizer && strictCompareFlags[index])\n          ? values[index] !== object[props[index]]\n          : !(props[index] in object)\n        ) {\n      return false;\n    }\n  }\n  index = -1;\n  while (++index < length) {\n    var key = props[index],\n        objValue = object[key],\n        srcValue = values[index];\n\n    if (noCustomizer && strictCompareFlags[index]) {\n      var result = objValue !== undefined || (key in object);\n    } else {\n      result = customizer ? customizer(objValue, srcValue, key) : undefined;\n      if (result === undefined) {\n        result = baseIsEqual(srcValue, objValue, customizer, true);\n      }\n    }\n    if (!result) {\n      return false;\n    }\n  }\n  return true;\n}\n\nmodule.exports = baseIsMatch;\n","/**\n * The function whose prototype all chaining wrappers inherit from.\n *\n * @private\n */\nfunction baseLodash() {\n  // No operation performed.\n}\n\nmodule.exports = baseLodash;\n","var baseEach = require(235),\n    isArrayLike = require(293);\n\n/**\n * The base implementation of `_.map` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n  var index = -1,\n      result = isArrayLike(collection) ? Array(collection.length) : [];\n\n  baseEach(collection, function(value, key, collection) {\n    result[++index] = iteratee(value, key, collection);\n  });\n  return result;\n}\n\nmodule.exports = baseMap;\n","var baseIsMatch = require(249),\n    constant = require(334),\n    isStrictComparable = require(300),\n    keys = require(326),\n    toObject = require(312);\n\n/**\n * The base implementation of `_.matches` which does not clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatches(source) {\n  var props = keys(source),\n      length = props.length;\n\n  if (!length) {\n    return constant(true);\n  }\n  if (length == 1) {\n    var key = props[0],\n        value = source[key];\n\n    if (isStrictComparable(value)) {\n      return function(object) {\n        if (object == null) {\n          return false;\n        }\n        return object[key] === value && (value !== undefined || (key in toObject(object)));\n      };\n    }\n  }\n  var values = Array(length),\n      strictCompareFlags = Array(length);\n\n  while (length--) {\n    value = source[props[length]];\n    values[length] = value;\n    strictCompareFlags[length] = isStrictComparable(value);\n  }\n  return function(object) {\n    return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);\n  };\n}\n\nmodule.exports = baseMatches;\n","var baseGet = require(244),\n    baseIsEqual = require(246),\n    baseSlice = require(260),\n    isArray = require(316),\n    isKey = require(296),\n    isStrictComparable = require(300),\n    last = require(197),\n    toObject = require(312),\n    toPath = require(313);\n\n/**\n * The base implementation of `_.matchesProperty` which does not which does\n * not clone `value`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} value The value to compare.\n * @returns {Function} Returns the new function.\n */\nfunction baseMatchesProperty(path, value) {\n  var isArr = isArray(path),\n      isCommon = isKey(path) && isStrictComparable(value),\n      pathKey = (path + '');\n\n  path = toPath(path);\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    var key = pathKey;\n    object = toObject(object);\n    if ((isArr || !isCommon) && !(key in object)) {\n      object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n      if (object == null) {\n        return false;\n      }\n      key = last(path);\n      object = toObject(object);\n    }\n    return object[key] === value\n      ? (value !== undefined || (key in object))\n      : baseIsEqual(value, object[key], null, true);\n  };\n}\n\nmodule.exports = baseMatchesProperty;\n","var arrayEach = require(221),\n    baseMergeDeep = require(255),\n    getSymbols = require(291),\n    isArray = require(316),\n    isArrayLike = require(293),\n    isObject = require(320),\n    isObjectLike = require(299),\n    isTypedArray = require(323),\n    keys = require(326);\n\n/** Used for native method references. */\nvar arrayProto = Array.prototype;\n\n/** Native method references. */\nvar push = arrayProto.push;\n\n/**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\nfunction baseMerge(object, source, customizer, stackA, stackB) {\n  if (!isObject(object)) {\n    return object;\n  }\n  var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));\n  if (!isSrcArr) {\n    var props = keys(source);\n    push.apply(props, getSymbols(source));\n  }\n  arrayEach(props || source, function(srcValue, key) {\n    if (props) {\n      key = srcValue;\n      srcValue = source[key];\n    }\n    if (isObjectLike(srcValue)) {\n      stackA || (stackA = []);\n      stackB || (stackB = []);\n      baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n    }\n    else {\n      var value = object[key],\n          result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n          isCommon = result === undefined;\n\n      if (isCommon) {\n        result = srcValue;\n      }\n      if ((isSrcArr || result !== undefined) &&\n          (isCommon || (result === result ? (result !== value) : (value === value)))) {\n        object[key] = result;\n      }\n    }\n  });\n  return object;\n}\n\nmodule.exports = baseMerge;\n","var arrayCopy = require(220),\n    isArguments = require(315),\n    isArray = require(316),\n    isArrayLike = require(293),\n    isPlainObject = require(321),\n    isTypedArray = require(323),\n    toPlainObject = require(324);\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merging properties.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n  var length = stackA.length,\n      srcValue = source[key];\n\n  while (length--) {\n    if (stackA[length] == srcValue) {\n      object[key] = stackB[length];\n      return;\n    }\n  }\n  var value = object[key],\n      result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n      isCommon = result === undefined;\n\n  if (isCommon) {\n    result = srcValue;\n    if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n      result = isArray(value)\n        ? value\n        : (isArrayLike(value) ? arrayCopy(value) : []);\n    }\n    else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n      result = isArguments(value)\n        ? toPlainObject(value)\n        : (isPlainObject(value) ? value : {});\n    }\n    else {\n      isCommon = false;\n    }\n  }\n  // Add the source value to the stack of traversed objects and associate\n  // it with its merged value.\n  stackA.push(srcValue);\n  stackB.push(result);\n\n  if (isCommon) {\n    // Recursively merge objects and arrays (susceptible to call stack limits).\n    object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n  } else if (result === result ? (result !== value) : (value === value)) {\n    object[key] = result;\n  }\n}\n\nmodule.exports = baseMergeDeep;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require(244),\n    toPath = require(313);\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction basePropertyDeep(path) {\n  var pathKey = (path + '');\n  path = toPath(path);\n  return function(object) {\n    return baseGet(object, path, pathKey);\n  };\n}\n\nmodule.exports = basePropertyDeep;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight` without support\n * for callback shorthands and `this` binding, which iterates over `collection`\n * using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initFromCollection Specify using the first or last element\n *  of `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {\n  eachFunc(collection, function(value, index, collection) {\n    accumulator = initFromCollection\n      ? (initFromCollection = false, value)\n      : iteratee(accumulator, value, index, collection);\n  });\n  return accumulator;\n}\n\nmodule.exports = baseReduce;\n","var identity = require(335),\n    metaMap = require(302);\n\n/**\n * The base implementation of `setData` without support for hot loop detection.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n  metaMap.set(func, data);\n  return func;\n};\n\nmodule.exports = baseSetData;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n  var index = -1,\n      length = array.length;\n\n  start = start == null ? 0 : (+start || 0);\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = (end === undefined || end > length) ? length : (+end || 0);\n  if (end < 0) {\n    end += length;\n  }\n  length = start > end ? 0 : ((end - start) >>> 0);\n  start >>>= 0;\n\n  var result = Array(length);\n  while (++index < length) {\n    result[index] = array[index + start];\n  }\n  return result;\n}\n\nmodule.exports = baseSlice;\n","var baseEach = require(235);\n\n/**\n * The base implementation of `_.some` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction baseSome(collection, predicate) {\n  var result;\n\n  baseEach(collection, function(value, index, collection) {\n    result = predicate(value, index, collection);\n    return !result;\n  });\n  return !!result;\n}\n\nmodule.exports = baseSome;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define\n * the sort order of `array` and replaces criteria objects with their\n * corresponding values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n  var length = array.length;\n\n  array.sort(comparer);\n  while (length--) {\n    array[length] = array[length].value;\n  }\n  return array;\n}\n\nmodule.exports = baseSortBy;\n","/**\n * Converts `value` to a string if it is not one. An empty string is returned\n * for `null` or `undefined` values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  if (typeof value == 'string') {\n    return value;\n  }\n  return value == null ? '' : (value + '');\n}\n\nmodule.exports = baseToString;\n","var baseIndexOf = require(245),\n    cacheIndexOf = require(267),\n    createCache = require(277);\n\n/**\n * The base implementation of `_.uniq` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate-value-free array.\n */\nfunction baseUniq(array, iteratee) {\n  var index = -1,\n      indexOf = baseIndexOf,\n      length = array.length,\n      isCommon = true,\n      isLarge = isCommon && length >= 200,\n      seen = isLarge ? createCache() : null,\n      result = [];\n\n  if (seen) {\n    indexOf = cacheIndexOf;\n    isCommon = false;\n  } else {\n    isLarge = false;\n    seen = iteratee ? [] : result;\n  }\n  outer:\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value, index, array) : value;\n\n    if (isCommon && value === value) {\n      var seenIndex = seen.length;\n      while (seenIndex--) {\n        if (seen[seenIndex] === computed) {\n          continue outer;\n        }\n      }\n      if (iteratee) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n    else if (indexOf(seen, computed, 0) < 0) {\n      if (iteratee || isLarge) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseUniq;\n","/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n  var index = -1,\n      length = props.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = object[props[index]];\n  }\n  return result;\n}\n\nmodule.exports = baseValues;\n","var identity = require(335);\n\n/**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\nfunction bindCallback(func, thisArg, argCount) {\n  if (typeof func != 'function') {\n    return identity;\n  }\n  if (thisArg === undefined) {\n    return func;\n  }\n  switch (argCount) {\n    case 1: return function(value) {\n      return func.call(thisArg, value);\n    };\n    case 3: return function(value, index, collection) {\n      return func.call(thisArg, value, index, collection);\n    };\n    case 4: return function(accumulator, value, index, collection) {\n      return func.call(thisArg, accumulator, value, index, collection);\n    };\n    case 5: return function(value, other, key, object, source) {\n      return func.call(thisArg, value, other, key, object, source);\n    };\n  }\n  return function() {\n    return func.apply(thisArg, arguments);\n  };\n}\n\nmodule.exports = bindCallback;\n","var isObject = require(320);\n\n/**\n * Checks if `value` is in `cache` mimicking the return signature of\n * `_.indexOf` by returning `0` if the value is found, else `-1`.\n *\n * @private\n * @param {Object} cache The cache to search.\n * @param {*} value The value to search for.\n * @returns {number} Returns `0` if `value` is found, else `-1`.\n */\nfunction cacheIndexOf(cache, value) {\n  var data = cache.data,\n      result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n  return result ? 0 : -1;\n}\n\nmodule.exports = cacheIndexOf;\n","var isObject = require(320);\n\n/**\n * Adds `value` to the cache.\n *\n * @private\n * @name push\n * @memberOf SetCache\n * @param {*} value The value to cache.\n */\nfunction cachePush(value) {\n  var data = this.data;\n  if (typeof value == 'string' || isObject(value)) {\n    data.set.add(value);\n  } else {\n    data.hash[value] = true;\n  }\n}\n\nmodule.exports = cachePush;\n","var baseCompareAscending = require(230);\n\n/**\n * Used by `_.sortBy` to compare transformed elements of a collection and stable\n * sort them in ascending order.\n *\n * @private\n * @param {Object} object The object to compare to `other`.\n * @param {Object} other The object to compare to `object`.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareAscending(object, other) {\n  return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);\n}\n\nmodule.exports = compareAscending;\n","/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array|Object} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders) {\n  var holdersLength = holders.length,\n      argsIndex = -1,\n      argsLength = nativeMax(args.length - holdersLength, 0),\n      leftIndex = -1,\n      leftLength = partials.length,\n      result = Array(argsLength + leftLength);\n\n  while (++leftIndex < leftLength) {\n    result[leftIndex] = partials[leftIndex];\n  }\n  while (++argsIndex < holdersLength) {\n    result[holders[argsIndex]] = args[argsIndex];\n  }\n  while (argsLength--) {\n    result[leftIndex++] = args[argsIndex++];\n  }\n  return result;\n}\n\nmodule.exports = composeArgs;\n","/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array|Object} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders) {\n  var holdersIndex = -1,\n      holdersLength = holders.length,\n      argsIndex = -1,\n      argsLength = nativeMax(args.length - holdersLength, 0),\n      rightIndex = -1,\n      rightLength = partials.length,\n      result = Array(argsLength + rightLength);\n\n  while (++argsIndex < argsLength) {\n    result[argsIndex] = args[argsIndex];\n  }\n  var offset = argsIndex;\n  while (++rightIndex < rightLength) {\n    result[offset + rightIndex] = partials[rightIndex];\n  }\n  while (++holdersIndex < holdersLength) {\n    result[offset + holders[holdersIndex]] = args[argsIndex++];\n  }\n  return result;\n}\n\nmodule.exports = composeArgsRight;\n","var baseCallback = require(229),\n    baseEach = require(235),\n    isArray = require(316);\n\n/**\n * Creates a function that aggregates a collection, creating an accumulator\n * object composed from the results of running each element in the collection\n * through an iteratee.\n *\n * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,\n * and `_.partition`.\n *\n * @private\n * @param {Function} setter The function to set keys and values of the accumulator object.\n * @param {Function} [initializer] The function to initialize the accumulator object.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n  return function(collection, iteratee, thisArg) {\n    var result = initializer ? initializer() : {};\n    iteratee = baseCallback(iteratee, thisArg, 3);\n\n    if (isArray(collection)) {\n      var index = -1,\n          length = collection.length;\n\n      while (++index < length) {\n        var value = collection[index];\n        setter(result, value, iteratee(value, index, collection), collection);\n      }\n    } else {\n      baseEach(collection, function(value, key, collection) {\n        setter(result, value, iteratee(value, key, collection), collection);\n      });\n    }\n    return result;\n  };\n}\n\nmodule.exports = createAggregator;\n","var bindCallback = require(266),\n    isIterateeCall = require(295),\n    restParam = require(216);\n\n/**\n * Creates a function that assigns properties of source object(s) to a given\n * destination object.\n *\n * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n  return restParam(function(object, sources) {\n    var index = -1,\n        length = object == null ? 0 : sources.length,\n        customizer = length > 2 && sources[length - 2],\n        guard = length > 2 && sources[2],\n        thisArg = length > 1 && sources[length - 1];\n\n    if (typeof customizer == 'function') {\n      customizer = bindCallback(customizer, thisArg, 5);\n      length -= 2;\n    } else {\n      customizer = typeof thisArg == 'function' ? thisArg : null;\n      length -= (customizer ? 1 : 0);\n    }\n    if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n      customizer = length < 3 ? null : customizer;\n      length = 1;\n    }\n    while (++index < length) {\n      var source = sources[index];\n      if (source) {\n        assigner(object, source, customizer);\n      }\n    }\n    return object;\n  });\n}\n\nmodule.exports = createAssigner;\n","var getLength = require(290),\n    isLength = require(298),\n    toObject = require(312);\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n  return function(collection, iteratee) {\n    var length = collection ? getLength(collection) : 0;\n    if (!isLength(length)) {\n      return eachFunc(collection, iteratee);\n    }\n    var index = fromRight ? length : -1,\n        iterable = toObject(collection);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (iteratee(iterable[index], index, iterable) === false) {\n        break;\n      }\n    }\n    return collection;\n  };\n}\n\nmodule.exports = createBaseEach;\n","var toObject = require(312);\n\n/**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var iterable = toObject(object),\n        props = keysFunc(object),\n        length = props.length,\n        index = fromRight ? length : -1;\n\n    while ((fromRight ? index-- : ++index < length)) {\n      var key = props[index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\nmodule.exports = createBaseFor;\n","var createCtorWrapper = require('./createCtorWrapper');\n\n/**\n * Creates a function that wraps `func` and invokes it with the `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new bound function.\n */\nfunction createBindWrapper(func, thisArg) {\n  var Ctor = createCtorWrapper(func);\n\n  function wrapper() {\n    var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;\n    return fn.apply(thisArg, arguments);\n  }\n  return wrapper;\n}\n\nmodule.exports = createBindWrapper;\n","var SetCache = require('./SetCache'),\n    constant = require('../utility/constant'),\n    isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar Set = isNative(Set = global.Set) && Set;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;\n\n/**\n * Creates a `Set` cache object to optimize linear searches of large arrays.\n *\n * @private\n * @param {Array} [values] The values to cache.\n * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n */\nvar createCache = !(nativeCreate && Set) ? constant(null) : function(values) {\n  return new SetCache(values);\n};\n\nmodule.exports = createCache;\n","var baseCreate = require(232),\n    isObject = require(320);\n\n/**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCtorWrapper(Ctor) {\n  return function() {\n    var thisBinding = baseCreate(Ctor.prototype),\n        result = Ctor.apply(thisBinding, arguments);\n\n    // Mimic the constructor's `return` behavior.\n    // See https://es5.github.io/#x13.2.2 for more details.\n    return isObject(result) ? result : thisBinding;\n  };\n}\n\nmodule.exports = createCtorWrapper;\n","var baseCallback = require(229),\n    baseFind = require(238),\n    baseFindIndex = require(239),\n    isArray = require(316);\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(eachFunc, fromRight) {\n  return function(collection, predicate, thisArg) {\n    predicate = baseCallback(predicate, thisArg, 3);\n    if (isArray(collection)) {\n      var index = baseFindIndex(collection, predicate, fromRight);\n      return index > -1 ? collection[index] : undefined;\n    }\n    return baseFind(collection, predicate, eachFunc);\n  };\n}\n\nmodule.exports = createFind;\n","var bindCallback = require(266),\n    isArray = require(316);\n\n/**\n * Creates a function for `_.forEach` or `_.forEachRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createForEach(arrayFunc, eachFunc) {\n  return function(collection, iteratee, thisArg) {\n    return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n      ? arrayFunc(collection, iteratee)\n      : eachFunc(collection, bindCallback(iteratee, thisArg, 3));\n  };\n}\n\nmodule.exports = createForEach;\n","var arrayCopy = require('./arrayCopy'),\n    composeArgs = require('./composeArgs'),\n    composeArgsRight = require('./composeArgsRight'),\n    createCtorWrapper = require('./createCtorWrapper'),\n    isLaziable = require('./isLaziable'),\n    reorder = require('./reorder'),\n    replaceHolders = require('./replaceHolders'),\n    setData = require('./setData');\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n    BIND_KEY_FLAG = 2,\n    CURRY_BOUND_FLAG = 4,\n    CURRY_FLAG = 8,\n    CURRY_RIGHT_FLAG = 16,\n    PARTIAL_FLAG = 32,\n    PARTIAL_RIGHT_FLAG = 64,\n    ARY_FLAG = 128;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that wraps `func` and invokes it with optional `this`\n * binding of, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to reference.\n * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n  var isAry = bitmask & ARY_FLAG,\n      isBind = bitmask & BIND_FLAG,\n      isBindKey = bitmask & BIND_KEY_FLAG,\n      isCurry = bitmask & CURRY_FLAG,\n      isCurryBound = bitmask & CURRY_BOUND_FLAG,\n      isCurryRight = bitmask & CURRY_RIGHT_FLAG;\n\n  var Ctor = !isBindKey && createCtorWrapper(func),\n      key = func;\n\n  function wrapper() {\n    // Avoid `arguments` object use disqualifying optimizations by\n    // converting it to an array before providing it to other functions.\n    var length = arguments.length,\n        index = length,\n        args = Array(length);\n\n    while (index--) {\n      args[index] = arguments[index];\n    }\n    if (partials) {\n      args = composeArgs(args, partials, holders);\n    }\n    if (partialsRight) {\n      args = composeArgsRight(args, partialsRight, holdersRight);\n    }\n    if (isCurry || isCurryRight) {\n      var placeholder = wrapper.placeholder,\n          argsHolders = replaceHolders(args, placeholder);\n\n      length -= argsHolders.length;\n      if (length < arity) {\n        var newArgPos = argPos ? arrayCopy(argPos) : null,\n            newArity = nativeMax(arity - length, 0),\n            newsHolders = isCurry ? argsHolders : null,\n            newHoldersRight = isCurry ? null : argsHolders,\n            newPartials = isCurry ? args : null,\n            newPartialsRight = isCurry ? null : args;\n\n        bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);\n        bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);\n\n        if (!isCurryBound) {\n          bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);\n        }\n        var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],\n            result = createHybridWrapper.apply(undefined, newData);\n\n        if (isLaziable(func)) {\n          setData(result, newData);\n        }\n        result.placeholder = placeholder;\n        return result;\n      }\n    }\n    var thisBinding = isBind ? thisArg : this;\n    if (isBindKey) {\n      func = thisBinding[key];\n    }\n    if (argPos) {\n      args = reorder(args, argPos);\n    }\n    if (isAry && ary < args.length) {\n      args.length = ary;\n    }\n    var fn = (this && this !== global && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func;\n    return fn.apply(thisBinding, args);\n  }\n  return wrapper;\n}\n\nmodule.exports = createHybridWrapper;\n","var createCtorWrapper = require('./createCtorWrapper');\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` and invokes it with the optional `this`\n * binding of `thisArg` and the `partials` prepended to those provided to\n * the wrapper.\n *\n * @private\n * @param {Function} func The function to partially apply arguments to.\n * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to the new function.\n * @returns {Function} Returns the new bound function.\n */\nfunction createPartialWrapper(func, bitmask, thisArg, partials) {\n  var isBind = bitmask & BIND_FLAG,\n      Ctor = createCtorWrapper(func);\n\n  function wrapper() {\n    // Avoid `arguments` object use disqualifying optimizations by\n    // converting it to an array before providing it `func`.\n    var argsIndex = -1,\n        argsLength = arguments.length,\n        leftIndex = -1,\n        leftLength = partials.length,\n        args = Array(argsLength + leftLength);\n\n    while (++leftIndex < leftLength) {\n      args[leftIndex] = partials[leftIndex];\n    }\n    while (argsLength--) {\n      args[leftIndex++] = arguments[++argsIndex];\n    }\n    var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;\n    return fn.apply(isBind ? thisArg : this, args);\n  }\n  return wrapper;\n}\n\nmodule.exports = createPartialWrapper;\n","var baseCallback = require(229),\n    baseReduce = require(258),\n    isArray = require(316);\n\n/**\n * Creates a function for `_.reduce` or `_.reduceRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\nfunction createReduce(arrayFunc, eachFunc) {\n  return function(collection, iteratee, accumulator, thisArg) {\n    var initFromArray = arguments.length < 3;\n    return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n      ? arrayFunc(collection, iteratee, accumulator, initFromArray)\n      : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);\n  };\n}\n\nmodule.exports = createReduce;\n","var baseSetData = require(259),\n    createBindWrapper = require(276),\n    createHybridWrapper = require(281),\n    createPartialWrapper = require(282),\n    getData = require(288),\n    mergeData = require(301),\n    setData = require(308);\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n    BIND_KEY_FLAG = 2,\n    PARTIAL_FLAG = 32,\n    PARTIAL_RIGHT_FLAG = 64;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to reference.\n * @param {number} bitmask The bitmask of flags.\n *  The bitmask may be composed of the following flags:\n *     1 - `_.bind`\n *     2 - `_.bindKey`\n *     4 - `_.curry` or `_.curryRight` of a bound function\n *     8 - `_.curry`\n *    16 - `_.curryRight`\n *    32 - `_.partial`\n *    64 - `_.partialRight`\n *   128 - `_.rearg`\n *   256 - `_.ary`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n  var isBindKey = bitmask & BIND_KEY_FLAG;\n  if (!isBindKey && typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var length = partials ? partials.length : 0;\n  if (!length) {\n    bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);\n    partials = holders = null;\n  }\n  length -= (holders ? holders.length : 0);\n  if (bitmask & PARTIAL_RIGHT_FLAG) {\n    var partialsRight = partials,\n        holdersRight = holders;\n\n    partials = holders = null;\n  }\n  var data = isBindKey ? null : getData(func),\n      newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];\n\n  if (data) {\n    mergeData(newData, data);\n    bitmask = newData[1];\n    arity = newData[9];\n  }\n  newData[9] = arity == null\n    ? (isBindKey ? 0 : func.length)\n    : (nativeMax(arity - length, 0) || 0);\n\n  if (bitmask == BIND_FLAG) {\n    var result = createBindWrapper(newData[0], newData[2]);\n  } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {\n    result = createPartialWrapper.apply(undefined, newData);\n  } else {\n    result = createHybridWrapper.apply(undefined, newData);\n  }\n  var setter = data ? baseSetData : setData;\n  return setter(result, newData);\n}\n\nmodule.exports = createWrapper;\n","/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing arrays.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {\n  var index = -1,\n      arrLength = array.length,\n      othLength = other.length,\n      result = true;\n\n  if (arrLength != othLength && !(isLoose && othLength > arrLength)) {\n    return false;\n  }\n  // Deep compare the contents, ignoring non-numeric properties.\n  while (result && ++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    result = undefined;\n    if (customizer) {\n      result = isLoose\n        ? customizer(othValue, arrValue, index)\n        : customizer(arrValue, othValue, index);\n    }\n    if (result === undefined) {\n      // Recursively compare arrays (susceptible to call stack limits).\n      if (isLoose) {\n        var othIndex = othLength;\n        while (othIndex--) {\n          othValue = other[othIndex];\n          result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n          if (result) {\n            break;\n          }\n        }\n      } else {\n        result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n      }\n    }\n  }\n  return !!result;\n}\n\nmodule.exports = equalArrays;\n","/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    stringTag = '[object String]';\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} value The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag) {\n  switch (tag) {\n    case boolTag:\n    case dateTag:\n      // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n      // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n      return +object == +other;\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case numberTag:\n      // Treat `NaN` vs. `NaN` as equal.\n      return (object != +object)\n        ? other != +other\n        : object == +other;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings primitives and string\n      // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n      return object == (other + '');\n  }\n  return false;\n}\n\nmodule.exports = equalByTag;\n","var keys = require(326);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n  var objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isLoose) {\n    return false;\n  }\n  var skipCtor = isLoose,\n      index = -1;\n\n  while (++index < objLength) {\n    var key = objProps[index],\n        result = isLoose ? key in other : hasOwnProperty.call(other, key);\n\n    if (result) {\n      var objValue = object[key],\n          othValue = other[key];\n\n      result = undefined;\n      if (customizer) {\n        result = isLoose\n          ? customizer(othValue, objValue, key)\n          : customizer(objValue, othValue, key);\n      }\n      if (result === undefined) {\n        // Recursively compare objects (susceptible to call stack limits).\n        result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);\n      }\n    }\n    if (!result) {\n      return false;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (!skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nmodule.exports = equalObjects;\n","var metaMap = require(302),\n    noop = require(336);\n\n/**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\nvar getData = !metaMap ? noop : function(func) {\n  return metaMap.get(func);\n};\n\nmodule.exports = getData;\n","var baseProperty = require(256),\n    constant = require(334),\n    realNames = require(305),\n    support = require(333);\n\n/**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nvar getFuncName = (function() {\n  if (!support.funcNames) {\n    return constant('');\n  }\n  if (constant.name == 'constant') {\n    return baseProperty('name');\n  }\n  return function(func) {\n    var result = func.name,\n        array = realNames[result],\n        length = array ? array.length : 0;\n\n    while (length--) {\n      var data = array[length],\n          otherFunc = data.func;\n\n      if (otherFunc == null || otherFunc == func) {\n        return data.name;\n      }\n    }\n    return result;\n  };\n}());\n\nmodule.exports = getFuncName;\n","var baseProperty = require(256);\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\nmodule.exports = getLength;\n","var constant = require(334),\n    isNative = require(318),\n    toObject = require(312);\n\n/** Native method references. */\nvar getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;\n\n/**\n * Creates an array of the own symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {\n  return getOwnPropertySymbols(toObject(object));\n};\n\nmodule.exports = getSymbols;\n","/**\n * Gets the index at which the first occurrence of `NaN` is found in `array`.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n */\nfunction indexOfNaN(array, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 0 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    var other = array[index];\n    if (other !== other) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = indexOfNaN;\n","var getLength = require(290),\n    isLength = require(298);\n\n/**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(getLength(value));\n}\n\nmodule.exports = isArrayLike;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  value = +value;\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return value > -1 && value % 1 == 0 && value < length;\n}\n\nmodule.exports = isIndex;\n","var isArrayLike = require(293),\n    isIndex = require(294),\n    isObject = require(320);\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n  if (!isObject(object)) {\n    return false;\n  }\n  var type = typeof index;\n  if (type == 'number'\n      ? (isArrayLike(object) && isIndex(index, object.length))\n      : (type == 'string' && index in object)) {\n    var other = object[index];\n    return value === value ? (value === other) : (other !== other);\n  }\n  return false;\n}\n\nmodule.exports = isIterateeCall;\n","var isArray = require(316),\n    toObject = require(312);\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = //.|/[(?:[^[/]]*|([\"'])(?:(?!/1)[^/n//]|//.)*?/1)/]/,\n    reIsPlainProp = /^/w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  var type = typeof value;\n  if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {\n    return true;\n  }\n  if (isArray(value)) {\n    return false;\n  }\n  var result = !reIsDeepProp.test(value);\n  return result || (object != null && value in toObject(object));\n}\n\nmodule.exports = isKey;\n","var LazyWrapper = require(217),\n    getFuncName = require(289),\n    lodash = require(200);\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.\n */\nfunction isLaziable(func) {\n  var funcName = getFuncName(func);\n  return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;\n}\n\nmodule.exports = isLaziable;\n","/**\n * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)\n * of an array-like value.\n */\nvar MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\nfunction isLength(value) {\n  return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var isObject = require(320);\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var arrayCopy = require(220),\n    composeArgs = require(270),\n    composeArgsRight = require(271),\n    replaceHolders = require(307);\n\n/** Used to compose bitmasks for wrapper metadata. */\nvar BIND_FLAG = 1,\n    CURRY_BOUND_FLAG = 4,\n    CURRY_FLAG = 8,\n    ARY_FLAG = 128,\n    REARG_FLAG = 256;\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers required to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`\n * augment function arguments, making the order in which they are executed important,\n * preventing the merging of metadata. However, we make an exception for a safe\n * common case where curried functions have `_.ary` and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n  var bitmask = data[1],\n      srcBitmask = source[1],\n      newBitmask = bitmask | srcBitmask,\n      isCommon = newBitmask < ARY_FLAG;\n\n  var isCombo =\n    (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||\n    (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||\n    (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);\n\n  // Exit early if metadata can't be merged.\n  if (!(isCommon || isCombo)) {\n    return data;\n  }\n  // Use source `thisArg` if available.\n  if (srcBitmask & BIND_FLAG) {\n    data[2] = source[2];\n    // Set when currying a bound function.\n    newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;\n  }\n  // Compose partial arguments.\n  var value = source[3];\n  if (value) {\n    var partials = data[3];\n    data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);\n    data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);\n  }\n  // Compose partial right arguments.\n  value = source[5];\n  if (value) {\n    partials = data[5];\n    data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);\n    data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);\n  }\n  // Use source `argPos` if available.\n  value = source[7];\n  if (value) {\n    data[7] = arrayCopy(value);\n  }\n  // Use source `ary` if it's smaller.\n  if (srcBitmask & ARY_FLAG) {\n    data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n  }\n  // Use source `arity` if one is not provided.\n  if (data[9] == null) {\n    data[9] = source[9];\n  }\n  // Use source `func` and merge bitmasks.\n  data[0] = source[0];\n  data[1] = newBitmask;\n\n  return data;\n}\n\nmodule.exports = mergeData;\n","var isNative = require('../lang/isNative');\n\n/** Native method references. */\nvar WeakMap = isNative(WeakMap = global.WeakMap) && WeakMap;\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nmodule.exports = metaMap;\n","var toObject = require(312);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties specified\n * by `props`.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property names to pick.\n * @returns {Object} Returns the new object.\n */\nfunction pickByArray(object, props) {\n  object = toObject(object);\n\n  var index = -1,\n      length = props.length,\n      result = {};\n\n  while (++index < length) {\n    var key = props[index];\n    if (key in object) {\n      result[key] = object[key];\n    }\n  }\n  return result;\n}\n\nmodule.exports = pickByArray;\n","var baseForIn = require(242);\n\n/**\n * A specialized version of `_.pick` which picks `object` properties `predicate`\n * returns truthy for.\n *\n * @private\n * @param {Object} object The source object.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Object} Returns the new object.\n */\nfunction pickByCallback(object, predicate) {\n  var result = {};\n  baseForIn(object, function(value, key, object) {\n    if (predicate(value, key, object)) {\n      result[key] = value;\n    }\n  });\n  return result;\n}\n\nmodule.exports = pickByCallback;\n","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nmodule.exports = realNames;\n","var arrayCopy = require(220),\n    isIndex = require(294);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n  var arrLength = array.length,\n      length = nativeMin(indexes.length, arrLength),\n      oldArray = arrayCopy(array);\n\n  while (length--) {\n    var index = indexes[length];\n    array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n  }\n  return array;\n}\n\nmodule.exports = reorder;\n","/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\nfunction replaceHolders(array, placeholder) {\n  var index = -1,\n      length = array.length,\n      resIndex = -1,\n      result = [];\n\n  while (++index < length) {\n    if (array[index] === placeholder) {\n      array[index] = PLACEHOLDER;\n      result[++resIndex] = index;\n    }\n  }\n  return result;\n}\n\nmodule.exports = replaceHolders;\n","var baseSetData = require(259),\n    now = require(212);\n\n/** Used to detect when a function becomes hot. */\nvar HOT_COUNT = 150,\n    HOT_SPAN = 16;\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity function\n * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = (function() {\n  var count = 0,\n      lastCalled = 0;\n\n  return function(key, value) {\n    var stamp = now(),\n        remaining = HOT_SPAN - (stamp - lastCalled);\n\n    lastCalled = stamp;\n    if (remaining > 0) {\n      if (++count >= HOT_COUNT) {\n        return key;\n      }\n    } else {\n      count = 0;\n    }\n    return baseSetData(key, value);\n  };\n}());\n\nmodule.exports = setData;\n","var baseForIn = require(242),\n    isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * A fallback implementation of `_.isPlainObject` which checks if `value`\n * is an object created by the `Object` constructor or has a `[[Prototype]]`\n * of `null`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n */\nfunction shimIsPlainObject(value) {\n  var Ctor;\n\n  // Exit early for non `Object` objects.\n  if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||\n      (!hasOwnProperty.call(value, 'constructor') &&\n        (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n    return false;\n  }\n  // IE < 9 iterates inherited properties before own properties. If the first\n  // iterated property is an object's own property then there are no inherited\n  // enumerable properties.\n  var result;\n  // In most environments an object's own properties are iterated before\n  // its inherited properties. If the last iterated property is an object's\n  // own property then there are no inherited enumerable properties.\n  baseForIn(value, function(subValue, key) {\n    result = key;\n  });\n  return result === undefined || hasOwnProperty.call(value, result);\n}\n\nmodule.exports = shimIsPlainObject;\n","var isArguments = require(315),\n    isArray = require(316),\n    isIndex = require(294),\n    isLength = require(298),\n    keysIn = require(327),\n    support = require(333);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction shimKeys(object) {\n  var props = keysIn(object),\n      propsLength = props.length,\n      length = propsLength && object.length;\n\n  var allowIndexes = length && isLength(length) &&\n    (isArray(object) || (support.nonEnumArgs && isArguments(object)));\n\n  var index = -1,\n      result = [];\n\n  while (++index < propsLength) {\n    var key = props[index];\n    if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = shimKeys;\n","/**\n * An implementation of `_.uniq` optimized for sorted arrays without support\n * for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate-value-free array.\n */\nfunction sortedUniq(array, iteratee) {\n  var seen,\n      index = -1,\n      length = array.length,\n      resIndex = -1,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value, index, array) : value;\n\n    if (!index || seen !== computed) {\n      seen = computed;\n      result[++resIndex] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = sortedUniq;\n","var isObject = require(320);\n\n/**\n * Converts `value` to an object if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\nfunction toObject(value) {\n  return isObject(value) ? value : Object(value);\n}\n\nmodule.exports = toObject;\n","var baseToString = require(263),\n    isArray = require(316);\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[/]]+|/[(?:(-?/d+(?:/./d+)?)|([\"'])((?:(?!/2)[^/n//]|//.)*?)/2)/]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = ///(//)?/g;\n\n/**\n * Converts `value` to property path array if it is not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array} Returns the property path array.\n */\nfunction toPath(value) {\n  if (isArray(value)) {\n    return value;\n  }\n  var result = [];\n  baseToString(value).replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n}\n\nmodule.exports = toPath;\n","var LazyWrapper = require(217),\n    LodashWrapper = require(218),\n    arrayCopy = require(220);\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n  return wrapper instanceof LazyWrapper\n    ? wrapper.clone()\n    : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));\n}\n\nmodule.exports = wrapperClone;\n","var isArrayLike = require(293),\n    isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;\n}\n\nmodule.exports = isArguments;\n","var isLength = require(298),\n    isNative = require(318),\n    isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar arrayTag = '[object Array]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\nvar isArray = nativeIsArray || function(value) {\n  return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n};\n\nmodule.exports = isArray;\n","var baseIsFunction = require('../internal/baseIsFunction'),\n    isNative = require('./isNative');\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nvar isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in older versions of Chrome and Safari which return 'function' for regexes\n  // and Safari 8 equivalents which return 'object' for typed array constructors.\n  return objToString.call(value) == funcTag;\n};\n\nmodule.exports = isFunction;\n","var escapeRegExp = require(332),\n    isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]';\n\n/** Used to detect host constructors (Safari > 5). */\nvar reIsHostCtor = /^/[object .+?Constructor/]$/;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar fnToString = Function.prototype.toString;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  escapeRegExp(objToString)\n  .replace(/toString|(function).*?(?=///()| for .+?(?=///])/g, '$1.*?') + '$'\n);\n\n/**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\nfunction isNative(value) {\n  if (value == null) {\n    return false;\n  }\n  if (objToString.call(value) == funcTag) {\n    return reIsNative.test(fnToString.call(value));\n  }\n  return isObjectLike(value) && reIsHostCtor.test(value);\n}\n\nmodule.exports = isNative;\n","var isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(8.4);\n * // => true\n *\n * _.isNumber(NaN);\n * // => true\n *\n * _.isNumber('8.4');\n * // => false\n */\nfunction isNumber(value) {\n  return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\nfunction isObject(value) {\n  // Avoid a V8 JIT bug in Chrome 19-20.\n  // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n  var type = typeof value;\n  return type == 'function' || (!!value && type == 'object');\n}\n\nmodule.exports = isObject;\n","var isNative = require(318),\n    shimIsPlainObject = require(309);\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/** Native method references. */\nvar getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nvar isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {\n  if (!(value && objToString.call(value) == objectTag)) {\n    return false;\n  }\n  var valueOf = value.valueOf,\n      objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);\n\n  return objProto\n    ? (value == objProto || getPrototypeOf(value) == objProto)\n    : shimIsPlainObject(value);\n};\n\nmodule.exports = isPlainObject;\n","var isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n  return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var isLength = require(298),\n    isObjectLike = require(299);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dateTag] = typedArrayTags[errorTag] =\ntypedArrayTags[funcTag] = typedArrayTags[mapTag] =\ntypedArrayTags[numberTag] = typedArrayTags[objectTag] =\ntypedArrayTags[regexpTag] = typedArrayTags[setTag] =\ntypedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)\n * of values.\n */\nvar objToString = objectProto.toString;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nfunction isTypedArray(value) {\n  return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n}\n\nmodule.exports = isTypedArray;\n","var baseCopy = require(231),\n    keysIn = require(327);\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n  return baseCopy(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var assignWith = require(227),\n    baseAssign = require(228),\n    createAssigner = require(273);\n\n/**\n * Assigns own enumerable properties of source object(s) to the destination\n * object. Subsequent sources overwrite property assignments of previous sources.\n * If `customizer` is provided it is invoked to produce the assigned values.\n * The `customizer` is bound to `thisArg` and invoked with five arguments:\n * (objectValue, sourceValue, key, object, source).\n *\n * **Note:** This method mutates `object` and is based on\n * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).\n *\n * @static\n * @memberOf _\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });\n * // => { 'user': 'fred', 'age': 40 }\n *\n * // using a customizer callback\n * var defaults = _.partialRight(_.assign, function(value, other) {\n *   return _.isUndefined(value) ? other : value;\n * });\n *\n * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n * // => { 'user': 'barney', 'age': 36 }\n */\nvar assign = createAssigner(function(object, source, customizer) {\n  return customizer\n    ? assignWith(object, source, customizer)\n    : baseAssign(object, source);\n});\n\nmodule.exports = assign;\n","var isArrayLike = require(293),\n    isNative = require(318),\n    isObject = require(320),\n    shimKeys = require(310);\n\n/* Native method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nvar keys = !nativeKeys ? shimKeys : function(object) {\n  var Ctor = object != null && object.constructor;\n  if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n      (typeof object != 'function' && isArrayLike(object))) {\n    return shimKeys(object);\n  }\n  return isObject(object) ? nativeKeys(object) : [];\n};\n\nmodule.exports = keys;\n","var isArguments = require(315),\n    isArray = require(316),\n    isIndex = require(294),\n    isLength = require(298),\n    isObject = require(320),\n    support = require(333);\n\n/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n  if (object == null) {\n    return [];\n  }\n  if (!isObject(object)) {\n    object = Object(object);\n  }\n  var length = object.length;\n  length = (length && isLength(length) &&\n    (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;\n\n  var Ctor = object.constructor,\n      index = -1,\n      isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n      result = Array(length),\n      skipIndexes = length > 0;\n\n  while (++index < length) {\n    result[index] = (index + '');\n  }\n  for (var key in object) {\n    if (!(skipIndexes && isIndex(key, length)) &&\n        !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = keysIn;\n","var baseMerge = require(254),\n    createAssigner = require(273);\n\n/**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it is invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n *   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n *   'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n *   'fruits': ['apple'],\n *   'vegetables': ['beet']\n * };\n *\n * var other = {\n *   'fruits': ['banana'],\n *   'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n *   if (_.isArray(a)) {\n *     return a.concat(b);\n *   }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\nvar merge = createAssigner(baseMerge);\n\nmodule.exports = merge;\n","var arrayMap = require(224),\n    baseDifference = require(234),\n    baseFlatten = require(240),\n    bindCallback = require(266),\n    keysIn = require(327),\n    pickByArray = require(303),\n    pickByCallback = require(304),\n    restParam = require(216);\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n *  iteration or property names to omit, specified as individual property\n *  names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.omit(object, 'age');\n * // => { 'user': 'fred' }\n *\n * _.omit(object, _.isNumber);\n * // => { 'user': 'fred' }\n */\nvar omit = restParam(function(object, props) {\n  if (object == null) {\n    return {};\n  }\n  if (typeof props[0] != 'function') {\n    var props = arrayMap(baseFlatten(props), String);\n    return pickByArray(object, baseDifference(keysIn(object), props));\n  }\n  var predicate = bindCallback(props[0], props[1], 3);\n  return pickByCallback(object, function(value, key, object) {\n    return !predicate(value, key, object);\n  });\n});\n\nmodule.exports = omit;\n","var baseFlatten = require(240),\n    bindCallback = require(266),\n    pickByArray = require(303),\n    pickByCallback = require(304),\n    restParam = require(216);\n\n/**\n * Creates an object composed of the picked `object` properties. Property\n * names may be specified as individual arguments or as arrays of property\n * names. If `predicate` is provided it is invoked for each property of `object`\n * picking the properties `predicate` returns truthy for. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n *  iteration or property names to pick, specified as individual property\n *  names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.pick(object, 'user');\n * // => { 'user': 'fred' }\n *\n * _.pick(object, _.isString);\n * // => { 'user': 'fred' }\n */\nvar pick = restParam(function(object, props) {\n  if (object == null) {\n    return {};\n  }\n  return typeof props[0] == 'function'\n    ? pickByCallback(object, bindCallback(props[0], props[1], 3))\n    : pickByArray(object, baseFlatten(props));\n});\n\nmodule.exports = pick;\n","var baseValues = require(265),\n    keys = require(326);\n\n/**\n * Creates an array of the own enumerable property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n  return baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var baseToString = require(263);\n\n/**\n * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).\n * In addition to special characters the forward slash is escaped to allow for\n * easier `eval` use and `Function` compilation.\n */\nvar reRegExpChars = /[.*+?^${}()|[/]////]/g,\n    reHasRegExpChars = RegExp(reRegExpChars.source);\n\n/**\n * Escapes the `RegExp` special characters \"/\", \"/\", \"^\", \"$\", \".\", \"|\", \"?\",\n * \"*\", \"+\", \"(\", \")\", \"[\", \"]\", \"{\" and \"}\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '/[lodash/]/(https:////lodash/.com///)'\n */\nfunction escapeRegExp(string) {\n  string = baseToString(string);\n  return (string && reHasRegExpChars.test(string))\n    ? string.replace(reRegExpChars, '//$&')\n    : string;\n}\n\nmodule.exports = escapeRegExp;\n","/** Used for native method references. */\nvar objectProto = Object.prototype;\n\n/** Used to detect DOM support. */\nvar document = (document = global.window) && document.document;\n\n/** Native method references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * An object environment feature flags.\n *\n * @static\n * @memberOf _\n * @type Object\n */\nvar support = {};\n\n(function(x) {\n  var Ctor = function() { this.x = x; },\n      args = arguments,\n      object = { '0': x, 'length': x },\n      props = [];\n\n  Ctor.prototype = { 'valueOf': x, 'y': x };\n  for (var key in new Ctor) { props.push(key); }\n\n  /**\n   * Detect if functions can be decompiled by `Function#toString`\n   * (all but Firefox OS certified apps, older Opera mobile browsers, and\n   * the PlayStation 3; forced `false` for Windows 8 apps).\n   *\n   * @memberOf _.support\n   * @type boolean\n   */\n  support.funcDecomp = //bthis/b/.test(function() { return this; });\n\n  /**\n   * Detect if `Function#name` is supported (all but IE).\n   *\n   * @memberOf _.support\n   * @type boolean\n   */\n  support.funcNames = typeof Function.name == 'string';\n\n  /**\n   * Detect if the DOM is supported.\n   *\n   * @memberOf _.support\n   * @type boolean\n   */\n  try {\n    support.dom = document.createDocumentFragment().nodeType === 11;\n  } catch(e) {\n    support.dom = false;\n  }\n\n  /**\n   * Detect if `arguments` object indexes are non-enumerable.\n   *\n   * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object\n   * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat\n   * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`\n   * checks for indexes that exceed the number of function parameters and\n   * whose associated argument values are `0`.\n   *\n   * @memberOf _.support\n   * @type boolean\n   */\n  try {\n    support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);\n  } catch(e) {\n    support.nonEnumArgs = true;\n  }\n}(1, 0));\n\nmodule.exports = support;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\nfunction constant(value) {\n  return function() {\n    return value;\n  };\n}\n\nmodule.exports = constant;\n","/**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\nmodule.exports = identity;\n","/**\n * A no-operation function which returns `undefined` regardless of the\n * arguments it receives.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.noop(object) === undefined;\n * // => true\n */\nfunction noop() {\n  // No operation performed.\n}\n\nmodule.exports = noop;\n","var baseProperty = require(256),\n    basePropertyDeep = require(257),\n    isKey = require(296);\n\n/**\n * Creates a function which returns the property value at `path` on a\n * given object.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': { 'c': 2 } } },\n *   { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","/**\n * Set attribute `name` to `val`, or get attr `name`.\n *\n * @param {Element} el\n * @param {String} name\n * @param {String} [val]\n * @api public\n */\n\nmodule.exports = function(el, name, val) {\n  // get\n  if (arguments.length == 2) {\n    return el.getAttribute(name);\n  }\n\n  // remove\n  if (val === null) {\n    return el.removeAttribute(name);\n  }\n\n  // set\n  el.setAttribute(name, val);\n\n  return el;\n};","module.exports = require(348);","module.exports = function(el) {\n\n  var c;\n\n  while (el.childNodes.length) {\n    c = el.childNodes[0];\n    el.removeChild(c);\n  }\n\n  return el;\n};","module.exports = require(350);","module.exports = require(351);","module.exports = require(355);","module.exports = require(352);","module.exports = require(353);","module.exports = require(354);","module.exports = function(el) {\n  el.parentNode && el.parentNode.removeChild(el);\n};","/**\n * Module dependencies.\n */\n\nvar index = require(349);\n\n/**\n * Whitespace regexp.\n */\n\nvar re = //s+/;\n\n/**\n * toString reference.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Wrap `el` in a `ClassList`.\n *\n * @param {Element} el\n * @return {ClassList}\n * @api public\n */\n\nmodule.exports = function(el){\n  return new ClassList(el);\n};\n\n/**\n * Initialize a new ClassList for `el`.\n *\n * @param {Element} el\n * @api private\n */\n\nfunction ClassList(el) {\n  if (!el || !el.nodeType) {\n    throw new Error('A DOM element reference is required');\n  }\n  this.el = el;\n  this.list = el.classList;\n}\n\n/**\n * Add class `name` if not already present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.add = function(name){\n  // classList\n  if (this.list) {\n    this.list.add(name);\n    return this;\n  }\n\n  // fallback\n  var arr = this.array();\n  var i = index(arr, name);\n  if (!~i) arr.push(name);\n  this.el.className = arr.join(' ');\n  return this;\n};\n\n/**\n * Remove class `name` when present, or\n * pass a regular expression to remove\n * any which match.\n *\n * @param {String|RegExp} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.remove = function(name){\n  if ('[object RegExp]' == toString.call(name)) {\n    return this.removeMatching(name);\n  }\n\n  // classList\n  if (this.list) {\n    this.list.remove(name);\n    return this;\n  }\n\n  // fallback\n  var arr = this.array();\n  var i = index(arr, name);\n  if (~i) arr.splice(i, 1);\n  this.el.className = arr.join(' ');\n  return this;\n};\n\n/**\n * Remove all classes matching `re`.\n *\n * @param {RegExp} re\n * @return {ClassList}\n * @api private\n */\n\nClassList.prototype.removeMatching = function(re){\n  var arr = this.array();\n  for (var i = 0; i < arr.length; i++) {\n    if (re.test(arr[i])) {\n      this.remove(arr[i]);\n    }\n  }\n  return this;\n};\n\n/**\n * Toggle class `name`, can force state via `force`.\n *\n * For browsers that support classList, but do not support `force` yet,\n * the mistake will be detected and corrected.\n *\n * @param {String} name\n * @param {Boolean} force\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.toggle = function(name, force){\n  // classList\n  if (this.list) {\n    if (\"undefined\" !== typeof force) {\n      if (force !== this.list.toggle(name, force)) {\n        this.list.toggle(name); // toggle again to correct\n      }\n    } else {\n      this.list.toggle(name);\n    }\n    return this;\n  }\n\n  // fallback\n  if (\"undefined\" !== typeof force) {\n    if (!force) {\n      this.remove(name);\n    } else {\n      this.add(name);\n    }\n  } else {\n    if (this.has(name)) {\n      this.remove(name);\n    } else {\n      this.add(name);\n    }\n  }\n\n  return this;\n};\n\n/**\n * Return an array of classes.\n *\n * @return {Array}\n * @api public\n */\n\nClassList.prototype.array = function(){\n  var className = this.el.getAttribute('class') || '';\n  var str = className.replace(/^/s+|/s+$/g, '');\n  var arr = str.split(re);\n  if ('' === arr[0]) arr.shift();\n  return arr;\n};\n\n/**\n * Check if class `name` is present.\n *\n * @param {String} name\n * @return {ClassList}\n * @api public\n */\n\nClassList.prototype.has =\nClassList.prototype.contains = function(name){\n  return this.list\n    ? this.list.contains(name)\n    : !! ~index(this.array(), name);\n};\n","module.exports = function(arr, obj){\n  if (arr.indexOf) return arr.indexOf(obj);\n  for (var i = 0; i < arr.length; ++i) {\n    if (arr[i] === obj) return i;\n  }\n  return -1;\n};","var matches = require(353)\n\nmodule.exports = function (element, selector, checkYoSelf, root) {\n  element = checkYoSelf ? {parentNode: element} : element\n\n  root = root || document\n\n  // Make sure `element !== document` and `element != null`\n  // otherwise we get an illegal invocation\n  while ((element = element.parentNode) && element !== document) {\n    if (matches(element, selector))\n      return element\n    // After `matches` on the edge case that\n    // the selector matches the root\n    // (when the root is not the document)\n    if (element === root)\n      return\n  }\n}\n","/**\n * Module dependencies.\n */\n\nvar closest = require(350)\n  , event = require(352);\n\n/**\n * Delegate event `type` to `selector`\n * and invoke `fn(e)`. A callback function\n * is returned which may be passed to `.unbind()`.\n *\n * @param {Element} el\n * @param {String} selector\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, selector, type, fn, capture){\n  return event.bind(el, type, function(e){\n    var target = e.target || e.srcElement;\n    e.delegateTarget = closest(target, selector, true, el);\n    if (e.delegateTarget) fn.call(el, e);\n  }, capture);\n};\n\n/**\n * Unbind event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n  event.unbind(el, type, fn, capture);\n};\n","var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',\n    unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',\n    prefix = bind !== 'addEventListener' ? 'on' : '';\n\n/**\n * Bind `el` event `type` to `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.bind = function(el, type, fn, capture){\n  el[bind](prefix + type, fn, capture || false);\n  return fn;\n};\n\n/**\n * Unbind `el` event `type`'s callback `fn`.\n *\n * @param {Element} el\n * @param {String} type\n * @param {Function} fn\n * @param {Boolean} capture\n * @return {Function}\n * @api public\n */\n\nexports.unbind = function(el, type, fn, capture){\n  el[unbind](prefix + type, fn, capture || false);\n  return fn;\n};","/**\n * Module dependencies.\n */\n\nvar query = require(354);\n\n/**\n * Element prototype.\n */\n\nvar proto = Element.prototype;\n\n/**\n * Vendor function.\n */\n\nvar vendor = proto.matches\n  || proto.webkitMatchesSelector\n  || proto.mozMatchesSelector\n  || proto.msMatchesSelector\n  || proto.oMatchesSelector;\n\n/**\n * Expose `match()`.\n */\n\nmodule.exports = match;\n\n/**\n * Match `el` to `selector`.\n *\n * @param {Element} el\n * @param {String} selector\n * @return {Boolean}\n * @api public\n */\n\nfunction match(el, selector) {\n  if (!el || el.nodeType !== 1) return false;\n  if (vendor) return vendor.call(el, selector);\n  var nodes = query.all(selector, el.parentNode);\n  for (var i = 0; i < nodes.length; ++i) {\n    if (nodes[i] == el) return true;\n  }\n  return false;\n}\n","function one(selector, el) {\n  return el.querySelector(selector);\n}\n\nexports = module.exports = function(selector, el){\n  el = el || document;\n  return one(selector, el);\n};\n\nexports.all = function(selector, el){\n  el = el || document;\n  return el.querySelectorAll(selector);\n};\n\nexports.engine = function(obj){\n  if (!obj.one) throw new Error('.one callback required');\n  if (!obj.all) throw new Error('.all callback required');\n  one = obj.one;\n  exports.all = obj.all;\n  return exports;\n};\n","\n/**\n * Expose `parse`.\n */\n\nmodule.exports = parse;\n\n/**\n * Tests for browser support.\n */\n\nvar div = document.createElement('div');\n// Setup\ndiv.innerHTML = '  <link/><table></table><a href=\"/a\">a</a><input type=\"checkbox\"/>';\n// Make sure that link elements get serialized correctly by innerHTML\n// This requires a wrapper element in IE\nvar innerHTMLBug = !div.getElementsByTagName('link').length;\ndiv = undefined;\n\n/**\n * Wrap map from jquery.\n */\n\nvar map = {\n  legend: [1, '<fieldset>', '</fieldset>'],\n  tr: [2, '<table><tbody>', '</tbody></table>'],\n  col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],\n  // for script/link/style tags to work in IE6-8, you have to wrap\n  // in a div with a non-whitespace character in front, ha!\n  _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']\n};\n\nmap.td =\nmap.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];\n\nmap.option =\nmap.optgroup = [1, '<select multiple=\"multiple\">', '</select>'];\n\nmap.thead =\nmap.tbody =\nmap.colgroup =\nmap.caption =\nmap.tfoot = [1, '<table>', '</table>'];\n\nmap.polyline =\nmap.ellipse =\nmap.polygon =\nmap.circle =\nmap.text =\nmap.line =\nmap.path =\nmap.rect =\nmap.g = [1, '<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">','</svg>'];\n\n/**\n * Parse `html` and return a DOM Node instance, which could be a TextNode,\n * HTML DOM Node of some kind (<div> for example), or a DocumentFragment\n * instance, depending on the contents of the `html` string.\n *\n * @param {String} html - HTML string to \"domify\"\n * @param {Document} doc - The `document` instance to create the Node for\n * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance\n * @api private\n */\n\nfunction parse(html, doc) {\n  if ('string' != typeof html) throw new TypeError('String expected');\n\n  // default to the global `document` object\n  if (!doc) doc = document;\n\n  // tag name\n  var m = /<([/w:]+)/.exec(html);\n  if (!m) return doc.createTextNode(html);\n\n  html = html.replace(/^/s+|/s+$/g, ''); // Remove leading/trailing whitespace\n\n  var tag = m[1];\n\n  // body support\n  if (tag == 'body') {\n    var el = doc.createElement('html');\n    el.innerHTML = html;\n    return el.removeChild(el.lastChild);\n  }\n\n  // wrap map\n  var wrap = map[tag] || map._default;\n  var depth = wrap[0];\n  var prefix = wrap[1];\n  var suffix = wrap[2];\n  var el = doc.createElement('div');\n  el.innerHTML = prefix + html + suffix;\n  while (depth--) el = el.lastChild;\n\n  // one element\n  if (el.firstChild == el.lastChild) {\n    return el.removeChild(el.firstChild);\n  }\n\n  // several elements\n  var fragment = doc.createDocumentFragment();\n  while (el.firstChild) {\n    fragment.appendChild(el.removeChild(el.firstChild));\n  }\n\n  return fragment;\n}\n","module.exports = require(358);\r\n\r\nmodule.exports.Collection = require(357);","'use strict';\r\n\r\n/**\r\n * An empty collection stub. Use {@link RefsCollection.extend} to extend a\r\n * collection with ref semantics.\r\n *\r\n * @classdesc A change and inverse-reference aware collection with set semantics.\r\n *\r\n * @class RefsCollection\r\n */\r\nfunction RefsCollection() { }\r\n\r\n/**\r\n * Extends a collection with {@link Refs} aware methods\r\n *\r\n * @memberof RefsCollection\r\n * @static\r\n *\r\n * @param  {Array<Object>} collection\r\n * @param  {Refs} refs instance\r\n * @param  {Object} property represented by the collection\r\n * @param  {Object} target object the collection is attached to\r\n *\r\n * @return {RefsCollection<Object>} the extended array\r\n */\r\nfunction extend(collection, refs, property, target) {\r\n\r\n  var inverseProperty = property.inverse;\r\n\r\n  /**\r\n   * Removes the given element from the array and returns it.\r\n   *\r\n   * @method RefsCollection#remove\r\n   *\r\n   * @param {Object} element the element to remove\r\n   */\r\n  collection.remove = function(element) {\r\n    var idx = this.indexOf(element);\r\n    if (idx !== -1) {\r\n      this.splice(idx, 1);\r\n\r\n      // unset inverse\r\n      refs.unset(element, inverseProperty, target);\r\n    }\r\n\r\n    return element;\r\n  };\r\n\r\n  /**\r\n   * Returns true if the collection contains the given element\r\n   *\r\n   * @method RefsCollection#contains\r\n   *\r\n   * @param {Object} element the element to check for\r\n   */\r\n  collection.contains = function(element) {\r\n    return this.indexOf(element) !== -1;\r\n  };\r\n\r\n  /**\r\n   * Adds an element to the array, unless it exists already (set semantics).\r\n   *\r\n   * @method RefsCollection#add\r\n   *\r\n   * @param {Object} element the element to add\r\n   */\r\n  collection.add = function(element) {\r\n\r\n    if (!this.contains(element)) {\r\n      this.push(element);\r\n\r\n      // set inverse\r\n      refs.set(element, inverseProperty, target);\r\n    }\r\n  };\r\n\r\n  return collection;\r\n}\r\n\r\n\r\nmodule.exports.extend = extend;","'use strict';\r\n\r\nvar Collection = require(357);\r\n\r\nfunction hasOwnProperty(e, property) {\r\n  return Object.prototype.hasOwnProperty.call(e, property.name || property);\r\n}\r\n\r\n\r\nfunction defineCollectionProperty(ref, property, target) {\r\n  Object.defineProperty(target, property.name, {\r\n    enumerable: property.enumerable,\r\n    value: Collection.extend(target[property.name] || [], ref, property, target)\r\n  });\r\n}\r\n\r\n\r\nfunction defineProperty(ref, property, target) {\r\n\r\n  var inverseProperty = property.inverse;\r\n\r\n  var _value = target[property.name];\r\n\r\n  Object.defineProperty(target, property.name, {\r\n    enumerable: property.enumerable,\r\n\r\n    get: function() {\r\n      return _value;\r\n    },\r\n\r\n    set: function(value) {\r\n\r\n      // return if we already performed all changes\r\n      if (value === _value) {\r\n        return;\r\n      }\r\n\r\n      var old = _value;\r\n\r\n      // temporary set null\r\n      _value = null;\r\n\r\n      if (old) {\r\n        ref.unset(old, inverseProperty, target);\r\n      }\r\n\r\n      // set new value\r\n      _value = value;\r\n\r\n      // set inverse value\r\n      ref.set(_value, inverseProperty, target);\r\n    }\r\n  });\r\n\r\n}\r\n\r\n/**\r\n * Creates a new references object defining two inversly related\r\n * attribute descriptors a and b.\r\n *\r\n * <p>\r\n *   When bound to an object using {@link Refs#bind} the references\r\n *   get activated and ensure that add and remove operations are applied\r\n *   reversely, too.\r\n * </p>\r\n *\r\n * <p>\r\n *   For attributes represented as collections {@link Refs} provides the\r\n *   {@link RefsCollection#add}, {@link RefsCollection#remove} and {@link RefsCollection#contains} extensions\r\n *   that must be used to properly hook into the inverse change mechanism.\r\n * </p>\r\n *\r\n * @class Refs\r\n *\r\n * @classdesc A bi-directional reference between two attributes.\r\n *\r\n * @param {Refs.AttributeDescriptor} a property descriptor\r\n * @param {Refs.AttributeDescriptor} b property descriptor\r\n *\r\n * @example\r\n *\r\n * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, { name: 'car' });\r\n *\r\n * var car = { name: 'toyota' };\r\n * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];\r\n *\r\n * refs.bind(car, 'wheels');\r\n *\r\n * car.wheels // []\r\n * car.wheels.add(wheels[0]);\r\n * car.wheels.add(wheels[1]);\r\n *\r\n * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]\r\n *\r\n * wheels[0].car // { name: 'toyota' };\r\n * car.wheels.remove(wheels[0]);\r\n *\r\n * wheels[0].car // undefined\r\n */\r\nfunction Refs(a, b) {\r\n\r\n  if (!(this instanceof Refs)) {\r\n    return new Refs(a, b);\r\n  }\r\n\r\n  // link\r\n  a.inverse = b;\r\n  b.inverse = a;\r\n\r\n  this.props = {};\r\n  this.props[a.name] = a;\r\n  this.props[b.name] = b;\r\n}\r\n\r\n/**\r\n * Binds one side of a bi-directional reference to a\r\n * target object.\r\n *\r\n * @memberOf Refs\r\n *\r\n * @param  {Object} target\r\n * @param  {String} property\r\n */\r\nRefs.prototype.bind = function(target, property) {\r\n  if (typeof property === 'string') {\r\n    if (!this.props[property]) {\r\n      throw new Error('no property <' + property + '> in ref');\r\n    }\r\n    property = this.props[property];\r\n  }\r\n\r\n  if (property.collection) {\r\n    defineCollectionProperty(this, property, target);\r\n  } else {\r\n    defineProperty(this, property, target);\r\n  }\r\n};\r\n\r\nRefs.prototype.ensureBound = function(target, property) {\r\n  if (!hasOwnProperty(target, property)) {\r\n    this.bind(target, property);\r\n  }\r\n};\r\n\r\nRefs.prototype.unset = function(target, property, value) {\r\n\r\n  if (target) {\r\n    this.ensureBound(target, property);\r\n\r\n    if (property.collection) {\r\n      target[property.name].remove(value);\r\n    } else {\r\n      target[property.name] = undefined;\r\n    }\r\n  }\r\n};\r\n\r\nRefs.prototype.set = function(target, property, value) {\r\n\r\n  if (target) {\r\n    this.ensureBound(target, property);\r\n\r\n    if (property.collection) {\r\n      target[property.name].add(value);\r\n    } else {\r\n      target[property.name] = value;\r\n    }\r\n  }\r\n};\r\n\r\nmodule.exports = Refs;\r\n\r\n\r\n/**\r\n * An attribute descriptor to be used specify an attribute in a {@link Refs} instance\r\n *\r\n * @typedef {Object} Refs.AttributeDescriptor\r\n * @property {String} name\r\n * @property {boolean} [collection=false]\r\n * @property {boolean} [enumerable=false]\r\n */"]}