@logicflow/core 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$dev.log +2 -2
- package/.turbo/turbo-build.log +9 -9
- package/__tests__/bugs/1545-spec.test.ts +19 -15
- package/__tests__/util/edge.test.ts +57 -57
- package/dist/index.min.js +9 -3
- package/es/LogicFlow.d.ts +88 -40
- package/es/LogicFlow.js +38 -33
- package/es/LogicFlow.js.map +1 -1
- package/es/algorithm/edge.js.map +1 -1
- package/es/algorithm/index.d.ts +2 -0
- package/es/algorithm/index.js +2 -0
- package/es/algorithm/index.js.map +1 -1
- package/es/algorithm/outline.d.ts +1 -1
- package/es/common/drag.d.ts +51 -0
- package/es/common/drag.js +145 -0
- package/es/common/drag.js.map +1 -0
- package/es/common/history.d.ts +28 -0
- package/es/common/history.js +92 -0
- package/es/common/history.js.map +1 -0
- package/es/common/index.d.ts +5 -0
- package/es/common/index.js +6 -0
- package/es/common/index.js.map +1 -0
- package/es/common/keyboard.d.ts +34 -0
- package/es/common/keyboard.js +80 -0
- package/es/common/keyboard.js.map +1 -0
- package/es/common/matrix.d.ts +30 -0
- package/es/common/matrix.js +155 -0
- package/es/common/matrix.js.map +1 -0
- package/es/common/vector.d.ts +23 -0
- package/es/common/vector.js +97 -0
- package/es/common/vector.js.map +1 -0
- package/es/constant/index.d.ts +39 -2
- package/es/constant/index.js +41 -1
- package/es/constant/index.js.map +1 -1
- package/es/event/eventArgs.d.ts +103 -25
- package/es/event/eventEmitter.d.ts +2 -2
- package/es/event/eventEmitter.js +0 -1
- package/es/event/eventEmitter.js.map +1 -1
- package/es/index.d.ts +6 -1
- package/es/index.js +6 -1
- package/es/index.js.map +1 -1
- package/es/keyboard/index.d.ts +1 -0
- package/es/keyboard/index.js +1 -0
- package/es/keyboard/index.js.map +1 -1
- package/es/keyboard/shortcut.d.ts +8 -0
- package/es/keyboard/shortcut.js +70 -8
- package/es/keyboard/shortcut.js.map +1 -1
- package/es/model/BaseModel.d.ts +16 -7
- package/es/model/EditConfigModel.d.ts +97 -36
- package/es/model/EditConfigModel.js +169 -82
- package/es/model/EditConfigModel.js.map +1 -1
- package/es/model/GraphModel.d.ts +36 -14
- package/es/model/GraphModel.js +60 -10
- package/es/model/GraphModel.js.map +1 -1
- package/es/model/SnaplineModel.d.ts +2 -0
- package/es/model/TransformModel.js +1 -1
- package/es/model/TransformModel.js.map +1 -1
- package/es/model/edge/BaseEdgeModel.d.ts +21 -17
- package/es/model/edge/BaseEdgeModel.js +64 -42
- package/es/model/edge/BaseEdgeModel.js.map +1 -1
- package/es/model/edge/BezierEdgeModel.d.ts +5 -3
- package/es/model/edge/BezierEdgeModel.js +7 -3
- package/es/model/edge/BezierEdgeModel.js.map +1 -1
- package/es/model/edge/LineEdgeModel.d.ts +2 -0
- package/es/model/edge/LineEdgeModel.js +2 -1
- package/es/model/edge/LineEdgeModel.js.map +1 -1
- package/es/model/edge/PolylineEdgeModel.d.ts +5 -3
- package/es/model/edge/PolylineEdgeModel.js +22 -15
- package/es/model/edge/PolylineEdgeModel.js.map +1 -1
- package/es/model/node/BaseNodeModel.d.ts +42 -14
- package/es/model/node/BaseNodeModel.js +62 -48
- package/es/model/node/BaseNodeModel.js.map +1 -1
- package/es/model/node/CircleNodeModel.d.ts +4 -3
- package/es/model/node/CircleNodeModel.js +4 -7
- package/es/model/node/CircleNodeModel.js.map +1 -1
- package/es/model/node/DiamondNodeModel.d.ts +5 -4
- package/es/model/node/DiamondNodeModel.js +4 -6
- package/es/model/node/DiamondNodeModel.js.map +1 -1
- package/es/model/node/EllipseNodeModel.d.ts +5 -4
- package/es/model/node/EllipseNodeModel.js +4 -6
- package/es/model/node/EllipseNodeModel.js.map +1 -1
- package/es/model/node/HtmlNodeModel.d.ts +4 -5
- package/es/model/node/HtmlNodeModel.js +2 -12
- package/es/model/node/HtmlNodeModel.js.map +1 -1
- package/es/model/node/PolygonNodeModel.d.ts +5 -4
- package/es/model/node/PolygonNodeModel.js +4 -7
- package/es/model/node/PolygonNodeModel.js.map +1 -1
- package/es/model/node/RectNodeModel.d.ts +7 -5
- package/es/model/node/RectNodeModel.js +10 -7
- package/es/model/node/RectNodeModel.js.map +1 -1
- package/es/model/node/TextNodeModel.d.ts +17 -9
- package/es/model/node/TextNodeModel.js +2 -1
- package/es/model/node/TextNodeModel.js.map +1 -1
- package/es/options.d.ts +6 -3
- package/es/options.js +2 -11
- package/es/options.js.map +1 -1
- package/es/tool/MultipleSelectTool.d.ts +1 -1
- package/es/tool/MultipleSelectTool.js +5 -5
- package/es/tool/MultipleSelectTool.js.map +1 -1
- package/es/tool/TextEditTool.d.ts +3 -3
- package/es/tool/TextEditTool.js +2 -2
- package/es/tool/TextEditTool.js.map +1 -1
- package/es/tool/index.d.ts +24 -2
- package/es/tool/index.js +82 -2
- package/es/tool/index.js.map +1 -1
- package/es/util/drag.d.ts +5 -5
- package/es/util/drag.js +3 -1
- package/es/util/drag.js.map +1 -1
- package/es/util/edge.d.ts +9 -2
- package/es/util/edge.js +23 -12
- package/es/util/edge.js.map +1 -1
- package/es/util/index.d.ts +1 -0
- package/es/util/index.js +1 -0
- package/es/util/index.js.map +1 -1
- package/es/util/node.d.ts +8 -7
- package/es/util/node.js +26 -7
- package/es/util/node.js.map +1 -1
- package/es/util/resize.d.ts +32 -0
- package/es/util/resize.js +197 -0
- package/es/util/resize.js.map +1 -0
- package/es/view/Anchor.d.ts +6 -7
- package/es/view/Anchor.js +6 -3
- package/es/view/Anchor.js.map +1 -1
- package/es/view/Control.d.ts +1 -1
- package/es/view/Control.js +88 -39
- package/es/view/Control.js.map +1 -1
- package/es/view/Graph.d.ts +5 -1
- package/es/view/Graph.js +43 -3
- package/es/view/Graph.js.map +1 -1
- package/es/view/Rotate.js +2 -1
- package/es/view/Rotate.js.map +1 -1
- package/es/view/behavior/index.d.ts +2 -0
- package/es/view/behavior/index.js +3 -0
- package/es/view/behavior/index.js.map +1 -0
- package/es/view/behavior/snapline.d.ts +3 -0
- package/es/{tool → view/behavior}/snapline.js +0 -1
- package/es/view/behavior/snapline.js.map +1 -0
- package/es/view/edge/AdjustPoint.js +12 -23
- package/es/view/edge/AdjustPoint.js.map +1 -1
- package/es/view/edge/BaseEdge.d.ts +2 -2
- package/es/view/edge/BaseEdge.js +30 -22
- package/es/view/edge/BaseEdge.js.map +1 -1
- package/es/view/node/BaseNode.d.ts +4 -4
- package/es/view/node/BaseNode.js +33 -24
- package/es/view/node/BaseNode.js.map +1 -1
- package/es/view/node/CircleNode.d.ts +1 -1
- package/es/view/node/CircleNode.js.map +1 -1
- package/es/view/node/DiamondNode.d.ts +1 -1
- package/es/view/node/DiamondNode.js.map +1 -1
- package/es/view/node/EllipseNode.d.ts +1 -1
- package/es/view/node/EllipseNode.js.map +1 -1
- package/es/view/node/HtmlNode.d.ts +1 -1
- package/es/view/node/HtmlNode.js +2 -2
- package/es/view/node/HtmlNode.js.map +1 -1
- package/es/view/node/PolygonNode.d.ts +1 -1
- package/es/view/node/PolygonNode.js.map +1 -1
- package/es/view/node/RectNode.d.ts +1 -1
- package/es/view/node/RectNode.js.map +1 -1
- package/es/view/node/TextNode.d.ts +1 -1
- package/es/view/node/TextNode.js +1 -1
- package/es/view/node/TextNode.js.map +1 -1
- package/es/view/overlay/CanvasOverlay.js +5 -4
- package/es/view/overlay/CanvasOverlay.js.map +1 -1
- package/es/view/overlay/ToolOverlay.d.ts +1 -1
- package/es/view/overlay/ToolOverlay.js +1 -1
- package/es/view/overlay/ToolOverlay.js.map +1 -1
- package/es/view/shape/Circle.d.ts +9 -1
- package/es/view/shape/Circle.js +5 -5
- package/es/view/shape/Circle.js.map +1 -1
- package/es/view/shape/Ellipse.d.ts +10 -1
- package/es/view/shape/Ellipse.js +5 -5
- package/es/view/shape/Ellipse.js.map +1 -1
- package/es/view/shape/Line.d.ts +14 -1
- package/es/view/shape/Line.js +5 -7
- package/es/view/shape/Line.js.map +1 -1
- package/es/view/shape/Path.d.ts +3 -2
- package/es/view/shape/Path.js +3 -3
- package/es/view/shape/Path.js.map +1 -1
- package/es/view/shape/Polygon.d.ts +5 -3
- package/es/view/shape/Polygon.js +6 -6
- package/es/view/shape/Polygon.js.map +1 -1
- package/es/view/shape/Polyline.d.ts +7 -1
- package/es/view/shape/Polyline.js +8 -6
- package/es/view/shape/Polyline.js.map +1 -1
- package/es/view/shape/Rect.d.ts +11 -13
- package/es/view/shape/Rect.js +6 -9
- package/es/view/shape/Rect.js.map +1 -1
- package/es/view/shape/Text.d.ts +19 -1
- package/es/view/shape/Text.js +28 -21
- package/es/view/shape/Text.js.map +1 -1
- package/es/view/text/BaseText.d.ts +12 -15
- package/es/view/text/BaseText.js +43 -29
- package/es/view/text/BaseText.js.map +1 -1
- package/es/view/text/LineText.d.ts +19 -7
- package/es/view/text/LineText.js +62 -54
- package/es/view/text/LineText.js.map +1 -1
- package/lib/LogicFlow.d.ts +88 -40
- package/lib/LogicFlow.js +40 -35
- package/lib/LogicFlow.js.map +1 -1
- package/lib/algorithm/edge.js.map +1 -1
- package/lib/algorithm/index.d.ts +2 -0
- package/lib/algorithm/index.js +17 -1
- package/lib/algorithm/index.js.map +1 -1
- package/lib/algorithm/outline.d.ts +1 -1
- package/lib/common/drag.d.ts +51 -0
- package/lib/common/drag.js +148 -0
- package/lib/common/drag.js.map +1 -0
- package/lib/common/history.d.ts +28 -0
- package/lib/common/history.js +95 -0
- package/lib/common/history.js.map +1 -0
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.js +22 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/keyboard.d.ts +34 -0
- package/lib/common/keyboard.js +86 -0
- package/lib/common/keyboard.js.map +1 -0
- package/lib/common/matrix.d.ts +30 -0
- package/lib/common/matrix.js +158 -0
- package/lib/common/matrix.js.map +1 -0
- package/lib/common/vector.d.ts +23 -0
- package/lib/common/vector.js +101 -0
- package/lib/common/vector.js.map +1 -0
- package/lib/constant/index.d.ts +39 -2
- package/lib/constant/index.js +42 -2
- package/lib/constant/index.js.map +1 -1
- package/lib/event/eventArgs.d.ts +103 -25
- package/lib/event/eventEmitter.d.ts +2 -2
- package/lib/event/eventEmitter.js +0 -1
- package/lib/event/eventEmitter.js.map +1 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.js +7 -2
- package/lib/index.js.map +1 -1
- package/lib/keyboard/index.d.ts +1 -0
- package/lib/keyboard/index.js +15 -0
- package/lib/keyboard/index.js.map +1 -1
- package/lib/keyboard/shortcut.d.ts +8 -0
- package/lib/keyboard/shortcut.js +75 -9
- package/lib/keyboard/shortcut.js.map +1 -1
- package/lib/model/BaseModel.d.ts +16 -7
- package/lib/model/EditConfigModel.d.ts +97 -36
- package/lib/model/EditConfigModel.js +168 -81
- package/lib/model/EditConfigModel.js.map +1 -1
- package/lib/model/GraphModel.d.ts +36 -14
- package/lib/model/GraphModel.js +59 -9
- package/lib/model/GraphModel.js.map +1 -1
- package/lib/model/SnaplineModel.d.ts +2 -0
- package/lib/model/TransformModel.js +1 -1
- package/lib/model/TransformModel.js.map +1 -1
- package/lib/model/edge/BaseEdgeModel.d.ts +21 -17
- package/lib/model/edge/BaseEdgeModel.js +61 -39
- package/lib/model/edge/BaseEdgeModel.js.map +1 -1
- package/lib/model/edge/BezierEdgeModel.d.ts +5 -3
- package/lib/model/edge/BezierEdgeModel.js +6 -2
- package/lib/model/edge/BezierEdgeModel.js.map +1 -1
- package/lib/model/edge/LineEdgeModel.d.ts +2 -0
- package/lib/model/edge/LineEdgeModel.js +2 -1
- package/lib/model/edge/LineEdgeModel.js.map +1 -1
- package/lib/model/edge/PolylineEdgeModel.d.ts +5 -3
- package/lib/model/edge/PolylineEdgeModel.js +21 -14
- package/lib/model/edge/PolylineEdgeModel.js.map +1 -1
- package/lib/model/node/BaseNodeModel.d.ts +42 -14
- package/lib/model/node/BaseNodeModel.js +60 -46
- package/lib/model/node/BaseNodeModel.js.map +1 -1
- package/lib/model/node/CircleNodeModel.d.ts +4 -3
- package/lib/model/node/CircleNodeModel.js +4 -7
- package/lib/model/node/CircleNodeModel.js.map +1 -1
- package/lib/model/node/DiamondNodeModel.d.ts +5 -4
- package/lib/model/node/DiamondNodeModel.js +4 -6
- package/lib/model/node/DiamondNodeModel.js.map +1 -1
- package/lib/model/node/EllipseNodeModel.d.ts +5 -4
- package/lib/model/node/EllipseNodeModel.js +4 -6
- package/lib/model/node/EllipseNodeModel.js.map +1 -1
- package/lib/model/node/HtmlNodeModel.d.ts +4 -5
- package/lib/model/node/HtmlNodeModel.js +2 -12
- package/lib/model/node/HtmlNodeModel.js.map +1 -1
- package/lib/model/node/PolygonNodeModel.d.ts +5 -4
- package/lib/model/node/PolygonNodeModel.js +4 -7
- package/lib/model/node/PolygonNodeModel.js.map +1 -1
- package/lib/model/node/RectNodeModel.d.ts +7 -5
- package/lib/model/node/RectNodeModel.js +10 -7
- package/lib/model/node/RectNodeModel.js.map +1 -1
- package/lib/model/node/TextNodeModel.d.ts +17 -9
- package/lib/model/node/TextNodeModel.js +2 -1
- package/lib/model/node/TextNodeModel.js.map +1 -1
- package/lib/options.d.ts +6 -3
- package/lib/options.js +2 -11
- package/lib/options.js.map +1 -1
- package/lib/tool/MultipleSelectTool.d.ts +1 -1
- package/lib/tool/MultipleSelectTool.js +5 -5
- package/lib/tool/MultipleSelectTool.js.map +1 -1
- package/lib/tool/TextEditTool.d.ts +3 -3
- package/lib/tool/TextEditTool.js +4 -4
- package/lib/tool/TextEditTool.js.map +1 -1
- package/lib/tool/index.d.ts +24 -2
- package/lib/tool/index.js +85 -15
- package/lib/tool/index.js.map +1 -1
- package/lib/util/drag.d.ts +5 -5
- package/lib/util/drag.js +3 -1
- package/lib/util/drag.js.map +1 -1
- package/lib/util/edge.d.ts +9 -2
- package/lib/util/edge.js +27 -15
- package/lib/util/edge.js.map +1 -1
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/lib/util/node.d.ts +8 -7
- package/lib/util/node.js +28 -9
- package/lib/util/node.js.map +1 -1
- package/lib/util/resize.d.ts +32 -0
- package/lib/util/resize.js +204 -0
- package/lib/util/resize.js.map +1 -0
- package/lib/view/Anchor.d.ts +6 -7
- package/lib/view/Anchor.js +5 -2
- package/lib/view/Anchor.js.map +1 -1
- package/lib/view/Control.d.ts +1 -1
- package/lib/view/Control.js +87 -38
- package/lib/view/Control.js.map +1 -1
- package/lib/view/Graph.d.ts +5 -1
- package/lib/view/Graph.js +42 -2
- package/lib/view/Graph.js.map +1 -1
- package/lib/view/Rotate.js +2 -1
- package/lib/view/Rotate.js.map +1 -1
- package/lib/view/behavior/index.d.ts +2 -0
- package/lib/view/behavior/index.js +19 -0
- package/lib/view/behavior/index.js.map +1 -0
- package/lib/view/behavior/snapline.d.ts +3 -0
- package/lib/{tool → view/behavior}/snapline.js +0 -1
- package/lib/view/behavior/snapline.js.map +1 -0
- package/lib/view/edge/AdjustPoint.js +11 -22
- package/lib/view/edge/AdjustPoint.js.map +1 -1
- package/lib/view/edge/BaseEdge.d.ts +2 -2
- package/lib/view/edge/BaseEdge.js +29 -21
- package/lib/view/edge/BaseEdge.js.map +1 -1
- package/lib/view/node/BaseNode.d.ts +4 -4
- package/lib/view/node/BaseNode.js +32 -23
- package/lib/view/node/BaseNode.js.map +1 -1
- package/lib/view/node/CircleNode.d.ts +1 -1
- package/lib/view/node/CircleNode.js.map +1 -1
- package/lib/view/node/DiamondNode.d.ts +1 -1
- package/lib/view/node/DiamondNode.js.map +1 -1
- package/lib/view/node/EllipseNode.d.ts +1 -1
- package/lib/view/node/EllipseNode.js.map +1 -1
- package/lib/view/node/HtmlNode.d.ts +1 -1
- package/lib/view/node/HtmlNode.js +2 -2
- package/lib/view/node/HtmlNode.js.map +1 -1
- package/lib/view/node/PolygonNode.d.ts +1 -1
- package/lib/view/node/PolygonNode.js.map +1 -1
- package/lib/view/node/RectNode.d.ts +1 -1
- package/lib/view/node/RectNode.js.map +1 -1
- package/lib/view/node/TextNode.d.ts +1 -1
- package/lib/view/node/TextNode.js +1 -1
- package/lib/view/node/TextNode.js.map +1 -1
- package/lib/view/overlay/CanvasOverlay.js +5 -4
- package/lib/view/overlay/CanvasOverlay.js.map +1 -1
- package/lib/view/overlay/ToolOverlay.d.ts +1 -1
- package/lib/view/overlay/ToolOverlay.js +1 -1
- package/lib/view/overlay/ToolOverlay.js.map +1 -1
- package/lib/view/shape/Circle.d.ts +9 -1
- package/lib/view/shape/Circle.js +5 -5
- package/lib/view/shape/Circle.js.map +1 -1
- package/lib/view/shape/Ellipse.d.ts +10 -1
- package/lib/view/shape/Ellipse.js +5 -5
- package/lib/view/shape/Ellipse.js.map +1 -1
- package/lib/view/shape/Line.d.ts +14 -1
- package/lib/view/shape/Line.js +5 -7
- package/lib/view/shape/Line.js.map +1 -1
- package/lib/view/shape/Path.d.ts +3 -2
- package/lib/view/shape/Path.js +3 -3
- package/lib/view/shape/Path.js.map +1 -1
- package/lib/view/shape/Polygon.d.ts +5 -3
- package/lib/view/shape/Polygon.js +6 -6
- package/lib/view/shape/Polygon.js.map +1 -1
- package/lib/view/shape/Polyline.d.ts +7 -1
- package/lib/view/shape/Polyline.js +8 -6
- package/lib/view/shape/Polyline.js.map +1 -1
- package/lib/view/shape/Rect.d.ts +11 -13
- package/lib/view/shape/Rect.js +6 -9
- package/lib/view/shape/Rect.js.map +1 -1
- package/lib/view/shape/Text.d.ts +19 -1
- package/lib/view/shape/Text.js +29 -21
- package/lib/view/shape/Text.js.map +1 -1
- package/lib/view/text/BaseText.d.ts +12 -15
- package/lib/view/text/BaseText.js +46 -29
- package/lib/view/text/BaseText.js.map +1 -1
- package/lib/view/text/LineText.d.ts +19 -7
- package/lib/view/text/LineText.js +62 -57
- package/lib/view/text/LineText.js.map +1 -1
- package/package.json +2 -1
- package/src/LogicFlow.tsx +163 -79
- package/src/algorithm/edge.ts +1 -0
- package/src/algorithm/index.ts +2 -0
- package/src/algorithm/outline.ts +2 -2
- package/src/common/drag.ts +219 -0
- package/src/common/history.ts +108 -0
- package/src/common/index.ts +6 -0
- package/src/common/keyboard.ts +108 -0
- package/src/common/matrix.ts +122 -0
- package/src/common/vector.ts +93 -0
- package/src/constant/index.ts +43 -1
- package/src/event/eventArgs.ts +173 -34
- package/src/event/eventEmitter.ts +2 -3
- package/src/index.ts +6 -1
- package/src/keyboard/index.ts +2 -0
- package/src/keyboard/shortcut.ts +79 -8
- package/src/model/BaseModel.ts +18 -7
- package/src/model/EditConfigModel.ts +209 -97
- package/src/model/GraphModel.ts +64 -9
- package/src/model/TransformModel.ts +1 -1
- package/src/model/edge/BaseEdgeModel.ts +75 -44
- package/src/model/edge/BezierEdgeModel.ts +7 -6
- package/src/model/edge/LineEdgeModel.ts +2 -0
- package/src/model/edge/PolylineEdgeModel.ts +24 -18
- package/src/model/node/BaseNodeModel.ts +72 -47
- package/src/model/node/CircleNodeModel.ts +8 -7
- package/src/model/node/DiamondNodeModel.ts +9 -6
- package/src/model/node/EllipseNodeModel.ts +9 -6
- package/src/model/node/HtmlNodeModel.ts +8 -7
- package/src/model/node/PolygonNodeModel.ts +9 -7
- package/src/model/node/RectNodeModel.ts +16 -8
- package/src/model/node/TextNodeModel.ts +14 -1
- package/src/options.ts +11 -15
- package/src/tool/MultipleSelectTool.tsx +6 -6
- package/src/tool/TextEditTool.tsx +3 -3
- package/src/tool/index.ts +96 -2
- package/src/util/drag.ts +22 -6
- package/src/util/edge.ts +39 -13
- package/src/util/index.ts +1 -0
- package/src/util/node.ts +36 -13
- package/src/util/resize.ts +286 -0
- package/src/view/Anchor.tsx +7 -5
- package/src/view/Control.tsx +93 -62
- package/src/view/Graph.tsx +21 -4
- package/src/view/Rotate.tsx +2 -1
- package/src/view/behavior/index.ts +2 -0
- package/src/{tool → view/behavior}/snapline.ts +3 -4
- package/src/view/edge/AdjustPoint.tsx +35 -49
- package/src/view/edge/BaseEdge.tsx +65 -45
- package/src/view/node/BaseNode.tsx +55 -28
- package/src/view/node/CircleNode.tsx +3 -1
- package/src/view/node/DiamondNode.tsx +3 -1
- package/src/view/node/EllipseNode.tsx +3 -1
- package/src/view/node/HtmlNode.tsx +5 -3
- package/src/view/node/PolygonNode.tsx +3 -1
- package/src/view/node/RectNode.tsx +3 -1
- package/src/view/node/TextNode.tsx +4 -2
- package/src/view/overlay/CanvasOverlay.tsx +5 -4
- package/src/view/overlay/ToolOverlay.tsx +1 -1
- package/src/view/shape/Circle.tsx +21 -7
- package/src/view/shape/Ellipse.tsx +20 -6
- package/src/view/shape/Line.tsx +24 -9
- package/src/view/shape/Path.tsx +9 -6
- package/src/view/shape/Polygon.tsx +13 -10
- package/src/view/shape/Polyline.tsx +20 -8
- package/src/view/shape/Rect.tsx +19 -19
- package/src/view/shape/Text.tsx +64 -33
- package/src/view/text/BaseText.tsx +76 -42
- package/src/view/text/LineText.tsx +94 -80
- package/tsconfig.json +1 -1
- package/es/tool/snapline.d.ts +0 -3
- package/es/tool/snapline.js.map +0 -1
- package/es/tool/tool.d.ts +0 -22
- package/es/tool/tool.js +0 -43
- package/es/tool/tool.js.map +0 -1
- package/lib/tool/snapline.d.ts +0 -3
- package/lib/tool/snapline.js.map +0 -1
- package/lib/tool/tool.d.ts +0 -22
- package/lib/tool/tool.js +0 -49
- package/lib/tool/tool.js.map +0 -1
- package/src/tool/tool.ts +0 -66
package/dist/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Core={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r,o={},i={};var a="An invariant failed, however the error is obfuscated because this is a production build.",s=[];Object.freeze(s);var u={};function l(){return++
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Core={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r,o={},i={};var a="An invariant failed, however the error is obfuscated because this is a production build.",s=[];Object.freeze(s);var u={};function l(){return++jt.mobxGuid}function c(t){throw d(!1,t),"X"}function d(t,e){if(!t)throw new Error("[mobx] "+(e||a))}function p(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(u);var h=function(){};function f(t){return null!==t&&"object"==typeof t}function v(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function y(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return f(t)&&!0===t[n]}}function _(t){return t instanceof Map}function m(t){return t instanceof Set}function b(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function x(t){return t&&t.toString?t.toString():new String(t).toString()}function E(t){return null===t?null:"object"==typeof t?""+t:t}var M="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,w=Symbol("mobx administration"),T=function(){function t(t){void 0===t&&(t="Atom@"+l()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Q.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return Ht(this)},t.prototype.reportChanged=function(){zt(),function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale()),e.dependenciesState=Q.STALE}))}(this),Ut()},t.prototype.toString=function(){return this.name},t}(),S=g("Atom",T);function A(t,e,n){void 0===e&&(e=h),void 0===n&&(n=h);var r=new T(t);return e!==h&&se(r,e),n!==h&&ue(r,n),r}var O={identity:function(t,e){return t===e},structural:function(t,e){return _n(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return _n(t,e,1)}},D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},D(t,e)};
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
14
|
and limitations under the License.
|
|
15
|
-
***************************************************************************** */var D=function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},D.apply(this,arguments)};function P(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function C(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function j(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C(arguments[e]));return t}var I=Symbol("mobx did run lazy initializers"),k=Symbol("mobx pending decorators"),R={},L={};function B(t){var e,n;if(!0!==t[I]){var r=t[k];if(r){v(t,I,!0);var o=j(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var i=P(o),a=i.next();!a.done;a=i.next()){var s=r[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function z(t,e){return function(){var n,r,o=function(r,o,i,a){if(!0===a)return e(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,k)){var s=r[k];v(r,k,D({},s))}return r[k][o]={prop:o,propertyCreator:e,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(t,e){var n=e?R:L;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return B(this),this[t]},set:function(e){B(this),this[t]=e}})}(o,t)};return(2===(r=arguments).length||3===r.length)&&("string"==typeof r[1]||"symbol"==typeof r[1])||4===r.length&&!0===r[3]?(n=s,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function H(t,e,n){return Se(t)?t:Array.isArray(t)?$.array(t,{name:n}):y(t)?$.object(t,void 0,{name:n}):_(t)?$.map(t,{name:n}):m(t)?$.set(t,{name:n}):t}function U(t){return t}function X(t){p(t);var e=z(!0,(function(e,n,r,o,i){var a=r?r.initializer?r.initializer.call(e):r.value:void 0;un(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var G={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function W(t){return null==t?G:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(G);var Y=X(H),F=X((function(t,e,n){return null==t||hn(t)||Je(t)||nn(t)||an(t)?t:Array.isArray(t)?$.array(t,{name:n,deep:!1}):y(t)?$.object(t,void 0,{name:n,deep:!1}):_(t)?$.map(t,{name:n,deep:!1}):m(t)?$.set(t,{name:n,deep:!1}):c(!1)})),V=X(U),K=X((function(t,e,n){return _n(t,e)?e:t}));function q(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?U:H}var Z={box:function(t,e){arguments.length>2&&J("box");var n=W(e);return new Mt(t,q(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&J("array");var n=W(e);return function(t,e,n,r){void 0===n&&(n="ObservableArray@"+l());void 0===r&&(r=!1);var o=new Ke(n,e,r);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(o.values,S,o);var i=new Proxy(o.values,Ve);if(o.proxy=i,t&&t.length){var a=wt(!0);o.spliceWithArray(0,0,t),St(a)}return i}(t,q(n),n.name)},map:function(t,e){arguments.length>2&&J("map");var n=W(e);return new en(t,q(n),n.name)},set:function(t,e){arguments.length>2&&J("set");var n=W(e);return new on(t,q(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&J("object");var r=W(n);if(!1===r.proxy)return pe({},t,e,r);var o=de(r),i=function(t){var e=new Proxy(t,He);return t[S].proxy=e,e}(pe({},void 0,void 0,r));return he(i,t,e,o),i},ref:V,shallow:F,deep:Y,struct:K},$=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Y.apply(null,arguments);if(Se(t))return t;var r=y(t)?$.object(t,e,n):Array.isArray(t)?$.array(t,e):_(t)?$.map(t,e):m(t)?$.set(t,e):t;if(r!==t)return r;c(!1)};function J(t){c("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(Z).forEach((function(t){return $[t]=Z[t]}));var Q,tt,et=z(!1,(function(t,e,n,r,o){var i=n.get,a=n.set,s=o[0]||{};un(t).addComputedProp(t,e,D({get:i,set:a,context:t},s))})),nt=et({equals:T.structural}),rt=function(t,e,n){if("string"==typeof e)return et.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return et.apply(null,arguments);var r="object"==typeof e?e:{};return r.get=t,r.set="function"==typeof e?e:r.set,r.name=r.name||t.name||"",new Ot(r)};rt.struct=nt,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Q||(Q={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(tt||(tt={}));var ot=function(t){this.cause=t};function it(t){return t instanceof ot}function at(t){switch(t.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var e=ht(!0),n=pt(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Tt(a)){if(kt.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return dt(n),ft(e),!0}if(t.dependenciesState===Q.STALE)return dt(n),ft(e),!0}}return yt(t),dt(n),ft(e),!1}}function st(t){var e=t.observers.size>0;kt.computationDepth>0&&e&&c(!1),kt.allowStateChanges||!e&&"strict"!==kt.enforceActions||c(!1)}function ut(t,e,n){var r=ht(!0);yt(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++kt.runId;var o,i=kt.trackingDerivation;if(kt.trackingDerivation=t,!0===kt.disableErrorBoundaries)o=e.call(n);else try{o=e.call(n)}catch(t){o=new ot(t)}return kt.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Q.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,o!==a&&(n[o]=s),o++),s.dependenciesState>r&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&Lt(s,t),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,Rt(s,t))}r!==Q.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),ft(r),o}function lt(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Lt(e[n],t);t.dependenciesState=Q.NOT_TRACKING}function ct(t){var e=pt();try{return t()}finally{dt(e)}}function pt(){var t=kt.trackingDerivation;return kt.trackingDerivation=null,t}function dt(t){kt.trackingDerivation=t}function ht(t){var e=kt.allowStateReads;return kt.allowStateReads=t,e}function ft(t){kt.allowStateReads=t}function yt(t){if(t.dependenciesState!==Q.UP_TO_DATE){t.dependenciesState=Q.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Q.UP_TO_DATE}}var vt=0,gt=1,_t=Object.getOwnPropertyDescriptor((function(){}),"name");function mt(t,e,n){var r=function(){return bt(t,e,n||this,arguments)};return r.isMobxAction=!0,r}function bt(t,e,n,r){var o=Et();try{return e.apply(n,r)}catch(t){throw o.error=t,t}finally{xt(o)}}function Et(t,e,n){var r=pt();zt();var o={prevDerivation:r,prevAllowStateChanges:wt(!0),prevAllowStateReads:ht(!0),notifySpy:false,startTime:0,actionId:gt++,parentActionId:vt};return vt=o.actionId,o}function xt(t){vt!==t.actionId&&c("invalid action stack. did you forget to finish an action?"),vt=t.parentActionId,void 0!==t.error&&(kt.suppressReactionErrors=!0),St(t.prevAllowStateChanges),ft(t.prevAllowStateReads),Ht(),dt(t.prevDerivation),t.notifySpy,kt.suppressReactionErrors=!1}function wt(t){var e=kt.allowStateChanges;return kt.allowStateChanges=t,e}function St(t){kt.allowStateChanges=t}_t&&_t.configurable;var Mt=function(t){function e(e,n,r,o,i){void 0===r&&(r="ObservableValue@"+l()),void 0===o&&(o=!0),void 0===i&&(i=T.default);var a=t.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,r),a}return function(t,e){function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==kt.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(st(this),Ue(this)){var e=Ge(this,{object:this,type:"update",newValue:t});if(!e)return kt.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?kt.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),We(this)&&Fe(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return Xe(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ye(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return x(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(M),At=g("ObservableValue",Mt),Ot=function(){function t(t){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+l(),this.value=new ot(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=tt.NONE,p(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+l(),t.set&&(this.setter=mt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?T.structural:T.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Q.UP_TO_DATE)return;t.lowestObserverState=Q.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.dependenciesState=Q.POSSIBLY_STALE,e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&c("Cycle detected in computation "+this.name+": "+this.derivation),0!==kt.inBatch||0!==this.observers.size||this.keepAlive?(Ut(this),at(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.POSSIBLY_STALE?e.dependenciesState=Q.STALE:e.dependenciesState===Q.UP_TO_DATE&&(t.lowestObserverState=Q.UP_TO_DATE)}))}(this)):at(this)&&(this.warnAboutUntrackedRead(),zt(),this.value=this.computeValue(!1),Ht());var t=this.value;if(it(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(it(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){p(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else p(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=e||it(t)||it(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,kt.computationDepth++,t)e=ut(this,this.derivation,this.scope);else if(!0===kt.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new ot(t)}return kt.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(lt(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return re((function(){var i=n.get();if(!r||e){var a=pt();t({type:"update",object:n,newValue:i,oldValue:o}),dt(a)}r=!1,o=i}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Tt=g("ComputedValue",Ot),Nt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Dt=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Pt={};function Ct(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Pt}var jt=!0,It=!1,kt=function(){var t=Ct();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(jt=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Dt).version&&(jt=!1),jt?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Dt):(setTimeout((function(){It||c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Dt)}();function Rt(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Lt(t,e){t.observers.delete(e),0===t.observers.size&&Bt(t)}function Bt(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,kt.pendingUnobservations.push(t))}function zt(){kt.inBatch++}function Ht(){if(0==--kt.inBatch){Vt();for(var t=kt.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Ot&&n.suspend())}kt.pendingUnobservations=[]}}function Ut(t){var e=kt.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&kt.inBatch>0&&Bt(t),!1)}function Xt(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===tt.BREAK){var n=[];Gt(fe(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof Ot?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Gt(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return Gt(t,e,n+1)})))}var Wt=function(){function t(t,e,n,r){void 0===t&&(t="Reaction@"+l()),void 0===r&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=tt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,kt.pendingReactions.push(this),Vt())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(zt(),this._isScheduled=!1,at(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}Ht()}},t.prototype.track=function(t){if(!this.isDisposed){zt(),this._isRunning=!0;var e=ut(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&<(this),it(e)&&this.reportExceptionInDerivation(e.cause),Ht()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(kt.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";kt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),kt.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(zt(),lt(this),Ht()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[S]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),ke(this,t)},t}();var Yt=100,Ft=function(t){return t()};function Vt(){kt.inBatch>0||kt.isRunningReactions||Ft(Kt)}function Kt(){kt.isRunningReactions=!0;for(var t=kt.pendingReactions,e=0;t.length>0;){++e===Yt&&(console.error("Reaction doesn't converge to a stable state after "+Yt+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}kt.isRunningReactions=!1}var qt=g("Reaction",Wt);function Zt(t){var e=Ft;Ft=function(n){return t((function(){return e(n)}))}}function $t(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function Jt(){c(!1)}function Qt(t){return function(e,n,r){if(r){if(r.value)return{value:mt(t,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return mt(t,o.call(this))}}}return function(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){v(this,n,te(t,e))}})}}(t).apply(this,arguments)}}var te=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?mt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?mt(t,e):1===arguments.length&&"string"==typeof t?Qt(t):!0!==r?Qt(e).apply(null,arguments):void v(t,e,mt(t.name||e,n.value,this))};function ee(t,e){"string"==typeof t||t.name;return bt(0,"function"==typeof t?t:e,this,void 0)}function ne(t,e,n){v(t,e,mt(e,n.bind(t)))}function re(t,e){void 0===e&&(e=u);var n,r=e&&e.name||t.name||"Autorun@"+l();if(!e.scheduler&&!e.delay)n=new Wt(r,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var o=ie(e),i=!1;n=new Wt(r,(function(){i||(i=!0,o((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}te.bound=function(t,e,n,r){return!0===r?(ne(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ne(this,e,n.value||n.initializer.call(this)),this[e]},set:Jt}:{enumerable:!1,configurable:!0,set:function(t){ne(this,e,t)},get:function(){}}};var oe=function(t){return t()};function ie(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:oe}function ae(t,e,n){void 0===n&&(n=u);var r,o,i,a=n.name||"Reaction@"+l(),s=te(a,n.onError?(r=n.onError,o=e,function(){try{return o.apply(this,arguments)}catch(t){r.call(this,t)}}):e),c=!n.scheduler&&!n.delay,p=ie(n),d=!0,h=!1,f=n.compareStructural?T.structural:n.equals||T.default,y=new Wt(a,(function(){d||c?v():h||(h=!0,p(v))}),n.onError,n.requiresObservable);function v(){if(h=!1,!y.isDisposed){var e=!1;y.track((function(){var n=t(y);e=d||!f(i,n),i=n})),d&&n.fireImmediately&&s(i,y),d||!0!==e||s(i,y),d&&(d=!1)}}return y.schedule(),y.getDisposer()}function se(t,e,n){return le("onBecomeObserved",t,e,n)}function ue(t,e,n){return le("onBecomeUnobserved",t,e,n)}function le(t,e,n,r){var o="function"==typeof r?fn(e,n):fn(e),i="function"==typeof r?r:n,a=t+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[t]?c(!1):function(){var t=o[a];t&&(t.delete(i),0===t.size&&delete o[a])}}function ce(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,o=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((kt.pendingReactions.length||kt.inBatch||kt.isRunningReactions)&&c("isolateGlobalState should be called before MobX is running any reactions"),It=!0,jt&&(0==--Ct().__mobxInstanceCount&&(Ct().__mobxGlobals=void 0),kt=new Dt)),void 0!==e){var u=void 0;switch(e){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:c("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}kt.enforceActions=u,kt.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(kt.computedRequiresReaction=!!n),void 0!==a&&(kt.reactionRequiresObservable=!!a),void 0!==s&&(kt.observableRequiresReaction=!!s,kt.allowStateReads=!kt.observableRequiresReaction),void 0!==r&&(kt.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),kt.disableErrorBoundaries=!!o),i&&Zt(i)}function pe(t,e,n,r){var o=de(r=W(r));return B(t),un(t,r.name,o.enhancer),e&&he(t,e,n,o),t}function de(t){return t.defaultDecorator||(!1===t.deep?V:Y)}function he(t,e,n,r){var o,i;zt();try{var a=w(e);try{for(var s=P(a),u=s.next();!u.done;u=s.next()){var l=u.value,c=Object.getOwnPropertyDescriptor(e,l);0;var p=n&&l in n?n[l]:c.get?et:r;0;var d=p(t,l,c,!0);d&&Object.defineProperty(t,l,d)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{Ht()}}function fe(t,e){return ye(fn(t,e))}function ye(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(ye)),r}function ve(t){var e={name:t.name};return function(t){return t.observers&&t.observers.size>0}(t)&&(e.observers=Array.from(function(t){return t.observers}(t)).map(ve)),e}var ge=0;function _e(){this.message="FLOW_CANCELLED"}function me(t){"function"==typeof t.cancel&&t.cancel()}function be(t,e){if(null==t)return!1;if(void 0!==e){if(!1===hn(t))return!1;if(!t[S].values.has(e))return!1;var n=fn(t,e);return Tt(n)}return Tt(t)}function Ee(t){return arguments.length>1?c(!1):be(t)}function xe(t,e){return"string"!=typeof e?c(!1):be(t,e)}function we(t,e){return null!=t&&(void 0!==e?!!hn(t)&&t[S].values.has(e):hn(t)||!!t[S]||A(t)||qt(t)||Tt(t))}function Se(t){return 1!==arguments.length&&c(!1),we(t)}function Me(t){return hn(t)?t[S].getKeys():nn(t)||an(t)?Array.from(t.keys()):Je(t)?t.map((function(t,e){return e})):c(!1)}function Ae(t){return hn(t)?Me(t).map((function(e){return t[e]})):nn(t)?Me(t).map((function(e){return t.get(e)})):an(t)?Array.from(t.values()):Je(t)?t.slice():c(!1)}function Oe(t){return hn(t)?Me(t).map((function(e){return[e,t[e]]})):nn(t)?Me(t).map((function(e){return[e,t.get(e)]})):an(t)?Array.from(t.entries()):Je(t)?t.map((function(t,e){return[e,t]})):c(!1)}function Te(t,e,n){if(2!==arguments.length||an(t))if(hn(t)){var r=t[S];r.values.get(e)?r.write(e,n):r.addObservableProp(e,n,r.defaultEnhancer)}else if(nn(t))t.set(e,n);else if(an(t))t.add(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),p(e>=0,"Not a valid index: '"+e+"'"),zt(),e>=t.length&&(t.length=e+1),t[e]=n,Ht()}else{zt();var o=e;try{for(var i in o)Te(t,i,o[i])}finally{Ht()}}}function Ne(t,e){return hn(t)?yn(t).has(e):nn(t)||an(t)?t.has(e):Je(t)?e>=0&&e<t.length:c(!1)}function De(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return yn(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return yn(t).observe(e,n)}(t,e,n)}_e.prototype=Object.create(Error.prototype);var Pe={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ce(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function je(t,e,n){if(!e.recurseEverything&&!Se(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(At(t))return je(t.get(),e,n);if(Se(t)&&Me(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Je(t)||Array.isArray(t)){var r=Ce(n,t,[],e),o=t.map((function(t){return je(t,e,n)}));r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(an(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Ce(n,t,new Set,e);return t.forEach((function(t){s.add(je(t,e,n))})),s}var u=Ce(n,t,[],e);return t.forEach((function(t){u.push(je(t,e,n))})),u}if(nn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var l=Ce(n,t,new Map,e);return t.forEach((function(t,r){l.set(r,je(t,e,n))})),l}var c=Ce(n,t,{},e);return t.forEach((function(t,r){c[r]=je(t,e,n)})),c}var p=Ce(n,t,{},e);return b(t).forEach((function(r){p[r]=je(t[r],e,n)})),p}function Ie(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Pe),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),je(t,e,n)}function ke(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=function(t){switch(t.length){case 0:return kt.trackingDerivation;case 1:return fn(t[0]);case 2:return fn(t[0],t[1])}}(t);if(!r)return c(!1);r.isTracing===tt.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?tt.BREAK:tt.LOG}function Re(t,e){void 0===e&&(e=void 0),zt();try{return t.apply(e)}finally{Ht()}}function Le(t,e,n){var r;"number"==typeof n.timeout&&(r=setTimeout((function(){if(!i[S].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+l();var o=mt(n.name+"-effect",e),i=re((function(e){t()&&(e.dispose(),r&&clearTimeout(r),o())}),n);return i}function Be(t){return t[S]}function ze(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var He={has:function(t,e){if(e===S||"constructor"===e||e===I)return!0;var n=Be(t);return ze(e)?n.has(e):e in t},get:function(t,e){if(e===S||"constructor"===e||e===I)return t[e];var n=Be(t),r=n.values.get(e);if(r instanceof M){var o=r.get();return void 0===o&&n.has(e),o}return ze(e)&&n.has(e),t[e]},set:function(t,e,n){return!!ze(e)&&(Te(t,e,n),!0)},deleteProperty:function(t,e){return!!ze(e)&&(Be(t).remove(e),!0)},ownKeys:function(t){return Be(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return c("Dynamic observable objects cannot be frozen"),!1}};function Ue(t){return void 0!==t.interceptors&&t.interceptors.length>0}function Xe(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),d((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ge(t,e){var n=pt();try{for(var r=j(t.interceptors||[]),o=0,i=r.length;o<i&&(p(!(e=r[o](e))||e.type,"Intercept handlers should return nothing or a change object"),e);o++);return e}finally{dt(n)}}function We(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Ye(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),d((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Fe(t,e){var n=pt(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](e);dt(n)}}var Ve={get:function(t,e){return e===S?t[S]:"length"===e?t[S].getArrayLength():"number"==typeof e?qe.get.call(t,e):"string"!=typeof e||isNaN(e)?qe.hasOwnProperty(e)?qe[e]:t[e]:qe.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[S].setArrayLength(n),"number"==typeof e&&qe.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:qe.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return c("Observable arrays cannot be frozen"),!1}};var Ke=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new M(t||"ObservableArray@"+l()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ye(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var r=this;st(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=s),Ue(this)){var i=Ge(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return s;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return r.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,j([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),o&&Fe(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),o&&Fe(this,i)},t}(),qe={intercept:function(t){return this[S].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[S].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[S];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this[S];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray(t);case 2:return o.spliceWithArray(t,e)}return o.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[S].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[S];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[S].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[S];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[S],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[S];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[S],r=n.values;if(t<r.length){st(n.atom);var o=r[t];if(Ue(n)){var i=Ge(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,o))!==o&&(r[t]=e,n.notifyArrayChildUpdate(t,e,o))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(){var e=this[S];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(e,n){var r=this,o=this[S];return o.atom.reportObserved(),o.dehanceValues(o.values)[t]((function(t,o){return e.call(n,t,o,r)}),n)})})),["reduce","reduceRight"].forEach((function(t){qe[t]=function(){var e=this,n=this[S];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(t,o,i){return o=n.dehanceValue(o),r(t,o,i,e)},n.values[t].apply(n.values,arguments)}}));var Ze,$e=g("ObservableArrayAdministration",Ke);function Je(t){return f(t)&&$e(t[S])}var Qe,tn={},en=function(){function t(t,e,n){if(void 0===e&&(e=H),void 0===n&&(n="ObservableMap@"+l()),this.enhancer=e,this.name=n,this[Ze]=tn,this._keysAtom=O(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!kt.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var r=n=new Mt(this._has(t),U,this.name+"."+E(t)+"?",!1);this._hasMap.set(t,r),ue(r,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(Ue(this)){var r=Ge(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((st(this._keysAtom),Ue(this))&&!(r=Ge(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return Re((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Fe(this,r),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==kt.UNCHANGED){var r=We(this),o=r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;false,n.setNewValue(e),r&&Fe(this,o)}},t.prototype._addValue=function(t,e){var n=this;st(this._keysAtom),Re((function(){var r=new Mt(e,n.enhancer,n.name+"."+E(t),!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var r=We(this);r&&Fe(this,r?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return xn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:t.get(o)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return xn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,t.get(o)]}}})},t.prototype[(Ze=S,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=C(i.value,2),s=a[0],u=a[1];t.call(e,u,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return nn(t)&&(t=t.toJS()),Re((function(){var n=wt(!0);try{y(t)?b(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=C(t,2),r=n[0],o=n[1];return e.set(r,o)})):_(t)?(t.constructor!==Map&&c("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&c("Cannot initialize map from "+t)}finally{St(n)}})),this},t.prototype.clear=function(){var t=this;Re((function(){ct((function(){var e,n;try{for(var r=P(t.keys()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return Re((function(){var n,r,o,i,a=function(t){if(_(t)||nn(t))return t;if(Array.isArray(t))return new Map(t);if(y(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return c("Cannot convert to map from '"+t+"'")}(t),s=new Map,u=!1;try{for(var l=P(e._data.keys()),p=l.next();!p.done;p=l.next()){var d=p.value;if(!a.has(d))if(e.delete(d))u=!0;else{var h=e._data.get(d);s.set(d,h)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}try{for(var f=P(a.entries()),v=f.next();!v.done;v=f.next()){var g=C(v.value,2),m=(d=g[0],h=g[1],e._data.has(d));if(e.set(d,h),e._data.has(d)){var b=e._data.get(d);s.set(d,b),m||(u=!0)}}}catch(t){o={error:t}}finally{try{v&&!v.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(!u)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var E=e._data.keys(),x=s.keys(),w=E.next(),S=x.next();!w.done;){if(w.value!==S.value){e._keysAtom.reportChanged();break}w=E.next(),S=x.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var r=P(this),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:E(a)]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return E(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t}(),nn=g("ObservableMap",en),rn={},on=function(){function t(t,e,n){if(void 0===e&&(e=H),void 0===n&&(n="ObservableSet@"+l()),this.name=n,this[Qe]=rn,this._data=new Set,this._atom=O(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,r){return e(t,r,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;Re((function(){ct((function(){var e,n;try{for(var r=P(t._data.values()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((st(this._atom),Ue(this))&&!(r=Ge(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){Re((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=We(this),r=n?{type:"add",object:this,newValue:t}:null;n&&Fe(this,r)}return this},t.prototype.delete=function(t){var e=this;if(Ue(this)&&!(r=Ge(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:t}:null;return Re((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Fe(this,r),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return xn({next:function(){var r=t;return t+=1,r<n.length?{value:[e[r],n[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return xn({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return an(t)&&(t=t.toJS()),Re((function(){var n=wt(!0);try{Array.isArray(t)||m(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&c("Cannot initialize set from "+t)}finally{St(n)}})),this},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(Qe=S,Symbol.iterator)]=function(){return this.values()},t}(),an=g("ObservableSet",on),sn=function(){function t(t,e,n,r){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=r,this.keysAtom=new M(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,r=this.values.get(t);if(r instanceof Ot)r.set(e);else{if(Ue(this)){if(!(i=Ge(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=i.newValue}if((e=r.prepareNewValue(e))!==kt.UNCHANGED){var o=We(this),i=o?{type:"update",object:this.proxy||n,oldValue:r.value,name:t,newValue:e}:null;false,r.setNewValue(e),o&&Fe(this,i)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var r=!!this.values.get(t);return n=new Mt(r,U,this.name+"."+E(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var r=this.target;if(Ue(this)){var o=Ge(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!o)return;e=o.newValue}var i=new Mt(e,n,this.name+"."+E(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(r,t,function(t){return ln[t]||(ln[t]={configurable:!0,enumerable:!0,get:function(){return this[S].read(t)},set:function(e){this[S].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var r=this.target;n.name=n.name||this.name+"."+E(e),this.values.set(e,new Ot(n)),(t===r||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return cn[t]||(cn[t]={configurable:kt.computedConfigurable,enumerable:!1,get:function(){return pn(this).read(t)},set:function(e){pn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(Ue(this))if(!(s=Ge(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{zt();var n=We(this),r=!1,o=this.values.get(t),i=o&&o.get();if(o&&o.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:i,name:t}:null;r,n&&Fe(this,s)}finally{Ht()}}},t.prototype.illegalAccess=function(t,e){console.warn("Property '"+e+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=We(this),r=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Fe(this,r),this.pendingKeys){var o=this.pendingKeys.get(t);o&&o.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var r=P(this.values),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0];i[1]instanceof Mt&&n.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t}();function un(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=H),Object.prototype.hasOwnProperty.call(t,S))return t[S];y(t)||(e=(t.constructor.name||"ObservableObject")+"@"+l()),e||(e="ObservableObject@"+l());var r=new sn(t,new Map,E(e),n);return v(t,S,r),r}var ln=Object.create(null),cn=Object.create(null);function pn(t){var e=t[S];return e||(B(t),t[S])}var dn=g("ObservableObjectAdministration",sn);function hn(t){return!!f(t)&&(B(t),dn(t[S]))}function fn(t,e){if("object"==typeof t&&null!==t){if(Je(t))return void 0!==e&&c(!1),t[S].atom;if(an(t))return t[S];if(nn(t)){var n=t;return void 0===e?n._keysAtom:((r=n._data.get(e)||n._hasMap.get(e))||c(!1),r)}var r;if(B(t),e&&!t[S]&&t[e],hn(t))return e?((r=t[S].values.get(e))||c(!1),r):c(!1);if(A(t)||Tt(t)||qt(t))return t}else if("function"==typeof t&&qt(t[S]))return t[S];return c(!1)}function yn(t,e){return t||c("Expecting some object"),void 0!==e?yn(fn(t,e)):A(t)||Tt(t)||qt(t)||nn(t)||an(t)?t:(B(t),t[S]?t[S]:void c(!1))}function vn(t,e){return(void 0!==e?fn(t,e):hn(t)||nn(t)||an(t)?yn(t):fn(t)).name}var gn=Object.prototype.toString;function _n(t,e,n){return void 0===n&&(n=-1),mn(t,e,n)}function mn(t,e,n,r,o){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;if("function"!==i&&"object"!==i&&"object"!=typeof e)return!1;var a=gn.call(t);if(a!==gn.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=bn(t),e=bn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,l=e.constructor;if(u!==l&&!("function"==typeof u&&u instanceof u&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var c=(r=r||[]).length;c--;)if(r[c]===t)return o[c]===e;if(r.push(t),o.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!mn(t[c],e[c],n-1,r,o))return!1}else{var p=Object.keys(t),d=void 0;if(c=p.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!En(e,d=p[c])||!mn(t[d],e[d],n-1,r,o))return!1}return r.pop(),o.pop(),!0}function bn(t){return Je(t)?t.slice():_(t)||nn(t)||m(t)||an(t)?Array.from(t.entries()):t}function En(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xn(t){return t[Symbol.iterator]=wn,t}function wn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$t,extras:{getDebugName:vn},$mobx:S});var Sn=Object.freeze({__proto__:null,$mobx:S,FlowCancellationError:_e,get IDerivationState(){return Q},ObservableMap:en,ObservableSet:on,Reaction:Wt,_allowStateChanges:function(t,e){var n,r=wt(t);try{n=e()}finally{St(r)}return n},_allowStateChangesInsideComputed:function(t){var e,n=kt.computationDepth;kt.computationDepth=0;try{e=t()}finally{kt.computationDepth=n}return e},_allowStateReadsEnd:ft,_allowStateReadsStart:ht,_endAction:xt,_getAdministration:yn,_getGlobalState:function(){return kt},_interceptReads:function(t,e,n){var r;if(nn(t)||Je(t)||At(t))r=yn(t);else{if(!hn(t))return c(!1);if("string"!=typeof e)return c(!1);r=yn(t,e)}return void 0!==r.dehancer?c(!1):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},_isComputingDerivation:function(){return null!==kt.trackingDerivation},_resetGlobalState:function(){var t=new Dt;for(var e in t)-1===Nt.indexOf(e)&&(kt[e]=t[e]);kt.allowStateChanges=!kt.enforceActions},_startAction:Et,action:te,autorun:re,comparer:T,computed:rt,configure:ce,createAtom:O,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,r=function(t){var r=e[t];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,t),i=r.reduce((function(e,r){return r(n,t,e)}),o);i&&Object.defineProperty(n,t,i)};for(var o in e)r(o);return t},entries:Oe,extendObservable:pe,flow:function(t){1!==arguments.length&&c("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,r=arguments,o=++ge,i=te(e+" - runid: "+o+" - init",t).apply(this,r),a=void 0,s=new Promise((function(t,r){var s=0;function u(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.next).call(i,t)}catch(t){return r(t)}c(n)}function l(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.throw).call(i,t)}catch(t){return r(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(u,l);e.then(c,r)}n=r,u(void 0)}));return s.cancel=te(e+" - runid: "+o+" - cancel",(function(){try{a&&me(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(h,h),me(e),n(new _e)}catch(t){n(t)}})),s}},get:function(t,e){if(Ne(t,e))return hn(t)?t[e]:nn(t)?t.get(e):Je(t)?t[e]:c(!1)},getAtom:fn,getDebugName:vn,getDependencyTree:fe,getObserverTree:function(t,e){return ve(fn(t,e))},has:Ne,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return yn(t,e).intercept(n)}(t,e,n):function(t,e){return yn(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||Je(t)},isBoxedObservable:At,isComputed:Ee,isComputedProp:xe,isFlowCancellationError:function(t){return t instanceof _e},isObservable:Se,isObservableArray:Je,isObservableMap:nn,isObservableObject:hn,isObservableProp:function(t,e){return"string"!=typeof e?c(!1):we(t,e)},isObservableSet:an,keys:Me,observable:$,observe:De,onBecomeObserved:se,onBecomeUnobserved:ue,onReactionError:function(t){return kt.globalReactionErrorHandlers.push(t),function(){var e=kt.globalReactionErrorHandlers.indexOf(t);e>=0&&kt.globalReactionErrorHandlers.splice(e,1)}},reaction:ae,remove:function(t,e){if(hn(t))t[S].remove(e);else if(nn(t))t.delete(e);else if(an(t))t.delete(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),p(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:ee,set:Te,spy:$t,toJS:Ie,trace:ke,transaction:Re,untracked:ct,values:Ae,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,r=new Promise((function(r,o){var i=Le(t,r,D(D({},e),{onError:o}));n=function(){i(),o("WHEN_CANCELLED")}}));return r.cancel=n,r}(t,e):Le(t,e,n||{})}}),Mn=n(Sn);!function(t,n){!function(t,n,r){function o(t){return!(t.prototype&&t.prototype.render||n.Component.isPrototypeOf(t))}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,r=void 0===n?"":n,o=e.suffix,i=void 0===o?"":o;return r+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},p=!1,d=console;function h(t){p=t}function f(t){var e=r._getGlobalState().allowStateChanges;return r._getGlobalState().allowStateChanges=t,e}function y(t){r._getGlobalState().allowStateChanges=t}function v(t,e,n,r,o){var i=f(t),a=void 0;try{a=e(n,r,o)}finally{y(i)}return a}function g(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t[e],o=m[e],i=r?!0===n?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;t[e]=i}function _(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":a(t))||"object"!==(void 0===e?"undefined":a(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(e[r]!==t[r])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==p){var e=i(this),o=!1,a=!1;h.call(this,"props"),h.call(this,"state");var s=this.render.bind(this),u=null,l=!1,c=function(){return(u=new r.Reaction(e+".render()",(function(){if(!l&&(l=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var e=!0;try{a=!0,o||n.Component.prototype.forceUpdate.call(t),e=!1}finally{a=!1,e&&u.dispose()}}}))).reactComponent=t,d.$mobx=u,t.render=d,d(t.props,t.state,t.context)},d=function(t,e,n){l=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=v(!1,s,t,e,n)}catch(t){r=t}})),r)throw r;return o};this.render=c}function h(t){var e=this[t],n=r.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return n.reportObserved(),e},set:function(t){!a&&_(e,t)?(e=t,o=!0,n.reportChanged(),o=!1):e=t}})}},componentWillUnmount:function(){!0!==p&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return p&&d.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||_(this.props,t)}};function b(t){var e,r;if(arguments.length>1&&d.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===t.isMobxInjector&&d.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),o(t))return b((r=e=function(e){function n(){return s(this,n),c(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,e),u(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(n.Component),e.displayName=i(t),r));if(!t)throw new Error("Please pass a valid component to 'observer'");return E(t.prototype||t),t.isMobXReactObserver=!0,t}function E(t){g(t,"componentWillMount",!0),g(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=m.shouldComponentUpdate)}var x=b((function(t){return t.children[0]()}));function w(t,e){return t(e={exports:{}},e.exports),e.exports}x.displayName="Observer","undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var S=w((function(t,e){!function(e,n){t.exports=n()}(0,(function(){var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function u(l,c,p){if("string"!=typeof c){if(s){var d=a(c);d&&d!==s&&u(l,d,p)}var h=r(c);o&&(h=h.concat(o(c)));for(var f=0;f<h.length;++f){var y=h[f];if(!(t[y]||e[y]||p&&p[y])){var v=i(c,y);try{n(l,y,v)}catch(t){}}}return l}return l}}))})),M={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function A(t,e,r){var o,a,p=i(e,{prefix:"inject-",suffix:r?"-with-"+r:""}),d=(a=o=function(r){function o(){return s(this,o),c(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return l(o,r),u(o,[{key:"render",value:function(){var r={};for(var o in this.props)this.props.hasOwnProperty(o)&&(r[o]=this.props[o]);var i=t(this.context.mobxStores||{},r,this.context)||{};for(var a in i)r[a]=i[a];return n.h(e,r)}}]),o}(n.Component),o.displayName=p,a);return S(d,e),d.wrappedComponent=e,Object.defineProperties(d,M),d}function O(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function T(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=A(t,e);return n.isMobxInjector=!1,(n=b(n)).isMobxInjector=!0,n};for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t=O(e),function(n){return A(t,n,e.join("-"))}}function N(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");return Array.isArray(t)?e?T.apply(null,t)(N(e)):function(e){return N(t,e)}:b(t)}var D={children:!0,key:!0,ref:!0},P=console,C=function(t){function e(){return s(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),u(e,[{key:"render",value:function(t){var e=t.children;return e.length>1?n.h("div",null," ",e," "):e[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var r in this.props)D[r]||"suppressChangedStoreWarning"===r||(t[r]=this.props[r]);return{mobxStores:t}}},{key:"componentWillReceiveProps",value:function(t){if(Object.keys(t).length!==Object.keys(this.props).length&&P.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!t.suppressChangedStoreWarning)for(var e in t)D[e]||this.props[e]===t[e]||P.warn("MobX Provider: Provided store '"+e+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(n.Component);if(!n.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=x,t.useStaticRendering=h,t.connect=N,t.inject=T,t.Provider=C,Object.defineProperty(t,"__esModule",{value:!0})}(n,function(){if(r)return i;r=1;var t,e,n,o,a,s,u,l,c,p,d,h,f={},y=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function _(t,e){for(var n in e)t[n]=e[n];return t}function m(t){var e=t.parentNode;e&&e.removeChild(t)}function b(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(t,r,o,i,a){var s={type:t,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++n:a,__i:-1,__u:0};return null==a&&null!=e.vnode&&e.vnode(s),s}function x(t){return t.children}function w(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function M(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return M(t)}}function A(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!O.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||u)(O)}function O(){var t,n,r,o,i,s,u,c;for(a.sort(l);t=a.shift();)t.__d&&(n=a.length,o=void 0,s=(i=(r=t).__v).__e,u=[],c=[],r.__P&&((o=_({},i)).__v=i.__v+1,e.vnode&&e.vnode(o),k(r.__P,o,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,u,null==s?S(i):s,!!(32&i.__u),c),o.__v=i.__v,o.__.__k[o.__i]=o,R(u,o,c),o.__e!=s&&M(o)),a.length>n&&a.sort(l));O.__r=0}function T(t,e,n,r,o,i,a,s,u,l,c){var p,d,h,v,g,_=r&&r.__k||y,m=e.length;for(n.__d=u,N(n,e,_),u=n.__d,p=0;p<m;p++)null!=(h=n.__k[p])&&"boolean"!=typeof h&&"function"!=typeof h&&(d=-1===h.__i?f:_[h.__i]||f,h.__i=p,k(t,h,d,o,i,a,s,u,l,c),v=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&B(d.ref,null,h),c.push(h.ref,h.__c||v,h)),null==g&&null!=v&&(g=v),65536&h.__u||d.__k===h.__k?(u&&!u.isConnected&&(u=S(d)),u=D(h,u,t)):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:v&&(u=v.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=g}function N(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?E(null,o,null,null,null):g(o)?E(x,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?E(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=P(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=S(i)),z(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=S(i)),z(i,i))}function D(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=D(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function P(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function C(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||v.test(e)?n:n+"px"}function j(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||C(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=c,t.addEventListener(e,i?d:p,i)):t.removeEventListener(e,i?d:p,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function I(t){return function(n){if(this.l){var r=this.l[n.type+t];if(null==n.u)n.u=c++;else if(n.u<r.t)return;return r(e.event?e.event(n):n)}}}function k(t,n,r,o,i,a,s,u,l,c){var p,d,h,f,y,v,m,b,E,S,M,A,O,N,D,P=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[u=n.__e=r.__e]),(p=e.__b)&&p(n);t:if("function"==typeof P)try{if(b=n.props,E=(p=P.contextType)&&o[p.__c],S=p?E?E.props.value:p.__:o,r.__c?m=(d=n.__c=r.__c).__=d.__E:("prototype"in P&&P.prototype.render?n.__c=d=new P(b,S):(n.__c=d=new w(b,S),d.constructor=P,d.render=H),E&&E.sub(d),d.props=b,d.state||(d.state={}),d.context=S,d.__n=o,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=P.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=_({},d.__s)),_(d.__s,P.getDerivedStateFromProps(b,d.__s))),f=d.props,y=d.state,d.__v=n,h)null==P.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==P.getDerivedStateFromProps&&b!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(b,S),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(b,d.__s,S)||n.__v===r.__v)){for(n.__v!==r.__v&&(d.props=b,d.state=d.__s,d.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(t){t&&(t.__=n)})),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[],d.__h.length&&s.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,S),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,y,v)}))}if(d.context=S,d.props=b,d.__P=t,d.__e=!1,A=e.__r,O=0,"prototype"in P&&P.prototype.render){for(d.state=d.__s,d.__d=!1,A&&A(n),p=d.render(d.props,d.state,d.context),N=0;N<d._sb.length;N++)d.__h.push(d._sb[N]);d._sb=[]}else do{d.__d=!1,A&&A(n),p=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++O<25);d.state=d.__s,null!=d.getChildContext&&(o=_(_({},o),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(f,y)),T(t,g(D=null!=p&&p.type===x&&null==p.key?p.props.children:p)?D:[D],n,r,o,i,a,s,u,l,c),d.base=n.__e,n.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(t){n.__v=null,l||null!=a?(n.__e=u,n.__u|=l?160:32,a[a.indexOf(u)]=null):(n.__e=r.__e,n.__k=r.__k),e.__e(t,n,r)}else null==a&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=L(r.__e,n,r,o,i,a,s,l,c);(p=e.diffed)&&p(n)}function R(t,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)B(r[o],r[++o],r[++o]);e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function L(e,n,r,o,i,a,s,u,l){var c,p,d,h,y,v,_,b=r.props,E=n.props,x=n.type;if("svg"===x?i="http://www.w3.org/2000/svg":"math"===x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(c=0;c<a.length;c++)if((y=a[c])&&"setAttribute"in y==!!x&&(x?y.localName===x:3===y.nodeType)){e=y,a[c]=null;break}if(null==e){if(null===x)return document.createTextNode(E);e=document.createElementNS(i,x,E.is&&E),a=null,u=!1}if(null===x)b===E||u&&e.data===E||(e.data=E);else{if(a=a&&t.call(e.childNodes),b=r.props||f,!u&&null!=a)for(b={},c=0;c<e.attributes.length;c++)b[(y=e.attributes[c]).name]=y.value;for(c in b)if(y=b[c],"children"==c);else if("dangerouslySetInnerHTML"==c)d=y;else if("key"!==c&&!(c in E)){if("value"==c&&"defaultValue"in E||"checked"==c&&"defaultChecked"in E)continue;j(e,c,null,y,i)}for(c in E)y=E[c],"children"==c?h=y:"dangerouslySetInnerHTML"==c?p=y:"value"==c?v=y:"checked"==c?_=y:"key"===c||u&&"function"!=typeof y||b[c]===y||j(e,c,y,b[c],i);if(p)u||d&&(p.__html===d.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(d&&(e.innerHTML=""),T(e,g(h)?h:[h],n,r,o,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:r.__k&&S(r,0),u,l),null!=a)for(c=a.length;c--;)null!=a[c]&&m(a[c]);u||(c="value",void 0!==v&&(v!==e[c]||"progress"===x&&!v||"option"===x&&v!==b[c])&&j(e,c,v,b[c],i),c="checked",void 0!==_&&_!==e[c]&&j(e,c,_,b[c],i))}return e}function B(t,n,r){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,r)}}function z(t,n,r){var o,i;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||B(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],n,r||"function"!=typeof t.type);r||null==t.__e||m(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function H(t,e,n){return this.constructor(t,n)}function U(n,r,o){var i,a,s,u;e.__&&e.__(n,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],u=[],k(r,n=(!i&&o||r).__k=b(x,null,[n]),a||f,f,r.namespaceURI,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i,u),R(s,n,u)}return t=y.slice,e={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,o=function(t){return null!=t&&null==t.constructor},w.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof t&&(t=t(_({},n),this.props)),t&&_(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),A(this))},w.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),A(this))},w.prototype.render=x,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(t,e){return t.__v.__b-e.__v.__b},O.__r=0,c=0,p=I(!1),d=I(!0),h=0,i.Component=w,i.Fragment=x,i.cloneElement=function(e,n,r){var o,i,a,s,u=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?o=n[a]:"ref"==a?i=n[a]:u[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),E(e.type,u,o||e.key,i||e.ref,null)},i.createContext=function(t,e){var n={__c:e="__cC"+h++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,A(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},i.createElement=b,i.createRef=function(){return{current:null}},i.h=b,i.hydrate=function t(e,n){U(e,n,t)},i.isValidElement=o,i.options=e,i.render=U,i.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(g(e)?e.some((function(e){t(e,n)})):n.push(e)),n},i}(),Mn)}(0,o);var An,On,Tn,Nn,Dn,Pn,Cn,jn,In,kn,Rn={},Ln=[],Bn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zn=Array.isArray;function Hn(t,e){for(var n in e)t[n]=e[n];return t}function Un(t){var e=t.parentNode;e&&e.removeChild(t)}function Xn(t,e,n){var r,o,i,a={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?An.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===a[i]&&(a[i]=t.defaultProps[i]);return Gn(t,a,r,o,null)}function Gn(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++Tn:o,__i:-1,__u:0};return null==o&&null!=On.vnode&&On.vnode(i),i}function Wn(){return{current:null}}function Yn(t){return t.children}function Fn(t,e){this.props=t,this.context=e}function Vn(t,e){if(null==e)return t.__?Vn(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Vn(t):null}function Kn(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Kn(t)}}function qn(t){(!t.__d&&(t.__d=!0)&&Nn.push(t)&&!Zn.__r++||Dn!==On.debounceRendering)&&((Dn=On.debounceRendering)||Pn)(Zn)}function Zn(){var t,e,n,r,o,i,a,s;for(Nn.sort(Cn);t=Nn.shift();)t.__d&&(e=Nn.length,r=void 0,i=(o=(n=t).__v).__e,a=[],s=[],n.__P&&((r=Hn({},o)).__v=o.__v+1,On.vnode&&On.vnode(r),ir(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,null==i?Vn(o):i,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,ar(a,r,s),r.__e!=i&&Kn(r)),Nn.length>e&&Nn.sort(Cn));Zn.__r=0}function $n(t,e,n,r,o,i,a,s,u,l,c){var p,d,h,f,y,v=r&&r.__k||Ln,g=e.length;for(n.__d=u,Jn(n,e,v),u=n.__d,p=0;p<g;p++)null!=(h=n.__k[p])&&"boolean"!=typeof h&&"function"!=typeof h&&(d=-1===h.__i?Rn:v[h.__i]||Rn,h.__i=p,ir(t,h,d,o,i,a,s,u,l,c),f=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&ur(d.ref,null,h),c.push(h.ref,h.__c||f,h)),null==y&&null!=f&&(y=f),65536&h.__u||d.__k===h.__k?(u&&!u.isConnected&&(u=Vn(d)),u=Qn(h,u,t)):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:f&&(u=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=y}function Jn(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Gn(null,o,null,null,null):zn(o)?Gn(Yn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Gn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=er(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Vn(i)),lr(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Vn(i)),lr(i,i))}function Qn(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=Qn(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function tr(t,e){return e=e||[],null==t||"boolean"==typeof t||(zn(t)?t.some((function(t){tr(t,e)})):e.push(t)),e}function er(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function nr(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Bn.test(e)?n:n+"px"}function rr(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||nr(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||nr(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=jn,t.addEventListener(e,i?kn:In,i)):t.removeEventListener(e,i?kn:In,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function or(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=jn++;else if(e.t<n.u)return;return n(On.event?On.event(e):e)}}}function ir(t,e,n,r,o,i,a,s,u,l){var c,p,d,h,f,y,v,g,_,m,b,E,x,w,S,M=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=On.__b)&&c(e);t:if("function"==typeof M)try{if(g=e.props,_=(c=M.contextType)&&r[c.__c],m=c?_?_.props.value:c.__:r,n.__c?v=(p=e.__c=n.__c).__=p.__E:("prototype"in M&&M.prototype.render?e.__c=p=new M(g,m):(e.__c=p=new Fn(g,m),p.constructor=M,p.render=cr),_&&_.sub(p),p.props=g,p.state||(p.state={}),p.context=m,p.__n=r,d=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=M.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=Hn({},p.__s)),Hn(p.__s,M.getDerivedStateFromProps(g,p.__s))),h=p.props,f=p.state,p.__v=e,d)null==M.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,m),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,m)||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),b=0;b<p._sb.length;b++)p.__h.push(p._sb[b]);p._sb=[],p.__h.length&&a.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,m),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(h,f,y)}))}if(p.context=m,p.props=g,p.__P=t,p.__e=!1,E=On.__r,x=0,"prototype"in M&&M.prototype.render){for(p.state=p.__s,p.__d=!1,E&&E(e),c=p.render(p.props,p.state,p.context),w=0;w<p._sb.length;w++)p.__h.push(p._sb[w]);p._sb=[]}else do{p.__d=!1,E&&E(e),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++x<25);p.state=p.__s,null!=p.getChildContext&&(r=Hn(Hn({},r),p.getChildContext())),d||null==p.getSnapshotBeforeUpdate||(y=p.getSnapshotBeforeUpdate(h,f)),$n(t,zn(S=null!=c&&c.type===Yn&&null==c.key?c.props.children:c)?S:[S],e,n,r,o,i,a,s,u,l),p.base=e.__e,e.__u&=-161,p.__h.length&&a.push(p),v&&(p.__E=p.__=null)}catch(t){e.__v=null,u||null!=i?(e.__e=s,e.__u|=u?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),On.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=sr(n.__e,e,n,r,o,i,a,u,l);(c=On.diffed)&&c(e)}function ar(t,e,n){e.__d=void 0;for(var r=0;r<n.length;r++)ur(n[r],n[++r],n[++r]);On.__c&&On.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){On.__e(t,e.__v)}}))}function sr(t,e,n,r,o,i,a,s,u){var l,c,p,d,h,f,y,v=n.props,g=e.props,_=e.type;if("svg"===_?o="http://www.w3.org/2000/svg":"math"===_?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((h=i[l])&&"setAttribute"in h==!!_&&(_?h.localName===_:3===h.nodeType)){t=h,i[l]=null;break}if(null==t){if(null===_)return document.createTextNode(g);t=document.createElementNS(o,_,g.is&&g),i=null,s=!1}if(null===_)v===g||s&&t.data===g||(t.data=g);else{if(i=i&&An.call(t.childNodes),v=n.props||Rn,!s&&null!=i)for(v={},l=0;l<t.attributes.length;l++)v[(h=t.attributes[l]).name]=h.value;for(l in v)if(h=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)p=h;else if("key"!==l&&!(l in g)){if("value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g)continue;rr(t,l,null,h,o)}for(l in g)h=g[l],"children"==l?d=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?f=h:"checked"==l?y=h:"key"===l||s&&"function"!=typeof h||v[l]===h||rr(t,l,h,v[l],o);if(c)s||p&&(c.__html===p.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(p&&(t.innerHTML=""),$n(t,zn(d)?d:[d],e,n,r,"foreignObject"===_?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Vn(n,0),s,u),null!=i)for(l=i.length;l--;)null!=i[l]&&Un(i[l]);s||(l="value",void 0!==f&&(f!==t[l]||"progress"===_&&!f||"option"===_&&f!==v[l])&&rr(t,l,f,v[l],o),l="checked",void 0!==y&&y!==t[l]&&rr(t,l,y,v[l],o))}return t}function ur(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){On.__e(t,n)}}function lr(t,e,n){var r,o;if(On.unmount&&On.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ur(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){On.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&lr(r[o],e,n||"function"!=typeof t.type);n||null==t.__e||Un(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function cr(t,e,n){return this.constructor(t,n)}function pr(t,e,n){var r,o,i,a;On.__&&On.__(t,e),o=(r="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],ir(e,t=(!r&&n||e).__k=Xn(Yn,null,[t]),o||Rn,Rn,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?An.call(e.childNodes):null,i,!r&&n?n:o?o.__e:e.firstChild,r,a),ar(i,t,a)}An=Ln.slice,On={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},Tn=0,Fn.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Hn({},this.state),"function"==typeof t&&(t=t(Hn({},n),this.props)),t&&Hn(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),qn(this))},Fn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qn(this))},Fn.prototype.render=Yn,Nn=[],Pn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cn=function(t,e){return t.__v.__b-e.__v.__b},Zn.__r=0,jn=0,In=or(!1),kn=or(!0);var dr,hr,fr,yr=[],vr=[],gr=On,_r=gr.__b,mr=gr.__r,br=gr.diffed,Er=gr.__c,xr=gr.unmount,wr=gr.__;function Sr(){for(var t;t=yr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Or),t.__H.__h.forEach(Tr),t.__H.__h=[]}catch(e){t.__H.__h=[],gr.__e(e,t.__v)}}gr.__b=function(t){dr=null,_r&&_r(t)},gr.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),wr&&wr(t,e)},gr.__r=function(t){mr&&mr(t);var e=(dr=t.__c).__H;e&&(hr===dr?(e.__h=[],dr.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=vr,t.__N=t.i=void 0}))):(e.__h.forEach(Or),e.__h.forEach(Tr),e.__h=[])),hr=dr},gr.diffed=function(t){br&&br(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==yr.push(e)&&fr===gr.requestAnimationFrame||((fr=gr.requestAnimationFrame)||Ar)(Sr)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==vr&&(t.__=t.__V),t.i=void 0,t.__V=vr}))),hr=dr=null},gr.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Or),t.__h=t.__h.filter((function(t){return!t.__||Tr(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],gr.__e(n,t.__v)}})),Er&&Er(t,e)},gr.unmount=function(t){xr&&xr(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Or(t)}catch(t){e=t}})),n.__H=void 0,e&&gr.__e(e,n.__v))};var Mr="function"==typeof requestAnimationFrame;function Ar(t){var e,n=function(){clearTimeout(r),Mr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Mr&&(e=requestAnimationFrame(n))}function Or(t){var e=dr,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),dr=e}function Tr(t){var e=dr;t.__c=t.__(),dr=e}function Nr(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}function Dr(t,e){this.props=t,this.context=e}(Dr.prototype=new Fn).isPureReactComponent=!0,Dr.prototype.shouldComponentUpdate=function(t,e){return Nr(this.props,t)||Nr(this.state,e)};var Pr=On.__b;On.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Pr&&Pr(t)};var Cr=On.__e;On.__e=function(t,e,n,r){if(t.then)for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Cr(t,e,n,r)};var jr=On.unmount;function Ir(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Ir(t,e,n)}))),t}function kr(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return kr(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Rr(){this.__u=0,this.t=null,this.__b=null}function Lr(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Br(){this.u=null,this.o=null}On.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),jr&&jr(t)},(Rr.prototype=new Fn).__c=function(t,e){var n=e.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Lr(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var t=r.state.__a;r.__v.__k[0]=kr(t,t.__c.__P,t.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},Rr.prototype.componentWillUnmount=function(){this.t=[]},Rr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Ir(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&Xn(Yn,null,t.fallback);return o&&(o.__u&=-33),[Xn(Yn,null,e.__a?null:t.children),o]};var zr=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(Br.prototype=new Fn).__a=function(t){var e=this,n=Lr(e.__v),r=e.o.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),zr(e,t,r)):o()};n?n(i):i()}},Br.prototype.render=function(t){this.u=null,this.o=new Map;var e=tr(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Br.prototype.componentDidUpdate=Br.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){zr(t,n,e)}))};var Hr="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ur=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Xr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Gr=/[A-Z0-9]/g,Wr="undefined"!=typeof document,Yr=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};Fn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(Fn.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Fr=On.event;function Vr(){}function Kr(){return this.cancelBubble}function qr(){return this.defaultPrevented}On.event=function(t){return Fr&&(t=Fr(t)),t.persist=Vr,t.isPropagationStopped=Kr,t.isDefaultPrevented=qr,t.nativeEvent=t};var Zr={enumerable:!1,configurable:!0,get:function(){return this.class}},$r=On.vnode;On.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,r={};for(var o in e){var i=e[o];if(!("value"===o&&"defaultValue"in e&&null==i||Wr&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Yr(e.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Xr.test(o)?o=a:-1===n.indexOf("-")&&Ur.test(o)?o=o.replace(Gr,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=tr(e.children).forEach((function(t){t.props.selected=-1!=r.value.indexOf(t.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=tr(e.children).forEach((function(t){t.props.selected=r.multiple?-1!=r.defaultValue.indexOf(t.props.value):r.defaultValue==t.props.value}))),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",Zr)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r}(t),t.$$typeof=Hr,$r&&$r(t)};var Jr=On.__r;On.__r=function(t){Jr&&Jr(t),t.__c};var Qr=On.diffed;On.diffed=function(t){Qr&&Qr(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var to=function(t,e){return to=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},to(t,e)};function eo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}to(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var no=function(){return no=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},no.apply(this,arguments)};function ro(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function oo(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function io(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function ao(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var so=0;function uo(t,e,n,r,o,i){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--so,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return On.vnode&&On.vnode(l),l}var lo="object"==typeof global&&global&&global.Object===Object&&global,co="object"==typeof self&&self&&self.Object===Object&&self,po=lo||co||Function("return this")(),ho=po.Symbol,fo=Object.prototype,yo=fo.hasOwnProperty,vo=fo.toString,go=ho?ho.toStringTag:void 0;var _o=Object.prototype.toString;var mo="[object Null]",bo="[object Undefined]",Eo=ho?ho.toStringTag:void 0;function xo(t){return null==t?void 0===t?bo:mo:Eo&&Eo in Object(t)?function(t){var e=yo.call(t,go),n=t[go];try{t[go]=void 0;var r=!0}catch(t){}var o=vo.call(t);return r&&(e?t[go]=n:delete t[go]),o}(t):function(t){return _o.call(t)}(t)}function wo(t){return null!=t&&"object"==typeof t}var So="[object Symbol]";function Mo(t){return"symbol"==typeof t||wo(t)&&xo(t)==So}var Ao=NaN;function Oo(t){return"number"==typeof t?t:Mo(t)?Ao:+t}function To(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var No=Array.isArray,Do=1/0,Po=ho?ho.prototype:void 0,Co=Po?Po.toString:void 0;function jo(t){if("string"==typeof t)return t;if(No(t))return To(t,jo)+"";if(Mo(t))return Co?Co.call(t):"";var e=t+"";return"0"==e&&1/t==-Do?"-0":e}function Io(t,e){return function(n,r){var o;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=jo(n),r=jo(r)):(n=Oo(n),r=Oo(r)),o=t(n,r)}return o}}var ko=Io((function(t,e){return t+e}),0),Ro=/\s/;function Lo(t){for(var e=t.length;e--&&Ro.test(t.charAt(e)););return e}var Bo=/^\s+/;function zo(t){return t?t.slice(0,Lo(t)+1).replace(Bo,""):t}function Ho(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Uo=NaN,Xo=/^[-+]0x[0-9a-f]+$/i,Go=/^0b[01]+$/i,Wo=/^0o[0-7]+$/i,Yo=parseInt;function Fo(t){if("number"==typeof t)return t;if(Mo(t))return Uo;if(Ho(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ho(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=zo(t);var n=Go.test(t);return n||Wo.test(t)?Yo(t.slice(2),n?2:8):Xo.test(t)?Uo:+t}var Vo=1/0,Ko=17976931348623157e292;function qo(t){return t?(t=Fo(t))===Vo||t===-Vo?(t<0?-1:1)*Ko:t==t?t:0:0===t?t:0}function Zo(t){var e=qo(t),n=e%1;return e==e?n?e-n:e:0}function $o(t){return t}var Jo="[object AsyncFunction]",Qo="[object Function]",ti="[object GeneratorFunction]",ei="[object Proxy]";function ni(t){if(!Ho(t))return!1;var e=xo(t);return e==Qo||e==ti||e==Jo||e==ei}var ri,oi=po["__core-js_shared__"],ii=(ri=/[^.]+$/.exec(oi&&oi.keys&&oi.keys.IE_PROTO||""))?"Symbol(src)_1."+ri:"";var ai=Function.prototype.toString;function si(t){if(null!=t){try{return ai.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var ui=/^\[object .+?Constructor\]$/,li=Function.prototype,ci=Object.prototype,pi=li.toString,di=ci.hasOwnProperty,hi=RegExp("^"+pi.call(di).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fi(t){return!(!Ho(t)||function(t){return!!ii&&ii in t}(t))&&(ni(t)?hi:ui).test(si(t))}function yi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return fi(n)?n:void 0}var vi=yi(po,"WeakMap"),gi=vi&&new vi,_i=gi?function(t,e){return gi.set(t,e),t}:$o,mi=Object.create,bi=function(){function t(){}return function(e){if(!Ho(e))return{};if(mi)return mi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ei(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=bi(t.prototype),r=t.apply(n,e);return Ho(r)?r:n}}var xi=1;function wi(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Si=Math.max;function Mi(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,u=e.length,l=Si(i-a,0),c=Array(u+l),p=!r;++s<u;)c[s]=e[s];for(;++o<a;)(p||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[s++]=t[o++];return c}var Ai=Math.max;function Oi(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,u=-1,l=e.length,c=Ai(i-s,0),p=Array(c+l),d=!r;++o<c;)p[o]=t[o];for(var h=o;++u<l;)p[h+u]=e[u];for(;++a<s;)(d||o<i)&&(p[h+n[a]]=t[o++]);return p}function Ti(){}var Ni=4294967295;function Di(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ni,this.__views__=[]}function Pi(){}Di.prototype=bi(Ti.prototype),Di.prototype.constructor=Di;var Ci=gi?function(t){return gi.get(t)}:Pi,ji={},Ii=Object.prototype.hasOwnProperty;function ki(t){for(var e=t.name+"",n=ji[e],r=Ii.call(ji,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function Ri(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Li(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Bi(t){if(t instanceof Di)return t.clone();var e=new Ri(t.__wrapped__,t.__chain__);return e.__actions__=Li(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}Ri.prototype=bi(Ti.prototype),Ri.prototype.constructor=Ri;var zi=Object.prototype.hasOwnProperty;function Hi(t){if(wo(t)&&!No(t)&&!(t instanceof Di)){if(t instanceof Ri)return t;if(zi.call(t,"__wrapped__"))return Bi(t)}return new Ri(t)}function Ui(t){var e=ki(t),n=Hi[e];if("function"!=typeof n||!(e in Di.prototype))return!1;if(t===n)return!0;var r=Ci(n);return!!r&&t===r[0]}Hi.prototype=Ti.prototype,Hi.prototype.constructor=Hi;var Xi=Date.now;function Gi(t){var e=0,n=0;return function(){var r=Xi(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Wi=Gi(_i),Yi=/\{\n\/\* \[wrapped with (.+)\] \*/,Fi=/,? & /;var Vi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Ki(t){return function(){return t}}var qi=function(){try{var t=yi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Zi=qi?function(t,e){return qi(t,"toString",{configurable:!0,enumerable:!1,value:Ki(e),writable:!0})}:$o,$i=Gi(Zi);function Ji(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Qi(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function ta(t){return t!=t}function ea(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Qi(t,ta,n)}function na(t,e){return!!(null==t?0:t.length)&&ea(t,e,0)>-1}var ra=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function oa(t,e,n){var r=e+"";return $i(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Vi,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ji(ra,(function(n){var r="_."+n[0];e&n[1]&&!na(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Yi);return e?e[1].split(Fi):[]}(r),n)))}var ia=1,aa=2,sa=4,ua=8,la=32,ca=64;function pa(t,e,n,r,o,i,a,s,u,l){var c=e&ua;e|=c?la:ca,(e&=~(c?ca:la))&sa||(e&=~(ia|aa));var p=[t,e,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,u,l],d=n.apply(void 0,p);return Ui(t)&&Wi(d,p),d.placeholder=r,oa(d,t,e)}function da(t){return t.placeholder}var ha=9007199254740991,fa=/^(?:0|[1-9]\d*)$/;function ya(t,e){var n=typeof t;return!!(e=null==e?ha:e)&&("number"==n||"symbol"!=n&&fa.test(t))&&t>-1&&t%1==0&&t<e}var va=Math.min;var ga="__lodash_placeholder__";function _a(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==ga||(t[n]=ga,i[o++]=n)}return i}var ma=1,ba=2,Ea=8,xa=16,wa=128,Sa=512;function Ma(t,e,n,r,o,i,a,s,u,l){var c=e&wa,p=e&ma,d=e&ba,h=e&(Ea|xa),f=e&Sa,y=d?void 0:Ei(t);return function v(){for(var g=arguments.length,_=Array(g),m=g;m--;)_[m]=arguments[m];if(h)var b=da(v),E=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,b);if(r&&(_=Mi(_,r,o,h)),i&&(_=Oi(_,i,a,h)),g-=E,h&&g<l){var x=_a(_,b);return pa(t,e,Ma,v.placeholder,n,_,x,s,u,l-g)}var w=p?n:this,S=d?w[t]:t;return g=_.length,s?_=function(t,e){for(var n=t.length,r=va(e.length,n),o=Li(t);r--;){var i=e[r];t[r]=ya(i,n)?o[i]:void 0}return t}(_,s):f&&g>1&&_.reverse(),c&&u<g&&(_.length=u),this&&this!==po&&this instanceof v&&(S=y||Ei(S)),S.apply(w,_)}}var Aa=1;var Oa="__lodash_placeholder__",Ta=1,Na=2,Da=4,Pa=8,Ca=128,ja=256,Ia=Math.min;var ka="Expected a function",Ra=1,La=2,Ba=8,za=16,Ha=32,Ua=64,Xa=Math.max;function Ga(t,e,n,r,o,i,a,s){var u=e&La;if(!u&&"function"!=typeof t)throw new TypeError(ka);var l=r?r.length:0;if(l||(e&=~(Ha|Ua),r=o=void 0),a=void 0===a?a:Xa(Zo(a),0),s=void 0===s?s:Zo(s),l-=o?o.length:0,e&Ua){var c=r,p=o;r=o=void 0}var d=u?void 0:Ci(t),h=[t,e,n,r,o,c,p,i,a,s];if(d&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<(Ta|Na|Ca),a=r==Ca&&n==Pa||r==Ca&&n==ja&&t[7].length<=e[8]||r==(Ca|ja)&&e[7].length<=e[8]&&n==Pa;if(!i&&!a)return t;r&Ta&&(t[2]=e[2],o|=n&Ta?0:Da);var s=e[3];if(s){var u=t[3];t[3]=u?Mi(u,s,e[4]):s,t[4]=u?_a(t[3],Oa):e[4]}(s=e[5])&&(u=t[5],t[5]=u?Oi(u,s,e[6]):s,t[6]=u?_a(t[5],Oa):e[6]),(s=e[7])&&(t[7]=s),r&Ca&&(t[8]=null==t[8]?e[8]:Ia(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(h,d),t=h[0],e=h[1],n=h[2],r=h[3],o=h[4],!(s=h[9]=void 0===h[9]?u?0:t.length:Xa(h[9]-l,0))&&e&(Ba|za)&&(e&=~(Ba|za)),e&&e!=Ra)f=e==Ba||e==za?function(t,e,n){var r=Ei(t);return function o(){for(var i=arguments.length,a=Array(i),s=i,u=da(o);s--;)a[s]=arguments[s];var l=i<3&&a[0]!==u&&a[i-1]!==u?[]:_a(a,u);return(i-=l.length)<n?pa(t,e,Ma,o.placeholder,void 0,a,l,void 0,void 0,n-i):wi(this&&this!==po&&this instanceof o?r:t,this,a)}}(t,e,s):e!=Ha&&e!=(Ra|Ha)||o.length?Ma.apply(void 0,h):function(t,e,n,r){var o=e&Aa,i=Ei(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=Array(l+s),p=this&&this!==po&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return wi(p,o?n:this,c)}}(t,e,n,r);else var f=function(t,e,n){var r=e&xi,o=Ei(t);return function e(){return(this&&this!==po&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return oa((d?_i:Wi)(f,h),t,e)}var Wa=128;function Ya(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,Ga(t,Wa,void 0,void 0,void 0,void 0,e)}function Fa(t,e,n){"__proto__"==e&&qi?qi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Va(t,e){return t===e||t!=t&&e!=e}var Ka=Object.prototype.hasOwnProperty;function qa(t,e,n){var r=t[e];Ka.call(t,e)&&Va(r,n)&&(void 0!==n||e in t)||Fa(t,e,n)}function Za(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),o?Fa(n,s,u):qa(n,s,u)}return n}var $a=Math.max;function Ja(t,e,n){return e=$a(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=$a(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),wi(t,this,s)}}function Qa(t,e){return $i(Ja(t,e,$o),t+"")}var ts=9007199254740991;function es(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ts}function ns(t){return null!=t&&es(t.length)&&!ni(t)}function rs(t,e,n){if(!Ho(n))return!1;var r=typeof e;return!!("number"==r?ns(n)&&ya(e,n.length):"string"==r&&e in n)&&Va(n[e],t)}function os(t){return Qa((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&rs(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e}))}var is=Object.prototype;function as(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||is)}function ss(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function us(t){return wo(t)&&"[object Arguments]"==xo(t)}var ls=Object.prototype,cs=ls.hasOwnProperty,ps=ls.propertyIsEnumerable,ds=us(function(){return arguments}())?us:function(t){return wo(t)&&cs.call(t,"callee")&&!ps.call(t,"callee")};function hs(){return!1}var fs="object"==typeof t&&t&&!t.nodeType&&t,ys=fs&&"object"==typeof module&&module&&!module.nodeType&&module,vs=ys&&ys.exports===fs?po.Buffer:void 0,gs=(vs?vs.isBuffer:void 0)||hs,_s={};function ms(t){return function(e){return t(e)}}_s["[object Float32Array]"]=_s["[object Float64Array]"]=_s["[object Int8Array]"]=_s["[object Int16Array]"]=_s["[object Int32Array]"]=_s["[object Uint8Array]"]=_s["[object Uint8ClampedArray]"]=_s["[object Uint16Array]"]=_s["[object Uint32Array]"]=!0,_s["[object Arguments]"]=_s["[object Array]"]=_s["[object ArrayBuffer]"]=_s["[object Boolean]"]=_s["[object DataView]"]=_s["[object Date]"]=_s["[object Error]"]=_s["[object Function]"]=_s["[object Map]"]=_s["[object Number]"]=_s["[object Object]"]=_s["[object RegExp]"]=_s["[object Set]"]=_s["[object String]"]=_s["[object WeakMap]"]=!1;var bs="object"==typeof t&&t&&!t.nodeType&&t,Es=bs&&"object"==typeof module&&module&&!module.nodeType&&module,xs=Es&&Es.exports===bs&&lo.process,ws=function(){try{var t=Es&&Es.require&&Es.require("util").types;return t||xs&&xs.binding&&xs.binding("util")}catch(t){}}(),Ss=ws&&ws.isTypedArray,Ms=Ss?ms(Ss):function(t){return wo(t)&&es(t.length)&&!!_s[xo(t)]},As=Object.prototype.hasOwnProperty;function Os(t,e){var n=No(t),r=!n&&ds(t),o=!n&&!r&&gs(t),i=!n&&!r&&!o&&Ms(t),a=n||r||o||i,s=a?ss(t.length,String):[],u=s.length;for(var l in t)!e&&!As.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ya(l,u))||s.push(l);return s}function Ts(t,e){return function(n){return t(e(n))}}var Ns=Ts(Object.keys,Object),Ds=Object.prototype.hasOwnProperty;function Ps(t){if(!as(t))return Ns(t);var e=[];for(var n in Object(t))Ds.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Cs(t){return ns(t)?Os(t):Ps(t)}var js=Object.prototype.hasOwnProperty,Is=os((function(t,e){if(as(e)||ns(e))Za(e,Cs(e),t);else for(var n in e)js.call(e,n)&&qa(t,n,e[n])}));var ks=Object.prototype.hasOwnProperty;function Rs(t){if(!Ho(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=as(t),n=[];for(var r in t)("constructor"!=r||!e&&ks.call(t,r))&&n.push(r);return n}function Ls(t){return ns(t)?Os(t,!0):Rs(t)}var Bs=os((function(t,e){Za(e,Ls(e),t)})),zs=os((function(t,e,n,r){Za(e,Ls(e),t,r)})),Hs=os((function(t,e,n,r){Za(e,Cs(e),t,r)})),Us=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xs=/^\w*$/;function Gs(t,e){if(No(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Mo(t))||(Xs.test(t)||!Us.test(t)||null!=e&&t in Object(e))}var Ws=yi(Object,"create");var Ys=Object.prototype.hasOwnProperty;var Fs=Object.prototype.hasOwnProperty;function Vs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ks(t,e){for(var n=t.length;n--;)if(Va(t[n][0],e))return n;return-1}Vs.prototype.clear=function(){this.__data__=Ws?Ws(null):{},this.size=0},Vs.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vs.prototype.get=function(t){var e=this.__data__;if(Ws){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ys.call(e,t)?e[t]:void 0},Vs.prototype.has=function(t){var e=this.__data__;return Ws?void 0!==e[t]:Fs.call(e,t)},Vs.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ws&&void 0===e?"__lodash_hash_undefined__":e,this};var qs=Array.prototype.splice;function Zs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Zs.prototype.clear=function(){this.__data__=[],this.size=0},Zs.prototype.delete=function(t){var e=this.__data__,n=Ks(e,t);return!(n<0)&&(n==e.length-1?e.pop():qs.call(e,n,1),--this.size,!0)},Zs.prototype.get=function(t){var e=this.__data__,n=Ks(e,t);return n<0?void 0:e[n][1]},Zs.prototype.has=function(t){return Ks(this.__data__,t)>-1},Zs.prototype.set=function(t,e){var n=this.__data__,r=Ks(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var $s=yi(po,"Map");function Js(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Qs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qs.prototype.clear=function(){this.size=0,this.__data__={hash:new Vs,map:new($s||Zs),string:new Vs}},Qs.prototype.delete=function(t){var e=Js(this,t).delete(t);return this.size-=e?1:0,e},Qs.prototype.get=function(t){return Js(this,t).get(t)},Qs.prototype.has=function(t){return Js(this,t).has(t)},Qs.prototype.set=function(t,e){var n=Js(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var tu="Expected a function";function eu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(tu);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(eu.Cache||Qs),n}eu.Cache=Qs;var nu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ru=/\\(\\)?/g,ou=function(t){var e=eu(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(nu,(function(t,n,r,o){e.push(r?o.replace(ru,"$1"):n||t)})),e}));function iu(t){return null==t?"":jo(t)}function au(t,e){return No(t)?t:Gs(t,e)?[t]:ou(iu(t))}var su=1/0;function uu(t){if("string"==typeof t||Mo(t))return t;var e=t+"";return"0"==e&&1/t==-su?"-0":e}function lu(t,e){for(var n=0,r=(e=au(e,t)).length;null!=t&&n<r;)t=t[uu(e[n++])];return n&&n==r?t:void 0}function cu(t,e,n){var r=null==t?void 0:lu(t,e);return void 0===r?n:r}function pu(t,e){for(var n=-1,r=e.length,o=Array(r),i=null==t;++n<r;)o[n]=i?void 0:cu(t,e[n]);return o}function du(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var hu=ho?ho.isConcatSpreadable:void 0;function fu(t){return No(t)||ds(t)||!!(hu&&t&&t[hu])}function yu(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=fu),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?yu(s,e-1,n,r,o):du(o,s):r||(o[o.length]=s)}return o}function vu(t){return(null==t?0:t.length)?yu(t,1):[]}function gu(t){return $i(Ja(t,void 0,vu),t+"")}var _u=gu(pu),mu=Ts(Object.getPrototypeOf,Object),bu="[object Object]",Eu=Function.prototype,xu=Object.prototype,wu=Eu.toString,Su=xu.hasOwnProperty,Mu=wu.call(Object);function Au(t){if(!wo(t)||xo(t)!=bu)return!1;var e=mu(t);if(null===e)return!0;var n=Su.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&wu.call(n)==Mu}var Ou="[object DOMException]",Tu="[object Error]";function Nu(t){if(!wo(t))return!1;var e=xo(t);return e==Tu||e==Ou||"string"==typeof t.message&&"string"==typeof t.name&&!Au(t)}var Du=Qa((function(t,e){try{return wi(t,void 0,e)}catch(t){return Nu(t)?t:new Error(t)}})),Pu="Expected a function";function Cu(t,e){var n;if("function"!=typeof e)throw new TypeError(Pu);return t=Zo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var ju=Qa((function(t,e,n){var r=1;if(n.length){var o=_a(n,da(ju));r|=32}return Ga(t,r,e,n,o)}));ju.placeholder={};var Iu=gu((function(t,e){return Ji(e,(function(e){e=uu(e),Fa(t,e,ju(t[e],t))})),t})),ku=Qa((function(t,e,n){var r=3;if(n.length){var o=_a(n,da(ku));r|=32}return Ga(e,r,t,n,o)}));function Ru(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function Lu(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Ru(t,e,n)}ku.placeholder={};var Bu=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function zu(t){return Bu.test(t)}var Hu="\\ud800-\\udfff",Uu="["+Hu+"]",Xu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Gu="\\ud83c[\\udffb-\\udfff]",Wu="[^"+Hu+"]",Yu="(?:\\ud83c[\\udde6-\\uddff]){2}",Fu="[\\ud800-\\udbff][\\udc00-\\udfff]",Vu="(?:"+Xu+"|"+Gu+")"+"?",Ku="[\\ufe0e\\ufe0f]?",qu=Ku+Vu+("(?:\\u200d(?:"+[Wu,Yu,Fu].join("|")+")"+Ku+Vu+")*"),Zu="(?:"+[Wu+Xu+"?",Xu,Yu,Fu,Uu].join("|")+")",$u=RegExp(Gu+"(?="+Gu+")|"+Zu+qu,"g");function Ju(t){return zu(t)?function(t){return t.match($u)||[]}(t):function(t){return t.split("")}(t)}function Qu(t){return function(e){var n=zu(e=iu(e))?Ju(e):void 0,r=n?n[0]:e.charAt(0),o=n?Lu(n,1).join(""):e.slice(1);return r[t]()+o}}var tl=Qu("toUpperCase");function el(t){return tl(iu(t).toLowerCase())}function nl(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function rl(t){return function(e){return null==t?void 0:t[e]}}var ol=rl({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),il=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,al=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function sl(t){return(t=iu(t))&&t.replace(il,ol).replace(al,"")}var ul=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ll=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var cl="\\ud800-\\udfff",pl="\\u2700-\\u27bf",dl="a-z\\xdf-\\xf6\\xf8-\\xff",hl="A-Z\\xc0-\\xd6\\xd8-\\xde",fl="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yl="["+fl+"]",vl="\\d+",gl="["+pl+"]",_l="["+dl+"]",ml="[^"+cl+fl+vl+pl+dl+hl+"]",bl="(?:\\ud83c[\\udde6-\\uddff]){2}",El="[\\ud800-\\udbff][\\udc00-\\udfff]",xl="["+hl+"]",wl="(?:"+_l+"|"+ml+")",Sl="(?:"+xl+"|"+ml+")",Ml="(?:['’](?:d|ll|m|re|s|t|ve))?",Al="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ol="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Tl="[\\ufe0e\\ufe0f]?",Nl=Tl+Ol+("(?:\\u200d(?:"+["[^"+cl+"]",bl,El].join("|")+")"+Tl+Ol+")*"),Dl="(?:"+[gl,bl,El].join("|")+")"+Nl,Pl=RegExp([xl+"?"+_l+"+"+Ml+"(?="+[yl,xl,"$"].join("|")+")",Sl+"+"+Al+"(?="+[yl,xl+wl,"$"].join("|")+")",xl+"?"+wl+"+"+Ml,xl+"+"+Al,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vl,Dl].join("|"),"g");function Cl(t,e,n){return t=iu(t),void 0===(e=n?void 0:e)?function(t){return ll.test(t)}(t)?function(t){return t.match(Pl)||[]}(t):function(t){return t.match(ul)||[]}(t):t.match(e)||[]}var jl=RegExp("['’]","g");function Il(t){return function(e){return nl(Cl(sl(e).replace(jl,"")),t,"")}}var kl=Il((function(t,e,n){return e=e.toLowerCase(),t+(n?el(e):e)}));var Rl=po.isFinite,Ll=Math.min;function Bl(t){var e=Math[t];return function(t,n){if(t=Fo(t),(n=null==n?0:Ll(Zo(n),292))&&Rl(t)){var r=(iu(t)+"e").split("e");return+((r=(iu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var zl=Bl("ceil");function Hl(t){var e=Hi(t);return e.__chain__=!0,e}var Ul=Math.ceil,Xl=Math.max;function Gl(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Wl(t){var e=this.__data__=new Zs(t);this.size=e.size}function Yl(t,e){return t&&Za(e,Cs(e),t)}Wl.prototype.clear=function(){this.__data__=new Zs,this.size=0},Wl.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Wl.prototype.get=function(t){return this.__data__.get(t)},Wl.prototype.has=function(t){return this.__data__.has(t)},Wl.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Zs){var r=n.__data__;if(!$s||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Qs(r)}return n.set(t,e),this.size=n.size,this};var Fl="object"==typeof t&&t&&!t.nodeType&&t,Vl=Fl&&"object"==typeof module&&module&&!module.nodeType&&module,Kl=Vl&&Vl.exports===Fl?po.Buffer:void 0,ql=Kl?Kl.allocUnsafe:void 0;function Zl(t,e){if(e)return t.slice();var n=t.length,r=ql?ql(n):new t.constructor(n);return t.copy(r),r}function $l(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function Jl(){return[]}var Ql=Object.prototype.propertyIsEnumerable,tc=Object.getOwnPropertySymbols,ec=tc?function(t){return null==t?[]:(t=Object(t),$l(tc(t),(function(e){return Ql.call(t,e)})))}:Jl;var nc=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)du(e,ec(t)),t=mu(t);return e}:Jl;function rc(t,e,n){var r=e(t);return No(t)?r:du(r,n(t))}function oc(t){return rc(t,Cs,ec)}function ic(t){return rc(t,Ls,nc)}var ac=yi(po,"DataView"),sc=yi(po,"Promise"),uc=yi(po,"Set"),lc="[object Map]",cc="[object Promise]",pc="[object Set]",dc="[object WeakMap]",hc="[object DataView]",fc=si(ac),yc=si($s),vc=si(sc),gc=si(uc),_c=si(vi),mc=xo;(ac&&mc(new ac(new ArrayBuffer(1)))!=hc||$s&&mc(new $s)!=lc||sc&&mc(sc.resolve())!=cc||uc&&mc(new uc)!=pc||vi&&mc(new vi)!=dc)&&(mc=function(t){var e=xo(t),n="[object Object]"==e?t.constructor:void 0,r=n?si(n):"";if(r)switch(r){case fc:return hc;case yc:return lc;case vc:return cc;case gc:return pc;case _c:return dc}return e});var bc=mc,Ec=Object.prototype.hasOwnProperty;var xc=po.Uint8Array;function wc(t){var e=new t.constructor(t.byteLength);return new xc(e).set(new xc(t)),e}var Sc=/\w*$/;var Mc=ho?ho.prototype:void 0,Ac=Mc?Mc.valueOf:void 0;function Oc(t,e){var n=e?wc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Tc="[object Boolean]",Nc="[object Date]",Dc="[object Map]",Pc="[object Number]",Cc="[object RegExp]",jc="[object Set]",Ic="[object String]",kc="[object Symbol]",Rc="[object ArrayBuffer]",Lc="[object DataView]",Bc="[object Float32Array]",zc="[object Float64Array]",Hc="[object Int8Array]",Uc="[object Int16Array]",Xc="[object Int32Array]",Gc="[object Uint8Array]",Wc="[object Uint8ClampedArray]",Yc="[object Uint16Array]",Fc="[object Uint32Array]";function Vc(t,e,n){var r,o=t.constructor;switch(e){case Rc:return wc(t);case Tc:case Nc:return new o(+t);case Lc:return function(t,e){var n=e?wc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Bc:case zc:case Hc:case Uc:case Xc:case Gc:case Wc:case Yc:case Fc:return Oc(t,n);case Dc:return new o;case Pc:case Ic:return new o(t);case Cc:return function(t){var e=new t.constructor(t.source,Sc.exec(t));return e.lastIndex=t.lastIndex,e}(t);case jc:return new o;case kc:return r=t,Ac?Object(Ac.call(r)):{}}}function Kc(t){return"function"!=typeof t.constructor||as(t)?{}:bi(mu(t))}var qc=ws&&ws.isMap,Zc=qc?ms(qc):function(t){return wo(t)&&"[object Map]"==bc(t)};var $c=ws&&ws.isSet,Jc=$c?ms($c):function(t){return wo(t)&&"[object Set]"==bc(t)},Qc=1,tp=2,ep=4,np="[object Arguments]",rp="[object Function]",op="[object GeneratorFunction]",ip="[object Object]",ap={};function sp(t,e,n,r,o,i){var a,s=e&Qc,u=e&tp,l=e&ep;if(n&&(a=o?n(t,r,o,i):n(t)),void 0!==a)return a;if(!Ho(t))return t;var c=No(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ec.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Li(t,a)}else{var p=bc(t),d=p==rp||p==op;if(gs(t))return Zl(t,s);if(p==ip||p==np||d&&!o){if(a=u||d?{}:Kc(t),!s)return u?function(t,e){return Za(t,nc(t),e)}(t,function(t,e){return t&&Za(e,Ls(e),t)}(a,t)):function(t,e){return Za(t,ec(t),e)}(t,Yl(a,t))}else{if(!ap[p])return o?t:{};a=Vc(t,p,s)}}i||(i=new Wl);var h=i.get(t);if(h)return h;i.set(t,a),Jc(t)?t.forEach((function(r){a.add(sp(r,e,n,r,t,i))})):Zc(t)&&t.forEach((function(r,o){a.set(o,sp(r,e,n,o,t,i))}));var f=c?void 0:(l?u?ic:oc:u?Ls:Cs)(t);return Ji(f||t,(function(r,o){f&&(r=t[o=r]),qa(a,o,sp(r,e,n,o,t,i))})),a}ap[np]=ap["[object Array]"]=ap["[object ArrayBuffer]"]=ap["[object DataView]"]=ap["[object Boolean]"]=ap["[object Date]"]=ap["[object Float32Array]"]=ap["[object Float64Array]"]=ap["[object Int8Array]"]=ap["[object Int16Array]"]=ap["[object Int32Array]"]=ap["[object Map]"]=ap["[object Number]"]=ap[ip]=ap["[object RegExp]"]=ap["[object Set]"]=ap["[object String]"]=ap["[object Symbol]"]=ap["[object Uint8Array]"]=ap["[object Uint8ClampedArray]"]=ap["[object Uint16Array]"]=ap["[object Uint32Array]"]=!0,ap["[object Error]"]=ap[rp]=ap["[object WeakMap]"]=!1;function up(t){return sp(t,5)}function lp(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Qs;++e<n;)this.add(t[e])}function cp(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function pp(t,e){return t.has(e)}lp.prototype.add=lp.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},lp.prototype.has=function(t){return this.__data__.has(t)};var dp=1,hp=2;function fp(t,e,n,r,o,i){var a=n&dp,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var l=i.get(t),c=i.get(e);if(l&&c)return l==e&&c==t;var p=-1,d=!0,h=n&hp?new lp:void 0;for(i.set(t,e),i.set(e,t);++p<s;){var f=t[p],y=e[p];if(r)var v=a?r(y,f,p,e,t,i):r(f,y,p,t,e,i);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!cp(e,(function(t,e){if(!pp(h,e)&&(f===t||o(f,t,n,r,i)))return h.push(e)}))){d=!1;break}}else if(f!==y&&!o(f,y,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function yp(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function vp(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var gp=1,_p=2,mp="[object Boolean]",bp="[object Date]",Ep="[object Error]",xp="[object Map]",wp="[object Number]",Sp="[object RegExp]",Mp="[object Set]",Ap="[object String]",Op="[object Symbol]",Tp="[object ArrayBuffer]",Np="[object DataView]",Dp=ho?ho.prototype:void 0,Pp=Dp?Dp.valueOf:void 0;var Cp=1,jp=Object.prototype.hasOwnProperty;var Ip=1,kp="[object Arguments]",Rp="[object Array]",Lp="[object Object]",Bp=Object.prototype.hasOwnProperty;function zp(t,e,n,r,o,i){var a=No(t),s=No(e),u=a?Rp:bc(t),l=s?Rp:bc(e),c=(u=u==kp?Lp:u)==Lp,p=(l=l==kp?Lp:l)==Lp,d=u==l;if(d&&gs(t)){if(!gs(e))return!1;a=!0,c=!1}if(d&&!c)return i||(i=new Wl),a||Ms(t)?fp(t,e,n,r,o,i):function(t,e,n,r,o,i,a){switch(n){case Np:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Tp:return!(t.byteLength!=e.byteLength||!i(new xc(t),new xc(e)));case mp:case bp:case wp:return Va(+t,+e);case Ep:return t.name==e.name&&t.message==e.message;case Sp:case Ap:return t==e+"";case xp:var s=yp;case Mp:var u=r&gp;if(s||(s=vp),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=_p,a.set(t,e);var c=fp(s(t),s(e),r,o,i,a);return a.delete(t),c;case Op:if(Pp)return Pp.call(t)==Pp.call(e)}return!1}(t,e,u,n,r,o,i);if(!(n&Ip)){var h=c&&Bp.call(t,"__wrapped__"),f=p&&Bp.call(e,"__wrapped__");if(h||f){var y=h?t.value():t,v=f?e.value():e;return i||(i=new Wl),o(y,v,n,r,i)}}return!!d&&(i||(i=new Wl),function(t,e,n,r,o,i){var a=n&Cp,s=oc(t),u=s.length;if(u!=oc(e).length&&!a)return!1;for(var l=u;l--;){var c=s[l];if(!(a?c in e:jp.call(e,c)))return!1}var p=i.get(t),d=i.get(e);if(p&&d)return p==e&&d==t;var h=!0;i.set(t,e),i.set(e,t);for(var f=a;++l<u;){var y=t[c=s[l]],v=e[c];if(r)var g=a?r(v,y,c,e,t,i):r(y,v,c,t,e,i);if(!(void 0===g?y===v||o(y,v,n,r,i):g)){h=!1;break}f||(f="constructor"==c)}if(h&&!f){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,r,o,i))}function Hp(t,e,n,r,o){return t===e||(null==t||null==e||!wo(t)&&!wo(e)?t!=t&&e!=e:zp(t,e,n,r,Hp,o))}var Up=1,Xp=2;function Gp(t,e,n,r){var o=n.length,i=o,a=!r;if(null==t)return!i;for(t=Object(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var u=(s=n[o])[0],l=t[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in t))return!1}else{var p=new Wl;if(r)var d=r(l,c,u,t,e,p);if(!(void 0===d?Hp(c,l,Up|Xp,r,p):d))return!1}}return!0}function Wp(t){return t==t&&!Ho(t)}function Yp(t){for(var e=Cs(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Wp(o)]}return e}function Fp(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function Vp(t){var e=Yp(t);return 1==e.length&&e[0][2]?Fp(e[0][0],e[0][1]):function(n){return n===t||Gp(n,t,e)}}function Kp(t,e){return null!=t&&e in Object(t)}function qp(t,e,n){for(var r=-1,o=(e=au(e,t)).length,i=!1;++r<o;){var a=uu(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&es(o)&&ya(a,o)&&(No(t)||ds(t))}function Zp(t,e){return null!=t&&qp(t,e,Kp)}var $p=1,Jp=2;function Qp(t,e){return Gs(t)&&Wp(e)?Fp(uu(t),e):function(n){var r=cu(n,t);return void 0===r&&r===e?Zp(n,t):Hp(e,r,$p|Jp)}}function td(t){return function(e){return null==e?void 0:e[t]}}function ed(t){return Gs(t)?td(uu(t)):function(t){return function(e){return lu(e,t)}}(t)}function nd(t){return"function"==typeof t?t:null==t?$o:"object"==typeof t?No(t)?Qp(t[0],t[1]):Vp(t):ed(t)}function rd(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var o=n[r],i=e[o],a=t[o];if(void 0===a&&!(o in t)||!i(a))return!1}return!0}function od(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function id(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}var ad=id();function sd(t,e){return t&&ad(t,e,Cs)}function ud(t,e){return function(n,r){if(null==n)return n;if(!ns(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}var ld=ud(sd);function cd(t,e,n,r){return ld(t,(function(t,o,i){e(r,t,n(t),i)})),r}function pd(t,e){return function(n,r){var o=No(n)?od:cd,i=e?e():{};return o(n,t,nd(r),i)}}var dd=Object.prototype.hasOwnProperty,hd=pd((function(t,e,n){dd.call(t,n)?++t[n]:Fa(t,n,1)}));function fd(t,e,n){var r=Ga(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=fd.placeholder,r}fd.placeholder={};function yd(t,e,n){var r=Ga(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=yd.placeholder,r}yd.placeholder={};var vd=function(){return po.Date.now()},gd="Expected a function",_d=Math.max,md=Math.min;function bd(t,e,n){var r,o,i,a,s,u,l=0,c=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(gd);function h(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function f(t){var n=t-u;return void 0===u||n>=e||n<0||p&&t-l>=i}function y(){var t=vd();if(f(t))return v(t);s=setTimeout(y,function(t){var n=e-(t-u);return p?md(n,i-(t-l)):n}(t))}function v(t){return s=void 0,d&&r?h(t):(r=o=void 0,a)}function g(){var t=vd(),n=f(t);if(r=arguments,o=this,u=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(y,e),c?h(t):a}(u);if(p)return clearTimeout(s),s=setTimeout(y,e),h(u)}return void 0===s&&(s=setTimeout(y,e)),a}return e=Fo(e)||0,Ho(n)&&(c=!!n.leading,i=(p="maxWait"in n)?_d(Fo(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=o=s=void 0},g.flush=function(){return void 0===s?a:v(vd())},g}var Ed=Object.prototype,xd=Ed.hasOwnProperty,wd=Qa((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&rs(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Ls(i),s=-1,u=a.length;++s<u;){var l=a[s],c=t[l];(void 0===c||Va(c,Ed[l])&&!xd.call(t,l))&&(t[l]=i[l])}return t}));function Sd(t,e,n){(void 0!==n&&!Va(t[e],n)||void 0===n&&!(e in t))&&Fa(t,e,n)}function Md(t){return wo(t)&&ns(t)}function Ad(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Od(t){return Za(t,Ls(t))}function Td(t,e,n,r,o){t!==e&&ad(e,(function(i,a){if(o||(o=new Wl),Ho(i))!function(t,e,n,r,o,i,a){var s=Ad(t,n),u=Ad(e,n),l=a.get(u);if(l)Sd(t,n,l);else{var c=i?i(s,u,n+"",t,e,a):void 0,p=void 0===c;if(p){var d=No(u),h=!d&&gs(u),f=!d&&!h&&Ms(u);c=u,d||h||f?No(s)?c=s:Md(s)?c=Li(s):h?(p=!1,c=Zl(u,!0)):f?(p=!1,c=Oc(u,!0)):c=[]:Au(u)||ds(u)?(c=s,ds(s)?c=Od(s):Ho(s)&&!ni(s)||(c=Kc(u))):p=!1}p&&(a.set(u,c),o(c,u,r,i,a),a.delete(u)),Sd(t,n,c)}}(t,e,a,n,Td,r,o);else{var s=r?r(Ad(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),Sd(t,a,s)}}),Ls)}function Nd(t,e,n,r,o,i){return Ho(t)&&Ho(e)&&(i.set(e,t),Td(t,e,void 0,Nd,i),i.delete(e)),t}var Dd=os((function(t,e,n,r){Td(t,e,n,r)})),Pd=Qa((function(t){return t.push(void 0,Nd),wi(Dd,void 0,t)}));function Cd(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var jd=Qa((function(t,e){return Cd(t,1,e)})),Id=Qa((function(t,e,n){return Cd(t,Fo(e)||0,n)}));function kd(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}var Rd=200;function Ld(t,e,n,r){var o=-1,i=na,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=To(e,ms(n))),r?(i=kd,a=!1):e.length>=Rd&&(i=pp,a=!1,e=new lp(e));t:for(;++o<s;){var c=t[o],p=null==n?c:n(c);if(c=r||0!==c?c:0,a&&p==p){for(var d=l;d--;)if(e[d]===p)continue t;u.push(c)}else i(e,p,r)||u.push(c)}return u}var Bd=Qa((function(t,e){return Md(t)?Ld(t,yu(e,1,Md,!0)):[]}));function zd(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Hd=Qa((function(t,e){var n=zd(e);return Md(n)&&(n=void 0),Md(t)?Ld(t,yu(e,1,Md,!0),nd(n)):[]})),Ud=Qa((function(t,e){var n=zd(e);return Md(n)&&(n=void 0),Md(t)?Ld(t,yu(e,1,Md,!0),void 0,n):[]})),Xd=Io((function(t,e){return t/e}),1);function Gd(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?Ru(t,r?0:i,r?i+1:o):Ru(t,r?i+1:0,r?o:i)}function Wd(t){return"function"==typeof t?t:$o}function Yd(t,e){return(No(t)?Ji:ld)(t,Wd(e))}function Fd(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var Vd=id(!0);function Kd(t,e){return t&&Vd(t,e,Cs)}var qd=ud(Kd,!0);function Zd(t,e){return(No(t)?Fd:qd)(t,Wd(e))}function $d(t){return function(e){var n=bc(e);return"[object Map]"==n?yp(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return To(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Jd=$d(Cs),Qd=$d(Ls),th=rl({"&":"&","<":"<",">":">",'"':""","'":"'"}),eh=/[&<>"']/g,nh=RegExp(eh.source);function rh(t){return(t=iu(t))&&nh.test(t)?t.replace(eh,th):t}var oh=/[\\^$.*+?()[\]{}|]/g,ih=RegExp(oh.source);function ah(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function sh(t,e){var n=!0;return ld(t,(function(t,r,o){return n=!!e(t,r,o)})),n}var uh=4294967295;function lh(t){return t?Gl(Zo(t),0,uh):0}function ch(t,e){var n=[];return ld(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function ph(t){return function(e,n,r){var o=Object(e);if(!ns(e)){var i=nd(n);e=Cs(e),n=function(t){return i(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:void 0}}var dh=Math.max;function hh(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Zo(n);return o<0&&(o=dh(r+o,0)),Qi(t,nd(e),o)}var fh=ph(hh);function yh(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}var vh=Math.max,gh=Math.min;function _h(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=Zo(n),o=n<0?vh(r+o,0):gh(o,r-1)),Qi(t,nd(e),o,!0)}var mh=ph(_h);function bh(t){return t&&t.length?t[0]:void 0}function Eh(t,e){var n=-1,r=ns(t)?Array(t.length):[];return ld(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function xh(t,e){return(No(t)?To:Eh)(t,nd(e))}var wh=Bl("floor");function Sh(t){return gu((function(e){var n=e.length,r=n,o=Ri.prototype.thru;for(t&&e.reverse();r--;){var i=e[r];if("function"!=typeof i)throw new TypeError("Expected a function");if(o&&!a&&"wrapper"==ki(i))var a=new Ri([],!0)}for(r=a?r:n;++r<n;){var s=ki(i=e[r]),u="wrapper"==s?Ci(i):void 0;a=u&&Ui(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[ki(u[0])].apply(a,u[3]):1==i.length&&Ui(i)?a[s]():a.thru(i)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&No(r))return a.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}var Mh=Sh(),Ah=Sh(!0);function Oh(t,e){return $l(e,(function(e){return ni(t[e])}))}var Th=Object.prototype.hasOwnProperty,Nh=pd((function(t,e,n){Th.call(t,n)?t[n].push(e):Fa(t,n,[e])}));function Dh(t,e){return t>e}function Ph(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Fo(e),n=Fo(n)),t(e,n)}}var Ch=Ph(Dh),jh=Ph((function(t,e){return t>=e})),Ih=Object.prototype.hasOwnProperty;function kh(t,e){return null!=t&&Ih.call(t,e)}function Rh(t,e){return null!=t&&qp(t,e,kh)}var Lh=Math.max,Bh=Math.min;var zh="[object String]";function Hh(t){return"string"==typeof t||!No(t)&&wo(t)&&xo(t)==zh}function Uh(t,e){return To(e,(function(e){return t[e]}))}function Xh(t){return null==t?[]:Uh(t,Cs(t))}var Gh=Math.max;var Wh=Math.max;var Yh=Math.min;function Fh(t,e,n){for(var r=n?kd:na,o=t[0].length,i=t.length,a=i,s=Array(i),u=1/0,l=[];a--;){var c=t[a];a&&e&&(c=To(c,ms(e))),u=Yh(c.length,u),s[a]=!n&&(e||o>=120&&c.length>=120)?new lp(a&&c):void 0}c=t[0];var p=-1,d=s[0];t:for(;++p<o&&l.length<u;){var h=c[p],f=e?e(h):h;if(h=n||0!==h?h:0,!(d?pp(d,f):r(l,f,n))){for(a=i;--a;){var y=s[a];if(!(y?pp(y,f):r(t[a],f,n)))continue t}d&&d.push(f),l.push(h)}}return l}function Vh(t){return Md(t)?t:[]}var Kh=Qa((function(t){var e=To(t,Vh);return e.length&&e[0]===t[0]?Fh(e):[]})),qh=Qa((function(t){var e=zd(t),n=To(t,Vh);return e===zd(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Fh(n,nd(e)):[]})),Zh=Qa((function(t){var e=zd(t),n=To(t,Vh);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Fh(n,void 0,e):[]}));function $h(t,e){return function(n,r){return function(t,e,n,r){return sd(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}var Jh=Object.prototype.toString,Qh=$h((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Jh.call(e)),t[e]=n}),Ki($o)),tf=Object.prototype,ef=tf.hasOwnProperty,nf=tf.toString,rf=$h((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=nf.call(e)),ef.call(t,e)?t[e].push(n):t[e]=[n]}),nd);function of(t,e){return e.length<2?t:lu(t,Ru(e,0,-1))}function af(t,e,n){var r=null==(t=of(t,e=au(e,t)))?t:t[uu(zd(e))];return null==r?void 0:wi(r,t,n)}var sf=Qa(af),uf=Qa((function(t,e,n){var r=-1,o="function"==typeof e,i=ns(t)?Array(t.length):[];return ld(t,(function(t){i[++r]=o?wi(e,t,n):af(t,e,n)})),i}));var lf=ws&&ws.isArrayBuffer,cf=lf?ms(lf):function(t){return wo(t)&&"[object ArrayBuffer]"==xo(t)};var pf=ws&&ws.isDate,df=pf?ms(pf):function(t){return wo(t)&&"[object Date]"==xo(t)};var hf=Object.prototype.hasOwnProperty;function ff(t,e){return Hp(t,e)}var yf=po.isFinite;function vf(t){return"number"==typeof t&&t==Zo(t)}var gf="[object Number]";function _f(t){return"number"==typeof t||wo(t)&&xo(t)==gf}var mf=oi?ni:hs;function bf(t){return null==t}var Ef=ws&&ws.isRegExp,xf=Ef?ms(Ef):function(t){return wo(t)&&"[object RegExp]"==xo(t)},wf=9007199254740991;var Sf=Array.prototype.join;var Mf=Il((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Af=pd((function(t,e,n){Fa(t,n,e)}));var Of=Math.max,Tf=Math.min;var Nf=Il((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Df=Qu("toLowerCase");function Pf(t,e){return t<e}var Cf=Ph(Pf),jf=Ph((function(t,e){return t<=e}));function If(t,e){var n={};return e=nd(e),sd(t,(function(t,r,o){Fa(n,e(t,r,o),t)})),n}function kf(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===s?a==a&&!Mo(a):n(a,s)))var s=a,u=i}return u}function Rf(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var Lf=NaN;function Bf(t,e){var n=null==t?0:t.length;return n?Rf(t,e)/n:Lf}var zf=os((function(t,e,n){Td(t,e,n)})),Hf=Qa((function(t,e){return function(n){return af(n,t,e)}})),Uf=Qa((function(t,e){return function(n){return af(t,n,e)}}));function Xf(t,e,n){var r=Cs(e),o=Oh(e,r),i=!(Ho(n)&&"chain"in n&&!n.chain),a=ni(t);return Ji(o,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Li(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,du([this.value()],arguments))})})),t}var Gf=Io((function(t,e){return t*e}),1),Wf="Expected a function";function Yf(t){if("function"!=typeof t)throw new TypeError(Wf);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Ff="[object Map]",Vf="[object Set]",Kf=ho?ho.iterator:void 0;function qf(t){if(!t)return[];if(ns(t))return Hh(t)?Ju(t):Li(t);if(Kf&&t[Kf])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Kf]());var e=bc(t);return(e==Ff?yp:e==Vf?vp:Xh)(t)}function Zf(t,e){var n=t.length;if(n)return ya(e+=e<0?n:0,n)?t[e]:void 0}function $f(t,e){return null==(t=of(t,e=au(e,t)))||delete t[uu(zd(e))]}function Jf(t){return Au(t)?void 0:t}var Qf=gu((function(t,e){var n={};if(null==t)return n;var r=!1;e=To(e,(function(e){return e=au(e,t),r||(r=e.length>1),e})),Za(t,ic(t),n),r&&(n=sp(n,7,Jf));for(var o=e.length;o--;)$f(n,e[o]);return n}));function ty(t,e,n,r){if(!Ho(t))return t;for(var o=-1,i=(e=au(e,t)).length,a=i-1,s=t;null!=s&&++o<i;){var u=uu(e[o]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=Ho(c)?c:ya(e[o+1])?[]:{})}qa(s,u,l),s=s[u]}return t}function ey(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=lu(t,a);n(s,a)&&ty(i,au(a,t),s)}return i}function ny(t,e){if(null==t)return{};var n=To(ic(t),(function(t){return[t]}));return e=nd(e),ey(t,n,(function(t,n){return e(t,n[0])}))}function ry(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=Mo(t),a=void 0!==e,s=null===e,u=e==e,l=Mo(e);if(!s&&!l&&!i&&t>e||i&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!l&&t<e||l&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!u)return-1}return 0}function oy(t,e,n){e=e.length?To(e,(function(t){return No(t)?function(e){return lu(e,1===t.length?t[0]:t)}:t})):[$o];var r=-1;e=To(e,ms(nd));var o=Eh(t,(function(t,n,o){var i=To(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=ry(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function iy(t){return gu((function(e){return e=To(e,ms(nd)),Qa((function(n){var r=this;return t(e,(function(t){return wi(t,r,n)}))}))}))}var ay=iy(To),sy=Qa,uy=Math.min,ly=sy((function(t,e){var n=(e=1==e.length&&No(e[0])?To(e[0],ms(nd)):To(yu(e,1),ms(nd))).length;return Qa((function(r){for(var o=-1,i=uy(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return wi(t,this,r)}))})),cy=iy(ah),py=iy(cp),dy=9007199254740991,hy=Math.floor;function fy(t,e){var n="";if(!t||e<1||e>dy)return n;do{e%2&&(n+=t),(e=hy(e/2))&&(t+=t)}while(e);return n}var yy=td("length"),vy="\\ud800-\\udfff",gy="["+vy+"]",_y="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",my="\\ud83c[\\udffb-\\udfff]",by="[^"+vy+"]",Ey="(?:\\ud83c[\\udde6-\\uddff]){2}",xy="[\\ud800-\\udbff][\\udc00-\\udfff]",wy="(?:"+_y+"|"+my+")"+"?",Sy="[\\ufe0e\\ufe0f]?",My=Sy+wy+("(?:\\u200d(?:"+[by,Ey,xy].join("|")+")"+Sy+wy+")*"),Ay="(?:"+[by+_y+"?",_y,Ey,xy,gy].join("|")+")",Oy=RegExp(my+"(?="+my+")|"+Ay+My,"g");function Ty(t){return zu(t)?function(t){for(var e=Oy.lastIndex=0;Oy.test(t);)++e;return e}(t):yy(t)}var Ny=Math.ceil;function Dy(t,e){var n=(e=void 0===e?" ":jo(e)).length;if(n<2)return n?fy(e,t):e;var r=fy(e,Ny(t/Ty(e)));return zu(e)?Lu(Ju(r),0,t).join(""):r.slice(0,t)}var Py=Math.ceil,Cy=Math.floor;var jy=/^\s+/,Iy=po.parseInt;var ky=Qa((function(t,e){return Ga(t,32,void 0,e,_a(e,da(ky)))}));ky.placeholder={};var Ry=Qa((function(t,e){return Ga(t,64,void 0,e,_a(e,da(Ry)))}));Ry.placeholder={};var Ly=pd((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var By=gu((function(t,e){return null==t?{}:function(t,e){return ey(t,e,(function(e,n){return Zp(t,n)}))}(t,e)}));function zy(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}var Hy=Array.prototype.splice;function Uy(t,e,n,r){var o=r?zy:ea,i=-1,a=e.length,s=t;for(t===e&&(e=Li(e)),n&&(s=To(t,ms(n)));++i<a;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(s,c,u,r))>-1;)s!==t&&Hy.call(s,u,1),Hy.call(t,u,1);return t}function Xy(t,e){return t&&t.length&&e&&e.length?Uy(t,e):t}var Gy=Qa(Xy);var Wy=Array.prototype.splice;function Yy(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;ya(o)?Wy.call(t,o,1):$f(t,o)}}return t}var Fy=gu((function(t,e){var n=null==t?0:t.length,r=pu(t,e);return Yy(t,To(e,(function(t){return ya(t,n)?+t:t})).sort(ry)),r})),Vy=Math.floor,Ky=Math.random;function qy(t,e){return t+Vy(Ky()*(e-t+1))}var Zy=parseFloat,$y=Math.min,Jy=Math.random;var Qy=Math.ceil,tv=Math.max;function ev(t){return function(e,n,r){return r&&"number"!=typeof r&&rs(e,n,r)&&(n=r=void 0),e=qo(e),void 0===n?(n=e,e=0):n=qo(n),function(t,e,n,r){for(var o=-1,i=tv(Qy((e-t)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:qo(r),t)}}var nv=ev(),rv=ev(!0),ov=gu((function(t,e){return Ga(t,256,void 0,void 0,void 0,e)}));function iv(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function av(t,e,n){var r=No(t)?nl:iv,o=arguments.length<3;return r(t,nd(e),n,o,ld)}function sv(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}var uv=Array.prototype.reverse;function lv(t){return null==t?t:uv.call(t)}var cv=Bl("round");function pv(t){var e=t.length;return e?t[qy(0,e-1)]:void 0}function dv(t){return pv(Xh(t))}function hv(t,e){var n=-1,r=t.length,o=r-1;for(e=void 0===e?r:e;++n<e;){var i=qy(n,o),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function fv(t,e){return hv(Li(t),Gl(e,0,t.length))}function yv(t,e){var n=Xh(t);return hv(n,Gl(e,0,n.length))}function vv(t){return hv(Li(t))}function gv(t){return hv(Xh(t))}var _v=Il((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function mv(t,e){var n;return ld(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}var bv=Qa((function(t,e){if(null==t)return[];var n=e.length;return n>1&&rs(t,e[0],e[1])?e=[]:n>2&&rs(e[0],e[1],e[2])&&(e=[e[0]]),oy(t,yu(e,1),[])})),Ev=4294967294,xv=Math.floor,wv=Math.min;function Sv(t,e,n,r){var o=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,u=Mo(e),l=void 0===e;o<i;){var c=xv((o+i)/2),p=n(t[c]),d=void 0!==p,h=null===p,f=p==p,y=Mo(p);if(a)var v=r||f;else v=l?f&&(r||d):s?f&&d&&(r||!h):u?f&&d&&!h&&(r||!y):!h&&!y&&(r?p<=e:p<e);v?o=c+1:i=c}return wv(i,Ev)}var Mv=2147483647;function Av(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=Mv){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!Mo(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return Sv(t,e,$o,n)}function Ov(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Va(s,u)){var u=s;i[o++]=0===a?0:a}}return i}var Tv=Math.max;var Nv=Il((function(t,e,n){return t+(n?" ":"")+tl(e)}));var Dv=Io((function(t,e){return t-e}),0);var Pv=Object.prototype,Cv=Pv.hasOwnProperty;function jv(t,e,n,r){return void 0===t||Va(t,Pv[n])&&!Cv.call(r,n)?e:t}var Iv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function kv(t){return"\\"+Iv[t]}var Rv=/<%=([\s\S]+?)%>/g,Lv={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Rv,variable:"",imports:{_:{escape:rh}}},Bv=/\b__p \+= '';/g,zv=/\b(__p \+=) '' \+/g,Hv=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Uv=/[()=,{}\[\]\/\s]/,Xv=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gv=/($^)/,Wv=/['\n\r\u2028\u2029\\]/g,Yv=Object.prototype.hasOwnProperty;function Fv(t,e){return e(t)}var Vv=4294967295,Kv=Math.min;function qv(t,e){var n=t;return n instanceof Di&&(n=n.value()),nl(e,(function(t,e){return e.func.apply(e.thisArg,du([t],e.args))}),n)}function Zv(){return qv(this.__wrapped__,this.__actions__)}var $v=9007199254740991;function Jv(t,e){for(var n=t.length;n--&&ea(e,t[n],0)>-1;);return n}function Qv(t,e){for(var n=-1,r=t.length;++n<r&&ea(e,t[n],0)>-1;);return n}var tg=/^\s+/;var eg=/\w*$/;var ng=rl({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rg=/&(?:amp|lt|gt|quot|#39);/g,og=RegExp(rg.source);var ig=uc&&1/vp(new uc([,-0]))[1]==1/0?function(t){return new uc(t)}:Pi,ag=200;function sg(t,e,n){var r=-1,o=na,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=kd;else if(i>=ag){var l=e?null:ig(t);if(l)return vp(l);a=!1,o=pp,u=new lp}else u=e?[]:s;t:for(;++r<i;){var c=t[r],p=e?e(c):c;if(c=n||0!==c?c:0,a&&p==p){for(var d=u.length;d--;)if(u[d]===p)continue t;e&&u.push(p),s.push(c)}else o(u,p,n)||(u!==s&&u.push(p),s.push(c))}return s}var ug=Qa((function(t){return sg(yu(t,1,Md,!0))})),lg=Qa((function(t){var e=zd(t);return Md(e)&&(e=void 0),sg(yu(t,1,Md,!0),nd(e))})),cg=Qa((function(t){var e=zd(t);return e="function"==typeof e?e:void 0,sg(yu(t,1,Md,!0),void 0,e)}));var pg=0;var dg=Math.max;function hg(t){if(!t||!t.length)return[];var e=0;return t=$l(t,(function(t){if(Md(t))return e=dg(t.length,e),!0})),ss(e,(function(e){return To(t,td(e))}))}function fg(t,e){if(!t||!t.length)return[];var n=hg(t);return null==e?n:To(n,(function(t){return wi(e,void 0,t)}))}function yg(t,e,n,r){return ty(t,e,n(lu(t,e)),r)}var vg=Il((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var gg=Qa((function(t,e){return Md(t)?Ld(t,e):[]}));var _g=gu((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return pu(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Di&&ya(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Fv,args:[o],thisArg:void 0}),new Ri(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)}));function mg(t,e,n){var r=t.length;if(r<2)return r?sg(t[0]):[];for(var o=-1,i=Array(r);++o<r;)for(var a=t[o],s=-1;++s<r;)s!=o&&(i[o]=Ld(i[o]||a,t[s],e,n));return sg(yu(i,1),e,n)}var bg=Qa((function(t){return mg($l(t,Md))})),Eg=Qa((function(t){var e=zd(t);return Md(e)&&(e=void 0),mg($l(t,Md),nd(e))})),xg=Qa((function(t){var e=zd(t);return e="function"==typeof e?e:void 0,mg($l(t,Md),void 0,e)})),wg=Qa(hg);function Sg(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}var Mg=Qa((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,fg(t,n)})),Ag={chunk:function(t,e,n){e=(n?rs(t,e,n):void 0===e)?1:Xl(Zo(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,i=0,a=Array(Ul(r/e));o<r;)a[i++]=Ru(t,o,o+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return du(No(n)?Li(n):[n],yu(e,1))},difference:Bd,differenceBy:Hd,differenceWith:Ud,drop:function(t,e,n){var r=null==t?0:t.length;return r?Ru(t,(e=n||void 0===e?1:Zo(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?Ru(t,0,(e=r-(e=n||void 0===e?1:Zo(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?Gd(t,nd(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?Gd(t,nd(e),!0):[]},fill:function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&rs(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=Zo(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:Zo(r))<0&&(r+=o),r=n>r?0:lh(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:hh,findLastIndex:_h,first:bh,flatten:vu,flattenDeep:function(t){return(null==t?0:t.length)?yu(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?yu(t,e=void 0===e?1:Zo(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},head:bh,indexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Zo(n);return o<0&&(o=Wh(r+o,0)),ea(t,e,o)},initial:function(t){return(null==t?0:t.length)?Ru(t,0,-1):[]},intersection:Kh,intersectionBy:qh,intersectionWith:Zh,join:function(t,e){return null==t?"":Sf.call(t,e)},last:zd,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=Zo(n))<0?Of(r+o,0):Tf(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Qi(t,ta,o,!0)},nth:function(t,e){return t&&t.length?Zf(t,Zo(e)):void 0},pull:Gy,pullAll:Xy,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?Uy(t,e,nd(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?Uy(t,e,void 0,n):t},pullAt:Fy,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=nd(e);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return Yy(t,o),n},reverse:lv,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&rs(t,e,n)?(e=0,n=r):(e=null==e?0:Zo(e),n=void 0===n?r:Zo(n)),Ru(t,e,n)):[]},sortedIndex:function(t,e){return Av(t,e)},sortedIndexBy:function(t,e,n){return Sv(t,e,nd(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Av(t,e);if(r<n&&Va(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Av(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Sv(t,e,nd(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Av(t,e,!0)-1;if(Va(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Ov(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Ov(t,nd(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?Ru(t,1,e):[]},take:function(t,e,n){return t&&t.length?Ru(t,0,(e=n||void 0===e?1:Zo(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?Ru(t,(e=r-(e=n||void 0===e?1:Zo(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?Gd(t,nd(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?Gd(t,nd(e)):[]},union:ug,unionBy:lg,unionWith:cg,uniq:function(t){return t&&t.length?sg(t):[]},uniqBy:function(t,e){return t&&t.length?sg(t,nd(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?sg(t,void 0,e):[]},unzip:hg,unzipWith:fg,without:gg,xor:bg,xorBy:Eg,xorWith:xg,zip:wg,zipObject:function(t,e){return Sg(t||[],e||[],qa)},zipObjectDeep:function(t,e){return Sg(t||[],e||[],ty)},zipWith:Mg},Og={countBy:hd,each:Yd,eachRight:Zd,every:function(t,e,n){var r=No(t)?ah:sh;return n&&rs(t,e,n)&&(e=void 0),r(t,nd(e))},filter:function(t,e){return(No(t)?$l:ch)(t,nd(e))},find:fh,findLast:mh,flatMap:function(t,e){return yu(xh(t,e),1)},flatMapDeep:function(t,e){return yu(xh(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:Zo(n),yu(xh(t,e),n)},forEach:Yd,forEachRight:Zd,groupBy:Nh,includes:function(t,e,n,r){t=ns(t)?t:Xh(t),n=n&&!r?Zo(n):0;var o=t.length;return n<0&&(n=Gh(o+n,0)),Hh(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&ea(t,e,n)>-1},invokeMap:uf,keyBy:Af,map:xh,orderBy:function(t,e,n,r){return null==t?[]:(No(e)||(e=null==e?[]:[e]),No(n=r?void 0:n)||(n=null==n?[]:[n]),oy(t,e,n))},partition:Ly,reduce:av,reduceRight:function(t,e,n){var r=No(t)?sv:iv,o=arguments.length<3;return r(t,nd(e),n,o,qd)},reject:function(t,e){return(No(t)?$l:ch)(t,Yf(nd(e)))},sample:function(t){return(No(t)?pv:dv)(t)},sampleSize:function(t,e,n){return e=(n?rs(t,e,n):void 0===e)?1:Zo(e),(No(t)?fv:yv)(t,e)},shuffle:function(t){return(No(t)?vv:gv)(t)},size:function(t){if(null==t)return 0;if(ns(t))return Hh(t)?Ty(t):t.length;var e=bc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Ps(t).length},some:function(t,e,n){var r=No(t)?cp:mv;return n&&rs(t,e,n)&&(e=void 0),r(t,nd(e))},sortBy:bv},Tg=vd,Ng={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=Zo(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:Ya,before:Cu,bind:ju,bindKey:ku,curry:fd,curryRight:yd,debounce:bd,defer:jd,delay:Id,flip:function(t){return Ga(t,512)},memoize:eu,negate:Yf,once:function(t){return Cu(2,t)},overArgs:ly,partial:ky,partialRight:Ry,rearg:ov,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return Qa(t,e=void 0===e?e:Zo(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:Tv(Zo(e),0),Qa((function(n){var r=n[e],o=Lu(n,0,e);return r&&du(o,r),wi(t,this,o)}))},throttle:function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Ho(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),bd(t,e,{leading:r,maxWait:e,trailing:o})},unary:function(t){return Ya(t,1)},wrap:function(t,e){return ky(Wd(e),t)}},Dg={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return No(t)?t:[t]},clone:function(t){return sp(t,4)},cloneDeep:up,cloneDeepWith:function(t,e){return sp(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return sp(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||rd(t,e,Cs(e))},eq:Va,gt:Ch,gte:jh,isArguments:ds,isArray:No,isArrayBuffer:cf,isArrayLike:ns,isArrayLikeObject:Md,isBoolean:function(t){return!0===t||!1===t||wo(t)&&"[object Boolean]"==xo(t)},isBuffer:gs,isDate:df,isElement:function(t){return wo(t)&&1===t.nodeType&&!Au(t)},isEmpty:function(t){if(null==t)return!0;if(ns(t)&&(No(t)||"string"==typeof t||"function"==typeof t.splice||gs(t)||Ms(t)||ds(t)))return!t.length;var e=bc(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(as(t))return!Ps(t).length;for(var n in t)if(hf.call(t,n))return!1;return!0},isEqual:ff,isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?Hp(t,e,void 0,n):!!r},isError:Nu,isFinite:function(t){return"number"==typeof t&&yf(t)},isFunction:ni,isInteger:vf,isLength:es,isMap:Zc,isMatch:function(t,e){return t===e||Gp(t,e,Yp(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,Gp(t,e,Yp(e),n)},isNaN:function(t){return _f(t)&&t!=+t},isNative:function(t){if(mf(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return fi(t)},isNil:bf,isNull:function(t){return null===t},isNumber:_f,isObject:Ho,isObjectLike:wo,isPlainObject:Au,isRegExp:xf,isSafeInteger:function(t){return vf(t)&&t>=-9007199254740991&&t<=wf},isSet:Jc,isString:Hh,isSymbol:Mo,isTypedArray:Ms,isUndefined:function(t){return void 0===t},isWeakMap:function(t){return wo(t)&&"[object WeakMap]"==bc(t)},isWeakSet:function(t){return wo(t)&&"[object WeakSet]"==xo(t)},lt:Cf,lte:jf,toArray:qf,toFinite:qo,toInteger:Zo,toLength:lh,toNumber:Fo,toPlainObject:Od,toSafeInteger:function(t){return t?Gl(Zo(t),-9007199254740991,$v):0===t?t:0},toString:iu},Pg={add:ko,ceil:zl,divide:Xd,floor:wh,max:function(t){return t&&t.length?kf(t,$o,Dh):void 0},maxBy:function(t,e){return t&&t.length?kf(t,nd(e),Dh):void 0},mean:function(t){return Bf(t,$o)},meanBy:function(t,e){return Bf(t,nd(e))},min:function(t){return t&&t.length?kf(t,$o,Pf):void 0},minBy:function(t,e){return t&&t.length?kf(t,nd(e),Pf):void 0},multiply:Gf,round:cv,subtract:Dv,sum:function(t){return t&&t.length?Rf(t,$o):0},sumBy:function(t,e){return t&&t.length?Rf(t,nd(e)):0}},Cg=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=Fo(n))==n?n:0),void 0!==e&&(e=(e=Fo(e))==e?e:0),Gl(Fo(t),e,n)},jg=function(t,e,n){return e=qo(e),void 0===n?(n=e,e=0):n=qo(n),function(t,e,n){return t>=Bh(e,n)&&t<Lh(e,n)}(t=Fo(t),e,n)},Ig=function(t,e,n){if(n&&"boolean"!=typeof n&&rs(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=qo(t),void 0===e?(e=t,t=0):e=qo(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=Jy();return $y(t+o*(e-t+Zy("1e-"+((o+"").length-1))),e)}return qy(t,e)},kg={assign:Is,assignIn:Bs,assignInWith:zs,assignWith:Hs,at:_u,create:function(t,e){var n=bi(t);return null==e?n:Yl(n,e)},defaults:wd,defaultsDeep:Pd,entries:Jd,entriesIn:Qd,extend:Bs,extendWith:zs,findKey:function(t,e){return yh(t,nd(e),sd)},findLastKey:function(t,e){return yh(t,nd(e),Kd)},forIn:function(t,e){return null==t?t:ad(t,Wd(e),Ls)},forInRight:function(t,e){return null==t?t:Vd(t,Wd(e),Ls)},forOwn:function(t,e){return t&&sd(t,Wd(e))},forOwnRight:function(t,e){return t&&Kd(t,Wd(e))},functions:function(t){return null==t?[]:Oh(t,Cs(t))},functionsIn:function(t){return null==t?[]:Oh(t,Ls(t))},get:cu,has:Rh,hasIn:Zp,invert:Qh,invertBy:rf,invoke:sf,keys:Cs,keysIn:Ls,mapKeys:If,mapValues:function(t,e){var n={};return e=nd(e),sd(t,(function(t,r,o){Fa(n,r,e(t,r,o))})),n},merge:zf,mergeWith:Dd,omit:Qf,omitBy:function(t,e){return ny(t,Yf(nd(e)))},pick:By,pickBy:ny,result:function(t,e,n){var r=-1,o=(e=au(e,t)).length;for(o||(o=1,t=void 0);++r<o;){var i=null==t?void 0:t[uu(e[r])];void 0===i&&(r=o,i=n),t=ni(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:ty(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ty(t,e,n,r)},toPairs:Jd,toPairsIn:Qd,transform:function(t,e,n){var r=No(t),o=r||gs(t)||Ms(t);if(e=nd(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Ho(t)&&ni(i)?bi(mu(t)):{}}return(o?Ji:sd)(t,(function(t,r,o){return e(n,t,r,o)})),n},unset:function(t,e){return null==t||$f(t,e)},update:function(t,e,n){return null==t?t:yg(t,e,Wd(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:yg(t,e,Wd(n),r)},values:Xh,valuesIn:function(t){return null==t?[]:Uh(t,Ls(t))}},Rg={at:_g,chain:Hl,commit:function(){return new Ri(this.value(),this.__chain__)},lodash:Hi,next:function(){void 0===this.__values__&&(this.__values__=qf(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof Ti;){var r=Bi(n);r.__index__=0,r.__values__=void 0,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Di){var e=t;return this.__actions__.length&&(e=new Di(this)),(e=e.reverse()).__actions__.push({func:Fv,args:[lv],thisArg:void 0}),new Ri(e,this.__chain__)}return this.thru(lv)},tap:function(t,e){return e(t),t},thru:Fv,toIterator:function(){return this},toJSON:Zv,value:Zv,valueOf:Zv,wrapperChain:function(){return Hl(this)}},Lg={camelCase:kl,capitalize:el,deburr:sl,endsWith:function(t,e,n){t=iu(t),e=jo(e);var r=t.length,o=n=void 0===n?r:Gl(Zo(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},escape:rh,escapeRegExp:function(t){return(t=iu(t))&&ih.test(t)?t.replace(oh,"\\$&"):t},kebabCase:Mf,lowerCase:Nf,lowerFirst:Df,pad:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Ty(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Dy(Cy(o),n)+t+Dy(Py(o),n)},padEnd:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Ty(t):0;return e&&r<e?t+Dy(e-r,n):t},padStart:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Ty(t):0;return e&&r<e?Dy(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),Iy(iu(t).replace(jy,""),e||0)},repeat:function(t,e,n){return e=(n?rs(t,e,n):void 0===e)?1:Zo(e),fy(iu(t),e)},replace:function(){var t=arguments,e=iu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:_v,split:function(t,e,n){return n&&"number"!=typeof n&&rs(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=iu(t))&&("string"==typeof e||null!=e&&!xf(e))&&!(e=jo(e))&&zu(t)?Lu(Ju(t),0,n):t.split(e,n):[]},startCase:Nv,startsWith:function(t,e,n){return t=iu(t),n=null==n?0:Gl(Zo(n),0,t.length),e=jo(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=Lv.imports._.templateSettings||Lv;n&&rs(t,e,n)&&(e=void 0),t=iu(t),e=zs({},e,r,jv);var o,i,a=zs({},e.imports,r.imports,jv),s=Cs(a),u=Uh(a,s),l=0,c=e.interpolate||Gv,p="__p += '",d=RegExp((e.escape||Gv).source+"|"+c.source+"|"+(c===Rv?Xv:Gv).source+"|"+(e.evaluate||Gv).source+"|$","g"),h=Yv.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,r,a,s,u){return r||(r=a),p+=t.slice(l,u).replace(Wv,kv),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),s&&(i=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),p+="';\n";var f=Yv.call(e,"variable")&&e.variable;if(f){if(Uv.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(i?p.replace(Bv,""):p).replace(zv,"$1").replace(Hv,"$1;"),p="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Du((function(){return Function(s,h+"return "+p).apply(void 0,u)}));if(y.source=p,Nu(y))throw y;return y},templateSettings:Lv,toLower:function(t){return iu(t).toLowerCase()},toUpper:function(t){return iu(t).toUpperCase()},trim:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return zo(t);if(!t||!(e=jo(e)))return t;var r=Ju(t),o=Ju(e);return Lu(r,Qv(r,o),Jv(r,o)+1).join("")},trimEnd:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return t.slice(0,Lo(t)+1);if(!t||!(e=jo(e)))return t;var r=Ju(t);return Lu(r,0,Jv(r,Ju(e))+1).join("")},trimStart:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return t.replace(tg,"");if(!t||!(e=jo(e)))return t;var r=Ju(t);return Lu(r,Qv(r,Ju(e))).join("")},truncate:function(t,e){var n=30,r="...";if(Ho(e)){var o="separator"in e?e.separator:o;n="length"in e?Zo(e.length):n,r="omission"in e?jo(e.omission):r}var i=(t=iu(t)).length;if(zu(t)){var a=Ju(t);i=a.length}if(n>=i)return t;var s=n-Ty(r);if(s<1)return r;var u=a?Lu(a,0,s).join(""):t.slice(0,s);if(void 0===o)return u+r;if(a&&(s+=u.length-s),xf(o)){if(t.slice(s).search(o)){var l,c=u;for(o.global||(o=RegExp(o.source,iu(eg.exec(o))+"g")),o.lastIndex=0;l=o.exec(c);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(t.indexOf(jo(o),s)!=s){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},unescape:function(t){return(t=iu(t))&&og.test(t)?t.replace(rg,ng):t},upperCase:vg,upperFirst:tl,words:Cl},Bg={attempt:Du,bindAll:Iu,cond:function(t){var e=null==t?0:t.length,n=nd;return t=e?To(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Qa((function(n){for(var r=-1;++r<e;){var o=t[r];if(wi(o[0],this,n))return wi(o[1],this,n)}}))},conforms:function(t){return function(t){var e=Cs(t);return function(n){return rd(n,t,e)}}(sp(t,1))},constant:Ki,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Mh,flowRight:Ah,identity:$o,iteratee:function(t){return nd("function"==typeof t?t:sp(t,1))},matches:function(t){return Vp(sp(t,1))},matchesProperty:function(t,e){return Qp(t,sp(e,1))},method:Hf,methodOf:Uf,mixin:Xf,noop:Pi,nthArg:function(t){return t=Zo(t),Qa((function(e){return Zf(e,t)}))},over:ay,overEvery:cy,overSome:py,property:ed,propertyOf:function(t){return function(e){return null==t?void 0:lu(t,e)}},range:nv,rangeRight:rv,stubArray:Jl,stubFalse:hs,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=Zo(t))<1||t>9007199254740991)return[];var n=Vv,r=Kv(t,Vv);e=Wd(e),t-=Vv;for(var o=ss(r,e);++n<t;)e(n);return o},toPath:function(t){return No(t)?To(t,uu):Mo(t)?[t]:Li(ou(iu(t)))},uniqueId:function(t){var e=++pg;return iu(t)+e}};var zg=Math.max,Hg=Math.min;var Ug=Math.min;
|
|
15
|
+
***************************************************************************** */var N=function(){return N=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},N.apply(this,arguments)};function P(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function C(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function I(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C(arguments[e]));return t}var L=Symbol("mobx did run lazy initializers"),j=Symbol("mobx pending decorators"),k={},R={};function B(t){var e,n;if(!0!==t[L]){var r=t[j];if(r){y(t,L,!0);var o=I(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var i=P(o),a=i.next();!a.done;a=i.next()){var s=r[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function z(t,e){return function(){var n,r,o=function(r,o,i,a){if(!0===a)return e(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,j)){var s=r[j];y(r,j,N({},s))}return r[j][o]={prop:o,propertyCreator:e,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(t,e){var n=e?k:R;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return B(this),this[t]},set:function(e){B(this),this[t]=e}})}(o,t)};return(2===(r=arguments).length||3===r.length)&&("string"==typeof r[1]||"symbol"==typeof r[1])||4===r.length&&!0===r[3]?(n=s,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function U(t,e,n){return we(t)?t:Array.isArray(t)?$.array(t,{name:n}):v(t)?$.object(t,void 0,{name:n}):_(t)?$.map(t,{name:n}):m(t)?$.set(t,{name:n}):t}function H(t){return t}function X(t){d(t);var e=z(!0,(function(e,n,r,o,i){var a=r?r.initializer?r.initializer.call(e):r.value:void 0;un(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var G={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function W(t){return null==t?G:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(G);var Y=X(U),V=X((function(t,e,n){return null==t||hn(t)||Je(t)||nn(t)||an(t)?t:Array.isArray(t)?$.array(t,{name:n,deep:!1}):v(t)?$.object(t,void 0,{name:n,deep:!1}):_(t)?$.map(t,{name:n,deep:!1}):m(t)?$.set(t,{name:n,deep:!1}):c(!1)})),F=X(H),K=X((function(t,e,n){return _n(t,e)?e:t}));function q(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?H:U}var Z={box:function(t,e){arguments.length>2&&J("box");var n=W(e);return new Tt(t,q(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&J("array");var n=W(e);return function(t,e,n,r){void 0===n&&(n="ObservableArray@"+l());void 0===r&&(r=!1);var o=new Ke(n,e,r);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(o.values,w,o);var i=new Proxy(o.values,Fe);if(o.proxy=i,t&&t.length){var a=Mt(!0);o.spliceWithArray(0,0,t),wt(a)}return i}(t,q(n),n.name)},map:function(t,e){arguments.length>2&&J("map");var n=W(e);return new en(t,q(n),n.name)},set:function(t,e){arguments.length>2&&J("set");var n=W(e);return new on(t,q(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&J("object");var r=W(n);if(!1===r.proxy)return de({},t,e,r);var o=pe(r),i=function(t){var e=new Proxy(t,Ue);return t[w].proxy=e,e}(de({},void 0,void 0,r));return he(i,t,e,o),i},ref:F,shallow:V,deep:Y,struct:K},$=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Y.apply(null,arguments);if(we(t))return t;var r=v(t)?$.object(t,e,n):Array.isArray(t)?$.array(t,e):_(t)?$.map(t,e):m(t)?$.set(t,e):t;if(r!==t)return r;c(!1)};function J(t){c("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(Z).forEach((function(t){return $[t]=Z[t]}));var Q,tt,et=z(!1,(function(t,e,n,r,o){var i=n.get,a=n.set,s=o[0]||{};un(t).addComputedProp(t,e,N({get:i,set:a,context:t},s))})),nt=et({equals:O.structural}),rt=function(t,e,n){if("string"==typeof e)return et.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return et.apply(null,arguments);var r="object"==typeof e?e:{};return r.get=t,r.set="function"==typeof e?e:r.set,r.name=r.name||t.name||"",new At(r)};rt.struct=nt,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Q||(Q={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(tt||(tt={}));var ot=function(t){this.cause=t};function it(t){return t instanceof ot}function at(t){switch(t.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var e=ht(!0),n=dt(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Ot(a)){if(jt.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return pt(n),ft(e),!0}if(t.dependenciesState===Q.STALE)return pt(n),ft(e),!0}}return vt(t),pt(n),ft(e),!1}}function st(t){var e=t.observers.size>0;jt.computationDepth>0&&e&&c(!1),jt.allowStateChanges||!e&&"strict"!==jt.enforceActions||c(!1)}function ut(t,e,n){var r=ht(!0);vt(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++jt.runId;var o,i=jt.trackingDerivation;if(jt.trackingDerivation=t,!0===jt.disableErrorBoundaries)o=e.call(n);else try{o=e.call(n)}catch(t){o=new ot(t)}return jt.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Q.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,o!==a&&(n[o]=s),o++),s.dependenciesState>r&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&Rt(s,t),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,kt(s,t))}r!==Q.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),ft(r),o}function lt(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Rt(e[n],t);t.dependenciesState=Q.NOT_TRACKING}function ct(t){var e=dt();try{return t()}finally{pt(e)}}function dt(){var t=jt.trackingDerivation;return jt.trackingDerivation=null,t}function pt(t){jt.trackingDerivation=t}function ht(t){var e=jt.allowStateReads;return jt.allowStateReads=t,e}function ft(t){jt.allowStateReads=t}function vt(t){if(t.dependenciesState!==Q.UP_TO_DATE){t.dependenciesState=Q.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Q.UP_TO_DATE}}var yt=0,gt=1,_t=Object.getOwnPropertyDescriptor((function(){}),"name");function mt(t,e,n){var r=function(){return bt(t,e,n||this,arguments)};return r.isMobxAction=!0,r}function bt(t,e,n,r){var o=xt();try{return e.apply(n,r)}catch(t){throw o.error=t,t}finally{Et(o)}}function xt(t,e,n){var r=dt();zt();var o={prevDerivation:r,prevAllowStateChanges:Mt(!0),prevAllowStateReads:ht(!0),notifySpy:false,startTime:0,actionId:gt++,parentActionId:yt};return yt=o.actionId,o}function Et(t){yt!==t.actionId&&c("invalid action stack. did you forget to finish an action?"),yt=t.parentActionId,void 0!==t.error&&(jt.suppressReactionErrors=!0),wt(t.prevAllowStateChanges),ft(t.prevAllowStateReads),Ut(),pt(t.prevDerivation),t.notifySpy,jt.suppressReactionErrors=!1}function Mt(t){var e=jt.allowStateChanges;return jt.allowStateChanges=t,e}function wt(t){jt.allowStateChanges=t}_t&&_t.configurable;var Tt=function(t){function e(e,n,r,o,i){void 0===r&&(r="ObservableValue@"+l()),void 0===o&&(o=!0),void 0===i&&(i=O.default);var a=t.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,r),a}return function(t,e){function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==jt.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(st(this),He(this)){var e=Ge(this,{object:this,type:"update",newValue:t});if(!e)return jt.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?jt.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),We(this)&&Ve(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return Xe(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ye(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return E(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(T),St=g("ObservableValue",Tt),At=function(){function t(t){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+l(),this.value=new ot(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=tt.NONE,d(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+l(),t.set&&(this.setter=mt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?O.structural:O.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Q.UP_TO_DATE)return;t.lowestObserverState=Q.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.dependenciesState=Q.POSSIBLY_STALE,e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&c("Cycle detected in computation "+this.name+": "+this.derivation),0!==jt.inBatch||0!==this.observers.size||this.keepAlive?(Ht(this),at(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.POSSIBLY_STALE?e.dependenciesState=Q.STALE:e.dependenciesState===Q.UP_TO_DATE&&(t.lowestObserverState=Q.UP_TO_DATE)}))}(this)):at(this)&&(this.warnAboutUntrackedRead(),zt(),this.value=this.computeValue(!1),Ut());var t=this.value;if(it(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(it(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){d(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else d(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=e||it(t)||it(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,jt.computationDepth++,t)e=ut(this,this.derivation,this.scope);else if(!0===jt.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new ot(t)}return jt.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(lt(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return re((function(){var i=n.get();if(!r||e){var a=dt();t({type:"update",object:n,newValue:i,oldValue:o}),pt(a)}r=!1,o=i}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return E(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Ot=g("ComputedValue",At),Dt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Nt=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Pt={};function Ct(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Pt}var It=!0,Lt=!1,jt=function(){var t=Ct();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(It=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Nt).version&&(It=!1),It?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Nt):(setTimeout((function(){Lt||c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Nt)}();function kt(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Rt(t,e){t.observers.delete(e),0===t.observers.size&&Bt(t)}function Bt(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,jt.pendingUnobservations.push(t))}function zt(){jt.inBatch++}function Ut(){if(0==--jt.inBatch){Ft();for(var t=jt.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof At&&n.suspend())}jt.pendingUnobservations=[]}}function Ht(t){var e=jt.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&jt.inBatch>0&&Bt(t),!1)}function Xt(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===tt.BREAK){var n=[];Gt(fe(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof At?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Gt(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return Gt(t,e,n+1)})))}var Wt=function(){function t(t,e,n,r){void 0===t&&(t="Reaction@"+l()),void 0===r&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=tt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,jt.pendingReactions.push(this),Ft())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(zt(),this._isScheduled=!1,at(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}Ut()}},t.prototype.track=function(t){if(!this.isDisposed){zt(),this._isRunning=!0;var e=ut(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&<(this),it(e)&&this.reportExceptionInDerivation(e.cause),Ut()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(jt.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";jt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),jt.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(zt(),lt(this),Ut()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[w]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),je(this,t)},t}();var Yt=100,Vt=function(t){return t()};function Ft(){jt.inBatch>0||jt.isRunningReactions||Vt(Kt)}function Kt(){jt.isRunningReactions=!0;for(var t=jt.pendingReactions,e=0;t.length>0;){++e===Yt&&(console.error("Reaction doesn't converge to a stable state after "+Yt+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}jt.isRunningReactions=!1}var qt=g("Reaction",Wt);function Zt(t){var e=Vt;Vt=function(n){return t((function(){return e(n)}))}}function $t(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function Jt(){c(!1)}function Qt(t){return function(e,n,r){if(r){if(r.value)return{value:mt(t,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return mt(t,o.call(this))}}}return function(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){y(this,n,te(t,e))}})}}(t).apply(this,arguments)}}var te=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?mt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?mt(t,e):1===arguments.length&&"string"==typeof t?Qt(t):!0!==r?Qt(e).apply(null,arguments):void y(t,e,mt(t.name||e,n.value,this))};function ee(t,e){"string"==typeof t||t.name;return bt(0,"function"==typeof t?t:e,this,void 0)}function ne(t,e,n){y(t,e,mt(e,n.bind(t)))}function re(t,e){void 0===e&&(e=u);var n,r=e&&e.name||t.name||"Autorun@"+l();if(!e.scheduler&&!e.delay)n=new Wt(r,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var o=ie(e),i=!1;n=new Wt(r,(function(){i||(i=!0,o((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}te.bound=function(t,e,n,r){return!0===r?(ne(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ne(this,e,n.value||n.initializer.call(this)),this[e]},set:Jt}:{enumerable:!1,configurable:!0,set:function(t){ne(this,e,t)},get:function(){}}};var oe=function(t){return t()};function ie(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:oe}function ae(t,e,n){void 0===n&&(n=u);var r,o,i,a=n.name||"Reaction@"+l(),s=te(a,n.onError?(r=n.onError,o=e,function(){try{return o.apply(this,arguments)}catch(t){r.call(this,t)}}):e),c=!n.scheduler&&!n.delay,d=ie(n),p=!0,h=!1,f=n.compareStructural?O.structural:n.equals||O.default,v=new Wt(a,(function(){p||c?y():h||(h=!0,d(y))}),n.onError,n.requiresObservable);function y(){if(h=!1,!v.isDisposed){var e=!1;v.track((function(){var n=t(v);e=p||!f(i,n),i=n})),p&&n.fireImmediately&&s(i,v),p||!0!==e||s(i,v),p&&(p=!1)}}return v.schedule(),v.getDisposer()}function se(t,e,n){return le("onBecomeObserved",t,e,n)}function ue(t,e,n){return le("onBecomeUnobserved",t,e,n)}function le(t,e,n,r){var o="function"==typeof r?fn(e,n):fn(e),i="function"==typeof r?r:n,a=t+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[t]?c(!1):function(){var t=o[a];t&&(t.delete(i),0===t.size&&delete o[a])}}function ce(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,o=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((jt.pendingReactions.length||jt.inBatch||jt.isRunningReactions)&&c("isolateGlobalState should be called before MobX is running any reactions"),Lt=!0,It&&(0==--Ct().__mobxInstanceCount&&(Ct().__mobxGlobals=void 0),jt=new Nt)),void 0!==e){var u=void 0;switch(e){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:c("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}jt.enforceActions=u,jt.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(jt.computedRequiresReaction=!!n),void 0!==a&&(jt.reactionRequiresObservable=!!a),void 0!==s&&(jt.observableRequiresReaction=!!s,jt.allowStateReads=!jt.observableRequiresReaction),void 0!==r&&(jt.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),jt.disableErrorBoundaries=!!o),i&&Zt(i)}function de(t,e,n,r){var o=pe(r=W(r));return B(t),un(t,r.name,o.enhancer),e&&he(t,e,n,o),t}function pe(t){return t.defaultDecorator||(!1===t.deep?F:Y)}function he(t,e,n,r){var o,i;zt();try{var a=M(e);try{for(var s=P(a),u=s.next();!u.done;u=s.next()){var l=u.value,c=Object.getOwnPropertyDescriptor(e,l);0;var d=n&&l in n?n[l]:c.get?et:r;0;var p=d(t,l,c,!0);p&&Object.defineProperty(t,l,p)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{Ut()}}function fe(t,e){return ve(fn(t,e))}function ve(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(ve)),r}function ye(t){var e={name:t.name};return function(t){return t.observers&&t.observers.size>0}(t)&&(e.observers=Array.from(function(t){return t.observers}(t)).map(ye)),e}var ge=0;function _e(){this.message="FLOW_CANCELLED"}function me(t){"function"==typeof t.cancel&&t.cancel()}function be(t,e){if(null==t)return!1;if(void 0!==e){if(!1===hn(t))return!1;if(!t[w].values.has(e))return!1;var n=fn(t,e);return Ot(n)}return Ot(t)}function xe(t){return arguments.length>1?c(!1):be(t)}function Ee(t,e){return"string"!=typeof e?c(!1):be(t,e)}function Me(t,e){return null!=t&&(void 0!==e?!!hn(t)&&t[w].values.has(e):hn(t)||!!t[w]||S(t)||qt(t)||Ot(t))}function we(t){return 1!==arguments.length&&c(!1),Me(t)}function Te(t){return hn(t)?t[w].getKeys():nn(t)||an(t)?Array.from(t.keys()):Je(t)?t.map((function(t,e){return e})):c(!1)}function Se(t){return hn(t)?Te(t).map((function(e){return t[e]})):nn(t)?Te(t).map((function(e){return t.get(e)})):an(t)?Array.from(t.values()):Je(t)?t.slice():c(!1)}function Ae(t){return hn(t)?Te(t).map((function(e){return[e,t[e]]})):nn(t)?Te(t).map((function(e){return[e,t.get(e)]})):an(t)?Array.from(t.entries()):Je(t)?t.map((function(t,e){return[e,t]})):c(!1)}function Oe(t,e,n){if(2!==arguments.length||an(t))if(hn(t)){var r=t[w];r.values.get(e)?r.write(e,n):r.addObservableProp(e,n,r.defaultEnhancer)}else if(nn(t))t.set(e,n);else if(an(t))t.add(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),d(e>=0,"Not a valid index: '"+e+"'"),zt(),e>=t.length&&(t.length=e+1),t[e]=n,Ut()}else{zt();var o=e;try{for(var i in o)Oe(t,i,o[i])}finally{Ut()}}}function De(t,e){return hn(t)?vn(t).has(e):nn(t)||an(t)?t.has(e):Je(t)?e>=0&&e<t.length:c(!1)}function Ne(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return vn(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return vn(t).observe(e,n)}(t,e,n)}_e.prototype=Object.create(Error.prototype);var Pe={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ce(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function Ie(t,e,n){if(!e.recurseEverything&&!we(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(St(t))return Ie(t.get(),e,n);if(we(t)&&Te(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Je(t)||Array.isArray(t)){var r=Ce(n,t,[],e),o=t.map((function(t){return Ie(t,e,n)}));r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(an(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Ce(n,t,new Set,e);return t.forEach((function(t){s.add(Ie(t,e,n))})),s}var u=Ce(n,t,[],e);return t.forEach((function(t){u.push(Ie(t,e,n))})),u}if(nn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var l=Ce(n,t,new Map,e);return t.forEach((function(t,r){l.set(r,Ie(t,e,n))})),l}var c=Ce(n,t,{},e);return t.forEach((function(t,r){c[r]=Ie(t,e,n)})),c}var d=Ce(n,t,{},e);return b(t).forEach((function(r){d[r]=Ie(t[r],e,n)})),d}function Le(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Pe),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),Ie(t,e,n)}function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=function(t){switch(t.length){case 0:return jt.trackingDerivation;case 1:return fn(t[0]);case 2:return fn(t[0],t[1])}}(t);if(!r)return c(!1);r.isTracing===tt.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?tt.BREAK:tt.LOG}function ke(t,e){void 0===e&&(e=void 0),zt();try{return t.apply(e)}finally{Ut()}}function Re(t,e,n){var r;"number"==typeof n.timeout&&(r=setTimeout((function(){if(!i[w].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+l();var o=mt(n.name+"-effect",e),i=re((function(e){t()&&(e.dispose(),r&&clearTimeout(r),o())}),n);return i}function Be(t){return t[w]}function ze(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var Ue={has:function(t,e){if(e===w||"constructor"===e||e===L)return!0;var n=Be(t);return ze(e)?n.has(e):e in t},get:function(t,e){if(e===w||"constructor"===e||e===L)return t[e];var n=Be(t),r=n.values.get(e);if(r instanceof T){var o=r.get();return void 0===o&&n.has(e),o}return ze(e)&&n.has(e),t[e]},set:function(t,e,n){return!!ze(e)&&(Oe(t,e,n),!0)},deleteProperty:function(t,e){return!!ze(e)&&(Be(t).remove(e),!0)},ownKeys:function(t){return Be(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return c("Dynamic observable objects cannot be frozen"),!1}};function He(t){return void 0!==t.interceptors&&t.interceptors.length>0}function Xe(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),p((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ge(t,e){var n=dt();try{for(var r=I(t.interceptors||[]),o=0,i=r.length;o<i&&(d(!(e=r[o](e))||e.type,"Intercept handlers should return nothing or a change object"),e);o++);return e}finally{pt(n)}}function We(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Ye(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),p((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ve(t,e){var n=dt(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](e);pt(n)}}var Fe={get:function(t,e){return e===w?t[w]:"length"===e?t[w].getArrayLength():"number"==typeof e?qe.get.call(t,e):"string"!=typeof e||isNaN(e)?qe.hasOwnProperty(e)?qe[e]:t[e]:qe.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[w].setArrayLength(n),"number"==typeof e&&qe.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:qe.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return c("Observable arrays cannot be frozen"),!1}};var Ke=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new T(t||"ObservableArray@"+l()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ye(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var r=this;st(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=s),He(this)){var i=Ge(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return s;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return r.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,I([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),o&&Ve(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),o&&Ve(this,i)},t}(),qe={intercept:function(t){return this[w].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[w].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[w];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this[w];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray(t);case 2:return o.spliceWithArray(t,e)}return o.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[w].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[w];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[w].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[w];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[w],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[w];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[w],r=n.values;if(t<r.length){st(n.atom);var o=r[t];if(He(n)){var i=Ge(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,o))!==o&&(r[t]=e,n.notifyArrayChildUpdate(t,e,o))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(){var e=this[w];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(e,n){var r=this,o=this[w];return o.atom.reportObserved(),o.dehanceValues(o.values)[t]((function(t,o){return e.call(n,t,o,r)}),n)})})),["reduce","reduceRight"].forEach((function(t){qe[t]=function(){var e=this,n=this[w];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(t,o,i){return o=n.dehanceValue(o),r(t,o,i,e)},n.values[t].apply(n.values,arguments)}}));var Ze,$e=g("ObservableArrayAdministration",Ke);function Je(t){return f(t)&&$e(t[w])}var Qe,tn={},en=function(){function t(t,e,n){if(void 0===e&&(e=U),void 0===n&&(n="ObservableMap@"+l()),this.enhancer=e,this.name=n,this[Ze]=tn,this._keysAtom=A(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!jt.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var r=n=new Tt(this._has(t),H,this.name+"."+x(t)+"?",!1);this._hasMap.set(t,r),ue(r,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(He(this)){var r=Ge(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((st(this._keysAtom),He(this))&&!(r=Ge(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return ke((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Ve(this,r),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==jt.UNCHANGED){var r=!1,o=We(this),i=o?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r,n.setNewValue(e),o&&Ve(this,i)}},t.prototype._addValue=function(t,e){var n=this;st(this._keysAtom),ke((function(){var r=new Tt(e,n.enhancer,n.name+"."+x(t),!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var r=We(this);r&&Ve(this,r?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return En({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:t.get(o)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return En({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,t.get(o)]}}})},t.prototype[(Ze=w,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=C(i.value,2),s=a[0],u=a[1];t.call(e,u,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return nn(t)&&(t=t.toJS()),ke((function(){var n=Mt(!0);try{v(t)?b(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=C(t,2),r=n[0],o=n[1];return e.set(r,o)})):_(t)?(t.constructor!==Map&&c("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&c("Cannot initialize map from "+t)}finally{wt(n)}})),this},t.prototype.clear=function(){var t=this;ke((function(){ct((function(){var e,n;try{for(var r=P(t.keys()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return ke((function(){var n,r,o,i,a=function(t){if(_(t)||nn(t))return t;if(Array.isArray(t))return new Map(t);if(v(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return c("Cannot convert to map from '"+t+"'")}(t),s=new Map,u=!1;try{for(var l=P(e._data.keys()),d=l.next();!d.done;d=l.next()){var p=d.value;if(!a.has(p))if(e.delete(p))u=!0;else{var h=e._data.get(p);s.set(p,h)}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}try{for(var f=P(a.entries()),y=f.next();!y.done;y=f.next()){var g=C(y.value,2),m=(p=g[0],h=g[1],e._data.has(p));if(e.set(p,h),e._data.has(p)){var b=e._data.get(p);s.set(p,b),m||(u=!0)}}}catch(t){o={error:t}}finally{try{y&&!y.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(!u)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var x=e._data.keys(),E=s.keys(),M=x.next(),w=E.next();!M.done;){if(M.value!==w.value){e._keysAtom.reportChanged();break}M=x.next(),w=E.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var r=P(this),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:x(a)]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return x(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t}(),nn=g("ObservableMap",en),rn={},on=function(){function t(t,e,n){if(void 0===e&&(e=U),void 0===n&&(n="ObservableSet@"+l()),this.name=n,this[Qe]=rn,this._data=new Set,this._atom=A(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,r){return e(t,r,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;ke((function(){ct((function(){var e,n;try{for(var r=P(t._data.values()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((st(this._atom),He(this))&&!(r=Ge(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){ke((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=We(this),r=n?{type:"add",object:this,newValue:t}:null;n&&Ve(this,r)}return this},t.prototype.delete=function(t){var e=this;if(He(this)&&!(r=Ge(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:t}:null;return ke((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Ve(this,r),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return En({next:function(){var r=t;return t+=1,r<n.length?{value:[e[r],n[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return En({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return an(t)&&(t=t.toJS()),ke((function(){var n=Mt(!0);try{Array.isArray(t)||m(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&c("Cannot initialize set from "+t)}finally{wt(n)}})),this},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(Qe=w,Symbol.iterator)]=function(){return this.values()},t}(),an=g("ObservableSet",on),sn=function(){function t(t,e,n,r){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=r,this.keysAtom=new T(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,r=this.values.get(t);if(r instanceof At)r.set(e);else{if(He(this)){if(!(a=Ge(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=a.newValue}if((e=r.prepareNewValue(e))!==jt.UNCHANGED){var o=We(this),i=!1,a=o?{type:"update",object:this.proxy||n,oldValue:r.value,name:t,newValue:e}:null;i,r.setNewValue(e),o&&Ve(this,a)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var r=!!this.values.get(t);return n=new Tt(r,H,this.name+"."+x(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var r=this.target;if(He(this)){var o=Ge(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!o)return;e=o.newValue}var i=new Tt(e,n,this.name+"."+x(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(r,t,function(t){return ln[t]||(ln[t]={configurable:!0,enumerable:!0,get:function(){return this[w].read(t)},set:function(e){this[w].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var r=this.target;n.name=n.name||this.name+"."+x(e),this.values.set(e,new At(n)),(t===r||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return cn[t]||(cn[t]={configurable:jt.computedConfigurable,enumerable:!1,get:function(){return dn(this).read(t)},set:function(e){dn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(He(this))if(!(s=Ge(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{zt();var n=We(this),r=!1,o=this.values.get(t),i=o&&o.get();if(o&&o.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:i,name:t}:null;r,n&&Ve(this,s)}finally{Ut()}}},t.prototype.illegalAccess=function(t,e){console.warn("Property '"+e+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=We(this),r=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Ve(this,r),this.pendingKeys){var o=this.pendingKeys.get(t);o&&o.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var r=P(this.values),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0];i[1]instanceof Tt&&n.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t}();function un(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=U),Object.prototype.hasOwnProperty.call(t,w))return t[w];v(t)||(e=(t.constructor.name||"ObservableObject")+"@"+l()),e||(e="ObservableObject@"+l());var r=new sn(t,new Map,x(e),n);return y(t,w,r),r}var ln=Object.create(null),cn=Object.create(null);function dn(t){var e=t[w];return e||(B(t),t[w])}var pn=g("ObservableObjectAdministration",sn);function hn(t){return!!f(t)&&(B(t),pn(t[w]))}function fn(t,e){if("object"==typeof t&&null!==t){if(Je(t))return void 0!==e&&c(!1),t[w].atom;if(an(t))return t[w];if(nn(t)){var n=t;return void 0===e?n._keysAtom:((r=n._data.get(e)||n._hasMap.get(e))||c(!1),r)}var r;if(B(t),e&&!t[w]&&t[e],hn(t))return e?((r=t[w].values.get(e))||c(!1),r):c(!1);if(S(t)||Ot(t)||qt(t))return t}else if("function"==typeof t&&qt(t[w]))return t[w];return c(!1)}function vn(t,e){return t||c("Expecting some object"),void 0!==e?vn(fn(t,e)):S(t)||Ot(t)||qt(t)||nn(t)||an(t)?t:(B(t),t[w]?t[w]:void c(!1))}function yn(t,e){return(void 0!==e?fn(t,e):hn(t)||nn(t)||an(t)?vn(t):fn(t)).name}var gn=Object.prototype.toString;function _n(t,e,n){return void 0===n&&(n=-1),mn(t,e,n)}function mn(t,e,n,r,o){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;if("function"!==i&&"object"!==i&&"object"!=typeof e)return!1;var a=gn.call(t);if(a!==gn.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=bn(t),e=bn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,l=e.constructor;if(u!==l&&!("function"==typeof u&&u instanceof u&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var c=(r=r||[]).length;c--;)if(r[c]===t)return o[c]===e;if(r.push(t),o.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!mn(t[c],e[c],n-1,r,o))return!1}else{var d=Object.keys(t),p=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!xn(e,p=d[c])||!mn(t[p],e[p],n-1,r,o))return!1}return r.pop(),o.pop(),!0}function bn(t){return Je(t)?t.slice():_(t)||nn(t)||m(t)||an(t)?Array.from(t.entries()):t}function xn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function En(t){return t[Symbol.iterator]=Mn,t}function Mn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$t,extras:{getDebugName:yn},$mobx:w});var wn=Object.freeze({__proto__:null,$mobx:w,FlowCancellationError:_e,get IDerivationState(){return Q},ObservableMap:en,ObservableSet:on,Reaction:Wt,_allowStateChanges:function(t,e){var n,r=Mt(t);try{n=e()}finally{wt(r)}return n},_allowStateChangesInsideComputed:function(t){var e,n=jt.computationDepth;jt.computationDepth=0;try{e=t()}finally{jt.computationDepth=n}return e},_allowStateReadsEnd:ft,_allowStateReadsStart:ht,_endAction:Et,_getAdministration:vn,_getGlobalState:function(){return jt},_interceptReads:function(t,e,n){var r;if(nn(t)||Je(t)||St(t))r=vn(t);else{if(!hn(t))return c(!1);if("string"!=typeof e)return c(!1);r=vn(t,e)}return void 0!==r.dehancer?c(!1):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},_isComputingDerivation:function(){return null!==jt.trackingDerivation},_resetGlobalState:function(){var t=new Nt;for(var e in t)-1===Dt.indexOf(e)&&(jt[e]=t[e]);jt.allowStateChanges=!jt.enforceActions},_startAction:xt,action:te,autorun:re,comparer:O,computed:rt,configure:ce,createAtom:A,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,r=function(t){var r=e[t];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,t),i=r.reduce((function(e,r){return r(n,t,e)}),o);i&&Object.defineProperty(n,t,i)};for(var o in e)r(o);return t},entries:Ae,extendObservable:de,flow:function(t){1!==arguments.length&&c("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,r=arguments,o=++ge,i=te(e+" - runid: "+o+" - init",t).apply(this,r),a=void 0,s=new Promise((function(t,r){var s=0;function u(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.next).call(i,t)}catch(t){return r(t)}c(n)}function l(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.throw).call(i,t)}catch(t){return r(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(u,l);e.then(c,r)}n=r,u(void 0)}));return s.cancel=te(e+" - runid: "+o+" - cancel",(function(){try{a&&me(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(h,h),me(e),n(new _e)}catch(t){n(t)}})),s}},get:function(t,e){if(De(t,e))return hn(t)?t[e]:nn(t)?t.get(e):Je(t)?t[e]:c(!1)},getAtom:fn,getDebugName:yn,getDependencyTree:fe,getObserverTree:function(t,e){return ye(fn(t,e))},has:De,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return vn(t,e).intercept(n)}(t,e,n):function(t,e){return vn(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||Je(t)},isBoxedObservable:St,isComputed:xe,isComputedProp:Ee,isFlowCancellationError:function(t){return t instanceof _e},isObservable:we,isObservableArray:Je,isObservableMap:nn,isObservableObject:hn,isObservableProp:function(t,e){return"string"!=typeof e?c(!1):Me(t,e)},isObservableSet:an,keys:Te,observable:$,observe:Ne,onBecomeObserved:se,onBecomeUnobserved:ue,onReactionError:function(t){return jt.globalReactionErrorHandlers.push(t),function(){var e=jt.globalReactionErrorHandlers.indexOf(t);e>=0&&jt.globalReactionErrorHandlers.splice(e,1)}},reaction:ae,remove:function(t,e){if(hn(t))t[w].remove(e);else if(nn(t))t.delete(e);else if(an(t))t.delete(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),d(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:ee,set:Oe,spy:$t,toJS:Le,trace:je,transaction:ke,untracked:ct,values:Se,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,r=new Promise((function(r,o){var i=Re(t,r,N(N({},e),{onError:o}));n=function(){i(),o("WHEN_CANCELLED")}}));return r.cancel=n,r}(t,e):Re(t,e,n||{})}}),Tn=n(wn);!function(t,n){!function(t,n,r){function o(t){return!(t.prototype&&t.prototype.render||n.Component.isPrototypeOf(t))}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,r=void 0===n?"":n,o=e.suffix,i=void 0===o?"":o;return r+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},d=!1,p=console;function h(t){d=t}function f(t){var e=r._getGlobalState().allowStateChanges;return r._getGlobalState().allowStateChanges=t,e}function v(t){r._getGlobalState().allowStateChanges=t}function y(t,e,n,r,o){var i=f(t),a=void 0;try{a=e(n,r,o)}finally{v(i)}return a}function g(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t[e],o=m[e],i=r?!0===n?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;t[e]=i}function _(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":a(t))||"object"!==(void 0===e?"undefined":a(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(e[r]!==t[r])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==d){var e=i(this),o=!1,a=!1;h.call(this,"props"),h.call(this,"state");var s=this.render.bind(this),u=null,l=!1,c=function(){return(u=new r.Reaction(e+".render()",(function(){if(!l&&(l=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var e=!0;try{a=!0,o||n.Component.prototype.forceUpdate.call(t),e=!1}finally{a=!1,e&&u.dispose()}}}))).reactComponent=t,p.$mobx=u,t.render=p,p(t.props,t.state,t.context)},p=function(t,e,n){l=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=y(!1,s,t,e,n)}catch(t){r=t}})),r)throw r;return o};this.render=c}function h(t){var e=this[t],n=r.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return n.reportObserved(),e},set:function(t){!a&&_(e,t)?(e=t,o=!0,n.reportChanged(),o=!1):e=t}})}},componentWillUnmount:function(){!0!==d&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return d&&p.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||_(this.props,t)}};function b(t){var e,r;if(arguments.length>1&&p.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===t.isMobxInjector&&p.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),o(t))return b((r=e=function(e){function n(){return s(this,n),c(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,e),u(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(n.Component),e.displayName=i(t),r));if(!t)throw new Error("Please pass a valid component to 'observer'");return x(t.prototype||t),t.isMobXReactObserver=!0,t}function x(t){g(t,"componentWillMount",!0),g(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=m.shouldComponentUpdate)}var E=b((function(t){return t.children[0]()}));function M(t,e){return t(e={exports:{}},e.exports),e.exports}E.displayName="Observer","undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var w=M((function(t,e){!function(e,n){t.exports=n()}(0,(function(){var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function u(l,c,d){if("string"!=typeof c){if(s){var p=a(c);p&&p!==s&&u(l,p,d)}var h=r(c);o&&(h=h.concat(o(c)));for(var f=0;f<h.length;++f){var v=h[f];if(!(t[v]||e[v]||d&&d[v])){var y=i(c,v);try{n(l,v,y)}catch(t){}}}return l}return l}}))})),T={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function S(t,e,r){var o,a,d=i(e,{prefix:"inject-",suffix:r?"-with-"+r:""}),p=(a=o=function(r){function o(){return s(this,o),c(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return l(o,r),u(o,[{key:"render",value:function(){var r={};for(var o in this.props)this.props.hasOwnProperty(o)&&(r[o]=this.props[o]);var i=t(this.context.mobxStores||{},r,this.context)||{};for(var a in i)r[a]=i[a];return n.h(e,r)}}]),o}(n.Component),o.displayName=d,a);return w(p,e),p.wrappedComponent=e,Object.defineProperties(p,T),p}function A(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function O(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=S(t,e);return n.isMobxInjector=!1,(n=b(n)).isMobxInjector=!0,n};for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t=A(e),function(n){return S(t,n,e.join("-"))}}function D(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");return Array.isArray(t)?e?O.apply(null,t)(D(e)):function(e){return D(t,e)}:b(t)}var N={children:!0,key:!0,ref:!0},P=console,C=function(t){function e(){return s(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),u(e,[{key:"render",value:function(t){var e=t.children;return e.length>1?n.h("div",null," ",e," "):e[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var r in this.props)N[r]||"suppressChangedStoreWarning"===r||(t[r]=this.props[r]);return{mobxStores:t}}},{key:"componentWillReceiveProps",value:function(t){if(Object.keys(t).length!==Object.keys(this.props).length&&P.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!t.suppressChangedStoreWarning)for(var e in t)N[e]||this.props[e]===t[e]||P.warn("MobX Provider: Provided store '"+e+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(n.Component);if(!n.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=E,t.useStaticRendering=h,t.connect=D,t.inject=O,t.Provider=C,Object.defineProperty(t,"__esModule",{value:!0})}(n,function(){if(r)return i;r=1;var t,e,n,o,a,s,u,l,c,d,p,h,f={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function _(t,e){for(var n in e)t[n]=e[n];return t}function m(t){var e=t.parentNode;e&&e.removeChild(t)}function b(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return x(e,s,o,i,null)}function x(t,r,o,i,a){var s={type:t,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++n:a,__i:-1,__u:0};return null==a&&null!=e.vnode&&e.vnode(s),s}function E(t){return t.children}function M(t,e){this.props=t,this.context=e}function w(t,e){if(null==e)return t.__?w(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?w(t):null}function T(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return T(t)}}function S(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!A.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||u)(A)}function A(){var t,n,r,o,i,s,u,c;for(a.sort(l);t=a.shift();)t.__d&&(n=a.length,o=void 0,s=(i=(r=t).__v).__e,u=[],c=[],r.__P&&((o=_({},i)).__v=i.__v+1,e.vnode&&e.vnode(o),j(r.__P,o,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,u,null==s?w(i):s,!!(32&i.__u),c),o.__v=i.__v,o.__.__k[o.__i]=o,k(u,o,c),o.__e!=s&&T(o)),a.length>n&&a.sort(l));A.__r=0}function O(t,e,n,r,o,i,a,s,u,l,c){var d,p,h,y,g,_=r&&r.__k||v,m=e.length;for(n.__d=u,D(n,e,_),u=n.__d,d=0;d<m;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?f:_[h.__i]||f,h.__i=d,j(t,h,p,o,i,a,s,u,l,c),y=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&B(p.ref,null,h),c.push(h.ref,h.__c||y,h)),null==g&&null!=y&&(g=y),65536&h.__u||p.__k===h.__k?u=N(h,u,t):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:y&&(u=y.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=g}function D(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,d=0;for(t.__k=[],r=0;r<u;r++)a=r+d,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?x(null,o,null,null,null):g(o)?x(E,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=P(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>u-a?d+=s-a:d--:s<a&&d++,s!==r+d&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=w(i)),z(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=w(i)),z(i,i))}function N(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=N(r[o],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=w(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function P(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&!(131072&u.__u))return n;if(r>(null==u||131072&u.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&!(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&!(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function C(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||y.test(e)?n:n+"px"}function I(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||C(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=c,t.addEventListener(e,i?p:d,i)):t.removeEventListener(e,i?p:d,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function L(t){return function(n){if(this.l){var r=this.l[n.type+t];if(null==n.u)n.u=c++;else if(n.u<r.t)return;return r(e.event?e.event(n):n)}}}function j(t,n,r,o,i,a,s,u,l,c){var d,p,h,f,v,y,m,b,x,w,T,S,A,D,N,P,C=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[u=n.__e=r.__e]),(d=e.__b)&&d(n);t:if("function"==typeof C)try{if(b=n.props,x="prototype"in C&&C.prototype.render,w=(d=C.contextType)&&o[d.__c],T=d?w?w.props.value:d.__:o,r.__c?m=(p=n.__c=r.__c).__=p.__E:(x?n.__c=p=new C(b,T):(n.__c=p=new M(b,T),p.constructor=C,p.render=U),w&&w.sub(p),p.props=b,p.state||(p.state={}),p.context=T,p.__n=o,h=p.__d=!0,p.__h=[],p._sb=[]),x&&null==p.__s&&(p.__s=p.state),x&&null!=C.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=_({},p.__s)),_(p.__s,C.getDerivedStateFromProps(b,p.__s))),f=p.props,v=p.state,p.__v=n,h)x&&null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),x&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(x&&null==C.getDerivedStateFromProps&&b!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,T),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,T)||n.__v===r.__v)){for(n.__v!==r.__v&&(p.props=b,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(t){t&&(t.__=n)})),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&s.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,T),x&&null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,v,y)}))}if(p.context=T,p.props=b,p.__P=t,p.__e=!1,A=e.__r,D=0,x){for(p.state=p.__s,p.__d=!1,A&&A(n),d=p.render(p.props,p.state,p.context),N=0;N<p._sb.length;N++)p.__h.push(p._sb[N]);p._sb=[]}else do{p.__d=!1,A&&A(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++D<25);p.state=p.__s,null!=p.getChildContext&&(o=_(_({},o),p.getChildContext())),x&&!h&&null!=p.getSnapshotBeforeUpdate&&(y=p.getSnapshotBeforeUpdate(f,v)),O(t,g(P=null!=d&&d.type===E&&null==d.key?d.props.children:d)?P:[P],n,r,o,i,a,s,u,l,c),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),m&&(p.__E=p.__=null)}catch(t){if(n.__v=null,l||null!=a){for(n.__u|=l?160:32;u&&8===u.nodeType&&u.nextSibling;)u=u.nextSibling;a[a.indexOf(u)]=null,n.__e=u}else n.__e=r.__e,n.__k=r.__k;e.__e(t,n,r)}else null==a&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=R(r.__e,n,r,o,i,a,s,l,c);(d=e.diffed)&&d(n)}function k(t,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)B(r[o],r[++o],r[++o]);e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function R(e,n,r,o,i,a,s,u,l){var c,d,p,h,v,y,_,b=r.props,x=n.props,E=n.type;if("svg"===E?i="http://www.w3.org/2000/svg":"math"===E?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(c=0;c<a.length;c++)if((v=a[c])&&"setAttribute"in v==!!E&&(E?v.localName===E:3===v.nodeType)){e=v,a[c]=null;break}if(null==e){if(null===E)return document.createTextNode(x);e=document.createElementNS(i,E,x.is&&x),a=null,u=!1}if(null===E)b===x||u&&e.data===x||(e.data=x);else{if(a=a&&t.call(e.childNodes),b=r.props||f,!u&&null!=a)for(b={},c=0;c<e.attributes.length;c++)b[(v=e.attributes[c]).name]=v.value;for(c in b)if(v=b[c],"children"==c);else if("dangerouslySetInnerHTML"==c)p=v;else if("key"!==c&&!(c in x)){if("value"==c&&"defaultValue"in x||"checked"==c&&"defaultChecked"in x)continue;I(e,c,null,v,i)}for(c in x)v=x[c],"children"==c?h=v:"dangerouslySetInnerHTML"==c?d=v:"value"==c?y=v:"checked"==c?_=v:"key"===c||u&&"function"!=typeof v||b[c]===v||I(e,c,v,b[c],i);if(d)u||p&&(d.__html===p.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),n.__k=[];else if(p&&(e.innerHTML=""),O(e,g(h)?h:[h],n,r,o,"foreignObject"===E?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:r.__k&&w(r,0),u,l),null!=a)for(c=a.length;c--;)null!=a[c]&&m(a[c]);u||(c="value",void 0!==y&&(y!==e[c]||"progress"===E&&!y||"option"===E&&y!==b[c])&&I(e,c,y,b[c],i),c="checked",void 0!==_&&_!==e[c]&&I(e,c,_,b[c],i))}return e}function B(t,n,r){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==n||(t.__u=t(n))}else t.current=n}catch(t){e.__e(t,r)}}function z(t,n,r){var o,i;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||B(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],n,r||"function"!=typeof t.type);r||null==t.__e||m(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function U(t,e,n){return this.constructor(t,n)}function H(n,r,o){var i,a,s,u;e.__&&e.__(n,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],u=[],j(r,n=(!i&&o||r).__k=b(E,null,[n]),a||f,f,r.namespaceURI,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i,u),k(s,n,u)}return t=v.slice,e={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,o=function(t){return null!=t&&null==t.constructor},M.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof t&&(t=t(_({},n),this.props)),t&&_(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),S(this))},M.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),S(this))},M.prototype.render=E,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(t,e){return t.__v.__b-e.__v.__b},A.__r=0,c=0,d=L(!1),p=L(!0),h=0,i.Component=M,i.Fragment=E,i.cloneElement=function(e,n,r){var o,i,a,s,u=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?o=n[a]:"ref"==a?i=n[a]:u[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),x(e.type,u,o||e.key,i||e.ref,null)},i.createContext=function(t,e){var n={__c:e="__cC"+h++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,S(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},i.createElement=b,i.createRef=function(){return{current:null}},i.h=b,i.hydrate=function t(e,n){H(e,n,t)},i.isValidElement=o,i.options=e,i.render=H,i.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(g(e)?e.some((function(e){t(e,n)})):n.push(e)),n},i}(),Tn)}(0,o);var Sn,An,On,Dn,Nn,Pn,Cn,In,Ln,jn,kn={},Rn=[],Bn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zn=Array.isArray;function Un(t,e){for(var n in e)t[n]=e[n];return t}function Hn(t){var e=t.parentNode;e&&e.removeChild(t)}function Xn(t,e,n){var r,o,i,a={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Sn.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===a[i]&&(a[i]=t.defaultProps[i]);return Gn(t,a,r,o,null)}function Gn(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++On:o,__i:-1,__u:0};return null==o&&null!=An.vnode&&An.vnode(i),i}function Wn(){return{current:null}}function Yn(t){return t.children}function Vn(t,e){this.props=t,this.context=e}function Fn(t,e){if(null==e)return t.__?Fn(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Fn(t):null}function Kn(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Kn(t)}}function qn(t){(!t.__d&&(t.__d=!0)&&Dn.push(t)&&!Zn.__r++||Nn!==An.debounceRendering)&&((Nn=An.debounceRendering)||Pn)(Zn)}function Zn(){var t,e,n,r,o,i,a,s;for(Dn.sort(Cn);t=Dn.shift();)t.__d&&(e=Dn.length,r=void 0,i=(o=(n=t).__v).__e,a=[],s=[],n.__P&&((r=Un({},o)).__v=o.__v+1,An.vnode&&An.vnode(r),ir(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,null==i?Fn(o):i,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,ar(a,r,s),r.__e!=i&&Kn(r)),Dn.length>e&&Dn.sort(Cn));Zn.__r=0}function $n(t,e,n,r,o,i,a,s,u,l,c){var d,p,h,f,v,y=r&&r.__k||Rn,g=e.length;for(n.__d=u,Jn(n,e,y),u=n.__d,d=0;d<g;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?kn:y[h.__i]||kn,h.__i=d,ir(t,h,p,o,i,a,s,u,l,c),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&ur(p.ref,null,h),c.push(h.ref,h.__c||f,h)),null==v&&null!=f&&(v=f),65536&h.__u||p.__k===h.__k?u=Qn(h,u,t):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:f&&(u=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=v}function Jn(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,d=0;for(t.__k=[],r=0;r<u;r++)a=r+d,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Gn(null,o,null,null,null):zn(o)?Gn(Yn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Gn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=er(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>u-a?d+=s-a:d--:s<a&&d++,s!==r+d&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Fn(i)),lr(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Fn(i)),lr(i,i))}function Qn(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=Qn(r[o],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=Fn(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function tr(t,e){return e=e||[],null==t||"boolean"==typeof t||(zn(t)?t.some((function(t){tr(t,e)})):e.push(t)),e}function er(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&!(131072&u.__u))return n;if(r>(null==u||131072&u.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&!(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&!(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function nr(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Bn.test(e)?n:n+"px"}function rr(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||nr(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||nr(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=In,t.addEventListener(e,i?jn:Ln,i)):t.removeEventListener(e,i?jn:Ln,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function or(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=In++;else if(e.t<n.u)return;return n(An.event?An.event(e):e)}}}function ir(t,e,n,r,o,i,a,s,u,l){var c,d,p,h,f,v,y,g,_,m,b,x,E,M,w,T,S=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=An.__b)&&c(e);t:if("function"==typeof S)try{if(g=e.props,_="prototype"in S&&S.prototype.render,m=(c=S.contextType)&&r[c.__c],b=c?m?m.props.value:c.__:r,n.__c?y=(d=e.__c=n.__c).__=d.__E:(_?e.__c=d=new S(g,b):(e.__c=d=new Vn(g,b),d.constructor=S,d.render=cr),m&&m.sub(d),d.props=g,d.state||(d.state={}),d.context=b,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),_&&null==d.__s&&(d.__s=d.state),_&&null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Un({},d.__s)),Un(d.__s,S.getDerivedStateFromProps(g,d.__s))),h=d.props,f=d.state,d.__v=e,p)_&&null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),_&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(_&&null==S.getDerivedStateFromProps&&g!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,b)||e.__v===n.__v)){for(e.__v!==n.__v&&(d.props=g,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,b),_&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,v)}))}if(d.context=b,d.props=g,d.__P=t,d.__e=!1,E=An.__r,M=0,_){for(d.state=d.__s,d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[]}else do{d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++M<25);d.state=d.__s,null!=d.getChildContext&&(r=Un(Un({},r),d.getChildContext())),_&&!p&&null!=d.getSnapshotBeforeUpdate&&(v=d.getSnapshotBeforeUpdate(h,f)),$n(t,zn(T=null!=c&&c.type===Yn&&null==c.key?c.props.children:c)?T:[T],e,n,r,o,i,a,s,u,l),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null)}catch(t){if(e.__v=null,u||null!=i){for(e.__u|=u?160:32;s&&8===s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else e.__e=n.__e,e.__k=n.__k;An.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=sr(n.__e,e,n,r,o,i,a,u,l);(c=An.diffed)&&c(e)}function ar(t,e,n){e.__d=void 0;for(var r=0;r<n.length;r++)ur(n[r],n[++r],n[++r]);An.__c&&An.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){An.__e(t,e.__v)}}))}function sr(t,e,n,r,o,i,a,s,u){var l,c,d,p,h,f,v,y=n.props,g=e.props,_=e.type;if("svg"===_?o="http://www.w3.org/2000/svg":"math"===_?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((h=i[l])&&"setAttribute"in h==!!_&&(_?h.localName===_:3===h.nodeType)){t=h,i[l]=null;break}if(null==t){if(null===_)return document.createTextNode(g);t=document.createElementNS(o,_,g.is&&g),i=null,s=!1}if(null===_)y===g||s&&t.data===g||(t.data=g);else{if(i=i&&Sn.call(t.childNodes),y=n.props||kn,!s&&null!=i)for(y={},l=0;l<t.attributes.length;l++)y[(h=t.attributes[l]).name]=h.value;for(l in y)if(h=y[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=h;else if("key"!==l&&!(l in g)){if("value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g)continue;rr(t,l,null,h,o)}for(l in g)h=g[l],"children"==l?p=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?f=h:"checked"==l?v=h:"key"===l||s&&"function"!=typeof h||y[l]===h||rr(t,l,h,y[l],o);if(c)s||d&&(c.__html===d.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),$n(t,zn(p)?p:[p],e,n,r,"foreignObject"===_?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Fn(n,0),s,u),null!=i)for(l=i.length;l--;)null!=i[l]&&Hn(i[l]);s||(l="value",void 0!==f&&(f!==t[l]||"progress"===_&&!f||"option"===_&&f!==y[l])&&rr(t,l,f,y[l],o),l="checked",void 0!==v&&v!==t[l]&&rr(t,l,v,y[l],o))}return t}function ur(t,e,n){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){An.__e(t,n)}}function lr(t,e,n){var r,o;if(An.unmount&&An.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ur(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){An.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&lr(r[o],e,n||"function"!=typeof t.type);n||null==t.__e||Hn(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function cr(t,e,n){return this.constructor(t,n)}function dr(t,e,n){var r,o,i,a;An.__&&An.__(t,e),o=(r="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],ir(e,t=(!r&&n||e).__k=Xn(Yn,null,[t]),o||kn,kn,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?Sn.call(e.childNodes):null,i,!r&&n?n:o?o.__e:e.firstChild,r,a),ar(i,t,a)}Sn=Rn.slice,An={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},On=0,Vn.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Un({},this.state),"function"==typeof t&&(t=t(Un({},n),this.props)),t&&Un(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),qn(this))},Vn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qn(this))},Vn.prototype.render=Yn,Dn=[],Pn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cn=function(t,e){return t.__v.__b-e.__v.__b},Zn.__r=0,In=0,Ln=or(!1),jn=or(!0);var pr,hr,fr,vr=[],yr=An,gr=yr.__b,_r=yr.__r,mr=yr.diffed,br=yr.__c,xr=yr.unmount,Er=yr.__;function Mr(){for(var t;t=vr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Sr),t.__H.__h.forEach(Ar),t.__H.__h=[]}catch(e){t.__H.__h=[],yr.__e(e,t.__v)}}yr.__b=function(t){pr=null,gr&&gr(t)},yr.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Er&&Er(t,e)},yr.__r=function(t){_r&&_r(t);var e=(pr=t.__c).__H;e&&(hr===pr?(e.__h=[],pr.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0}))):(e.__h.forEach(Sr),e.__h.forEach(Ar),e.__h=[])),hr=pr},yr.diffed=function(t){mr&&mr(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==vr.push(e)&&fr===yr.requestAnimationFrame||((fr=yr.requestAnimationFrame)||Tr)(Mr)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.i=void 0}))),hr=pr=null},yr.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Sr),t.__h=t.__h.filter((function(t){return!t.__||Ar(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],yr.__e(n,t.__v)}})),br&&br(t,e)},yr.unmount=function(t){xr&&xr(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Sr(t)}catch(t){e=t}})),n.__H=void 0,e&&yr.__e(e,n.__v))};var wr="function"==typeof requestAnimationFrame;function Tr(t){var e,n=function(){clearTimeout(r),wr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);wr&&(e=requestAnimationFrame(n))}function Sr(t){var e=pr,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),pr=e}function Ar(t){var e=pr;t.__c=t.__(),pr=e}function Or(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}function Dr(t,e){this.props=t,this.context=e}(Dr.prototype=new Vn).isPureReactComponent=!0,Dr.prototype.shouldComponentUpdate=function(t,e){return Or(this.props,t)||Or(this.state,e)};var Nr=An.__b;An.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Nr&&Nr(t)};var Pr=An.__e;An.__e=function(t,e,n,r){if(t.then)for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Pr(t,e,n,r)};var Cr=An.unmount;function Ir(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Ir(t,e,n)}))),t}function Lr(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return Lr(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function jr(){this.__u=0,this.t=null,this.__b=null}function kr(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Rr(){this.u=null,this.o=null}An.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Cr&&Cr(t)},(jr.prototype=new Vn).__c=function(t,e){var n=e.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=kr(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var t=r.state.__a;r.__v.__k[0]=Lr(t,t.__c.__P,t.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},jr.prototype.componentWillUnmount=function(){this.t=[]},jr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Ir(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&Xn(Yn,null,t.fallback);return o&&(o.__u&=-33),[Xn(Yn,null,e.__a?null:t.children),o]};var Br=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(Rr.prototype=new Vn).__a=function(t){var e=this,n=kr(e.__v),r=e.o.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),Br(e,t,r)):o()};n?n(i):i()}},Rr.prototype.render=function(t){this.u=null,this.o=new Map;var e=tr(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Rr.prototype.componentDidUpdate=Rr.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Br(t,n,e)}))};var zr="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ur=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Hr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xr=/[A-Z0-9]/g,Gr="undefined"!=typeof document,Wr=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};Vn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(Vn.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Yr=An.event;function Vr(){}function Fr(){return this.cancelBubble}function Kr(){return this.defaultPrevented}An.event=function(t){return Yr&&(t=Yr(t)),t.persist=Vr,t.isPropagationStopped=Fr,t.isDefaultPrevented=Kr,t.nativeEvent=t};var qr={enumerable:!1,configurable:!0,get:function(){return this.class}},Zr=An.vnode;An.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,r={};for(var o in e){var i=e[o];if(!("value"===o&&"defaultValue"in e&&null==i||Gr&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Wr(e.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Hr.test(o)?o=a:-1===n.indexOf("-")&&Ur.test(o)?o=o.replace(Xr,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=tr(e.children).forEach((function(t){t.props.selected=-1!=r.value.indexOf(t.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=tr(e.children).forEach((function(t){t.props.selected=r.multiple?-1!=r.defaultValue.indexOf(t.props.value):r.defaultValue==t.props.value}))),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",qr)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r}(t),t.$$typeof=zr,Zr&&Zr(t)};var $r=An.__r;An.__r=function(t){$r&&$r(t),t.__c};var Jr=An.diffed;An.diffed=function(t){Jr&&Jr(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var Qr=function(t,e){return Qr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Qr(t,e)};function to(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Qr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var eo=function(){return eo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},eo.apply(this,arguments)};function no(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function ro(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function oo(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function io(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var ao=0;function so(t,e,n,r,o,i){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ao,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return An.vnode&&An.vnode(l),l}var uo="object"==typeof global&&global&&global.Object===Object&&global,lo="object"==typeof self&&self&&self.Object===Object&&self,co=uo||lo||Function("return this")(),po=co.Symbol,ho=Object.prototype,fo=ho.hasOwnProperty,vo=ho.toString,yo=po?po.toStringTag:void 0;var go=Object.prototype.toString;var _o="[object Null]",mo="[object Undefined]",bo=po?po.toStringTag:void 0;function xo(t){return null==t?void 0===t?mo:_o:bo&&bo in Object(t)?function(t){var e=fo.call(t,yo),n=t[yo];try{t[yo]=void 0;var r=!0}catch(t){}var o=vo.call(t);return r&&(e?t[yo]=n:delete t[yo]),o}(t):function(t){return go.call(t)}(t)}function Eo(t){return null!=t&&"object"==typeof t}var Mo="[object Symbol]";function wo(t){return"symbol"==typeof t||Eo(t)&&xo(t)==Mo}var To=NaN;function So(t){return"number"==typeof t?t:wo(t)?To:+t}function Ao(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var Oo=Array.isArray,Do=1/0,No=po?po.prototype:void 0,Po=No?No.toString:void 0;function Co(t){if("string"==typeof t)return t;if(Oo(t))return Ao(t,Co)+"";if(wo(t))return Po?Po.call(t):"";var e=t+"";return"0"==e&&1/t==-Do?"-0":e}function Io(t,e){return function(n,r){var o;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Co(n),r=Co(r)):(n=So(n),r=So(r)),o=t(n,r)}return o}}var Lo=Io((function(t,e){return t+e}),0),jo=/\s/;function ko(t){for(var e=t.length;e--&&jo.test(t.charAt(e)););return e}var Ro=/^\s+/;function Bo(t){return t?t.slice(0,ko(t)+1).replace(Ro,""):t}function zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Uo=NaN,Ho=/^[-+]0x[0-9a-f]+$/i,Xo=/^0b[01]+$/i,Go=/^0o[0-7]+$/i,Wo=parseInt;function Yo(t){if("number"==typeof t)return t;if(wo(t))return Uo;if(zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Bo(t);var n=Xo.test(t);return n||Go.test(t)?Wo(t.slice(2),n?2:8):Ho.test(t)?Uo:+t}var Vo=1/0,Fo=17976931348623157e292;function Ko(t){return t?(t=Yo(t))===Vo||t===-Vo?(t<0?-1:1)*Fo:t==t?t:0:0===t?t:0}function qo(t){var e=Ko(t),n=e%1;return e==e?n?e-n:e:0}function Zo(t){return t}var $o="[object AsyncFunction]",Jo="[object Function]",Qo="[object GeneratorFunction]",ti="[object Proxy]";function ei(t){if(!zo(t))return!1;var e=xo(t);return e==Jo||e==Qo||e==$o||e==ti}var ni,ri=co["__core-js_shared__"],oi=(ni=/[^.]+$/.exec(ri&&ri.keys&&ri.keys.IE_PROTO||""))?"Symbol(src)_1."+ni:"";var ii=Function.prototype.toString;function ai(t){if(null!=t){try{return ii.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var si=/^\[object .+?Constructor\]$/,ui=Function.prototype,li=Object.prototype,ci=ui.toString,di=li.hasOwnProperty,pi=RegExp("^"+ci.call(di).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hi(t){return!(!zo(t)||function(t){return!!oi&&oi in t}(t))&&(ei(t)?pi:si).test(ai(t))}function fi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return hi(n)?n:void 0}var vi=fi(co,"WeakMap"),yi=vi&&new vi,gi=yi?function(t,e){return yi.set(t,e),t}:Zo,_i=Object.create,mi=function(){function t(){}return function(e){if(!zo(e))return{};if(_i)return _i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function bi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=mi(t.prototype),r=t.apply(n,e);return zo(r)?r:n}}var xi=1;function Ei(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Mi=Math.max;function wi(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,u=e.length,l=Mi(i-a,0),c=Array(u+l),d=!r;++s<u;)c[s]=e[s];for(;++o<a;)(d||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[s++]=t[o++];return c}var Ti=Math.max;function Si(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,u=-1,l=e.length,c=Ti(i-s,0),d=Array(c+l),p=!r;++o<c;)d[o]=t[o];for(var h=o;++u<l;)d[h+u]=e[u];for(;++a<s;)(p||o<i)&&(d[h+n[a]]=t[o++]);return d}function Ai(){}var Oi=4294967295;function Di(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Oi,this.__views__=[]}function Ni(){}Di.prototype=mi(Ai.prototype),Di.prototype.constructor=Di;var Pi=yi?function(t){return yi.get(t)}:Ni,Ci={},Ii=Object.prototype.hasOwnProperty;function Li(t){for(var e=t.name+"",n=Ci[e],r=Ii.call(Ci,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ji(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function ki(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Ri(t){if(t instanceof Di)return t.clone();var e=new ji(t.__wrapped__,t.__chain__);return e.__actions__=ki(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}ji.prototype=mi(Ai.prototype),ji.prototype.constructor=ji;var Bi=Object.prototype.hasOwnProperty;function zi(t){if(Eo(t)&&!Oo(t)&&!(t instanceof Di)){if(t instanceof ji)return t;if(Bi.call(t,"__wrapped__"))return Ri(t)}return new ji(t)}function Ui(t){var e=Li(t),n=zi[e];if("function"!=typeof n||!(e in Di.prototype))return!1;if(t===n)return!0;var r=Pi(n);return!!r&&t===r[0]}zi.prototype=Ai.prototype,zi.prototype.constructor=zi;var Hi=Date.now;function Xi(t){var e=0,n=0;return function(){var r=Hi(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Gi=Xi(gi),Wi=/\{\n\/\* \[wrapped with (.+)\] \*/,Yi=/,? & /;var Vi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Fi(t){return function(){return t}}var Ki=function(){try{var t=fi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),qi=Ki?function(t,e){return Ki(t,"toString",{configurable:!0,enumerable:!1,value:Fi(e),writable:!0})}:Zo,Zi=Xi(qi);function $i(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ji(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Qi(t){return t!=t}function ta(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Ji(t,Qi,n)}function ea(t,e){return!!(null==t?0:t.length)&&ta(t,e,0)>-1}var na=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function ra(t,e,n){var r=e+"";return Zi(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Vi,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return $i(na,(function(n){var r="_."+n[0];e&n[1]&&!ea(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Wi);return e?e[1].split(Yi):[]}(r),n)))}var oa=1,ia=2,aa=4,sa=8,ua=32,la=64;function ca(t,e,n,r,o,i,a,s,u,l){var c=e&sa;e|=c?ua:la,(e&=~(c?la:ua))&aa||(e&=~(oa|ia));var d=[t,e,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,u,l],p=n.apply(void 0,d);return Ui(t)&&Gi(p,d),p.placeholder=r,ra(p,t,e)}function da(t){return t.placeholder}var pa=9007199254740991,ha=/^(?:0|[1-9]\d*)$/;function fa(t,e){var n=typeof t;return!!(e=null==e?pa:e)&&("number"==n||"symbol"!=n&&ha.test(t))&&t>-1&&t%1==0&&t<e}var va=Math.min;var ya="__lodash_placeholder__";function ga(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==ya||(t[n]=ya,i[o++]=n)}return i}var _a=1,ma=2,ba=8,xa=16,Ea=128,Ma=512;function wa(t,e,n,r,o,i,a,s,u,l){var c=e&Ea,d=e&_a,p=e&ma,h=e&(ba|xa),f=e&Ma,v=p?void 0:bi(t);return function y(){for(var g=arguments.length,_=Array(g),m=g;m--;)_[m]=arguments[m];if(h)var b=da(y),x=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,b);if(r&&(_=wi(_,r,o,h)),i&&(_=Si(_,i,a,h)),g-=x,h&&g<l){var E=ga(_,b);return ca(t,e,wa,y.placeholder,n,_,E,s,u,l-g)}var M=d?n:this,w=p?M[t]:t;return g=_.length,s?_=function(t,e){for(var n=t.length,r=va(e.length,n),o=ki(t);r--;){var i=e[r];t[r]=fa(i,n)?o[i]:void 0}return t}(_,s):f&&g>1&&_.reverse(),c&&u<g&&(_.length=u),this&&this!==co&&this instanceof y&&(w=v||bi(w)),w.apply(M,_)}}var Ta=1;var Sa="__lodash_placeholder__",Aa=1,Oa=2,Da=4,Na=8,Pa=128,Ca=256,Ia=Math.min;var La="Expected a function",ja=1,ka=2,Ra=8,Ba=16,za=32,Ua=64,Ha=Math.max;function Xa(t,e,n,r,o,i,a,s){var u=e&ka;if(!u&&"function"!=typeof t)throw new TypeError(La);var l=r?r.length:0;if(l||(e&=~(za|Ua),r=o=void 0),a=void 0===a?a:Ha(qo(a),0),s=void 0===s?s:qo(s),l-=o?o.length:0,e&Ua){var c=r,d=o;r=o=void 0}var p=u?void 0:Pi(t),h=[t,e,n,r,o,c,d,i,a,s];if(p&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<(Aa|Oa|Pa),a=r==Pa&&n==Na||r==Pa&&n==Ca&&t[7].length<=e[8]||r==(Pa|Ca)&&e[7].length<=e[8]&&n==Na;if(!i&&!a)return t;r&Aa&&(t[2]=e[2],o|=n&Aa?0:Da);var s=e[3];if(s){var u=t[3];t[3]=u?wi(u,s,e[4]):s,t[4]=u?ga(t[3],Sa):e[4]}(s=e[5])&&(u=t[5],t[5]=u?Si(u,s,e[6]):s,t[6]=u?ga(t[5],Sa):e[6]),(s=e[7])&&(t[7]=s),r&Pa&&(t[8]=null==t[8]?e[8]:Ia(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(h,p),t=h[0],e=h[1],n=h[2],r=h[3],o=h[4],!(s=h[9]=void 0===h[9]?u?0:t.length:Ha(h[9]-l,0))&&e&(Ra|Ba)&&(e&=~(Ra|Ba)),e&&e!=ja)f=e==Ra||e==Ba?function(t,e,n){var r=bi(t);return function o(){for(var i=arguments.length,a=Array(i),s=i,u=da(o);s--;)a[s]=arguments[s];var l=i<3&&a[0]!==u&&a[i-1]!==u?[]:ga(a,u);return(i-=l.length)<n?ca(t,e,wa,o.placeholder,void 0,a,l,void 0,void 0,n-i):Ei(this&&this!==co&&this instanceof o?r:t,this,a)}}(t,e,s):e!=za&&e!=(ja|za)||o.length?wa.apply(void 0,h):function(t,e,n,r){var o=e&Ta,i=bi(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=Array(l+s),d=this&&this!==co&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return Ei(d,o?n:this,c)}}(t,e,n,r);else var f=function(t,e,n){var r=e&xi,o=bi(t);return function e(){return(this&&this!==co&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return ra((p?gi:Gi)(f,h),t,e)}var Ga=128;function Wa(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,Xa(t,Ga,void 0,void 0,void 0,void 0,e)}function Ya(t,e,n){"__proto__"==e&&Ki?Ki(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Va(t,e){return t===e||t!=t&&e!=e}var Fa=Object.prototype.hasOwnProperty;function Ka(t,e,n){var r=t[e];Fa.call(t,e)&&Va(r,n)&&(void 0!==n||e in t)||Ya(t,e,n)}function qa(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),o?Ya(n,s,u):Ka(n,s,u)}return n}var Za=Math.max;function $a(t,e,n){return e=Za(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Za(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),Ei(t,this,s)}}function Ja(t,e){return Zi($a(t,e,Zo),t+"")}var Qa=9007199254740991;function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Qa}function es(t){return null!=t&&ts(t.length)&&!ei(t)}function ns(t,e,n){if(!zo(n))return!1;var r=typeof e;return!!("number"==r?es(n)&&fa(e,n.length):"string"==r&&e in n)&&Va(n[e],t)}function rs(t){return Ja((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&ns(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e}))}var os=Object.prototype;function is(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||os)}function as(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function ss(t){return Eo(t)&&"[object Arguments]"==xo(t)}var us=Object.prototype,ls=us.hasOwnProperty,cs=us.propertyIsEnumerable,ds=ss(function(){return arguments}())?ss:function(t){return Eo(t)&&ls.call(t,"callee")&&!cs.call(t,"callee")};function ps(){return!1}var hs="object"==typeof t&&t&&!t.nodeType&&t,fs=hs&&"object"==typeof module&&module&&!module.nodeType&&module,vs=fs&&fs.exports===hs?co.Buffer:void 0,ys=(vs?vs.isBuffer:void 0)||ps,gs={};function _s(t){return function(e){return t(e)}}gs["[object Float32Array]"]=gs["[object Float64Array]"]=gs["[object Int8Array]"]=gs["[object Int16Array]"]=gs["[object Int32Array]"]=gs["[object Uint8Array]"]=gs["[object Uint8ClampedArray]"]=gs["[object Uint16Array]"]=gs["[object Uint32Array]"]=!0,gs["[object Arguments]"]=gs["[object Array]"]=gs["[object ArrayBuffer]"]=gs["[object Boolean]"]=gs["[object DataView]"]=gs["[object Date]"]=gs["[object Error]"]=gs["[object Function]"]=gs["[object Map]"]=gs["[object Number]"]=gs["[object Object]"]=gs["[object RegExp]"]=gs["[object Set]"]=gs["[object String]"]=gs["[object WeakMap]"]=!1;var ms="object"==typeof t&&t&&!t.nodeType&&t,bs=ms&&"object"==typeof module&&module&&!module.nodeType&&module,xs=bs&&bs.exports===ms&&uo.process,Es=function(){try{var t=bs&&bs.require&&bs.require("util").types;return t||xs&&xs.binding&&xs.binding("util")}catch(t){}}(),Ms=Es&&Es.isTypedArray,ws=Ms?_s(Ms):function(t){return Eo(t)&&ts(t.length)&&!!gs[xo(t)]},Ts=Object.prototype.hasOwnProperty;function Ss(t,e){var n=Oo(t),r=!n&&ds(t),o=!n&&!r&&ys(t),i=!n&&!r&&!o&&ws(t),a=n||r||o||i,s=a?as(t.length,String):[],u=s.length;for(var l in t)!e&&!Ts.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||fa(l,u))||s.push(l);return s}function As(t,e){return function(n){return t(e(n))}}var Os=As(Object.keys,Object),Ds=Object.prototype.hasOwnProperty;function Ns(t){if(!is(t))return Os(t);var e=[];for(var n in Object(t))Ds.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Ps(t){return es(t)?Ss(t):Ns(t)}var Cs=Object.prototype.hasOwnProperty,Is=rs((function(t,e){if(is(e)||es(e))qa(e,Ps(e),t);else for(var n in e)Cs.call(e,n)&&Ka(t,n,e[n])}));var Ls=Object.prototype.hasOwnProperty;function js(t){if(!zo(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=is(t),n=[];for(var r in t)("constructor"!=r||!e&&Ls.call(t,r))&&n.push(r);return n}function ks(t){return es(t)?Ss(t,!0):js(t)}var Rs=rs((function(t,e){qa(e,ks(e),t)})),Bs=rs((function(t,e,n,r){qa(e,ks(e),t,r)})),zs=rs((function(t,e,n,r){qa(e,Ps(e),t,r)})),Us=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hs=/^\w*$/;function Xs(t,e){if(Oo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!wo(t))||(Hs.test(t)||!Us.test(t)||null!=e&&t in Object(e))}var Gs=fi(Object,"create");var Ws=Object.prototype.hasOwnProperty;var Ys=Object.prototype.hasOwnProperty;function Vs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Fs(t,e){for(var n=t.length;n--;)if(Va(t[n][0],e))return n;return-1}Vs.prototype.clear=function(){this.__data__=Gs?Gs(null):{},this.size=0},Vs.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vs.prototype.get=function(t){var e=this.__data__;if(Gs){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ws.call(e,t)?e[t]:void 0},Vs.prototype.has=function(t){var e=this.__data__;return Gs?void 0!==e[t]:Ys.call(e,t)},Vs.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Gs&&void 0===e?"__lodash_hash_undefined__":e,this};var Ks=Array.prototype.splice;function qs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qs.prototype.clear=function(){this.__data__=[],this.size=0},qs.prototype.delete=function(t){var e=this.__data__,n=Fs(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ks.call(e,n,1),--this.size,!0)},qs.prototype.get=function(t){var e=this.__data__,n=Fs(e,t);return n<0?void 0:e[n][1]},qs.prototype.has=function(t){return Fs(this.__data__,t)>-1},qs.prototype.set=function(t,e){var n=this.__data__,r=Fs(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Zs=fi(co,"Map");function $s(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Js(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Js.prototype.clear=function(){this.size=0,this.__data__={hash:new Vs,map:new(Zs||qs),string:new Vs}},Js.prototype.delete=function(t){var e=$s(this,t).delete(t);return this.size-=e?1:0,e},Js.prototype.get=function(t){return $s(this,t).get(t)},Js.prototype.has=function(t){return $s(this,t).has(t)},Js.prototype.set=function(t,e){var n=$s(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Qs="Expected a function";function tu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Qs);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(tu.Cache||Js),n}tu.Cache=Js;var eu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nu=/\\(\\)?/g,ru=function(t){var e=tu(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(eu,(function(t,n,r,o){e.push(r?o.replace(nu,"$1"):n||t)})),e}));function ou(t){return null==t?"":Co(t)}function iu(t,e){return Oo(t)?t:Xs(t,e)?[t]:ru(ou(t))}var au=1/0;function su(t){if("string"==typeof t||wo(t))return t;var e=t+"";return"0"==e&&1/t==-au?"-0":e}function uu(t,e){for(var n=0,r=(e=iu(e,t)).length;null!=t&&n<r;)t=t[su(e[n++])];return n&&n==r?t:void 0}function lu(t,e,n){var r=null==t?void 0:uu(t,e);return void 0===r?n:r}function cu(t,e){for(var n=-1,r=e.length,o=Array(r),i=null==t;++n<r;)o[n]=i?void 0:lu(t,e[n]);return o}function du(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var pu=po?po.isConcatSpreadable:void 0;function hu(t){return Oo(t)||ds(t)||!!(pu&&t&&t[pu])}function fu(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=hu),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?fu(s,e-1,n,r,o):du(o,s):r||(o[o.length]=s)}return o}function vu(t){return(null==t?0:t.length)?fu(t,1):[]}function yu(t){return Zi($a(t,void 0,vu),t+"")}var gu=yu(cu),_u=As(Object.getPrototypeOf,Object),mu="[object Object]",bu=Function.prototype,xu=Object.prototype,Eu=bu.toString,Mu=xu.hasOwnProperty,wu=Eu.call(Object);function Tu(t){if(!Eo(t)||xo(t)!=mu)return!1;var e=_u(t);if(null===e)return!0;var n=Mu.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Eu.call(n)==wu}var Su="[object DOMException]",Au="[object Error]";function Ou(t){if(!Eo(t))return!1;var e=xo(t);return e==Au||e==Su||"string"==typeof t.message&&"string"==typeof t.name&&!Tu(t)}var Du=Ja((function(t,e){try{return Ei(t,void 0,e)}catch(t){return Ou(t)?t:new Error(t)}})),Nu="Expected a function";function Pu(t,e){var n;if("function"!=typeof e)throw new TypeError(Nu);return t=qo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Cu=Ja((function(t,e,n){var r=1;if(n.length){var o=ga(n,da(Cu));r|=32}return Xa(t,r,e,n,o)}));Cu.placeholder={};var Iu=yu((function(t,e){return $i(e,(function(e){e=su(e),Ya(t,e,Cu(t[e],t))})),t})),Lu=Ja((function(t,e,n){var r=3;if(n.length){var o=ga(n,da(Lu));r|=32}return Xa(e,r,t,n,o)}));function ju(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function ku(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:ju(t,e,n)}Lu.placeholder={};var Ru=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Bu(t){return Ru.test(t)}var zu="\\ud800-\\udfff",Uu="["+zu+"]",Hu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Xu="\\ud83c[\\udffb-\\udfff]",Gu="[^"+zu+"]",Wu="(?:\\ud83c[\\udde6-\\uddff]){2}",Yu="[\\ud800-\\udbff][\\udc00-\\udfff]",Vu="(?:"+Hu+"|"+Xu+")"+"?",Fu="[\\ufe0e\\ufe0f]?",Ku=Fu+Vu+("(?:\\u200d(?:"+[Gu,Wu,Yu].join("|")+")"+Fu+Vu+")*"),qu="(?:"+[Gu+Hu+"?",Hu,Wu,Yu,Uu].join("|")+")",Zu=RegExp(Xu+"(?="+Xu+")|"+qu+Ku,"g");function $u(t){return Bu(t)?function(t){return t.match(Zu)||[]}(t):function(t){return t.split("")}(t)}function Ju(t){return function(e){var n=Bu(e=ou(e))?$u(e):void 0,r=n?n[0]:e.charAt(0),o=n?ku(n,1).join(""):e.slice(1);return r[t]()+o}}var Qu=Ju("toUpperCase");function tl(t){return Qu(ou(t).toLowerCase())}function el(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function nl(t){return function(e){return null==t?void 0:t[e]}}var rl=nl({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ol=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,il=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function al(t){return(t=ou(t))&&t.replace(ol,rl).replace(il,"")}var sl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ul=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var ll="\\ud800-\\udfff",cl="\\u2700-\\u27bf",dl="a-z\\xdf-\\xf6\\xf8-\\xff",pl="A-Z\\xc0-\\xd6\\xd8-\\xde",hl="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fl="["+hl+"]",vl="\\d+",yl="["+cl+"]",gl="["+dl+"]",_l="[^"+ll+hl+vl+cl+dl+pl+"]",ml="(?:\\ud83c[\\udde6-\\uddff]){2}",bl="[\\ud800-\\udbff][\\udc00-\\udfff]",xl="["+pl+"]",El="(?:"+gl+"|"+_l+")",Ml="(?:"+xl+"|"+_l+")",wl="(?:['’](?:d|ll|m|re|s|t|ve))?",Tl="(?:['’](?:D|LL|M|RE|S|T|VE))?",Sl="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Al="[\\ufe0e\\ufe0f]?",Ol=Al+Sl+("(?:\\u200d(?:"+["[^"+ll+"]",ml,bl].join("|")+")"+Al+Sl+")*"),Dl="(?:"+[yl,ml,bl].join("|")+")"+Ol,Nl=RegExp([xl+"?"+gl+"+"+wl+"(?="+[fl,xl,"$"].join("|")+")",Ml+"+"+Tl+"(?="+[fl,xl+El,"$"].join("|")+")",xl+"?"+El+"+"+wl,xl+"+"+Tl,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vl,Dl].join("|"),"g");function Pl(t,e,n){return t=ou(t),void 0===(e=n?void 0:e)?function(t){return ul.test(t)}(t)?function(t){return t.match(Nl)||[]}(t):function(t){return t.match(sl)||[]}(t):t.match(e)||[]}var Cl=RegExp("['’]","g");function Il(t){return function(e){return el(Pl(al(e).replace(Cl,"")),t,"")}}var Ll=Il((function(t,e,n){return e=e.toLowerCase(),t+(n?tl(e):e)}));var jl=co.isFinite,kl=Math.min;function Rl(t){var e=Math[t];return function(t,n){if(t=Yo(t),(n=null==n?0:kl(qo(n),292))&&jl(t)){var r=(ou(t)+"e").split("e");return+((r=(ou(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Bl=Rl("ceil");function zl(t){var e=zi(t);return e.__chain__=!0,e}var Ul=Math.ceil,Hl=Math.max;function Xl(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Gl(t){var e=this.__data__=new qs(t);this.size=e.size}function Wl(t,e){return t&&qa(e,Ps(e),t)}Gl.prototype.clear=function(){this.__data__=new qs,this.size=0},Gl.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gl.prototype.get=function(t){return this.__data__.get(t)},Gl.prototype.has=function(t){return this.__data__.has(t)},Gl.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qs){var r=n.__data__;if(!Zs||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Js(r)}return n.set(t,e),this.size=n.size,this};var Yl="object"==typeof t&&t&&!t.nodeType&&t,Vl=Yl&&"object"==typeof module&&module&&!module.nodeType&&module,Fl=Vl&&Vl.exports===Yl?co.Buffer:void 0,Kl=Fl?Fl.allocUnsafe:void 0;function ql(t,e){if(e)return t.slice();var n=t.length,r=Kl?Kl(n):new t.constructor(n);return t.copy(r),r}function Zl(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function $l(){return[]}var Jl=Object.prototype.propertyIsEnumerable,Ql=Object.getOwnPropertySymbols,tc=Ql?function(t){return null==t?[]:(t=Object(t),Zl(Ql(t),(function(e){return Jl.call(t,e)})))}:$l;var ec=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)du(e,tc(t)),t=_u(t);return e}:$l;function nc(t,e,n){var r=e(t);return Oo(t)?r:du(r,n(t))}function rc(t){return nc(t,Ps,tc)}function oc(t){return nc(t,ks,ec)}var ic=fi(co,"DataView"),ac=fi(co,"Promise"),sc=fi(co,"Set"),uc="[object Map]",lc="[object Promise]",cc="[object Set]",dc="[object WeakMap]",pc="[object DataView]",hc=ai(ic),fc=ai(Zs),vc=ai(ac),yc=ai(sc),gc=ai(vi),_c=xo;(ic&&_c(new ic(new ArrayBuffer(1)))!=pc||Zs&&_c(new Zs)!=uc||ac&&_c(ac.resolve())!=lc||sc&&_c(new sc)!=cc||vi&&_c(new vi)!=dc)&&(_c=function(t){var e=xo(t),n="[object Object]"==e?t.constructor:void 0,r=n?ai(n):"";if(r)switch(r){case hc:return pc;case fc:return uc;case vc:return lc;case yc:return cc;case gc:return dc}return e});var mc=_c,bc=Object.prototype.hasOwnProperty;var xc=co.Uint8Array;function Ec(t){var e=new t.constructor(t.byteLength);return new xc(e).set(new xc(t)),e}var Mc=/\w*$/;var wc=po?po.prototype:void 0,Tc=wc?wc.valueOf:void 0;function Sc(t,e){var n=e?Ec(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Ac="[object Boolean]",Oc="[object Date]",Dc="[object Map]",Nc="[object Number]",Pc="[object RegExp]",Cc="[object Set]",Ic="[object String]",Lc="[object Symbol]",jc="[object ArrayBuffer]",kc="[object DataView]",Rc="[object Float32Array]",Bc="[object Float64Array]",zc="[object Int8Array]",Uc="[object Int16Array]",Hc="[object Int32Array]",Xc="[object Uint8Array]",Gc="[object Uint8ClampedArray]",Wc="[object Uint16Array]",Yc="[object Uint32Array]";function Vc(t,e,n){var r,o=t.constructor;switch(e){case jc:return Ec(t);case Ac:case Oc:return new o(+t);case kc:return function(t,e){var n=e?Ec(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Rc:case Bc:case zc:case Uc:case Hc:case Xc:case Gc:case Wc:case Yc:return Sc(t,n);case Dc:return new o;case Nc:case Ic:return new o(t);case Pc:return function(t){var e=new t.constructor(t.source,Mc.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Cc:return new o;case Lc:return r=t,Tc?Object(Tc.call(r)):{}}}function Fc(t){return"function"!=typeof t.constructor||is(t)?{}:mi(_u(t))}var Kc=Es&&Es.isMap,qc=Kc?_s(Kc):function(t){return Eo(t)&&"[object Map]"==mc(t)};var Zc=Es&&Es.isSet,$c=Zc?_s(Zc):function(t){return Eo(t)&&"[object Set]"==mc(t)},Jc=1,Qc=2,td=4,ed="[object Arguments]",nd="[object Function]",rd="[object GeneratorFunction]",od="[object Object]",id={};function ad(t,e,n,r,o,i){var a,s=e&Jc,u=e&Qc,l=e&td;if(n&&(a=o?n(t,r,o,i):n(t)),void 0!==a)return a;if(!zo(t))return t;var c=Oo(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&bc.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return ki(t,a)}else{var d=mc(t),p=d==nd||d==rd;if(ys(t))return ql(t,s);if(d==od||d==ed||p&&!o){if(a=u||p?{}:Fc(t),!s)return u?function(t,e){return qa(t,ec(t),e)}(t,function(t,e){return t&&qa(e,ks(e),t)}(a,t)):function(t,e){return qa(t,tc(t),e)}(t,Wl(a,t))}else{if(!id[d])return o?t:{};a=Vc(t,d,s)}}i||(i=new Gl);var h=i.get(t);if(h)return h;i.set(t,a),$c(t)?t.forEach((function(r){a.add(ad(r,e,n,r,t,i))})):qc(t)&&t.forEach((function(r,o){a.set(o,ad(r,e,n,o,t,i))}));var f=c?void 0:(l?u?oc:rc:u?ks:Ps)(t);return $i(f||t,(function(r,o){f&&(r=t[o=r]),Ka(a,o,ad(r,e,n,o,t,i))})),a}id[ed]=id["[object Array]"]=id["[object ArrayBuffer]"]=id["[object DataView]"]=id["[object Boolean]"]=id["[object Date]"]=id["[object Float32Array]"]=id["[object Float64Array]"]=id["[object Int8Array]"]=id["[object Int16Array]"]=id["[object Int32Array]"]=id["[object Map]"]=id["[object Number]"]=id[od]=id["[object RegExp]"]=id["[object Set]"]=id["[object String]"]=id["[object Symbol]"]=id["[object Uint8Array]"]=id["[object Uint8ClampedArray]"]=id["[object Uint16Array]"]=id["[object Uint32Array]"]=!0,id["[object Error]"]=id[nd]=id["[object WeakMap]"]=!1;function sd(t){return ad(t,5)}function ud(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Js;++e<n;)this.add(t[e])}function ld(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function cd(t,e){return t.has(e)}ud.prototype.add=ud.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ud.prototype.has=function(t){return this.__data__.has(t)};var dd=1,pd=2;function hd(t,e,n,r,o,i){var a=n&dd,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var l=i.get(t),c=i.get(e);if(l&&c)return l==e&&c==t;var d=-1,p=!0,h=n&pd?new ud:void 0;for(i.set(t,e),i.set(e,t);++d<s;){var f=t[d],v=e[d];if(r)var y=a?r(v,f,d,e,t,i):r(f,v,d,t,e,i);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!ld(e,(function(t,e){if(!cd(h,e)&&(f===t||o(f,t,n,r,i)))return h.push(e)}))){p=!1;break}}else if(f!==v&&!o(f,v,n,r,i)){p=!1;break}}return i.delete(t),i.delete(e),p}function fd(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function vd(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var yd=1,gd=2,_d="[object Boolean]",md="[object Date]",bd="[object Error]",xd="[object Map]",Ed="[object Number]",Md="[object RegExp]",wd="[object Set]",Td="[object String]",Sd="[object Symbol]",Ad="[object ArrayBuffer]",Od="[object DataView]",Dd=po?po.prototype:void 0,Nd=Dd?Dd.valueOf:void 0;var Pd=1,Cd=Object.prototype.hasOwnProperty;var Id=1,Ld="[object Arguments]",jd="[object Array]",kd="[object Object]",Rd=Object.prototype.hasOwnProperty;function Bd(t,e,n,r,o,i){var a=Oo(t),s=Oo(e),u=a?jd:mc(t),l=s?jd:mc(e),c=(u=u==Ld?kd:u)==kd,d=(l=l==Ld?kd:l)==kd,p=u==l;if(p&&ys(t)){if(!ys(e))return!1;a=!0,c=!1}if(p&&!c)return i||(i=new Gl),a||ws(t)?hd(t,e,n,r,o,i):function(t,e,n,r,o,i,a){switch(n){case Od:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ad:return!(t.byteLength!=e.byteLength||!i(new xc(t),new xc(e)));case _d:case md:case Ed:return Va(+t,+e);case bd:return t.name==e.name&&t.message==e.message;case Md:case Td:return t==e+"";case xd:var s=fd;case wd:var u=r&yd;if(s||(s=vd),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=gd,a.set(t,e);var c=hd(s(t),s(e),r,o,i,a);return a.delete(t),c;case Sd:if(Nd)return Nd.call(t)==Nd.call(e)}return!1}(t,e,u,n,r,o,i);if(!(n&Id)){var h=c&&Rd.call(t,"__wrapped__"),f=d&&Rd.call(e,"__wrapped__");if(h||f){var v=h?t.value():t,y=f?e.value():e;return i||(i=new Gl),o(v,y,n,r,i)}}return!!p&&(i||(i=new Gl),function(t,e,n,r,o,i){var a=n&Pd,s=rc(t),u=s.length;if(u!=rc(e).length&&!a)return!1;for(var l=u;l--;){var c=s[l];if(!(a?c in e:Cd.call(e,c)))return!1}var d=i.get(t),p=i.get(e);if(d&&p)return d==e&&p==t;var h=!0;i.set(t,e),i.set(e,t);for(var f=a;++l<u;){var v=t[c=s[l]],y=e[c];if(r)var g=a?r(y,v,c,e,t,i):r(v,y,c,t,e,i);if(!(void 0===g?v===y||o(v,y,n,r,i):g)){h=!1;break}f||(f="constructor"==c)}if(h&&!f){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,r,o,i))}function zd(t,e,n,r,o){return t===e||(null==t||null==e||!Eo(t)&&!Eo(e)?t!=t&&e!=e:Bd(t,e,n,r,zd,o))}var Ud=1,Hd=2;function Xd(t,e,n,r){var o=n.length,i=o,a=!r;if(null==t)return!i;for(t=Object(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var u=(s=n[o])[0],l=t[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in t))return!1}else{var d=new Gl;if(r)var p=r(l,c,u,t,e,d);if(!(void 0===p?zd(c,l,Ud|Hd,r,d):p))return!1}}return!0}function Gd(t){return t==t&&!zo(t)}function Wd(t){for(var e=Ps(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Gd(o)]}return e}function Yd(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function Vd(t){var e=Wd(t);return 1==e.length&&e[0][2]?Yd(e[0][0],e[0][1]):function(n){return n===t||Xd(n,t,e)}}function Fd(t,e){return null!=t&&e in Object(t)}function Kd(t,e,n){for(var r=-1,o=(e=iu(e,t)).length,i=!1;++r<o;){var a=su(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ts(o)&&fa(a,o)&&(Oo(t)||ds(t))}function qd(t,e){return null!=t&&Kd(t,e,Fd)}var Zd=1,$d=2;function Jd(t,e){return Xs(t)&&Gd(e)?Yd(su(t),e):function(n){var r=lu(n,t);return void 0===r&&r===e?qd(n,t):zd(e,r,Zd|$d)}}function Qd(t){return function(e){return null==e?void 0:e[t]}}function tp(t){return Xs(t)?Qd(su(t)):function(t){return function(e){return uu(e,t)}}(t)}function ep(t){return"function"==typeof t?t:null==t?Zo:"object"==typeof t?Oo(t)?Jd(t[0],t[1]):Vd(t):tp(t)}function np(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var o=n[r],i=e[o],a=t[o];if(void 0===a&&!(o in t)||!i(a))return!1}return!0}function rp(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function op(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}var ip=op();function ap(t,e){return t&&ip(t,e,Ps)}function sp(t,e){return function(n,r){if(null==n)return n;if(!es(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}var up=sp(ap);function lp(t,e,n,r){return up(t,(function(t,o,i){e(r,t,n(t),i)})),r}function cp(t,e){return function(n,r){var o=Oo(n)?rp:lp,i=e?e():{};return o(n,t,ep(r),i)}}var dp=Object.prototype.hasOwnProperty,pp=cp((function(t,e,n){dp.call(t,n)?++t[n]:Ya(t,n,1)}));function hp(t,e,n){var r=Xa(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=hp.placeholder,r}hp.placeholder={};function fp(t,e,n){var r=Xa(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=fp.placeholder,r}fp.placeholder={};var vp=function(){return co.Date.now()},yp="Expected a function",gp=Math.max,_p=Math.min;function mp(t,e,n){var r,o,i,a,s,u,l=0,c=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(yp);function h(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function f(t){var n=t-u;return void 0===u||n>=e||n<0||d&&t-l>=i}function v(){var t=vp();if(f(t))return y(t);s=setTimeout(v,function(t){var n=e-(t-u);return d?_p(n,i-(t-l)):n}(t))}function y(t){return s=void 0,p&&r?h(t):(r=o=void 0,a)}function g(){var t=vp(),n=f(t);if(r=arguments,o=this,u=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(v,e),c?h(t):a}(u);if(d)return clearTimeout(s),s=setTimeout(v,e),h(u)}return void 0===s&&(s=setTimeout(v,e)),a}return e=Yo(e)||0,zo(n)&&(c=!!n.leading,i=(d="maxWait"in n)?gp(Yo(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=o=s=void 0},g.flush=function(){return void 0===s?a:y(vp())},g}var bp=Object.prototype,xp=bp.hasOwnProperty,Ep=Ja((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&ns(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=ks(i),s=-1,u=a.length;++s<u;){var l=a[s],c=t[l];(void 0===c||Va(c,bp[l])&&!xp.call(t,l))&&(t[l]=i[l])}return t}));function Mp(t,e,n){(void 0!==n&&!Va(t[e],n)||void 0===n&&!(e in t))&&Ya(t,e,n)}function wp(t){return Eo(t)&&es(t)}function Tp(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Sp(t){return qa(t,ks(t))}function Ap(t,e,n,r,o){t!==e&&ip(e,(function(i,a){if(o||(o=new Gl),zo(i))!function(t,e,n,r,o,i,a){var s=Tp(t,n),u=Tp(e,n),l=a.get(u);if(l)Mp(t,n,l);else{var c=i?i(s,u,n+"",t,e,a):void 0,d=void 0===c;if(d){var p=Oo(u),h=!p&&ys(u),f=!p&&!h&&ws(u);c=u,p||h||f?Oo(s)?c=s:wp(s)?c=ki(s):h?(d=!1,c=ql(u,!0)):f?(d=!1,c=Sc(u,!0)):c=[]:Tu(u)||ds(u)?(c=s,ds(s)?c=Sp(s):zo(s)&&!ei(s)||(c=Fc(u))):d=!1}d&&(a.set(u,c),o(c,u,r,i,a),a.delete(u)),Mp(t,n,c)}}(t,e,a,n,Ap,r,o);else{var s=r?r(Tp(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),Mp(t,a,s)}}),ks)}function Op(t,e,n,r,o,i){return zo(t)&&zo(e)&&(i.set(e,t),Ap(t,e,void 0,Op,i),i.delete(e)),t}var Dp=rs((function(t,e,n,r){Ap(t,e,n,r)})),Np=Ja((function(t){return t.push(void 0,Op),Ei(Dp,void 0,t)}));function Pp(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var Cp=Ja((function(t,e){return Pp(t,1,e)})),Ip=Ja((function(t,e,n){return Pp(t,Yo(e)||0,n)}));function Lp(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}var jp=200;function kp(t,e,n,r){var o=-1,i=ea,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Ao(e,_s(n))),r?(i=Lp,a=!1):e.length>=jp&&(i=cd,a=!1,e=new ud(e));t:for(;++o<s;){var c=t[o],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var p=l;p--;)if(e[p]===d)continue t;u.push(c)}else i(e,d,r)||u.push(c)}return u}var Rp=Ja((function(t,e){return wp(t)?kp(t,fu(e,1,wp,!0)):[]}));function Bp(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var zp=Ja((function(t,e){var n=Bp(e);return wp(n)&&(n=void 0),wp(t)?kp(t,fu(e,1,wp,!0),ep(n)):[]})),Up=Ja((function(t,e){var n=Bp(e);return wp(n)&&(n=void 0),wp(t)?kp(t,fu(e,1,wp,!0),void 0,n):[]})),Hp=Io((function(t,e){return t/e}),1);function Xp(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?ju(t,r?0:i,r?i+1:o):ju(t,r?i+1:0,r?o:i)}function Gp(t){return"function"==typeof t?t:Zo}function Wp(t,e){return(Oo(t)?$i:up)(t,Gp(e))}function Yp(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var Vp=op(!0);function Fp(t,e){return t&&Vp(t,e,Ps)}var Kp=sp(Fp,!0);function qp(t,e){return(Oo(t)?Yp:Kp)(t,Gp(e))}function Zp(t){return function(e){var n=mc(e);return"[object Map]"==n?fd(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Ao(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var $p=Zp(Ps),Jp=Zp(ks),Qp=nl({"&":"&","<":"<",">":">",'"':""","'":"'"}),th=/[&<>"']/g,eh=RegExp(th.source);function nh(t){return(t=ou(t))&&eh.test(t)?t.replace(th,Qp):t}var rh=/[\\^$.*+?()[\]{}|]/g,oh=RegExp(rh.source);function ih(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function ah(t,e){var n=!0;return up(t,(function(t,r,o){return n=!!e(t,r,o)})),n}var sh=4294967295;function uh(t){return t?Xl(qo(t),0,sh):0}function lh(t,e){var n=[];return up(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function ch(t){return function(e,n,r){var o=Object(e);if(!es(e)){var i=ep(n);e=Ps(e),n=function(t){return i(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:void 0}}var dh=Math.max;function ph(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:qo(n);return o<0&&(o=dh(r+o,0)),Ji(t,ep(e),o)}var hh=ch(ph);function fh(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}var vh=Math.max,yh=Math.min;function gh(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=qo(n),o=n<0?vh(r+o,0):yh(o,r-1)),Ji(t,ep(e),o,!0)}var _h=ch(gh);function mh(t){return t&&t.length?t[0]:void 0}function bh(t,e){var n=-1,r=es(t)?Array(t.length):[];return up(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function xh(t,e){return(Oo(t)?Ao:bh)(t,ep(e))}var Eh=1/0;var Mh=1/0;var wh=Rl("floor");function Th(t){return yu((function(e){var n=e.length,r=n,o=ji.prototype.thru;for(t&&e.reverse();r--;){var i=e[r];if("function"!=typeof i)throw new TypeError("Expected a function");if(o&&!a&&"wrapper"==Li(i))var a=new ji([],!0)}for(r=a?r:n;++r<n;){var s=Li(i=e[r]),u="wrapper"==s?Pi(i):void 0;a=u&&Ui(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[Li(u[0])].apply(a,u[3]):1==i.length&&Ui(i)?a[s]():a.thru(i)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&Oo(r))return a.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}var Sh=Th(),Ah=Th(!0);function Oh(t,e){return Zl(e,(function(e){return ei(t[e])}))}var Dh=Object.prototype.hasOwnProperty,Nh=cp((function(t,e,n){Dh.call(t,n)?t[n].push(e):Ya(t,n,[e])}));function Ph(t,e){return t>e}function Ch(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Yo(e),n=Yo(n)),t(e,n)}}var Ih=Ch(Ph),Lh=Ch((function(t,e){return t>=e})),jh=Object.prototype.hasOwnProperty;function kh(t,e){return null!=t&&jh.call(t,e)}function Rh(t,e){return null!=t&&Kd(t,e,kh)}var Bh=Math.max,zh=Math.min;var Uh="[object String]";function Hh(t){return"string"==typeof t||!Oo(t)&&Eo(t)&&xo(t)==Uh}function Xh(t,e){return Ao(e,(function(e){return t[e]}))}function Gh(t){return null==t?[]:Xh(t,Ps(t))}var Wh=Math.max;var Yh=Math.max;function Vh(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:qo(n);return o<0&&(o=Yh(r+o,0)),ta(t,e,o)}var Fh=Math.min;function Kh(t,e,n){for(var r=n?Lp:ea,o=t[0].length,i=t.length,a=i,s=Array(i),u=1/0,l=[];a--;){var c=t[a];a&&e&&(c=Ao(c,_s(e))),u=Fh(c.length,u),s[a]=!n&&(e||o>=120&&c.length>=120)?new ud(a&&c):void 0}c=t[0];var d=-1,p=s[0];t:for(;++d<o&&l.length<u;){var h=c[d],f=e?e(h):h;if(h=n||0!==h?h:0,!(p?cd(p,f):r(l,f,n))){for(a=i;--a;){var v=s[a];if(!(v?cd(v,f):r(t[a],f,n)))continue t}p&&p.push(f),l.push(h)}}return l}function qh(t){return wp(t)?t:[]}var Zh=Ja((function(t){var e=Ao(t,qh);return e.length&&e[0]===t[0]?Kh(e):[]})),$h=Ja((function(t){var e=Bp(t),n=Ao(t,qh);return e===Bp(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Kh(n,ep(e)):[]})),Jh=Ja((function(t){var e=Bp(t),n=Ao(t,qh);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Kh(n,void 0,e):[]}));function Qh(t,e){return function(n,r){return function(t,e,n,r){return ap(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}var tf=Object.prototype.toString,ef=Qh((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=tf.call(e)),t[e]=n}),Fi(Zo)),nf=Object.prototype,rf=nf.hasOwnProperty,of=nf.toString,af=Qh((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=of.call(e)),rf.call(t,e)?t[e].push(n):t[e]=[n]}),ep);function sf(t,e){return e.length<2?t:uu(t,ju(e,0,-1))}function uf(t,e,n){var r=null==(t=sf(t,e=iu(e,t)))?t:t[su(Bp(e))];return null==r?void 0:Ei(r,t,n)}var lf=Ja(uf),cf=Ja((function(t,e,n){var r=-1,o="function"==typeof e,i=es(t)?Array(t.length):[];return up(t,(function(t){i[++r]=o?Ei(e,t,n):uf(t,e,n)})),i}));var df=Es&&Es.isArrayBuffer,pf=df?_s(df):function(t){return Eo(t)&&"[object ArrayBuffer]"==xo(t)};function hf(t){return!0===t||!1===t||Eo(t)&&"[object Boolean]"==xo(t)}var ff=Es&&Es.isDate,vf=ff?_s(ff):function(t){return Eo(t)&&"[object Date]"==xo(t)};var yf="[object Map]",gf="[object Set]",_f=Object.prototype.hasOwnProperty;function mf(t){if(null==t)return!0;if(es(t)&&(Oo(t)||"string"==typeof t||"function"==typeof t.splice||ys(t)||ws(t)||ds(t)))return!t.length;var e=mc(t);if(e==yf||e==gf)return!t.size;if(is(t))return!Ns(t).length;for(var n in t)if(_f.call(t,n))return!1;return!0}function bf(t,e){return zd(t,e)}var xf=co.isFinite;function Ef(t){return"number"==typeof t&&t==qo(t)}var Mf="[object Number]";function wf(t){return"number"==typeof t||Eo(t)&&xo(t)==Mf}var Tf=ri?ei:ps;function Sf(t){return null==t}var Af=Es&&Es.isRegExp,Of=Af?_s(Af):function(t){return Eo(t)&&"[object RegExp]"==xo(t)},Df=9007199254740991;function Nf(t){return void 0===t}var Pf=Array.prototype.join;var Cf=Il((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),If=cp((function(t,e,n){Ya(t,n,e)}));var Lf=Math.max,jf=Math.min;var kf=Il((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Rf=Ju("toLowerCase");function Bf(t,e){return t<e}var zf=Ch(Bf),Uf=Ch((function(t,e){return t<=e}));function Hf(t,e){var n={};return e=ep(e),ap(t,(function(t,r,o){Ya(n,e(t,r,o),t)})),n}function Xf(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===s?a==a&&!wo(a):n(a,s)))var s=a,u=i}return u}function Gf(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var Wf=NaN;function Yf(t,e){var n=null==t?0:t.length;return n?Gf(t,e)/n:Wf}var Vf=rs((function(t,e,n){Ap(t,e,n)})),Ff=Ja((function(t,e){return function(n){return uf(n,t,e)}})),Kf=Ja((function(t,e){return function(n){return uf(t,n,e)}}));function qf(t,e,n){var r=Ps(e),o=Oh(e,r),i=!(zo(n)&&"chain"in n&&!n.chain),a=ei(t);return $i(o,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=ki(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,du([this.value()],arguments))})})),t}var Zf=Io((function(t,e){return t*e}),1),$f="Expected a function";function Jf(t){if("function"!=typeof t)throw new TypeError($f);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Qf="[object Map]",tv="[object Set]",ev=po?po.iterator:void 0;function nv(t){if(!t)return[];if(es(t))return Hh(t)?$u(t):ki(t);if(ev&&t[ev])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ev]());var e=mc(t);return(e==Qf?fd:e==tv?vd:Gh)(t)}function rv(t,e){var n=t.length;if(n)return fa(e+=e<0?n:0,n)?t[e]:void 0}function ov(t,e){return null==(t=sf(t,e=iu(e,t)))||delete t[su(Bp(e))]}function iv(t){return Tu(t)?void 0:t}var av=yu((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ao(e,(function(e){return e=iu(e,t),r||(r=e.length>1),e})),qa(t,oc(t),n),r&&(n=ad(n,7,iv));for(var o=e.length;o--;)ov(n,e[o]);return n}));function sv(t,e,n,r){if(!zo(t))return t;for(var o=-1,i=(e=iu(e,t)).length,a=i-1,s=t;null!=s&&++o<i;){var u=su(e[o]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=zo(c)?c:fa(e[o+1])?[]:{})}Ka(s,u,l),s=s[u]}return t}function uv(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=uu(t,a);n(s,a)&&sv(i,iu(a,t),s)}return i}function lv(t,e){if(null==t)return{};var n=Ao(oc(t),(function(t){return[t]}));return e=ep(e),uv(t,n,(function(t,n){return e(t,n[0])}))}function cv(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=wo(t),a=void 0!==e,s=null===e,u=e==e,l=wo(e);if(!s&&!l&&!i&&t>e||i&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!l&&t<e||l&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!u)return-1}return 0}function dv(t,e,n){e=e.length?Ao(e,(function(t){return Oo(t)?function(e){return uu(e,1===t.length?t[0]:t)}:t})):[Zo];var r=-1;e=Ao(e,_s(ep));var o=bh(t,(function(t,n,o){var i=Ao(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=cv(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function pv(t){return yu((function(e){return e=Ao(e,_s(ep)),Ja((function(n){var r=this;return t(e,(function(t){return Ei(t,r,n)}))}))}))}var hv=pv(Ao),fv=Ja,vv=Math.min,yv=fv((function(t,e){var n=(e=1==e.length&&Oo(e[0])?Ao(e[0],_s(ep)):Ao(fu(e,1),_s(ep))).length;return Ja((function(r){for(var o=-1,i=vv(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Ei(t,this,r)}))})),gv=pv(ih),_v=pv(ld),mv=9007199254740991,bv=Math.floor;function xv(t,e){var n="";if(!t||e<1||e>mv)return n;do{e%2&&(n+=t),(e=bv(e/2))&&(t+=t)}while(e);return n}var Ev=Qd("length"),Mv="\\ud800-\\udfff",wv="["+Mv+"]",Tv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Sv="\\ud83c[\\udffb-\\udfff]",Av="[^"+Mv+"]",Ov="(?:\\ud83c[\\udde6-\\uddff]){2}",Dv="[\\ud800-\\udbff][\\udc00-\\udfff]",Nv="(?:"+Tv+"|"+Sv+")"+"?",Pv="[\\ufe0e\\ufe0f]?",Cv=Pv+Nv+("(?:\\u200d(?:"+[Av,Ov,Dv].join("|")+")"+Pv+Nv+")*"),Iv="(?:"+[Av+Tv+"?",Tv,Ov,Dv,wv].join("|")+")",Lv=RegExp(Sv+"(?="+Sv+")|"+Iv+Cv,"g");function jv(t){return Bu(t)?function(t){for(var e=Lv.lastIndex=0;Lv.test(t);)++e;return e}(t):Ev(t)}var kv=Math.ceil;function Rv(t,e){var n=(e=void 0===e?" ":Co(e)).length;if(n<2)return n?xv(e,t):e;var r=xv(e,kv(t/jv(e)));return Bu(e)?ku($u(r),0,t).join(""):r.slice(0,t)}var Bv=Math.ceil,zv=Math.floor;var Uv=/^\s+/,Hv=co.parseInt;var Xv=Ja((function(t,e){return Xa(t,32,void 0,e,ga(e,da(Xv)))}));Xv.placeholder={};var Gv=Ja((function(t,e){return Xa(t,64,void 0,e,ga(e,da(Gv)))}));Gv.placeholder={};var Wv=cp((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Yv=yu((function(t,e){return null==t?{}:function(t,e){return uv(t,e,(function(e,n){return qd(t,n)}))}(t,e)}));function Vv(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}var Fv=Array.prototype.splice;function Kv(t,e,n,r){var o=r?Vv:ta,i=-1,a=e.length,s=t;for(t===e&&(e=ki(e)),n&&(s=Ao(t,_s(n)));++i<a;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(s,c,u,r))>-1;)s!==t&&Fv.call(s,u,1),Fv.call(t,u,1);return t}function qv(t,e){return t&&t.length&&e&&e.length?Kv(t,e):t}var Zv=Ja(qv);var $v=Array.prototype.splice;function Jv(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;fa(o)?$v.call(t,o,1):ov(t,o)}}return t}var Qv=yu((function(t,e){var n=null==t?0:t.length,r=cu(t,e);return Jv(t,Ao(e,(function(t){return fa(t,n)?+t:t})).sort(cv)),r})),ty=Math.floor,ey=Math.random;function ny(t,e){return t+ty(ey()*(e-t+1))}var ry=parseFloat,oy=Math.min,iy=Math.random;var ay=Math.ceil,sy=Math.max;function uy(t){return function(e,n,r){return r&&"number"!=typeof r&&ns(e,n,r)&&(n=r=void 0),e=Ko(e),void 0===n?(n=e,e=0):n=Ko(n),function(t,e,n,r){for(var o=-1,i=sy(ay((e-t)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:Ko(r),t)}}var ly=uy(),cy=uy(!0),dy=yu((function(t,e){return Xa(t,256,void 0,void 0,void 0,e)}));function py(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function hy(t,e,n){var r=Oo(t)?el:py,o=arguments.length<3;return r(t,ep(e),n,o,up)}function fy(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}var vy=Array.prototype.reverse;function yy(t){return null==t?t:vy.call(t)}var gy=Rl("round");function _y(t){var e=t.length;return e?t[ny(0,e-1)]:void 0}function my(t){return _y(Gh(t))}function by(t,e){var n=-1,r=t.length,o=r-1;for(e=void 0===e?r:e;++n<e;){var i=ny(n,o),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function xy(t,e){return by(ki(t),Xl(e,0,t.length))}function Ey(t,e){var n=Gh(t);return by(n,Xl(e,0,n.length))}function My(t){return by(ki(t))}function wy(t){return by(Gh(t))}var Ty=Il((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Sy(t,e){var n;return up(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}var Ay=Ja((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ns(t,e[0],e[1])?e=[]:n>2&&ns(e[0],e[1],e[2])&&(e=[e[0]]),dv(t,fu(e,1),[])})),Oy=4294967294,Dy=Math.floor,Ny=Math.min;function Py(t,e,n,r){var o=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,u=wo(e),l=void 0===e;o<i;){var c=Dy((o+i)/2),d=n(t[c]),p=void 0!==d,h=null===d,f=d==d,v=wo(d);if(a)var y=r||f;else y=l?f&&(r||p):s?f&&p&&(r||!h):u?f&&p&&!h&&(r||!v):!h&&!v&&(r?d<=e:d<e);y?o=c+1:i=c}return Ny(i,Oy)}var Cy=2147483647;function Iy(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=Cy){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!wo(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return Py(t,e,Zo,n)}function Ly(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Va(s,u)){var u=s;i[o++]=0===a?0:a}}return i}var jy=Math.max;var ky=Il((function(t,e,n){return t+(n?" ":"")+Qu(e)}));var Ry=Io((function(t,e){return t-e}),0);var By=Object.prototype,zy=By.hasOwnProperty;function Uy(t,e,n,r){return void 0===t||Va(t,By[n])&&!zy.call(r,n)?e:t}var Hy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Xy(t){return"\\"+Hy[t]}var Gy=/<%=([\s\S]+?)%>/g,Wy={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Gy,variable:"",imports:{_:{escape:nh}}},Yy=/\b__p \+= '';/g,Vy=/\b(__p \+=) '' \+/g,Fy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ky=/[()=,{}\[\]\/\s]/,qy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zy=/($^)/,$y=/['\n\r\u2028\u2029\\]/g,Jy=Object.prototype.hasOwnProperty;function Qy(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return zo(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),mp(t,e,{leading:r,maxWait:e,trailing:o})}function tg(t,e){return e(t)}var eg=4294967295,ng=Math.min;function rg(t,e){var n=t;return n instanceof Di&&(n=n.value()),el(e,(function(t,e){return e.func.apply(e.thisArg,du([t],e.args))}),n)}function og(){return rg(this.__wrapped__,this.__actions__)}var ig=9007199254740991;function ag(t,e){for(var n=t.length;n--&&ta(e,t[n],0)>-1;);return n}function sg(t,e){for(var n=-1,r=t.length;++n<r&&ta(e,t[n],0)>-1;);return n}var ug=/^\s+/;var lg=/\w*$/;var cg=nl({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dg=/&(?:amp|lt|gt|quot|#39);/g,pg=RegExp(dg.source);var hg=sc&&1/vd(new sc([,-0]))[1]==1/0?function(t){return new sc(t)}:Ni,fg=200;function vg(t,e,n){var r=-1,o=ea,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=Lp;else if(i>=fg){var l=e?null:hg(t);if(l)return vd(l);a=!1,o=cd,u=new ud}else u=e?[]:s;t:for(;++r<i;){var c=t[r],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue t;e&&u.push(d),s.push(c)}else o(u,d,n)||(u!==s&&u.push(d),s.push(c))}return s}var yg=Ja((function(t){return vg(fu(t,1,wp,!0))})),gg=Ja((function(t){var e=Bp(t);return wp(e)&&(e=void 0),vg(fu(t,1,wp,!0),ep(e))})),_g=Ja((function(t){var e=Bp(t);return e="function"==typeof e?e:void 0,vg(fu(t,1,wp,!0),void 0,e)}));var mg=0;var bg=Math.max;function xg(t){if(!t||!t.length)return[];var e=0;return t=Zl(t,(function(t){if(wp(t))return e=bg(t.length,e),!0})),as(e,(function(e){return Ao(t,Qd(e))}))}function Eg(t,e){if(!t||!t.length)return[];var n=xg(t);return null==e?n:Ao(n,(function(t){return Ei(e,void 0,t)}))}function Mg(t,e,n,r){return sv(t,e,n(uu(t,e)),r)}var wg=Il((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var Tg=Ja((function(t,e){return wp(t)?kp(t,e):[]}));var Sg=yu((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return cu(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Di&&fa(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:tg,args:[o],thisArg:void 0}),new ji(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)}));function Ag(t,e,n){var r=t.length;if(r<2)return r?vg(t[0]):[];for(var o=-1,i=Array(r);++o<r;)for(var a=t[o],s=-1;++s<r;)s!=o&&(i[o]=kp(i[o]||a,t[s],e,n));return vg(fu(i,1),e,n)}var Og=Ja((function(t){return Ag(Zl(t,wp))})),Dg=Ja((function(t){var e=Bp(t);return wp(e)&&(e=void 0),Ag(Zl(t,wp),ep(e))})),Ng=Ja((function(t){var e=Bp(t);return e="function"==typeof e?e:void 0,Ag(Zl(t,wp),void 0,e)})),Pg=Ja(xg);function Cg(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}var Ig=Ja((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Eg(t,n)})),Lg={chunk:function(t,e,n){e=(n?ns(t,e,n):void 0===e)?1:Hl(qo(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,i=0,a=Array(Ul(r/e));o<r;)a[i++]=ju(t,o,o+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return du(Oo(n)?ki(n):[n],fu(e,1))},difference:Rp,differenceBy:zp,differenceWith:Up,drop:function(t,e,n){var r=null==t?0:t.length;return r?ju(t,(e=n||void 0===e?1:qo(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?ju(t,0,(e=r-(e=n||void 0===e?1:qo(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?Xp(t,ep(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?Xp(t,ep(e),!0):[]},fill:function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&ns(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=qo(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:qo(r))<0&&(r+=o),r=n>r?0:uh(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:ph,findLastIndex:gh,first:mh,flatten:vu,flattenDeep:function(t){return(null==t?0:t.length)?fu(t,Mh):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?fu(t,e=void 0===e?1:qo(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},head:mh,indexOf:Vh,initial:function(t){return(null==t?0:t.length)?ju(t,0,-1):[]},intersection:Zh,intersectionBy:$h,intersectionWith:Jh,join:function(t,e){return null==t?"":Pf.call(t,e)},last:Bp,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=qo(n))<0?Lf(r+o,0):jf(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Ji(t,Qi,o,!0)},nth:function(t,e){return t&&t.length?rv(t,qo(e)):void 0},pull:Zv,pullAll:qv,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?Kv(t,e,ep(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?Kv(t,e,void 0,n):t},pullAt:Qv,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ep(e);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return Jv(t,o),n},reverse:yy,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&ns(t,e,n)?(e=0,n=r):(e=null==e?0:qo(e),n=void 0===n?r:qo(n)),ju(t,e,n)):[]},sortedIndex:function(t,e){return Iy(t,e)},sortedIndexBy:function(t,e,n){return Py(t,e,ep(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Iy(t,e);if(r<n&&Va(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Iy(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Py(t,e,ep(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Iy(t,e,!0)-1;if(Va(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Ly(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Ly(t,ep(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?ju(t,1,e):[]},take:function(t,e,n){return t&&t.length?ju(t,0,(e=n||void 0===e?1:qo(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?ju(t,(e=r-(e=n||void 0===e?1:qo(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?Xp(t,ep(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?Xp(t,ep(e)):[]},union:yg,unionBy:gg,unionWith:_g,uniq:function(t){return t&&t.length?vg(t):[]},uniqBy:function(t,e){return t&&t.length?vg(t,ep(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?vg(t,void 0,e):[]},unzip:xg,unzipWith:Eg,without:Tg,xor:Og,xorBy:Dg,xorWith:Ng,zip:Pg,zipObject:function(t,e){return Cg(t||[],e||[],Ka)},zipObjectDeep:function(t,e){return Cg(t||[],e||[],sv)},zipWith:Ig},jg={countBy:pp,each:Wp,eachRight:qp,every:function(t,e,n){var r=Oo(t)?ih:ah;return n&&ns(t,e,n)&&(e=void 0),r(t,ep(e))},filter:function(t,e){return(Oo(t)?Zl:lh)(t,ep(e))},find:hh,findLast:_h,flatMap:function(t,e){return fu(xh(t,e),1)},flatMapDeep:function(t,e){return fu(xh(t,e),Eh)},flatMapDepth:function(t,e,n){return n=void 0===n?1:qo(n),fu(xh(t,e),n)},forEach:Wp,forEachRight:qp,groupBy:Nh,includes:function(t,e,n,r){t=es(t)?t:Gh(t),n=n&&!r?qo(n):0;var o=t.length;return n<0&&(n=Wh(o+n,0)),Hh(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&ta(t,e,n)>-1},invokeMap:cf,keyBy:If,map:xh,orderBy:function(t,e,n,r){return null==t?[]:(Oo(e)||(e=null==e?[]:[e]),Oo(n=r?void 0:n)||(n=null==n?[]:[n]),dv(t,e,n))},partition:Wv,reduce:hy,reduceRight:function(t,e,n){var r=Oo(t)?fy:py,o=arguments.length<3;return r(t,ep(e),n,o,Kp)},reject:function(t,e){return(Oo(t)?Zl:lh)(t,Jf(ep(e)))},sample:function(t){return(Oo(t)?_y:my)(t)},sampleSize:function(t,e,n){return e=(n?ns(t,e,n):void 0===e)?1:qo(e),(Oo(t)?xy:Ey)(t,e)},shuffle:function(t){return(Oo(t)?My:wy)(t)},size:function(t){if(null==t)return 0;if(es(t))return Hh(t)?jv(t):t.length;var e=mc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Ns(t).length},some:function(t,e,n){var r=Oo(t)?ld:Sy;return n&&ns(t,e,n)&&(e=void 0),r(t,ep(e))},sortBy:Ay},kg=vp,Rg={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=qo(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:Wa,before:Pu,bind:Cu,bindKey:Lu,curry:hp,curryRight:fp,debounce:mp,defer:Cp,delay:Ip,flip:function(t){return Xa(t,512)},memoize:tu,negate:Jf,once:function(t){return Pu(2,t)},overArgs:yv,partial:Xv,partialRight:Gv,rearg:dy,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return Ja(t,e=void 0===e?e:qo(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:jy(qo(e),0),Ja((function(n){var r=n[e],o=ku(n,0,e);return r&&du(o,r),Ei(t,this,o)}))},throttle:Qy,unary:function(t){return Wa(t,1)},wrap:function(t,e){return Xv(Gp(e),t)}},Bg={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return Oo(t)?t:[t]},clone:function(t){return ad(t,4)},cloneDeep:sd,cloneDeepWith:function(t,e){return ad(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return ad(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||np(t,e,Ps(e))},eq:Va,gt:Ih,gte:Lh,isArguments:ds,isArray:Oo,isArrayBuffer:pf,isArrayLike:es,isArrayLikeObject:wp,isBoolean:hf,isBuffer:ys,isDate:vf,isElement:function(t){return Eo(t)&&1===t.nodeType&&!Tu(t)},isEmpty:mf,isEqual:bf,isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?zd(t,e,void 0,n):!!r},isError:Ou,isFinite:function(t){return"number"==typeof t&&xf(t)},isFunction:ei,isInteger:Ef,isLength:ts,isMap:qc,isMatch:function(t,e){return t===e||Xd(t,e,Wd(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,Xd(t,e,Wd(e),n)},isNaN:function(t){return wf(t)&&t!=+t},isNative:function(t){if(Tf(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hi(t)},isNil:Sf,isNull:function(t){return null===t},isNumber:wf,isObject:zo,isObjectLike:Eo,isPlainObject:Tu,isRegExp:Of,isSafeInteger:function(t){return Ef(t)&&t>=-9007199254740991&&t<=Df},isSet:$c,isString:Hh,isSymbol:wo,isTypedArray:ws,isUndefined:Nf,isWeakMap:function(t){return Eo(t)&&"[object WeakMap]"==mc(t)},isWeakSet:function(t){return Eo(t)&&"[object WeakSet]"==xo(t)},lt:zf,lte:Uf,toArray:nv,toFinite:Ko,toInteger:qo,toLength:uh,toNumber:Yo,toPlainObject:Sp,toSafeInteger:function(t){return t?Xl(qo(t),-9007199254740991,ig):0===t?t:0},toString:ou},zg={add:Lo,ceil:Bl,divide:Hp,floor:wh,max:function(t){return t&&t.length?Xf(t,Zo,Ph):void 0},maxBy:function(t,e){return t&&t.length?Xf(t,ep(e),Ph):void 0},mean:function(t){return Yf(t,Zo)},meanBy:function(t,e){return Yf(t,ep(e))},min:function(t){return t&&t.length?Xf(t,Zo,Bf):void 0},minBy:function(t,e){return t&&t.length?Xf(t,ep(e),Bf):void 0},multiply:Zf,round:gy,subtract:Ry,sum:function(t){return t&&t.length?Gf(t,Zo):0},sumBy:function(t,e){return t&&t.length?Gf(t,ep(e)):0}},Ug=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=Yo(n))==n?n:0),void 0!==e&&(e=(e=Yo(e))==e?e:0),Xl(Yo(t),e,n)},Hg=function(t,e,n){return e=Ko(e),void 0===n?(n=e,e=0):n=Ko(n),function(t,e,n){return t>=zh(e,n)&&t<Bh(e,n)}(t=Yo(t),e,n)},Xg=function(t,e,n){if(n&&"boolean"!=typeof n&&ns(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=Ko(t),void 0===e?(e=t,t=0):e=Ko(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=iy();return oy(t+o*(e-t+ry("1e-"+((o+"").length-1))),e)}return ny(t,e)},Gg={assign:Is,assignIn:Rs,assignInWith:Bs,assignWith:zs,at:gu,create:function(t,e){var n=mi(t);return null==e?n:Wl(n,e)},defaults:Ep,defaultsDeep:Np,entries:$p,entriesIn:Jp,extend:Rs,extendWith:Bs,findKey:function(t,e){return fh(t,ep(e),ap)},findLastKey:function(t,e){return fh(t,ep(e),Fp)},forIn:function(t,e){return null==t?t:ip(t,Gp(e),ks)},forInRight:function(t,e){return null==t?t:Vp(t,Gp(e),ks)},forOwn:function(t,e){return t&&ap(t,Gp(e))},forOwnRight:function(t,e){return t&&Fp(t,Gp(e))},functions:function(t){return null==t?[]:Oh(t,Ps(t))},functionsIn:function(t){return null==t?[]:Oh(t,ks(t))},get:lu,has:Rh,hasIn:qd,invert:ef,invertBy:af,invoke:lf,keys:Ps,keysIn:ks,mapKeys:Hf,mapValues:function(t,e){var n={};return e=ep(e),ap(t,(function(t,r,o){Ya(n,r,e(t,r,o))})),n},merge:Vf,mergeWith:Dp,omit:av,omitBy:function(t,e){return lv(t,Jf(ep(e)))},pick:Yv,pickBy:lv,result:function(t,e,n){var r=-1,o=(e=iu(e,t)).length;for(o||(o=1,t=void 0);++r<o;){var i=null==t?void 0:t[su(e[r])];void 0===i&&(r=o,i=n),t=ei(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:sv(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:sv(t,e,n,r)},toPairs:$p,toPairsIn:Jp,transform:function(t,e,n){var r=Oo(t),o=r||ys(t)||ws(t);if(e=ep(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:zo(t)&&ei(i)?mi(_u(t)):{}}return(o?$i:ap)(t,(function(t,r,o){return e(n,t,r,o)})),n},unset:function(t,e){return null==t||ov(t,e)},update:function(t,e,n){return null==t?t:Mg(t,e,Gp(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Mg(t,e,Gp(n),r)},values:Gh,valuesIn:function(t){return null==t?[]:Xh(t,ks(t))}},Wg={at:Sg,chain:zl,commit:function(){return new ji(this.value(),this.__chain__)},lodash:zi,next:function(){void 0===this.__values__&&(this.__values__=nv(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof Ai;){var r=Ri(n);r.__index__=0,r.__values__=void 0,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Di){var e=t;return this.__actions__.length&&(e=new Di(this)),(e=e.reverse()).__actions__.push({func:tg,args:[yy],thisArg:void 0}),new ji(e,this.__chain__)}return this.thru(yy)},tap:function(t,e){return e(t),t},thru:tg,toIterator:function(){return this},toJSON:og,value:og,valueOf:og,wrapperChain:function(){return zl(this)}},Yg={camelCase:Ll,capitalize:tl,deburr:al,endsWith:function(t,e,n){t=ou(t),e=Co(e);var r=t.length,o=n=void 0===n?r:Xl(qo(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},escape:nh,escapeRegExp:function(t){return(t=ou(t))&&oh.test(t)?t.replace(rh,"\\$&"):t},kebabCase:Cf,lowerCase:kf,lowerFirst:Rf,pad:function(t,e,n){t=ou(t);var r=(e=qo(e))?jv(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Rv(zv(o),n)+t+Rv(Bv(o),n)},padEnd:function(t,e,n){t=ou(t);var r=(e=qo(e))?jv(t):0;return e&&r<e?t+Rv(e-r,n):t},padStart:function(t,e,n){t=ou(t);var r=(e=qo(e))?jv(t):0;return e&&r<e?Rv(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),Hv(ou(t).replace(Uv,""),e||0)},repeat:function(t,e,n){return e=(n?ns(t,e,n):void 0===e)?1:qo(e),xv(ou(t),e)},replace:function(){var t=arguments,e=ou(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Ty,split:function(t,e,n){return n&&"number"!=typeof n&&ns(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=ou(t))&&("string"==typeof e||null!=e&&!Of(e))&&!(e=Co(e))&&Bu(t)?ku($u(t),0,n):t.split(e,n):[]},startCase:ky,startsWith:function(t,e,n){return t=ou(t),n=null==n?0:Xl(qo(n),0,t.length),e=Co(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=Wy.imports._.templateSettings||Wy;n&&ns(t,e,n)&&(e=void 0),t=ou(t),e=Bs({},e,r,Uy);var o,i,a=Bs({},e.imports,r.imports,Uy),s=Ps(a),u=Xh(a,s),l=0,c=e.interpolate||Zy,d="__p += '",p=RegExp((e.escape||Zy).source+"|"+c.source+"|"+(c===Gy?qy:Zy).source+"|"+(e.evaluate||Zy).source+"|$","g"),h=Jy.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(p,(function(e,n,r,a,s,u){return r||(r=a),d+=t.slice(l,u).replace($y,Xy),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),d+="';\n";var f=Jy.call(e,"variable")&&e.variable;if(f){if(Ky.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(Yy,""):d).replace(Vy,"$1").replace(Fy,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Du((function(){return Function(s,h+"return "+d).apply(void 0,u)}));if(v.source=d,Ou(v))throw v;return v},templateSettings:Wy,toLower:function(t){return ou(t).toLowerCase()},toUpper:function(t){return ou(t).toUpperCase()},trim:function(t,e,n){if((t=ou(t))&&(n||void 0===e))return Bo(t);if(!t||!(e=Co(e)))return t;var r=$u(t),o=$u(e);return ku(r,sg(r,o),ag(r,o)+1).join("")},trimEnd:function(t,e,n){if((t=ou(t))&&(n||void 0===e))return t.slice(0,ko(t)+1);if(!t||!(e=Co(e)))return t;var r=$u(t);return ku(r,0,ag(r,$u(e))+1).join("")},trimStart:function(t,e,n){if((t=ou(t))&&(n||void 0===e))return t.replace(ug,"");if(!t||!(e=Co(e)))return t;var r=$u(t);return ku(r,sg(r,$u(e))).join("")},truncate:function(t,e){var n=30,r="...";if(zo(e)){var o="separator"in e?e.separator:o;n="length"in e?qo(e.length):n,r="omission"in e?Co(e.omission):r}var i=(t=ou(t)).length;if(Bu(t)){var a=$u(t);i=a.length}if(n>=i)return t;var s=n-jv(r);if(s<1)return r;var u=a?ku(a,0,s).join(""):t.slice(0,s);if(void 0===o)return u+r;if(a&&(s+=u.length-s),Of(o)){if(t.slice(s).search(o)){var l,c=u;for(o.global||(o=RegExp(o.source,ou(lg.exec(o))+"g")),o.lastIndex=0;l=o.exec(c);)var d=l.index;u=u.slice(0,void 0===d?s:d)}}else if(t.indexOf(Co(o),s)!=s){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+r},unescape:function(t){return(t=ou(t))&&pg.test(t)?t.replace(dg,cg):t},upperCase:wg,upperFirst:Qu,words:Pl},Vg={attempt:Du,bindAll:Iu,cond:function(t){var e=null==t?0:t.length,n=ep;return t=e?Ao(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Ja((function(n){for(var r=-1;++r<e;){var o=t[r];if(Ei(o[0],this,n))return Ei(o[1],this,n)}}))},conforms:function(t){return function(t){var e=Ps(t);return function(n){return np(n,t,e)}}(ad(t,1))},constant:Fi,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Sh,flowRight:Ah,identity:Zo,iteratee:function(t){return ep("function"==typeof t?t:ad(t,1))},matches:function(t){return Vd(ad(t,1))},matchesProperty:function(t,e){return Jd(t,ad(e,1))},method:Ff,methodOf:Kf,mixin:qf,noop:Ni,nthArg:function(t){return t=qo(t),Ja((function(e){return rv(e,t)}))},over:hv,overEvery:gv,overSome:_v,property:tp,propertyOf:function(t){return function(e){return null==t?void 0:uu(t,e)}},range:ly,rangeRight:cy,stubArray:$l,stubFalse:ps,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=qo(t))<1||t>9007199254740991)return[];var n=eg,r=ng(t,eg);e=Gp(e),t-=eg;for(var o=as(r,e);++n<t;)e(n);return o},toPath:function(t){return Oo(t)?Ao(t,su):wo(t)?[t]:ki(ru(ou(t)))},uniqueId:function(t){var e=++mg;return ou(t)+e}};var Fg=Math.max,Kg=Math.min;var qg=Math.min;
|
|
16
16
|
/**
|
|
17
17
|
* @license
|
|
18
18
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
@@ -22,5 +22,11 @@
|
|
|
22
22
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
23
23
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
24
24
|
*/
|
|
25
|
-
var Xg,Gg,Wg=4294967295,Yg=Array.prototype,Fg=Object.prototype.hasOwnProperty,Vg=ho?ho.iterator:void 0,Kg=Math.max,qg=Math.min,Zg=function(t){return function(e,n,r){if(null==r){var o=Ho(n),i=o&&Cs(n),a=i&&i.length&&Oh(n,i);(a?a.length:o)||(r=n,n=e,e=this)}return t(e,n,r)}}(Xf);Hi.after=Ng.after,Hi.ary=Ng.ary,Hi.assign=kg.assign,Hi.assignIn=kg.assignIn,Hi.assignInWith=kg.assignInWith,Hi.assignWith=kg.assignWith,Hi.at=kg.at,Hi.before=Ng.before,Hi.bind=Ng.bind,Hi.bindAll=Bg.bindAll,Hi.bindKey=Ng.bindKey,Hi.castArray=Dg.castArray,Hi.chain=Rg.chain,Hi.chunk=Ag.chunk,Hi.compact=Ag.compact,Hi.concat=Ag.concat,Hi.cond=Bg.cond,Hi.conforms=Bg.conforms,Hi.constant=Bg.constant,Hi.countBy=Og.countBy,Hi.create=kg.create,Hi.curry=Ng.curry,Hi.curryRight=Ng.curryRight,Hi.debounce=Ng.debounce,Hi.defaults=kg.defaults,Hi.defaultsDeep=kg.defaultsDeep,Hi.defer=Ng.defer,Hi.delay=Ng.delay,Hi.difference=Ag.difference,Hi.differenceBy=Ag.differenceBy,Hi.differenceWith=Ag.differenceWith,Hi.drop=Ag.drop,Hi.dropRight=Ag.dropRight,Hi.dropRightWhile=Ag.dropRightWhile,Hi.dropWhile=Ag.dropWhile,Hi.fill=Ag.fill,Hi.filter=Og.filter,Hi.flatMap=Og.flatMap,Hi.flatMapDeep=Og.flatMapDeep,Hi.flatMapDepth=Og.flatMapDepth,Hi.flatten=Ag.flatten,Hi.flattenDeep=Ag.flattenDeep,Hi.flattenDepth=Ag.flattenDepth,Hi.flip=Ng.flip,Hi.flow=Bg.flow,Hi.flowRight=Bg.flowRight,Hi.fromPairs=Ag.fromPairs,Hi.functions=kg.functions,Hi.functionsIn=kg.functionsIn,Hi.groupBy=Og.groupBy,Hi.initial=Ag.initial,Hi.intersection=Ag.intersection,Hi.intersectionBy=Ag.intersectionBy,Hi.intersectionWith=Ag.intersectionWith,Hi.invert=kg.invert,Hi.invertBy=kg.invertBy,Hi.invokeMap=Og.invokeMap,Hi.iteratee=Bg.iteratee,Hi.keyBy=Og.keyBy,Hi.keys=Cs,Hi.keysIn=kg.keysIn,Hi.map=Og.map,Hi.mapKeys=kg.mapKeys,Hi.mapValues=kg.mapValues,Hi.matches=Bg.matches,Hi.matchesProperty=Bg.matchesProperty,Hi.memoize=Ng.memoize,Hi.merge=kg.merge,Hi.mergeWith=kg.mergeWith,Hi.method=Bg.method,Hi.methodOf=Bg.methodOf,Hi.mixin=Zg,Hi.negate=Yf,Hi.nthArg=Bg.nthArg,Hi.omit=kg.omit,Hi.omitBy=kg.omitBy,Hi.once=Ng.once,Hi.orderBy=Og.orderBy,Hi.over=Bg.over,Hi.overArgs=Ng.overArgs,Hi.overEvery=Bg.overEvery,Hi.overSome=Bg.overSome,Hi.partial=Ng.partial,Hi.partialRight=Ng.partialRight,Hi.partition=Og.partition,Hi.pick=kg.pick,Hi.pickBy=kg.pickBy,Hi.property=Bg.property,Hi.propertyOf=Bg.propertyOf,Hi.pull=Ag.pull,Hi.pullAll=Ag.pullAll,Hi.pullAllBy=Ag.pullAllBy,Hi.pullAllWith=Ag.pullAllWith,Hi.pullAt=Ag.pullAt,Hi.range=Bg.range,Hi.rangeRight=Bg.rangeRight,Hi.rearg=Ng.rearg,Hi.reject=Og.reject,Hi.remove=Ag.remove,Hi.rest=Ng.rest,Hi.reverse=Ag.reverse,Hi.sampleSize=Og.sampleSize,Hi.set=kg.set,Hi.setWith=kg.setWith,Hi.shuffle=Og.shuffle,Hi.slice=Ag.slice,Hi.sortBy=Og.sortBy,Hi.sortedUniq=Ag.sortedUniq,Hi.sortedUniqBy=Ag.sortedUniqBy,Hi.split=Lg.split,Hi.spread=Ng.spread,Hi.tail=Ag.tail,Hi.take=Ag.take,Hi.takeRight=Ag.takeRight,Hi.takeRightWhile=Ag.takeRightWhile,Hi.takeWhile=Ag.takeWhile,Hi.tap=Rg.tap,Hi.throttle=Ng.throttle,Hi.thru=Fv,Hi.toArray=Dg.toArray,Hi.toPairs=kg.toPairs,Hi.toPairsIn=kg.toPairsIn,Hi.toPath=Bg.toPath,Hi.toPlainObject=Dg.toPlainObject,Hi.transform=kg.transform,Hi.unary=Ng.unary,Hi.union=Ag.union,Hi.unionBy=Ag.unionBy,Hi.unionWith=Ag.unionWith,Hi.uniq=Ag.uniq,Hi.uniqBy=Ag.uniqBy,Hi.uniqWith=Ag.uniqWith,Hi.unset=kg.unset,Hi.unzip=Ag.unzip,Hi.unzipWith=Ag.unzipWith,Hi.update=kg.update,Hi.updateWith=kg.updateWith,Hi.values=kg.values,Hi.valuesIn=kg.valuesIn,Hi.without=Ag.without,Hi.words=Lg.words,Hi.wrap=Ng.wrap,Hi.xor=Ag.xor,Hi.xorBy=Ag.xorBy,Hi.xorWith=Ag.xorWith,Hi.zip=Ag.zip,Hi.zipObject=Ag.zipObject,Hi.zipObjectDeep=Ag.zipObjectDeep,Hi.zipWith=Ag.zipWith,Hi.entries=kg.toPairs,Hi.entriesIn=kg.toPairsIn,Hi.extend=kg.assignIn,Hi.extendWith=kg.assignInWith,Zg(Hi,Hi),Hi.add=Pg.add,Hi.attempt=Bg.attempt,Hi.camelCase=Lg.camelCase,Hi.capitalize=Lg.capitalize,Hi.ceil=Pg.ceil,Hi.clamp=Cg,Hi.clone=Dg.clone,Hi.cloneDeep=Dg.cloneDeep,Hi.cloneDeepWith=Dg.cloneDeepWith,Hi.cloneWith=Dg.cloneWith,Hi.conformsTo=Dg.conformsTo,Hi.deburr=Lg.deburr,Hi.defaultTo=Bg.defaultTo,Hi.divide=Pg.divide,Hi.endsWith=Lg.endsWith,Hi.eq=Dg.eq,Hi.escape=Lg.escape,Hi.escapeRegExp=Lg.escapeRegExp,Hi.every=Og.every,Hi.find=Og.find,Hi.findIndex=Ag.findIndex,Hi.findKey=kg.findKey,Hi.findLast=Og.findLast,Hi.findLastIndex=Ag.findLastIndex,Hi.findLastKey=kg.findLastKey,Hi.floor=Pg.floor,Hi.forEach=Og.forEach,Hi.forEachRight=Og.forEachRight,Hi.forIn=kg.forIn,Hi.forInRight=kg.forInRight,Hi.forOwn=kg.forOwn,Hi.forOwnRight=kg.forOwnRight,Hi.get=kg.get,Hi.gt=Dg.gt,Hi.gte=Dg.gte,Hi.has=kg.has,Hi.hasIn=kg.hasIn,Hi.head=Ag.head,Hi.identity=$o,Hi.includes=Og.includes,Hi.indexOf=Ag.indexOf,Hi.inRange=jg,Hi.invoke=kg.invoke,Hi.isArguments=Dg.isArguments,Hi.isArray=No,Hi.isArrayBuffer=Dg.isArrayBuffer,Hi.isArrayLike=Dg.isArrayLike,Hi.isArrayLikeObject=Dg.isArrayLikeObject,Hi.isBoolean=Dg.isBoolean,Hi.isBuffer=Dg.isBuffer,Hi.isDate=Dg.isDate,Hi.isElement=Dg.isElement,Hi.isEmpty=Dg.isEmpty,Hi.isEqual=Dg.isEqual,Hi.isEqualWith=Dg.isEqualWith,Hi.isError=Dg.isError,Hi.isFinite=Dg.isFinite,Hi.isFunction=Dg.isFunction,Hi.isInteger=Dg.isInteger,Hi.isLength=Dg.isLength,Hi.isMap=Dg.isMap,Hi.isMatch=Dg.isMatch,Hi.isMatchWith=Dg.isMatchWith,Hi.isNaN=Dg.isNaN,Hi.isNative=Dg.isNative,Hi.isNil=Dg.isNil,Hi.isNull=Dg.isNull,Hi.isNumber=Dg.isNumber,Hi.isObject=Ho,Hi.isObjectLike=Dg.isObjectLike,Hi.isPlainObject=Dg.isPlainObject,Hi.isRegExp=Dg.isRegExp,Hi.isSafeInteger=Dg.isSafeInteger,Hi.isSet=Dg.isSet,Hi.isString=Dg.isString,Hi.isSymbol=Dg.isSymbol,Hi.isTypedArray=Dg.isTypedArray,Hi.isUndefined=Dg.isUndefined,Hi.isWeakMap=Dg.isWeakMap,Hi.isWeakSet=Dg.isWeakSet,Hi.join=Ag.join,Hi.kebabCase=Lg.kebabCase,Hi.last=zd,Hi.lastIndexOf=Ag.lastIndexOf,Hi.lowerCase=Lg.lowerCase,Hi.lowerFirst=Lg.lowerFirst,Hi.lt=Dg.lt,Hi.lte=Dg.lte,Hi.max=Pg.max,Hi.maxBy=Pg.maxBy,Hi.mean=Pg.mean,Hi.meanBy=Pg.meanBy,Hi.min=Pg.min,Hi.minBy=Pg.minBy,Hi.stubArray=Bg.stubArray,Hi.stubFalse=Bg.stubFalse,Hi.stubObject=Bg.stubObject,Hi.stubString=Bg.stubString,Hi.stubTrue=Bg.stubTrue,Hi.multiply=Pg.multiply,Hi.nth=Ag.nth,Hi.noop=Bg.noop,Hi.now=Tg,Hi.pad=Lg.pad,Hi.padEnd=Lg.padEnd,Hi.padStart=Lg.padStart,Hi.parseInt=Lg.parseInt,Hi.random=Ig,Hi.reduce=Og.reduce,Hi.reduceRight=Og.reduceRight,Hi.repeat=Lg.repeat,Hi.replace=Lg.replace,Hi.result=kg.result,Hi.round=Pg.round,Hi.sample=Og.sample,Hi.size=Og.size,Hi.snakeCase=Lg.snakeCase,Hi.some=Og.some,Hi.sortedIndex=Ag.sortedIndex,Hi.sortedIndexBy=Ag.sortedIndexBy,Hi.sortedIndexOf=Ag.sortedIndexOf,Hi.sortedLastIndex=Ag.sortedLastIndex,Hi.sortedLastIndexBy=Ag.sortedLastIndexBy,Hi.sortedLastIndexOf=Ag.sortedLastIndexOf,Hi.startCase=Lg.startCase,Hi.startsWith=Lg.startsWith,Hi.subtract=Pg.subtract,Hi.sum=Pg.sum,Hi.sumBy=Pg.sumBy,Hi.template=Lg.template,Hi.times=Bg.times,Hi.toFinite=Dg.toFinite,Hi.toInteger=Zo,Hi.toLength=Dg.toLength,Hi.toLower=Lg.toLower,Hi.toNumber=Dg.toNumber,Hi.toSafeInteger=Dg.toSafeInteger,Hi.toString=Dg.toString,Hi.toUpper=Lg.toUpper,Hi.trim=Lg.trim,Hi.trimEnd=Lg.trimEnd,Hi.trimStart=Lg.trimStart,Hi.truncate=Lg.truncate,Hi.unescape=Lg.unescape,Hi.uniqueId=Bg.uniqueId,Hi.upperCase=Lg.upperCase,Hi.upperFirst=Lg.upperFirst,Hi.each=Og.forEach,Hi.eachRight=Og.forEachRight,Hi.first=Ag.head,Zg(Hi,(Xg={},sd(Hi,(function(t,e){Fg.call(Hi.prototype,e)||(Xg[e]=t)})),Xg),{chain:!1}),Hi.VERSION="4.17.21",(Hi.templateSettings=Lg.templateSettings).imports._=Hi,Ji(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hi[t].placeholder=Hi})),Ji(["drop","take"],(function(t,e){Di.prototype[t]=function(n){n=void 0===n?1:Kg(Zo(n),0);var r=this.__filtered__&&!e?new Di(this):this.clone();return r.__filtered__?r.__takeCount__=qg(n,r.__takeCount__):r.__views__.push({size:qg(n,Wg),type:t+(r.__dir__<0?"Right":"")}),r},Di.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ji(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Di.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:nd(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ji(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Di.prototype[t]=function(){return this[n](1).value()[0]}})),Ji(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Di.prototype[t]=function(){return this.__filtered__?new Di(this):this[n](1)}})),Di.prototype.compact=function(){return this.filter($o)},Di.prototype.find=function(t){return this.filter(t).head()},Di.prototype.findLast=function(t){return this.reverse().find(t)},Di.prototype.invokeMap=Qa((function(t,e){return"function"==typeof t?new Di(this):this.map((function(n){return af(n,t,e)}))})),Di.prototype.reject=function(t){return this.filter(Yf(nd(t)))},Di.prototype.slice=function(t,e){t=Zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Di(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=Zo(e))<0?n.dropRight(-e):n.take(e-t)),n)},Di.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Di.prototype.toArray=function(){return this.take(Wg)},sd(Di.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Hi[r?"take"+("last"==e?"Right":""):e],i=r||/^find/.test(e);o&&(Hi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Di,u=a[0],l=s||No(e),c=function(t){var e=o.apply(Hi,du([t],a));return r&&p?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var p=this.__chain__,d=!!this.__actions__.length,h=i&&!p,f=s&&!d;if(!i&&l){e=f?e:new Di(this);var y=t.apply(e,a);return y.__actions__.push({func:Fv,args:[c],thisArg:void 0}),new Ri(y,p)}return h&&f?t.apply(this,a):(y=this.thru(c),h?r?y.value()[0]:y.value():y)})})),Ji(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Yg[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hi.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(No(o)?o:[],t)}return this[n]((function(n){return e.apply(No(n)?n:[],t)}))}})),sd(Di.prototype,(function(t,e){var n=Hi[e];if(n){var r=n.name+"";Fg.call(ji,r)||(ji[r]=[]),ji[r].push({name:e,func:n})}})),ji[Ma(void 0,2).name]=[{name:"wrapper",func:void 0}],Di.prototype.clone=function(){var t=new Di(this.__wrapped__);return t.__actions__=Li(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Li(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Li(this.__views__),t},Di.prototype.reverse=function(){if(this.__filtered__){var t=new Di(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Di.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=No(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Hg(e,t+a);break;case"takeRight":t=zg(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,p=c.length,d=0,h=Ug(u,this.__takeCount__);if(!n||!r&&o==u&&h==u)return qv(t,this.__actions__);var f=[];t:for(;u--&&d<h;){for(var y=-1,v=t[l+=e];++y<p;){var g=c[y],_=g.iteratee,m=g.type,b=_(v);if(2==m)v=b;else if(!b){if(1==m)continue t;break t}}f[d++]=v}return f},Hi.prototype.at=Rg.at,Hi.prototype.chain=Rg.wrapperChain,Hi.prototype.commit=Rg.commit,Hi.prototype.next=Rg.next,Hi.prototype.plant=Rg.plant,Hi.prototype.reverse=Rg.reverse,Hi.prototype.toJSON=Hi.prototype.valueOf=Hi.prototype.value=Rg.value,Hi.prototype.first=Hi.prototype.head,Vg&&(Hi.prototype[Vg]=Rg.toIterator),t.Options=void 0,(Gg=t.Options||(t.Options={})).get=function(t){var e=ro(t,[]),n=t.container;if(null==n)throw new Error("Ensure the container of LogicFlow is specified and valid.");return null==t.width&&(e.width=n.clientWidth),null==t.height&&(e.height=n.clientHeight),Is({},Gg.defaults,e)},function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(t.Options||(t.Options={}));var $g={node:!1,edge:!1},Jg={node:!0,edge:!0},Qg=function(t){return t&&"boolean"!=typeof t?zf(up($g),t):up(!0===t?Jg:$g)},t_=Qg,e_=null!==cu(window,"navigator.userAgent","").match(/MSIE|Trident/);function n_(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var r_,o_,i_,a_,s_,u_,l_=200;t.ElementState=void 0,(r_=t.ElementState||(t.ElementState={}))[r_.DEFAULT=1]="DEFAULT",r_[r_.TEXT_EDIT=2]="TEXT_EDIT",r_[r_.SHOW_MENU=3]="SHOW_MENU",r_[r_.ALLOW_CONNECT=4]="ALLOW_CONNECT",r_[r_.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT",t.ElementType=void 0,(o_=t.ElementType||(t.ElementType={})).NODE="node",o_.EDGE="edge",o_.GRAPH="graph",t.ModelType=void 0,(i_=t.ModelType||(t.ModelType={})).NODE="node",i_.CIRCLE_NODE="circle-node",i_.POLYGON_NODE="polygon-node",i_.RECT_NODE="rect-node",i_.TEXT_NODE="text-node",i_.ELLIPSE_NODE="ellipse-node",i_.DIAMOND_NODE="diamond-node",i_.HTML_NODE="html-node",i_.CUSTOM_HTML_NODE="custom-html-node",i_.EDGE="edge",i_.LINE_EDGE="line-edge",i_.POLYLINE_EDGE="polyline-edge",i_.BEZIER_EDGE="bezier-edge",i_.GRAPH="graph",t.EventType=void 0,(a_=t.EventType||(t.EventType={})).ELEMENT_CLICK="element:click",a_.NODE_ADD="node:add",a_.NODE_DELETE="node:delete",a_.NODE_CLICK="node:click",a_.NODE_DBCLICK="node:dbclick",a_.NODE_GROUP_COPY="node:group-copy-add",a_.NODE_DND_ADD="node:dnd-add",a_.NODE_DND_DRAG="node:dnd-drag",a_.NODE_MOUSEDOWN="node:mousedown",a_.NODE_DRAGSTART="node:dragstart",a_.NODE_DRAG="node:drag",a_.NODE_DROP="node:drop",a_.NODE_MOUSEUP="node:mouseup",a_.NODE_MOUSEMOVE="node:mousemove",a_.NODE_MOUSEENTER="node:mouseenter",a_.NODE_MOUSELEAVE="node:mouseleave",a_.NODE_CONTEXTMENU="node:contextmenu",a_.NODE_ROTATE="node:rotate",a_.NODE_RESIZE="node:resize",a_.NODE_PROPERTIES_CHANGE="node:properties-change",a_.NODE_PROPERTIES_DELETE="node:properties-delete",a_.EDGE_ADD="edge:add",a_.EDGE_DELETE="edge:delete",a_.EDGE_CLICK="edge:click",a_.EDGE_DBCLICK="edge:dbclick",a_.EDGE_MOUSEENTER="edge:mouseenter",a_.EDGE_MOUSELEAVE="edge:mouseleave",a_.EDGE_CONTEXTMENU="edge:contextmenu",a_.EDGE_ADJUST="edge:adjust",a_.EDGE_EXCHANGE_NODE="edge:exchange-node",a_.ANCHOR_DRAGSTART="anchor:dragstart",a_.ANCHOR_DRAG="anchor:drag",a_.ANCHOR_DROP="anchor:drop",a_.ANCHOR_DRAGEND="anchor:dragend",a_.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",a_.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",a_.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",a_.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",a_.ADJUST_POINT_DRAG="adjustPoint:drag",a_.ADJUST_POINT_DROP="adjustPoint:drop",a_.ADJUST_POINT_DRAGEND="adjustPoint:dragend",a_.BLANK_MOUSEDOWN="blank:mousedown",a_.BLANK_DRAGSTART="blank:dragstart",a_.BLANK_DRAG="blank:drag",a_.BLANK_DROP="blank:drop",a_.BLANK_MOUSEMOVE="blank:mousemove",a_.BLANK_MOUSEUP="blank:mouseup",a_.BLANK_CLICK="blank:click",a_.BLANK_CONTEXTMENU="blank:contextmenu",a_.SELECTION_MOUSEDOWN="selection:mousedown",a_.SELECTION_DRAGSTART="selection:dragstart",a_.SELECTION_DRAG="selection:drag",a_.SELECTION_DROP="selection:drop",a_.SELECTION_MOUSEMOVE="selection:mousemove",a_.SELECTION_MOUSEUP="selection:mouseup",a_.SELECTION_CONTEXTMENU="selection:contextmenu",a_.CONNECTION_NOT_ALLOWED="connection:not-allowed",a_.HISTORY_CHANGE="history:change",a_.TEXT_UPDATE="text:update",a_.GRAPH_TRANSFORM="graph:transform",a_.GRAPH_RENDERED="graph:rendered",function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(s_||(s_={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(u_||(u_={}));var c_=function(){function e(e){var n=e.onDragStart,r=void 0===n?Pi:n,o=e.onDragging,i=void 0===o?Pi:o,a=e.onDragEnd,s=void 0===a?Pi:a,u=e.eventType,l=void 0===u?"":u,c=e.eventCenter,p=e.step,d=void 0===p?1:p,h=e.isStopPropagation,f=void 0===h||h,y=e.model,v=e.data,g=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(e){var n,r,o=null===window||void 0===window?void 0:window.document;if(0===e.button){g.isStopPropagation&&e.stopPropagation(),g.isStartDragging=!0,g.startX=e.clientX,g.startY=e.clientY,o.addEventListener("mousemove",g.handleMouseMove,!1),o.addEventListener("mouseup",g.handleMouseUp,!1);var i=null===(n=g.model)||void 0===n?void 0:n.getData();null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_MOUSEDOWN")],{e:e,data:g.data||i}),g.startTime=(new Date).getTime()}},this.handleMouseMove=function(e){var n,r;if(g.isStopPropagation&&e.stopPropagation(),g.isStartDragging&&(g.sumDeltaX+=e.clientX-g.startX,g.sumDeltaY+=e.clientY-g.startY,g.startX=e.clientX,g.startY=e.clientY,g.step<=1||Math.abs(g.sumDeltaX)>g.step||Math.abs(g.sumDeltaY)>g.step)){var o=g.sumDeltaX%g.step,i=g.sumDeltaY%g.step,a=g.sumDeltaX-o,s=g.sumDeltaY-i;g.sumDeltaX=o,g.sumDeltaY=i;var u=null===(n=g.model)||void 0===n?void 0:n.getData();g.isDragging||(null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAGSTART")],{e:e,data:g.data||u}),g.onDragStart({event:e})),g.isDragging=!0,Promise.resolve().then((function(){var n,r;g.onDragging({deltaX:a,deltaY:s,event:e}),null===(n=g.eventCenter)||void 0===n||n.emit(t.EventType["".concat(g.eventType,"_MOUSEMOVE")],{e:e,data:g.data||u}),null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAG")],{e:e,data:g.data||u})}))}},this.handleMouseUp=function(e){var n=window.document;g.isStartDragging=!1,g.isStopPropagation&&e.stopPropagation(),Promise.resolve().then((function(){var r,o,i;n.removeEventListener("mousemove",g.handleMouseMove,!1),n.removeEventListener("mouseup",g.handleMouseUp,!1);var a=null===(r=g.model)||void 0===r?void 0:r.getData();null===(o=g.eventCenter)||void 0===o||o.emit(t.EventType["".concat(g.eventType,"_MOUSEUP")],{e:e,data:g.data||a}),g.isDragging&&(g.isDragging=!1,g.onDragEnd({event:e}),null===(i=g.eventCenter)||void 0===i||i.emit(t.EventType["".concat(g.eventType,"_DROP")],{e:e,data:g.data||a}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",g.handleMouseMove,!1),t.removeEventListener("mouseup",g.handleMouseUp,!1),g.onDragEnd({event:null}),g.isDragging=!1},this.onDragStart=r,this.onDragging=i,this.onDragEnd=s,this.step=d,this.isStopPropagation=f,this.eventType=l,this.eventCenter=c,this.model=y,this.data=v}return e.prototype.setStep=function(t){this.step=t},e.prototype.setModel=function(t){this.model=t},e}(),p_=function(t){var e=t.start,n=t.end,r=t.offset,o=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),u=Math.atan(r/o),l=Math.sqrt(o*o+r*r);return"start"===i?n.x>=e.x?(a.leftX=e.x+l*Math.sin(s+u),a.leftY=e.y-l*Math.cos(s+u),a.rightX=e.x-l*Math.sin(s-u),a.rightY=e.y+l*Math.cos(s-u)):(a.leftX=e.x-l*Math.sin(s+u),a.leftY=e.y+l*Math.cos(s+u),a.rightX=e.x+l*Math.sin(s-u),a.rightY=e.y-l*Math.cos(s-u)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+l*Math.sin(s-u),a.leftY=n.y-l*Math.cos(s-u),a.rightX=n.x-l*Math.sin(s+u),a.rightY=n.y+l*Math.cos(s+u)):(a.leftX=n.x-l*Math.sin(s-u),a.leftY=n.y+l*Math.cos(s-u),a.rightX=n.x+l*Math.sin(s+u),a.rightY=n.y-l*Math.cos(s+u))),a},d_=function(t,e,n){var r=t.x,o=t.y,i=e.x,a=e.y,s=n.x,u=n.y,l=(u-a)/(s-i),c=a-l*i;return r>=i&&r<=s&&o>=a&&o<=u&&Math.abs(o-l*r+c)<Number.EPSILON},h_=function(t,e){return 2*Math.abs(t.centerX-e.centerX)<t.width+e.width&&2*Math.abs(t.centerY-e.centerY)<t.height+e.height},f_=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},y_=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},v_=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height?u_.HORIZONTAL:u_.VERTICAL},g_=function(t,e,n){return v_(n,e)===u_.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},__=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),o=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+o)/2,y:(r+i)/2,centerX:(n+o)/2,centerY:(r+i)/2,minX:n,minY:r,maxX:o,maxY:i,height:i-r,width:o-n}},m_=function(t,e){void 0===t&&(t=[]);var n=[],r=[];t.forEach((function(t){n.push(t.x),r.push(t.y)}));var o=Math.min.apply(Math,ao([],io(n),!1)),i=Math.max.apply(Math,ao([],io(n),!1)),a=Math.min.apply(Math,ao([],io(r),!1)),s=Math.max.apply(Math,ao([],io(r),!1)),u=i-o,l=s-a;return e&&(u+=e,l+=e),{centerX:(o+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:o,minY:a,x:(o+i)/2,y:(a+s)/2,height:l,width:u}},b_=function(t){var e=t.minX,n=t.minY,r=t.maxX,o=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:o},{x:e,y:o}]},E_=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},x_=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},w_=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},S_=function(t,e){return ao(ao([],io(x_(t,e.x)),!1),io(w_(t,e.y)),!1)},M_=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},A_=function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n},O_=function(t,e,n,r,o){return M_(t,e)+M_(t,n)+A_(t,[e,n,r,o])},T_=function(t,e,n,r,o){o||(o=0),t.unshift(e[r]),n[r]&&n[r]!==r&&o<=100&&T_(t,e,n,n[r],o+1)},N_=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},D_=function(t,e,n,r){var o=e.x-t.x,i=e.y-t.y,a=r.x-n.x,s=r.y-n.y,u=(-i*(t.x-n.x)+o*(t.y-n.y))/(-a*i+o*s),l=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+o*s);return u>=0&&u<=1&&l>=0&&l<=1},P_=function(t,e,n){if(0===n.width&&0===n.height)return!1;var r=io(b_(n),4),o=r[0],i=r[1],a=r[2],s=r[3];return D_(t,e,o,i)||D_(t,e,o,s)||D_(t,e,i,a)||D_(t,e,a,s)},C_=function(t,e,n,r){var o=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||P_(t,e,n)||P_(t,e,r)||o.push(t))})),f_(o)},j_=function(t,e,n,r,o,i,a){var s=[],u=[e],l={},c={},p={};e.id&&(c[e.id]=0,p[e.id]=O_(e,n,e));var d={};t.forEach((function(t){t.id&&(d[t.id]=t)}));for(var h=function(){var h,f=1/0;if(u.forEach((function(t){t.id&&p[t.id]<f&&(f=p[t.id],h=t)})),h===n&&n.id){var y=[];return T_(y,d,l,n.id),{value:y}}if(!h)return{value:[e,n]};N_(u,h),s.push(h),C_(t,h,r,o).forEach((function(t){if(-1===s.indexOf(t)&&(-1===u.indexOf(t)&&u.push(t),(null==h?void 0:h.id)&&(null==t?void 0:t.id))){var r=p[h.id]+M_(h,t);if(c[t.id]&&r>=c[t.id])return;l[t.id]=h.id,c[t.id]=r,p[t.id]=c[t.id]+O_(t,n,e,i,a)}}))};u.length;){var f=h();if("object"==typeof f)return f.value}return[e,n]},I_=function(t){return Em(t)},k_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],o=t[e+1];n.x===r.x&&r.x===o.x||n.y===r.y&&r.y===o.y?t.splice(e,1):e++}return t},R_=function(t,e,n,r,o){var i=I_(n),a=I_(r),s=y_(i,o),u=y_(a,o),l=g_(s,i,t),c=g_(u,a,e);if(h_(s,u))return ao(ao([t,l],io(G_(t,e,l,c)),!1),[c,e],!1);var p=m_([l,c]),d=__(s,p),h=__(u,p),f=[];f=(f=f.concat(b_(d))).concat(b_(h));var y={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[p,d,h].forEach((function(t){f=f.concat(S_(t,y).filter((function(t){return E_(t,s)&&E_(t,u)})))})),[{x:l.x,y:c.y},{x:c.x,y:l.y}].forEach((function(t){E_(t,s)&&E_(t,u)&&f.push(t)})),f.unshift(l),f.push(c),f=f_(f);var v=j_(f,l,c,i,a,t,e);return v.unshift(t),v.push(e),v.length>2&&(v=k_(v)),f_(v)},L_=function(t){var e;if(1===t.length)e=[t[0],t[0]];else if(t.length>=2){for(var n=t[0],r=t[1],o=_m(n.x,n.y,r.x,r.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],u=_m(a.x,a.y,s.x,s.y);u>o&&(o=u,n=a,r=s)}e=[n,r]}return e},B_=function(t,e,n){var r=mm(t,n),o=mm(e,n);return r&&o},z_=function(t,e,n){var r=mm(t,n),o=mm(e,n);return!(r&&o)&&(r||o)},H_=function(t,e,n){for(var r,o=void 0,i=Em(n),a=b_(i),s=0;s<a.length;s++){D_(t,e,a[s],a[(s+1)%a.length])&&(o=[a[s],a[(s+1)%a.length]])}return o&&(r=function(t,e,n,r){var o=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(0===o)return!1;var i=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/o,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/o;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-r.x)<=0&&(a-n.y)*(a-r.y)<=0&&{x:i,y:a}}(t,e,o[0],o[1])),r},U_=function(t,e){var n=void 0;return t.x===e.x?n=u_.VERTICAL:t.y===e.y&&(n=u_.HORIZONTAL),n},X_=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=io(t.split(","),2),r=e[0],o=e[1];n.push({x:Number(r),y:Number(o)})})),n},G_=function(t,e,n,r){var o=[];if(U_(t,n)===U_(e,r))t.y===n.y?(o.push({x:n.x,y:(n.y+r.y)/2}),o.push({x:r.x,y:(n.y+r.y)/2})):(o.push({x:(n.x+r.x)/2,y:n.y}),o.push({x:(n.x+r.x)/2,y:r.y}));else{var i={x:n.x,y:r.y},a=d_(i,t,n),s=d_(i,e,r);if(a||s)i={x:r.x,y:n.y};else{var u=W_(i,t,n),l=W_(i,e,r);u&&l&&(i={x:r.x,y:n.y})}o.push(i)}return o},W_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},Y_=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=r>=1&&r<=126||r>=65376&&r<=65439?1:2}return e},F_=void 0,V_=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=p_(no(no({},o),{type:"start"})),a=p_(no(no({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},K_=function(t){var e=t.start,n=t.end,r=t.sourceNode,o=t.targetNode,i=t.offset,a=Em(r),s=Em(o),u=y_(a,i),l=y_(s,i);return{sNext:g_(u,a,e),ePre:g_(l,s,n)}},q_=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[Z_(e[0]),Z_(e[1]),Z_(e[2]),Z_(e[3])]},Z_=function(t){var e=io(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},$_=function(t,e){var n=io(t,4);return[ob(n[0],n[1],n[2],n[3],e),t[3]]},J_=function(t,e){for(var n,r=t.x,o=t.y,i=X_(e),a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});if(s.forEach((function(t){var e=t.start,i=t.end;if(e.x===i.x){var s={x:e.x,y:o};if(d_(s,e,i))(u=Math.abs(e.x-r))<a&&(a=u,n=s)}else if(e.y===i.y){var u;s={x:r,y:e.y};if(d_(s,e,i))(u=Math.abs(e.y-o))<a&&(a=u,n=s)}})),!n){var l=s[0],c=l.start,p=l.end;n={x:c.x+(p.x-c.x)/2,y:c.y+(p.y-c.y)/2}}return n},Q_=function(t){return By(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},tm=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function em(t,e){return"function"!=typeof e?function(e,n,r){return Object.assign({type:t.edgeType},r)}:function(n,r,o){var i=e(n,r,o);return i?"string"==typeof i?Object.assign({},o,{type:i}):Object.assign({type:i},o):{type:t.edgeType}}}function nm(t,e){return e*Math.round(t/e)||t}function rm(t,e,n){if(!t)return[];var r=Math.min.apply(Math,ao([],io(t.map((function(t){return t[0]}))),!1)),o=Math.max.apply(Math,ao([],io(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,ao([],io(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,ao([],io(t.map((function(t){return t[1]}))),!1)),s=-r,u=-i,l=t.map((function(t){var e=io(t,2),n=e[0],r=e[1];return[n+s,r+u]})),c=e?e/(o-r):1,p=n?n/(a-i):1,d=Math.min(c,p);return l.map((function(t){var e=io(t,2),n=e[0],r=e[1];return[n*d,r*d]}))}var om=function(t,e,n){var r=io(t,2),o=r[0],i=r[1],a=io(e,2),s=a[0],u=a[1],l=io(n,2),c=l[0],p=l[1];return o>s&&o<c&&i>u&&i<p},im=function(t,e){var n=!1;switch(e.multipleSelectKey){case"meta":n=t.metaKey;break;case"alt":n=t.altKey;break;case"shift":n=t.shiftKey;break;case"ctrl":n=t.ctrlKey;break;default:n=!1}return n};function am(t,e){return!!(t instanceof um&&e instanceof um)}var sm=function(t){function e(n,r,o){var i=t.call(this,3)||this;return i[0]=n,i[1]=r,i[2]=o,i.x=n,i.y=r,i.z=o,Object.setPrototypeOf(i,e.prototype),i}return eo(e,t),e.prototype.add=function(t){if(am(this,t))return new um(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new lm((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(am(this,t))return new um(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new um(this.x-t.x,this.y-t.y):new lm((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),um=function(t){function e(n,r,o){var i=t.call(this,n,r,null!=o?o:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return eo(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,r){return t+n*e[r]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(sm),lm=function(t){function e(n,r){var o=t.call(this,n,r,1)||this;return Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.toString=function(){return"Point"},e}(sm),cm=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.call(this,n.length)||this;return o.fill(new Array(3)),n.forEach((function(t,e){o[e]=t})),o.columns=n[0].length,o.rows=n.length,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return ao([],io(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,ao([void 0],io(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var r=0;r<this.rows;r++)for(var o=this.getRow(r),i=function(e){var i=t.getColumn(e);n[r][e]=o.reduce((function(t,e,n){return t+e*i[n]}),0)},a=0;a<t.columns;a++)i(a);return new(e.bind.apply(e,ao([void 0],io(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new lm(t[0],t[1])}))},e.prototype.toString=function(){var t=io(this[0],2),e=t[0],n=t[1],r=io(this[1],2),o=r[0],i=r[1],a=io(this[2],2),s=a[0],u=a[1];return"matrix(".concat(e," ").concat(n," ").concat(o," ").concat(i," ").concat(s," ").concat(u,")")},e.prototype.translate=function(t,e){return this.cross(new hm(t,e))},e.prototype.rotate=function(t){return this.cross(new pm(t))},e.prototype.scale=function(t,e){return this.cross(new dm(t,e))},e}(Array),pm=function(t){function e(n){var r=t.call(this,new um(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new um(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new um(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return eo(e,t),e.prototype.inverse=function(){return this.transpose()},e}(cm),dm=function(t){function e(n,r){var o=t.call(this,new um(n,0,0),new um(0,r,0),new um(0,0,1))||this;return o.sx=n,o.sy=r,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(cm),hm=function(t){function e(n,r){var o=t.call(this,new um(1,0,0),new um(0,1,0),new um(n,r,1))||this;return o.tx=n,o.ty=r,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(cm);ce({isolateGlobalState:!0});var fm=function(t){return t.anchors},ym=function(t,e){for(var n,r=e.nodes,o=r.length-1;o>=0;o--){var i=r[o];if(bm(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!vm(i,n.node,e)||(n=s)}}}return n},vm=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},gm=function(t,e){for(var n,r=fm(e),o=Number.MAX_SAFE_INTEGER,i=0;i<r.length;i++){var a=_m(t.x,t.y,r[i].x,r[i].y);a<o&&(o=a,n={index:i,anchor:no(no({},r[i]),{x:r[i].x,y:r[i].y,id:r[i].id})})}return n},_m=function(t,e,n,r){return Math.hypot(t-n,e-r)},mm=function(t,e){var n=!1,r=Em(e);return t.x>=r.minX-0&&t.x<=r.maxX+0&&t.y>=r.minY-0&&t.y<=r.maxY+0&&(n=!0),n},bm=function(t,e){var n=!1,r=Em(e);return t.x>=r.minX-5&&t.x<=r.maxX+5&&t.y>=r.minY-5&&t.y<=r.maxY+5&&(n=!0),n},Em=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{minX:e-r/2,minY:n-o/2,maxX:e+r/2,maxY:n+o/2,x:e,y:n,width:r,height:o,centerX:e,centerY:n}},xm=function(t){var e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.radius;return[{x:n-o/2+a,y:r-i/2+a,r:a},{x:n+o/2-a,y:r-i/2+a,r:a},{x:n-o/2+a,y:r+i/2-a,r:a},{x:n+o/2-a,y:r+i/2-a,r:a}]},wm=function(t,e,n){var r,o=xm(n),i=Number.MAX_SAFE_INTEGER;return o.forEach((function(e){var n=_m(t.x,t.y,e.x,e.y);n<i&&(i=n,r=e)})),Sm(t,e,r)},Sm=function(t,e,n){var r,o=n.x,i=n.y,a=n.r;if(e===u_.HORIZONTAL){var s=o-Math.sqrt(a*a-(t.y-i)*(t.y-i)),u=o+Math.sqrt(a*a-(t.y-i)*(t.y-i));r={x:Math.abs(s-t.x)<Math.abs(u-t.x)?s:u,y:t.y}}else if(e===u_.VERTICAL){var l=i-Math.sqrt(a*a-(t.x-o)*(t.x-o)),c=i+Math.sqrt(a*a-(t.x-o)*(t.x-o)),p=Math.abs(l-t.y)<Math.abs(c-t.y)?l:c;r={x:t.x,y:p}}return r},Mm=function(t,e){var n=e,r=!1,o=n.x,i=n.y,a=n.width,s=n.height,u=n.radius,l=o-a/2+u,c=o+a/2-u,p=i-s/2+u,d=i+s/2-u;return t.y===i+s/2||t.y===i-s/2?r=t.x>l&&t.x<c:t.x!==o+a/2&&t.x!==o-a/2||(r=t.y>p&&t.y<d),r},Am=function(t,e,n){var r,o=n,i=o.x,a=o.y,s=o.rx,u=o.ry;if(e===u_.HORIZONTAL){var l=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(u*u)),c=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(u*u));r={x:Math.abs(l-t.x)<Math.abs(c-t.x)?l:c,y:t.y}}else if(e===u_.VERTICAL){var p=a-Math.sqrt(u*u-(t.x-i)*(t.x-i)*u*u/(s*s)),d=a+Math.sqrt(u*u-(t.x-i)*(t.x-i)*u*u/(s*s)),h=Math.abs(p-t.y)<Math.abs(d-t.y)?p:d;r={x:t.x,y:h}}return r},Om=function(t,e,n){for(var r,o=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach((function(n){var o=n.start,a=n.end,s=o,u=a;o.x>a.x&&(s=a,u=o);var l={x:t.x,y:t.y};if(s.x===u.x&&e===u_.HORIZONTAL&&(l={x:s.x,y:t.y}),s.y===u.y&&e===u_.VERTICAL&&(l={x:t.x,y:s.y}),s.x!==u.x&&s.y!==u.y){var c=(u.y-s.y)/(u.x-s.x),p=(s.x*u.y-u.x*s.y)/(s.x-u.x);e===u_.HORIZONTAL?l={x:(t.y-p)/c,y:t.y}:e===u_.VERTICAL&&(l={x:t.x,y:c*t.x+p})}if(d_(l,o,a)){var d=_m(l.x,l.y,t.x,t.y);d<i&&(i=d,r=l)}})),r},Tm=function(t){return By(t,["id","type","x","y","text","properties","virtual","rotate"])},Nm=function(t,e,n,r){var o=t.x,i=t.y;return e.x>t.x?o=t.x+n/2:e.x<t.x&&(o=t.x-n/2),e.y>t.y?i=t.y+r/2:e.y<t.y&&(i=t.y-r/2),{x:o,y:i}},Dm=function(t){var e=t.rows,n=t.style,r=t.rowsLength,o=t.className,i=document.createElement("div");i.style.fontSize=n.fontSize,i.style.width=n.width,i.className=o,i.style.lineHeight=n.lineHeight,i.style.padding=n.padding,n.fontFamily&&(i.style.fontFamily=n.fontFamily),r>1?e.forEach((function(t){var e=document.createElement("div");e.textContent=t,i.appendChild(e)})):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},Pm=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return e&&e.forEach((function(t){var e=Y_(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}},Cm=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let jm;const Im=new Uint8Array(16);function km(){if(!jm&&(jm="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jm(Im)}var Rm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Lm=[];for(let t=0;t<256;++t)Lm.push((t+256).toString(16).slice(1));function Bm(t,e=0){return Lm[t[e+0]]+Lm[t[e+1]]+Lm[t[e+2]]+Lm[t[e+3]]+"-"+Lm[t[e+4]]+Lm[t[e+5]]+"-"+Lm[t[e+6]]+Lm[t[e+7]]+"-"+Lm[t[e+8]]+Lm[t[e+9]]+"-"+Lm[t[e+10]]+Lm[t[e+11]]+Lm[t[e+12]]+Lm[t[e+13]]+Lm[t[e+14]]+Lm[t[e+15]]}function zm(t){if(!function(t){return"string"==typeof t&&Rm.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function Hm(t,e,n){function r(t,r,o,i){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=zm(r)),16!==(null===(a=r)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(r),s.set(t,r.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=s[t];return o}return Bm(s)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function Um(t){return 14+(t+64>>>9<<4)+1}function Xm(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function Gm(t,e,n,r,o,i){return Xm((a=Xm(Xm(e,t),Xm(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function Wm(t,e,n,r,o,i,a){return Gm(e&n|~e&r,t,e,o,i,a)}function Ym(t,e,n,r,o,i,a){return Gm(e&r|n&~r,t,e,o,i,a)}function Fm(t,e,n,r,o,i,a){return Gm(e^n^r,t,e,o,i,a)}function Vm(t,e,n,r,o,i,a){return Gm(n^(e|~r),t,e,o,i,a)}Hm("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=t[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[Um(e)-1]=e;let n=1732584193,r=-271733879,o=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=r,u=o,l=i;n=Wm(n,r,o,i,t[e],7,-680876936),i=Wm(i,n,r,o,t[e+1],12,-389564586),o=Wm(o,i,n,r,t[e+2],17,606105819),r=Wm(r,o,i,n,t[e+3],22,-1044525330),n=Wm(n,r,o,i,t[e+4],7,-176418897),i=Wm(i,n,r,o,t[e+5],12,1200080426),o=Wm(o,i,n,r,t[e+6],17,-1473231341),r=Wm(r,o,i,n,t[e+7],22,-45705983),n=Wm(n,r,o,i,t[e+8],7,1770035416),i=Wm(i,n,r,o,t[e+9],12,-1958414417),o=Wm(o,i,n,r,t[e+10],17,-42063),r=Wm(r,o,i,n,t[e+11],22,-1990404162),n=Wm(n,r,o,i,t[e+12],7,1804603682),i=Wm(i,n,r,o,t[e+13],12,-40341101),o=Wm(o,i,n,r,t[e+14],17,-1502002290),r=Wm(r,o,i,n,t[e+15],22,1236535329),n=Ym(n,r,o,i,t[e+1],5,-165796510),i=Ym(i,n,r,o,t[e+6],9,-1069501632),o=Ym(o,i,n,r,t[e+11],14,643717713),r=Ym(r,o,i,n,t[e],20,-373897302),n=Ym(n,r,o,i,t[e+5],5,-701558691),i=Ym(i,n,r,o,t[e+10],9,38016083),o=Ym(o,i,n,r,t[e+15],14,-660478335),r=Ym(r,o,i,n,t[e+4],20,-405537848),n=Ym(n,r,o,i,t[e+9],5,568446438),i=Ym(i,n,r,o,t[e+14],9,-1019803690),o=Ym(o,i,n,r,t[e+3],14,-187363961),r=Ym(r,o,i,n,t[e+8],20,1163531501),n=Ym(n,r,o,i,t[e+13],5,-1444681467),i=Ym(i,n,r,o,t[e+2],9,-51403784),o=Ym(o,i,n,r,t[e+7],14,1735328473),r=Ym(r,o,i,n,t[e+12],20,-1926607734),n=Fm(n,r,o,i,t[e+5],4,-378558),i=Fm(i,n,r,o,t[e+8],11,-2022574463),o=Fm(o,i,n,r,t[e+11],16,1839030562),r=Fm(r,o,i,n,t[e+14],23,-35309556),n=Fm(n,r,o,i,t[e+1],4,-1530992060),i=Fm(i,n,r,o,t[e+4],11,1272893353),o=Fm(o,i,n,r,t[e+7],16,-155497632),r=Fm(r,o,i,n,t[e+10],23,-1094730640),n=Fm(n,r,o,i,t[e+13],4,681279174),i=Fm(i,n,r,o,t[e],11,-358537222),o=Fm(o,i,n,r,t[e+3],16,-722521979),r=Fm(r,o,i,n,t[e+6],23,76029189),n=Fm(n,r,o,i,t[e+9],4,-640364487),i=Fm(i,n,r,o,t[e+12],11,-421815835),o=Fm(o,i,n,r,t[e+15],16,530742520),r=Fm(r,o,i,n,t[e+2],23,-995338651),n=Vm(n,r,o,i,t[e],6,-198630844),i=Vm(i,n,r,o,t[e+7],10,1126891415),o=Vm(o,i,n,r,t[e+14],15,-1416354905),r=Vm(r,o,i,n,t[e+5],21,-57434055),n=Vm(n,r,o,i,t[e+12],6,1700485571),i=Vm(i,n,r,o,t[e+3],10,-1894986606),o=Vm(o,i,n,r,t[e+10],15,-1051523),r=Vm(r,o,i,n,t[e+1],21,-2054922799),n=Vm(n,r,o,i,t[e+8],6,1873313359),i=Vm(i,n,r,o,t[e+15],10,-30611744),o=Vm(o,i,n,r,t[e+6],15,-1560198380),r=Vm(r,o,i,n,t[e+13],21,1309151649),n=Vm(n,r,o,i,t[e+4],6,-145523070),i=Vm(i,n,r,o,t[e+11],10,-1120210379),o=Vm(o,i,n,r,t[e+2],15,718787259),r=Vm(r,o,i,n,t[e+9],21,-343485551),n=Xm(n,a),r=Xm(r,s),o=Xm(o,u),i=Xm(i,l)}return[n,r,o,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(Um(e));for(let r=0;r<e;r+=8)n[r>>5]|=(255&t[r/8])<<r%32;return n}(t),8*t.length))}));var Km={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qm(t,e,n){if(Km.randomUUID&&!e&&!t)return Km.randomUUID();const r=(t=t||{}).random||(t.rng||km)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return Bm(r)}function Zm(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function $m(t,e){return t<<e|t>>>32-e}Hm("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=$m(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],a=n[1],s=n[2],u=n[3],l=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=$m(o,5)+Zm(n,a,s,u)+l+e[n]+r[t]>>>0;l=u,u=s,s=$m(a,30)>>>0,a=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var Jm=function(){return qm()},Qm=new Map,tb=function(t){var e=Jm();var n=window.requestAnimationFrame((function n(){if(t(),Qm.get(e)){var r=window.requestAnimationFrame(n);Qm.set(e,r)}}));return Qm.set(e,n),e},eb=function(t){var e=Qm.get(t);e&&(window.cancelAnimationFrame(e),Qm.delete(t))},nb=100,rb={x:1,y:0,z:0};function ob(t,e,n,r,o){for(var i=function(o){if(o<0||o>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-o,3)+3*e.x*o*Math.pow(1-o,2)+3*n.x*Math.pow(o,2)*(1-o)+r.x*Math.pow(o,3),y:t.y*Math.pow(1-o,3)+3*e.y*o*Math.pow(1-o,2)+3*n.y*Math.pow(o,2)*(1-o)+r.y*Math.pow(o,3)}},a=0,s=2,u=r.x,l=r.y,c=r;a<o&&s<50;){var p=(c=i(1-s/nb)).x,d=c.y;a=_m(u,l,p,d),s++}return c}function ib(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function ab(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),r=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,r){return t+e*n[r]}))}(ib(t),ib(e)));return n>=0?r:-r}(rb,t)}function sb(t){return t*(180/Math.PI)}var ub={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},lb=function(t){var e=up(ub);return t&&(e=zf(e,t)),e},cb=lb,pb=1e3,db=999,hb=function(){return++pb},fb=function(){return--db},yb=Object.freeze({__proto__:null,Matrix:cm,Point:lm,RotateMatrix:pm,ScaleMatrix:dm,StepDrag:c_,TranslateMatrix:hm,Vector:um,action:te,cancelRaf:eb,computed:rt,configure:ce,costByPoints:A_,createEdgeGenerator:em,createRaf:tb,createUuid:Jm,defaultAnimationOffConfig:$g,defaultAnimationOnConfig:Jg,defaultTheme:ub,degrees:sb,distance:_m,estimateDistance:M_,filterRepeatPoints:f_,formatData:n_,formateAnchorConnectValidateData:Cm,getAnchors:fm,getAppendAttributes:V_,getBBoxCrossPointsByPoint:S_,getBBoxOfPoints:m_,getBBoxXCrossPoints:x_,getBBoxYCrossPoints:w_,getBezierControlPoints:K_,getBezierPoints:q_,getBoxByOriginNode:I_,getBytesLength:Y_,getClosestAnchor:gm,getClosestPointOfPolyline:J_,getClosestRadiusCenter:wm,getCrossPointInRect:H_,getCrossPointWithCircle:Sm,getCrossPointWithEllipse:Am,getCrossPointWithPolygon:Om,getEndTangent:$_,getExpandedBBox:y_,getExpandedBBoxPoint:g_,getGridOffset:function(t,e){return t%e},getHtmlTextHeight:Dm,getLongestEdge:L_,getMinIndex:fb,getNextNeighborPoints:C_,getNodeAnchorPosition:Nm,getNodeBBox:Em,getPointsFromBBox:b_,getPolylinePoints:R_,getRectRadiusCircle:xm,getSimplePoints:G_,getSimplePolyline:function(t,e){var n=[t,{x:t.x,y:e.y},e];return f_(n)},getSvgTextWidthHeight:Pm,getTextWidth:function(t,e){F_||(F_=document.createElement("canvas"));var n=F_.getContext("2d");return n.font=e,n.measureText(t).width},getThetaOfVector:ab,getZIndex:hb,heuristicCostEstimate:O_,inStraightLineOfRect:Mm,isBboxOverLapping:h_,isIe:e_,isInNode:mm,isInNodeBbox:bm,isMultipleSelect:im,isObservable:Se,isPointInArea:om,isPointOutsideBBox:E_,isSegmentCrossingBBox:P_,isSegmentsCrossNode:z_,isSegmentsInNode:B_,isSegmentsIntersected:D_,mergeBBox:__,normalizePolygon:rm,observable:$,pathFinder:j_,pickEdgeConfig:Q_,pickNodeConfig:Tm,pointDirection:v_,pointEdgeDirection:function(t,e){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);return n/e.width>r/e.height?u_.VERTICAL:u_.HORIZONTAL},pointFilter:k_,points2PointsList:X_,reaction:ae,rebuildPath:T_,refreshGraphId:function(t,e){void 0===e&&(e="");var n=t.nodes.reduce((function(t,n){return t[n.id]=e+qm(),n.id=t[n.id],t}),{});return t.edges.forEach((function(t){t.id=e+qm(),t.sourceNodeId=n[t.sourceNodeId],t.targetNodeId=n[t.targetNodeId]})),t},removeClosePointFromOpenList:N_,sampleCubic:ob,segmentDirection:U_,setupAnimation:Qg,setupEdgeModel:function(t,e){var n;switch(t.type){case"line":default:n=new _b(t,e);break;case"polyline":n=new mb(t,e)}return n},setupTheme:lb,snapToGrid:nm,targetNodeInfo:ym,toJS:Ie,twoPointDistance:tm,updateAnimation:t_,updateTheme:cb}),vb=function(){function e(e,n){this.BaseType=t.ElementType.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=t.ElementState.DEFAULT,this.modelType=t.ModelType.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.initEdgeData(e),this.setAttributes()}return e.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),r=this.createId();t.id=r||n||Jm()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var o=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=o,Is(this,Q_(t)),this.graphModel.overlapMode===s_.INCREASE&&(this.zIndex=t.zIndex||hb()),this.setAnchors(),this.initPoints(),this.formatText(t)},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.getEdgeStyle=function(){return no(no({},this.graphModel.theme.baseEdge),this.style)},e.prototype.getAdjustPointStyle=function(){return no({},this.graphModel.theme.edgeAdjust)},e.prototype.getTextStyle=function(){return up(this.graphModel.theme.edgeText)},e.prototype.getEdgeAnimationStyle=function(){return up(this.graphModel.theme.edgeAnimation)},e.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,r=this.isAnimation?e.stroke:t.stroke;return no(no(no({},t),{fill:r,stroke:r}),n)},e.prototype.getOutlineStyle=function(){return up(this.graphModel.theme.outline)},e.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(e.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),e.prototype.getBeginAnchor=function(t,e,n){var r,o,i=fm(t);if(n){if(r=fh(i,(function(t){return t.id===n})))return r;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=tm(t,e);(void 0===o||n<o)&&(o=n,r=t)})),r},e.prototype.getEndAnchor=function(t,e){var n,r,o=this,i=fm(t);if(e){if(n=fh(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(o.startPoint){var e=tm(t,o.startPoint);(void 0===r||e<r)&&(r=e,n=t)}})),n},e.prototype.getProperties=function(){return Ie(this.properties)},e.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,r=t.value,o={id:this.id,type:this.type,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Is({},this.startPoint),endPoint:Is({},this.endPoint),properties:Ie(this.properties)};return r&&(o.text={x:e,y:n,value:r}),this.graphModel.overlapMode===s_.INCREASE&&(o.zIndex=this.zIndex),o},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.setProperty=function(t,e){this.properties[t]=n_(e),this.setAttributes()},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setProperties=function(t){this.properties=no(no({},Ie(this.properties)),n_(t)),this.setAttributes()},e.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,r=e.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},e.prototype.setStyle=function(t,e){var n;this.style=no(no({},this.style),((n={})[t]=n_(e),n))},e.prototype.setStyles=function(t){this.style=no(no({},this.style),n_(t))},e.prototype.updateStyles=function(t){this.style=no({},n_(t))},e.prototype.formatText=function(t){var e=this.textPosition,n=e.x,r=e.y;t.text&&"string"!=typeof t.text?"[object Object]"===Object.prototype.toString.call(t.text)&&(this.text={x:t.text.x||n,y:t.text.y||r,value:t.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:t.text||"",x:n,y:r,draggable:this.text.draggable,editable:this.text.editable}},e.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},e.prototype.moveText=function(t,e){if(this.text){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,draggable:a,x:r+t,y:o+e,editable:s}}},e.prototype.setText=function(t){t&&Is(this.text,t)},e.prototype.updateText=function(t){this.text=no(no({},Ie(this.text)),{value:t})},e.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.openEdgeAnimation=function(){this.isAnimation=!0},e.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.updateStartPoint=function(t){this.startPoint=t},e.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},e.prototype.updateEndPoint=function(t){this.endPoint=t},e.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},e.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},e.prototype.initPoints=function(){},e.prototype.updateAttributes=function(t){Is(this,t)},e.prototype.getAdjustStart=function(){return this.startPoint},e.prototype.getAdjustEnd=function(){return this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},e.BaseType=t.ElementType.EDGE,oo([$],e.prototype,"type",void 0),oo([$],e.prototype,"sourceNodeId",void 0),oo([$],e.prototype,"targetNodeId",void 0),oo([$],e.prototype,"startPoint",void 0),oo([$],e.prototype,"endPoint",void 0),oo([$],e.prototype,"text",void 0),oo([$],e.prototype,"properties",void 0),oo([$],e.prototype,"points",void 0),oo([$],e.prototype,"pointsList",void 0),oo([$],e.prototype,"isSelected",void 0),oo([$],e.prototype,"isHovered",void 0),oo([$],e.prototype,"isHitable",void 0),oo([$],e.prototype,"isHittable",void 0),oo([$],e.prototype,"draggable",void 0),oo([$],e.prototype,"visible",void 0),oo([$],e.prototype,"isAnimation",void 0),oo([$],e.prototype,"isShowAdjustPoint",void 0),oo([$],e.prototype,"zIndex",void 0),oo([$],e.prototype,"state",void 0),oo([$],e.prototype,"style",void 0),oo([$],e.prototype,"arrowConfig",void 0),oo([rt],e.prototype,"sourceNode",null),oo([rt],e.prototype,"targetNode",null),oo([rt],e.prototype,"textPosition",null),oo([te],e.prototype,"setProperty",null),oo([te],e.prototype,"deleteProperty",null),oo([te],e.prototype,"setProperties",null),oo([te],e.prototype,"changeEdgeId",null),oo([te],e.prototype,"setStyle",null),oo([te],e.prototype,"setStyles",null),oo([te],e.prototype,"updateStyles",null),oo([te],e.prototype,"formatText",null),oo([te],e.prototype,"resetTextPosition",null),oo([te],e.prototype,"moveText",null),oo([te],e.prototype,"setText",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"setAnchors",null),oo([te],e.prototype,"setSelected",null),oo([te],e.prototype,"setHovered",null),oo([te],e.prototype,"setHitable",null),oo([te],e.prototype,"setHittable",null),oo([te],e.prototype,"openEdgeAnimation",null),oo([te],e.prototype,"closeEdgeAnimation",null),oo([te],e.prototype,"setElementState",null),oo([te],e.prototype,"updateStartPoint",null),oo([te],e.prototype,"moveStartPoint",null),oo([te],e.prototype,"updateEndPoint",null),oo([te],e.prototype,"moveEndPoint",null),oo([te],e.prototype,"setZIndex",null),oo([te],e.prototype,"initPoints",null),oo([te],e.prototype,"updateAttributes",null),oo([te],e.prototype,"getAdjustStart",null),oo([te],e.prototype,"getAdjustEnd",null),oo([te],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(),gb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.BEZIER_EDGE,o.path="",o.initEdgeData(n),o.setAttributes(),o}return eo(n,e),n.prototype.initEdgeData=function(t){this.offset=100,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.bezier,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var r=n.x,o=n.y;t+=r,e+=o})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return no(no({},t),{pointsList:n})},n.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return K_({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},n.prototype.getPath=function(t){var e=io(t,4),n=e[0],r=e[1],o=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(r.x," ").concat(r.y,",\n ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y)},n.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},n.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},n.prototype.updatePath=function(t,e){t=up(t),e=up(e);var n={x:this.startPoint.x,y:this.startPoint.y},r={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var o=this.getControls();t=o.sNext,e=o.ePre}this.pointsList=[n,t,e,r],this.path=this.getPath(this.pointsList)},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=io(this.pointsList,3),r=n[1],o=n[2];r.x+=t,r.y+=e,this.updatePath(r,o)},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=io(this.pointsList,3),r=n[1],o=n[2];o.x+=t,o.y+=e,this.updatePath(r,o)},n.prototype.updateAdjustAnchor=function(t,e){"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),this.setText(Object.assign({},this.text,this.textPosition))},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode,i=K_({start:e,end:n,sourceNode:r,targetNode:o,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},oo([$],n.prototype,"path",void 0),oo([te],n.prototype,"initPoints",null),oo([te],n.prototype,"updatePoints",null),oo([te],n.prototype,"updateStartPoint",null),oo([te],n.prototype,"updateEndPoint",null),oo([te],n.prototype,"moveStartPoint",null),oo([te],n.prototype,"moveEndPoint",null),oo([te],n.prototype,"updateAdjustAnchor",null),oo([te],n.prototype,"getAdjustStart",null),oo([te],n.prototype,"getAdjustEnd",null),oo([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(vb),_b=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.LINE_EDGE,n}return eo(n,e),n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.line,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n}(vb),mb=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.POLYLINE_EDGE,n.draggingPointList=[],n}return eo(n,e),n.prototype.initEdgeData=function(t){this.offset=30,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.polyline,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var r=X_(this.points),o=io(L_(r),2),i=o[0],a=o[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},n.prototype.getAfterAnchor=function(t,e,n){var r,o;return n.forEach((function(n){var i;t===u_.HORIZONTAL?i=Math.abs(e.y-n.y):t===u_.VERTICAL&&(i=Math.abs(e.x-n.x)),(!o||o>i)&&(o=i,r=n)})),r},n.prototype.getCrossPoint=function(t,e,n){var r;return t===u_.HORIZONTAL?r={x:n.x,y:e.y}:t===u_.VERTICAL&&(r={x:e.x,y:n.y}),r},n.prototype.removeCrossPoints=function(t,e,n){var r=n.map((function(t){return t}));if(1===t){var o=r[t],i=r[e],a=r[t-1];if(B_(a,o,this.sourceNode)){if(z_(o,i,this.sourceNode))(s=H_(o,i,this.sourceNode))&&(r[t]=s,r.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===o.x||e.y===a.y&&e.y===o.y)&&(_m(e.x,e.y,o.x,o.y)<_m(a.x,a.y,o.x,o.y)&&(r[t-1]=e))}))}if(e===n.length-2){var s,u=r[t],l=r[e],c=r[e+1];if(B_(l,c,this.targetNode)){if(z_(u,l,this.targetNode))(s=H_(u,l,this.targetNode))&&(r[e]=s,r.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===l.x||t.y===c.y&&t.y===l.y)&&(_m(t.x,t.y,l.x,l.y)<_m(c.x,c.y,l.x,l.y)&&(r[e+1]=t))}))}return r},n.prototype.getDraggingPoints=function(t,e,n,r,o){var i=o.map((function(t){return t})),a=this.getAfterAnchor(t,n,r),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},n.prototype.updateCrossPoints=function(e){var n=e.map((function(t){return t})),r=e[0],o=e[1],i=e[n.length-2],a=e[n.length-1],s=this.sourceNode,u=this.targetNode,l=s.modelType,c=u.modelType,p=U_(r,o),d=n[0];switch(l){case t.ModelType.RECT_NODE:if(0!==s.radius)Mm(r,s)||(d=wm(r,p,s));break;case t.ModelType.CIRCLE_NODE:d=Sm(r,p,s);break;case t.ModelType.ELLIPSE_NODE:d=Am(r,p,s);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:d=Om(r,p,s)}d&&(n[0]=d);var h=U_(i,a),f=n[n.length-1];switch(c){case t.ModelType.RECT_NODE:if(0!==u.radius)Mm(a,u)||(f=wm(a,h,u));break;case t.ModelType.CIRCLE_NODE:f=Sm(a,h,u);break;case t.ModelType.ELLIPSE_NODE:f=Am(a,h,u);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:f=Om(a,h,u)}return f&&(n[n.length-1]=f),n},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},t,{pointsList:n})},n.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},n.prototype.updatePoints=function(){var t=R_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},n.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var r=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},r),this.initPoints()},n.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},n.prototype.dragAppendSimple=function(t,e){this.isDragging=!0;var n=t.start,r=t.end,o=t.startIndex,i=t.endIndex,a=t.direction,s=this.pointsList,u=s;return a===u_.HORIZONTAL?(s[o]={x:n.x,y:n.y+e.y},s[i]={x:r.x,y:r.y+e.y},u=this.pointsList.map((function(t){return t}))):a===u_.VERTICAL&&(s[o]={x:n.x+e.x,y:n.y},s[i]={x:r.x+e.x,y:r.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},s[o]),end:Object.assign({},s[i]),startIndex:o,endIndex:i,direction:a}},n.prototype.dragAppend=function(t,e){this.isDragging=!0;var n=t.start,r=t.end,o=t.startIndex,i=t.endIndex,a=t.direction,s=this.pointsList;if(a===u_.HORIZONTAL){s[o]={x:n.x,y:n.y+e.y},s[i]={x:r.x,y:r.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==o&&i!==this.pointsList.length-1&&(u=this.removeCrossPoints(o,i,u)),0===o){var l={x:n.x,y:n.y+e.y};if(!mm(l,this.sourceNode)){var c=this.sourceNode.anchors;u=this.getDraggingPoints(a,"start",l,c,u)}}if(i===this.pointsList.length-1){var p={x:r.x,y:r.y+e.y};if(!mm(p,this.targetNode)){c=this.targetNode.anchors;u=this.getDraggingPoints(a,"end",p,c,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(a===u_.VERTICAL){s[o]={x:n.x+e.x,y:n.y},s[i]={x:r.x+e.x,y:r.y};u=this.pointsList.map((function(t){return t}));if(0!==o&&i!==this.pointsList.length-1&&(u=this.removeCrossPoints(o,i,u)),0===o){l={x:n.x+e.x,y:n.y};if(!mm(l,this.sourceNode)){c=this.sourceNode.anchors;u=this.getDraggingPoints(a,"start",l,c,u)}}if(i===this.pointsList.length-1){p={x:r.x+e.x,y:r.y};if(!mm(p,this.targetNode)){c=this.targetNode.anchors;u=this.getDraggingPoints(a,"end",p,c,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},s[o]),end:Object.assign({},s[i]),startIndex:o,endIndex:i,direction:a}},n.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=k_(X_(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Object.assign({},e);var n=t[t.length-1];this.endPoint=Object.assign({},n)}this.isDragging=!1},n.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode;this.pointsList=R_({x:e.x,y:e.y},{x:n.x,y:n.y},r,o,this.offset||0),this.initPoints()},oo([$],n.prototype,"dbClickPosition",void 0),oo([te],n.prototype,"initPoints",null),oo([te],n.prototype,"updatePoints",null),oo([te],n.prototype,"updateStartPoint",null),oo([te],n.prototype,"moveStartPoint",null),oo([te],n.prototype,"updateEndPoint",null),oo([te],n.prototype,"moveEndPoint",null),oo([te],n.prototype,"updatePointsList",null),oo([te],n.prototype,"dragAppendStart",null),oo([te],n.prototype,"dragAppendSimple",null),oo([te],n.prototype,"dragAppend",null),oo([te],n.prototype,"dragAppendEnd",null),oo([te],n.prototype,"updatePointsAfterDrag",null),oo([te],n.prototype,"getAdjustStart",null),oo([te],n.prototype,"getAdjustEnd",null),oo([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(vb),bb=function(){function e(e,n){this.BaseType=t.ElementType.NODE,this.id="",this.type="",this.x=0,this.y=0,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.enableRotate=!0,this.enableResize=!0,this.zIndex=1,this.state=t.ElementState.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=t.ModelType.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=e.properties||{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,r=this.y,o=void 0===r?0:r;this.transform=new hm(-n,-o).rotate(t).translate(n,o).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),e.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),r=this.createId();t.id=r||n||Jm()}this.formatText(t),Is(this,Tm(t)),this.graphModel.overlapMode===s_.INCREASE&&(this.zIndex=t.zIndex||hb())},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.formatText=function(t){var e;t.text?"string"==typeof t.text?t.text={value:t.text,x:t.x,y:t.y,draggable:!1,editable:!0}:t.text.editable=null===(e=t.text.editable)||void 0===e||e:t.text={value:"",x:t.x,y:t.y,draggable:!1,editable:!0}},e.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},e.prototype.proportionalResize=function(){},e.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,r=t.value,o=this.properties;Se(o)&&(o=Ie(o));var i={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(i.rotate=this.rotate),this.graphModel.overlapMode===s_.INCREASE&&(i.zIndex=this.zIndex),r&&(i.text={x:e,y:n,value:r}),i},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.getProperties=function(){return Ie(this.properties)},e.prototype.getOuterGAttributes=function(){return{className:""}},e.prototype.getNodeStyle=function(){return no(no({},this.graphModel.theme.baseNode),this.style)},e.prototype.getTextStyle=function(){return up(this.graphModel.theme.nodeText)},e.prototype.getRotateControlStyle=function(){return up(this.graphModel.theme.rotateControl)},e.prototype.getResizeControlStyle=function(){return up(this.graphModel.theme.resizeControl)},e.prototype.getResizeOutlineStyle=function(){return up(this.graphModel.theme.resizeOutline)},e.prototype.getAnchorStyle=function(t){return up(this.graphModel.theme.anchor)},e.prototype.getAnchorLineStyle=function(t){return up(this.graphModel.theme.anchorLine)},e.prototype.getOutlineStyle=function(){return up(this.graphModel.theme.outline)},e.prototype.isAllowConnectedAsSource=function(t,e,n,r){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,this,t,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.getConnectedSourceRules=function(){return this.sourceRules},e.prototype.isAllowConnectedAsTarget=function(t,e,n,r){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,t,this,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.isAllowMoveNode=function(t,e){var n,r,o=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=s.next();!u.done;u=s.next()){var l=(0,u.value)(this,t,e);if(!l)return!1;if("object"==typeof l){var c=l;if(!c.x&&!c.y)return!1;o=o&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{x:o,y:i}},e.prototype.getConnectedTargetRules=function(){return this.targetRules},e.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,r=t.x,o=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:r+t[0],y:o+t[1]}:no(no({},t),{x:r+t.x,y:o+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.getTargetAnchor=function(t){return gm(t,this)},e.prototype.getBounds=function(){return{x1:this.x-this.width/2,y1:this.y-this.height/2,x2:this.x+this.width/2,y2:this.y+this.height/2}},Object.defineProperty(e.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,r=e.y,o=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=io(new cm([e,i,1]).translate(-n,-r).rotate(o).translate(n,r)[0],2),s=a[0],u=a[1];t.x=s,t.y=u})),t},enumerable:!1,configurable:!0}),e.prototype.getAnchorInfo=function(t){if(!bf(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},e.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},e.prototype.isAllowMoveByXORY=function(t,e,n){var r,o;if(n)r=!0,o=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(r=i,o=i):(r=i.x,o=i.y)}return{isAllowMoveX:r,isAllowMoveY:o}},e.prototype.move=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY;return o&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),o||i},e.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY,a=0,s=0;return o&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),i&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},e.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var r=t-this.x,o=e-this.y;return!(!n&&!this.isAllowMoveNode(r,o))&&(this.text&&this.text&&this.moveText(r,o),this.x=t,this.y=e,!0)},e.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},e.prototype.updateText=function(t){this.text=no(no({},Ie(this.text)),{value:t})},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},e.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},e.prototype.setEnableRotate=function(t){void 0===t&&(t=!0),this.enableRotate=t},e.prototype.setEnableResize=function(t){void 0===t&&(t=!0),this.enableResize=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.setProperty=function(e,n){var r,o=Ie(this.properties),i=no(no({},o),((r={})[e]=n_(n),r));this.properties=i,this.setAttributes(),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[e],preProperties:o,properties:i})},e.prototype.setProperties=function(e){var n=Ie(this.properties),r=no(no({},n),n_(e));this.properties=r,this.setAttributes();var o=[];If(e,(function(t,e){(Rh(n,e)&&n[e]!==t||!Rh(n,e))&&o.push(e)})),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:o,preProperties:n,properties:r})},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setStyle=function(t,e){var n;this.style=no(no({},this.style),((n={})[t]=n_(e),n))},e.prototype.setStyles=function(t){this.style=no(no({},this.style),n_(t))},e.prototype.updateStyles=function(t){this.style=no({},n_(t))},e.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},e.prototype.updateAttributes=function(t){Is(this,t)},e.BaseType=t.ElementType.NODE,oo([$],e.prototype,"type",void 0),oo([$],e.prototype,"x",void 0),oo([$],e.prototype,"y",void 0),oo([$],e.prototype,"text",void 0),oo([$],e.prototype,"properties",void 0),oo([$],e.prototype,"_width",void 0),oo([$],e.prototype,"_height",void 0),oo([$],e.prototype,"anchorsOffset",void 0),oo([$],e.prototype,"isSelected",void 0),oo([$],e.prototype,"isHovered",void 0),oo([$],e.prototype,"isShowAnchor",void 0),oo([$],e.prototype,"isDragging",void 0),oo([$],e.prototype,"isHitable",void 0),oo([$],e.prototype,"isHittable",void 0),oo([$],e.prototype,"draggable",void 0),oo([$],e.prototype,"visible",void 0),oo([$],e.prototype,"enableRotate",void 0),oo([$],e.prototype,"enableResize",void 0),oo([$],e.prototype,"zIndex",void 0),oo([$],e.prototype,"state",void 0),oo([$],e.prototype,"autoToFront",void 0),oo([$],e.prototype,"style",void 0),oo([$],e.prototype,"transform",void 0),oo([$],e.prototype,"_rotate",void 0),oo([rt],e.prototype,"incoming",null),oo([rt],e.prototype,"outgoing",null),oo([te],e.prototype,"addNodeMoveRules",null),oo([te],e.prototype,"move",null),oo([te],e.prototype,"getMoveDistance",null),oo([te],e.prototype,"moveTo",null),oo([te],e.prototype,"moveText",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"setSelected",null),oo([te],e.prototype,"setHovered",null),oo([te],e.prototype,"setIsShowAnchor",null),oo([te],e.prototype,"setEnableRotate",null),oo([te],e.prototype,"setEnableResize",null),oo([te],e.prototype,"setHitable",null),oo([te],e.prototype,"setHittable",null),oo([te],e.prototype,"setElementState",null),oo([te],e.prototype,"setProperty",null),oo([te],e.prototype,"setProperties",null),oo([te],e.prototype,"deleteProperty",null),oo([te],e.prototype,"setStyle",null),oo([te],e.prototype,"setStyles",null),oo([te],e.prototype,"updateStyles",null),oo([te],e.prototype,"setZIndex",null),oo([te],e.prototype,"updateAttributes",null),e}(),Eb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.CIRCLE_NODE,o.properties={},o.r=50,o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties.r;t&&(this.r=t)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,r=this.properties.style;return no(no(no({},t),null!=r?r:{}),up(n))},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.r;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.deltaX,r=t.deltaY;return this.move(n/2,r/2),this.r=e,this.setProperties({r:e}),this.getData()},oo([$],n.prototype,"properties",void 0),oo([$],n.prototype,"r",void 0),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(bb),xb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.DIAMOND_NODE,o.rx=30,o.ry=50,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond;return no(no({},t),up(n))},Object.defineProperty(n.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[[e,n-o],[e+r,n],[e,n+o],[e-r,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pointsPosition",{get:function(){return xh(this.points,(function(t){var e=io(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Yd(this.points,(function(n){var r=io(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Yd(this.points,(function(n){var r=io(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this;return xh(this.points,(function(e,n){var r=io(e,2);return{x:r[0],y:r[1],id:"".concat(t.id,"_").concat(n)}}))},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},oo([$],n.prototype,"rx",void 0),oo([$],n.prototype,"ry",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"points",null),oo([rt],n.prototype,"pointsPosition",null),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(bb),wb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.ELLIPSE_NODE,o.rx=30,o.ry=45,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse;return no(no({},t),up(n))},Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},oo([$],n.prototype,"rx",void 0),oo([$],n.prototype,"ry",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(bb),Sb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.points,r=t.width,o=t.height,i=n||this.points;this.points=rm(i,r,o)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,r=this.properties.style;return no(no(no({},t),up(n)),up(r)||{})},Object.defineProperty(n.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return this.points.map((function(t){return{x:t[0]+e-r/2,y:t[1]+n-o/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=io(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=io(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,r=e.y,o=e.width,i=e.height;return e.points.map((function(e,a){var s=io(e,2),u=s[0],l=s[1];return{x:n+u-o/2,y:r+l-i/2,id:"".concat(t.id,"_").concat(a)}}))},n.prototype.resize=function(t){var e=this,n=t.width,r=t.height,o=t.deltaX,i=t.deltaY;this.move(o/2,i/2);var a=xh(this.points,(function(t){var o=io(t,2),i=o[0],a=o[1];return[i*n/e.width,a*r/e.height]}));return this.points=a,this.properties.points=a,this.getData()},oo([$],n.prototype,"points",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"pointsPosition",null),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(bb),Mb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.RECT_NODE,o.radius=0,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height;n&&(this.width=n),r&&(this.height=r)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect;return no(no({},t),up(n))},oo([$],n.prototype,"radius",void 0),oo([$],n.prototype,"properties",void 0),n}(bb),Ab=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.TEXT_NODE,n}return eo(n,e),n.prototype.getTextStyle=function(){var t=e.prototype.getTextStyle.call(this),n=this.graphModel.theme.text;return no(no({},t),up(n))},Object.defineProperty(n.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Pm({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Pm({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(bb),Ob=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.HTML_NODE,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height;n&&(this.width=n),r&&(this.height=r)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},oo([$],n.prototype,"properties",void 0),n}(bb),Tb={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,nodeTextEdit:!1,edgeTextEdit:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Nb=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],Db=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopScrollGraph=!1,this.stopMoveGraph=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustNodePosition=!0,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.edgeSelectedOutline=!0,this.nodeTextEdit=!0,this.edgeTextEdit=!0,this.nodeTextDraggable=!1,this.edgeTextDraggable=!1,this.autoExpand=!1,this.multipleSelectKey="",this.defaultConfig={},Is(this,this.getConfigDetail(t))}return t.prototype.updateEditConfig=function(t){var e=this.getConfigDetail(t);Is(this,e)},t.prototype.getConfigDetail=function(t){var e=t.isSilentMode,n=t.textEdit,r={};if(!1===e&&Is(r,this.defaultConfig),!0===e&&e!==this.isSilentMode){var o=By(Tb,Nb);this.defaultConfig={stopZoomGraph:this.stopZoomGraph,stopScrollGraph:this.stopScrollGraph,stopMoveGraph:this.stopMoveGraph,adjustEdge:this.adjustEdge,adjustEdgeMiddle:this.adjustEdgeMiddle,adjustEdgeStartAndEnd:this.adjustEdgeStartAndEnd,adjustNodePosition:this.adjustNodePosition,hideAnchors:this.hideAnchors,allowRotate:this.allowRotate,allowResize:this.allowResize,hoverOutline:this.hoverOutline,nodeSelectedOutline:this.nodeSelectedOutline,edgeSelectedOutline:this.edgeSelectedOutline,nodeTextEdit:this.nodeTextEdit,edgeTextEdit:this.edgeTextEdit,nodeTextDraggable:this.nodeTextDraggable,edgeTextDraggable:this.edgeTextDraggable,autoExpand:this.autoExpand},Is(r,o)}!1===n&&Is(r,{nodeTextEdit:!1,edgeTextEdit:!1});var i=By(t,Nb);return Is(r,i)},t.prototype.getConfig=function(){return By(this,Nb)},oo([$],t.prototype,"isSilentMode",void 0),oo([$],t.prototype,"stopZoomGraph",void 0),oo([$],t.prototype,"stopScrollGraph",void 0),oo([$],t.prototype,"stopMoveGraph",void 0),oo([$],t.prototype,"adjustEdge",void 0),oo([$],t.prototype,"adjustEdgeMiddle",void 0),oo([$],t.prototype,"adjustEdgeStartAndEnd",void 0),oo([$],t.prototype,"adjustNodePosition",void 0),oo([$],t.prototype,"hideAnchors",void 0),oo([$],t.prototype,"allowRotate",void 0),oo([$],t.prototype,"allowResize",void 0),oo([$],t.prototype,"hoverOutline",void 0),oo([$],t.prototype,"nodeSelectedOutline",void 0),oo([$],t.prototype,"edgeSelectedOutline",void 0),oo([$],t.prototype,"nodeTextEdit",void 0),oo([$],t.prototype,"edgeTextEdit",void 0),oo([$],t.prototype,"nodeTextDraggable",void 0),oo([$],t.prototype,"edgeTextDraggable",void 0),oo([$],t.prototype,"autoExpand",void 0),oo([te],t.prototype,"updateEditConfig",null),t}(),Pb=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var r=this;null==t||t.split(",").forEach((function(t){t=t.trim(),r._events[t]||(r._events[t]=[]),r._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var r=n._events[t]||[],o=n._events["*"]||[],i=function(r){for(var o=r.length,i=0;i<o;i++)if(r[i]){var a=r[i],s=a.callback;a.once&&(r.splice(i,1),0===r.length&&delete n._events[t],o--,i--),s.apply(n,[e])}};i(r),i(o)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var r=n._events[t]||[],o=r.length,i=0;i<o;i++)r[i].callback===e&&(r.splice(i,1),o--,i--);0===r.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),Cb=function(){function e(t){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=s_.DEFAULT,this.gridSize=1,this.partial=!1;var e=t.container,n=t.partial,r=t.background,o=void 0===r?{}:r,i=t.grid,a=t.idGenerator,s=t.edgeGenerator,u=t.animation,l=t.customTrajectory;this.rootEl=e,this.partial=!!n,this.background=o,"object"==typeof i&&(this.gridSize=i.size||1),this.theme=lb(t.style),this.edgeType=t.edgeType||"polyline",this.animation=Qg(u),this.overlapMode=t.overlapMode||s_.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new Pb,this.editConfigModel=new Db(t),this.transformModel=new kb(this.eventCenter,t),this.flowId=Jm(),this.idGenerator=a,this.edgeGenerator=em(this,s),this.customTrajectory=l}return Object.defineProperty(e.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modelsMap",{get:function(){return ao(ao([],io(this.nodes),!1),io(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortElements",{get:function(){for(var t=ao(ao([],io(this.nodes),!1),io(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],r=[this.width+l_,this.height+l_],o=0;o<t.length;o++){var i=t[o];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,r,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textEditElement",{get:function(){var e=this.nodes.find((function(e){return e.state===t.ElementState.TEXT_EDIT})),n=this.edges.find((function(e){return e.state===t.ElementState.TEXT_EDIT}));return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),e.prototype.getAreaElement=function(t,e,n,r,o){var i=this;void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[];return Yd(ao(ao([],io(this.nodes),!1),io(this.edges),!1),(function(s){var u=i.isElementInArea(s,t,e,n,r);o&&!s.visible||!u||a.push(s)})),a},e.prototype.getModel=function(t){return this.modelMap.get(t)},e.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},e.prototype.getPointByClient=function(t){var e=t.x,n=t.y,r=this.rootEl.getBoundingClientRect(),o={x:e-r.left,y:n-r.top},i=io(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2);return{domOverlayPosition:o,canvasOverlayPosition:{x:i[0],y:i[1]}}},e.prototype.isElementInArea=function(e,n,r,o,i){var a;if(void 0===o&&(o=!0),void 0===i&&(i=!0),e.BaseType===t.ElementType.NODE){for(var s=Em(e),u=s.minX,l=s.minY,c=s.maxX,p=s.maxY,d=[{x:u,y:l},{x:c,y:l},{x:c,y:p},{x:u,y:p}],h=i,f=0;f<d.length;f++){var y=d[f],v=y.x,g=y.y;if(v=(a=io(this.transformModel.CanvasPointToHtmlPoint([v,g]),2))[0],g=a[1],om([v,g],n,r)!==i){h=!i;break}}return h}if(e.BaseType===t.ElementType.EDGE){var _=e.startPoint,m=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([_.x,_.y]),E=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),x=om(b,n,r),w=om(E,n,r);return o?x&&w:x||w}return!1},e.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);t.nodes?this.nodes=xh(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges?this.edges=xh(t.edges,(function(t){var n,r=e.getModel(null!==(n=t.type)&&void 0!==n?n:"");if(!r)throw new Error("找不到".concat(t.type,"对应的边。"));return new r(t,e)})):this.edges=[]},e.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},e.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var r=this.nodes[n];if(r.isDragging){t=!0;break}e.push(r.getHistoryData())}if(t)return!1;for(var o=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){o=!0;break}i.push(s.getHistoryData())}return!o&&{nodes:e,edges:i}},e.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},e.prototype.getElement=function(t){return this.modelsMap[t]},e.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var r=this.edges[n],o=r.sourceNodeId===t,i=r.targetNodeId===t;(o||i)&&e.push(r)}return e},e.prototype.getSelectElements=function(e){void 0===e&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach((function(o){if(o.BaseType===t.ElementType.NODE&&r.nodes.push(o.getData()),o.BaseType===t.ElementType.EDGE){var i=o.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(e||a)&&r.edges.push(i)}})),r},e.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},e.prototype.changeNodeId=function(t,e){return e||(e=Jm()),this.nodesMap[e]?(console.warn("当前流程图已存在节点".concat(e,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},e.prototype.changeEdgeId=function(t,e){return e||(e=Jm()),this.edgesMap[e]?(console.warn("当前流程图已存在边: ".concat(e,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):(console.warn("当前流程图找不到边: ".concat(e,", 修改失败")),"")},e.prototype.setFakeNode=function(t){this.fakeNode=t},e.prototype.removeFakeNode=function(){this.fakeNode=null},e.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},e.prototype.toFront=function(t){var e,n,r,o=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);o&&(this.overlapMode===s_.DEFAULT&&(null===(r=this.topElement)||void 0===r||r.setZIndex(),o.setZIndex(9999),this.topElement=o),this.overlapMode===s_.INCREASE&&this.setElementZIndex(t,"top"))},e.prototype.setElementZIndex=function(t,e){var n,r,o=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[t])||void 0===r?void 0:r.model);if(o){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=hb()),"bottom"===e&&(i=fb())),o.setZIndex(i)}},e.prototype.deleteNode=function(e){var n=this.nodesMap[e].model.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(t.EventType.NODE_DELETE,{data:n})},e.prototype.addNode=function(e,n,r){void 0===n&&(n=t.EventType.NODE_ADD);var o=n_(e),i=o.id;i&&this.nodesMap[i]&&delete o.id;var a=this.getModelAfterSnapToGrid(o);this.nodes.push(a);var s={data:a.getData()};return r&&(s.e=r),this.eventCenter.emit(n,s),a},e.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,r=t.y;return n&&r&&(t.x=nm(n,this.gridSize),t.y=nm(r,this.gridSize),"object"==typeof t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-r)),new e(t,this)},e.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="",n.text&&(n.text.x+=30,n.text.y+=30);var r=this.addNode(n);return r.setSelected(!0),null==e||e.setSelected(!1),r.getData()}},e.prototype.moveNode=function(t,e,n,r){var o;void 0===r&&(r=!1);var i=this.nodesMap[t];i?(e=(o=io(i.model.getMoveDistance(e,n,r),2))[0],n=o[1],this.moveEdge(t,e,n)):console.warn("不存在id为".concat(t,"的节点"))},e.prototype.moveNode2Coordinate=function(t,e,n,r){void 0===r&&(r=!1);var o=this.nodesMap[t];if(o){var i=o.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,r)}else console.warn("不存在id为".concat(t,"的节点"))},e.prototype.editText=function(e){this.setElementStateById(e,t.ElementState.TEXT_EDIT)},e.prototype.addEdge=function(e){var n=n_(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&delete n.id;var o=this.getModel(r);if(!o)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var i=new o(no(no({},n),{type:r}),this),a=i.getData();return this.edges.push(i),this.eventCenter.emit(t.EventType.EDGE_ADD,{data:a}),i},e.prototype.moveEdge=function(t,e,n){for(var r=0;r<this.edges.length;r++){var o=this.edges[r],i=o.textPosition,a=i.x,s=i.y,u=this.edges[r].sourceNodeId===t,l=this.edges[r].targetNodeId===t;u&&o.moveStartPoint(e,n),l&&o.moveEndPoint(e,n),(u||l)&&this.handleEdgeTextMove(o,a,s)}},e.prototype.handleEdgeTextMove=function(e,n,r){var o;if(e.customTextPosition)e.resetTextPosition();else if(e.modelType===t.ModelType.POLYLINE_EDGE&&(null===(o=e.text)||void 0===o?void 0:o.value)){var i=e.text,a=J_(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}else{var s=e.textPosition,u=s.x,l=s.y;e.moveText(u-n,l-r)}},e.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var o=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:o})}},e.prototype.deleteEdgeById=function(e){if(this.edgesMap[e]){var n=this.edgesMap[e].index,r=this.edgesMap[e].model.getData();this.edges.splice(n,1),this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.setElementStateById=function(e,n,r){this.nodes.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)})),this.edges.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)}))},e.prototype.updateText=function(t,e){var n=fh(ao(ao([],io(this.nodes),!1),io(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},e.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},e.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===s_.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},e.prototype.moveNodes=function(e,n,r,o){var i,a,s,u=this;void 0===o&&(o=!1);for(var l=e.reduce((function(t,e){var i=u.nodesMap[e].model;return t[e]=i.getMoveDistance(n,r,o),t}),{}),c=0;c<this.edges.length;c++){var p=this.edges[c],d=p.textPosition,h=d.x,f=d.y,y=l[p.sourceNodeId],v=l[p.targetNodeId],g=void 0,_=void 0;y&&v&&p.modelType===t.ModelType.POLYLINE_EDGE?(g=(i=io(y,2))[0],_=i[1],p.updatePointsList(g,_)):(y&&(g=(a=io(y,2))[0],_=a[1],p.moveStartPoint(g,_)),v&&(g=(s=io(v,2))[0],_=s[1],p.moveEndPoint(g,_))),(y||v)&&this.handleEdgeTextMove(p,h,f)}},e.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},e.prototype.setDefaultEdgeType=function(t){this.edgeType=t},e.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new o(r,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=Nm(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=Nm(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},e.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var i=new o(r,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},e.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},e.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},e.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},e.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},e.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){var o;r.targetNodeId===t&&n.push(null===(o=e.nodesMap[r.sourceNodeId])||void 0===o?void 0:o.model)})),n},e.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){r.sourceNodeId===t&&n.push(e.nodesMap[r.targetNodeId].model)})),n},e.prototype.setTheme=function(t){this.theme=cb(no(no({},this.theme),t))},e.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,this.width&&this.height||console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},e.prototype.clearData=function(){this.nodes=[],this.edges=[]},e.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var r=t.x,o=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,u=void 0===s?0:s,l=r+i/2+u,c=r-i/2-u,p=o+a/2+u,d=o-a/2-u;e=e.concat([l,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([p,d].filter((function(t){return!Number.isNaN(t)})))}));var r=Math.min.apply(Math,ao([],io(e),!1)),o=Math.max.apply(Math,ao([],io(e),!1)),i=Math.min.apply(Math,ao([],io(n),!1)),a=o-r||0,s=Math.max.apply(Math,ao([],io(n),!1))-i||0;return{width:a,height:s,x:r+a/2,y:i+s/2}},e.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,r=t.height,o=t.rootEl,i=t.transformModel;if(e.length){var a=n||o.clientWidth,s=r||o.clientHeight,u=this.getVirtualRectSize(),l=u.x,c=u.y;i.focusOn(l,c,a,s)}},e.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,r=n.nodes,o=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(r.length){var u=o||a.clientWidth,l=i||a.clientHeight,c=this.getVirtualRectSize(),p=c.width,d=c.height,h=c.x,f=c.y,y=(p+e)/u,v=(d+t)/l,g=1/Math.max(y,v),_=[u/2,l/2];s.zoom(g,_),s.focusOn(h,f,u,l)}},e.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},e.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},oo([$],e.prototype,"width",void 0),oo([$],e.prototype,"height",void 0),oo([$],e.prototype,"edgeType",void 0),oo([$],e.prototype,"nodes",void 0),oo([$],e.prototype,"edges",void 0),oo([$],e.prototype,"fakeNode",void 0),oo([$],e.prototype,"overlapMode",void 0),oo([$],e.prototype,"background",void 0),oo([$],e.prototype,"gridSize",void 0),oo([$],e.prototype,"transformModel",void 0),oo([$],e.prototype,"editConfigModel",void 0),oo([$],e.prototype,"partial",void 0),oo([rt],e.prototype,"nodesMap",null),oo([rt],e.prototype,"edgesMap",null),oo([rt],e.prototype,"modelsMap",null),oo([rt],e.prototype,"sortElements",null),oo([rt],e.prototype,"textEditElement",null),oo([rt],e.prototype,"selectElements",null),oo([rt],e.prototype,"selectNodes",null),oo([te],e.prototype,"setFakeNode",null),oo([te],e.prototype,"removeFakeNode",null),oo([te],e.prototype,"setModel",null),oo([te],e.prototype,"toFront",null),oo([te],e.prototype,"setElementZIndex",null),oo([te],e.prototype,"deleteNode",null),oo([te],e.prototype,"addNode",null),oo([te],e.prototype,"cloneNode",null),oo([te],e.prototype,"moveNode",null),oo([te],e.prototype,"moveNode2Coordinate",null),oo([te],e.prototype,"editText",null),oo([te],e.prototype,"addEdge",null),oo([te],e.prototype,"moveEdge",null),oo([te],e.prototype,"deleteEdgeBySourceAndTarget",null),oo([te],e.prototype,"deleteEdgeById",null),oo([te],e.prototype,"deleteEdgeBySource",null),oo([te],e.prototype,"deleteEdgeByTarget",null),oo([te],e.prototype,"setElementStateById",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"selectNodeById",null),oo([te],e.prototype,"selectEdgeById",null),oo([te],e.prototype,"selectElementById",null),oo([te],e.prototype,"clearSelectElements",null),oo([te],e.prototype,"moveNodes",null),oo([te],e.prototype,"setDefaultEdgeType",null),oo([te],e.prototype,"changeNodeType",null),oo([te],e.prototype,"changeEdgeType",null),oo([te],e.prototype,"getNodeIncomingEdge",null),oo([te],e.prototype,"getNodeOutgoingEdge",null),oo([te],e.prototype,"getAnchorIncomingEdge",null),oo([te],e.prototype,"getAnchorOutcomingEdge",null),oo([te],e.prototype,"getNodeIncomingNode",null),oo([te],e.prototype,"getNodeOutgoingNode",null),oo([te],e.prototype,"setTheme",null),oo([te],e.prototype,"resize",null),oo([te],e.prototype,"clearData",null),oo([te],e.prototype,"translateCenter",null),oo([te],e.prototype,"fitView",null),oo([te],e.prototype,"openEdgeAnimation",null),oo([te],e.prototype,"closeEdgeAnimation",null),e}(),jb=function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}return t.prototype.getStyle=function(){return no({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,r=t.y,o=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(o=!0),r===s.y&&(i=!0),o&&i))break}return{isShowVertical:o,isShowHorizontal:i,position:{x:n,y:r}}},t.prototype.getHorizontalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Em(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Em(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Em(l);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){r=!0,o=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){r=!0,o=n.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:no(no({},this.position),{y:o})}},t.prototype.getVerticalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Em(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Em(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Em(l);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){r=!0,o=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){r=!0,o=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:no(no({},this.position),{x:o})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),r=n.isShowHorizontal,o=n.isShowVertical;if(!r){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!o){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},oo([$],t.prototype,"isShowHorizontal",void 0),oo([$],t.prototype,"isShowVertical",void 0),oo([$],t.prototype,"position",void 0),oo([te],t.prototype,"clearSnapline",null),oo([te],t.prototype,"setNodeSnapLine",null),t}(),Ib={false:[-1/0,-1/0,1/0,1/0],true:[0,0,0,0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},kb=function(){function e(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,r=void 0!==n&&n;this.updateTranslateLimits(r)}return e.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},e.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},e.prototype.HtmlPointToCanvasPoint=function(t){var e=io(t,2),n=e[0],r=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},e.prototype.CanvasPointToHtmlPoint=function(t){var e=io(t,2),n=e[0],r=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},e.prototype.moveCanvasPointByHtml=function(t,e,n){var r=io(t,2),o=r[0],i=r[1];return[o+e/this.SCALE_X,i+n/this.SCALE_Y]},e.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},e.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},e.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,r=this.SCALE_Y;return"number"==typeof t?(n=t,r=t):t?(n+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=r,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},e.prototype.emitGraphTransform=function(e){this.eventCenter.emit(t.EventType.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},e.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},e.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},e.prototype.focusOn=function(t,e,n,r){var o=io(this.CanvasPointToHtmlPoint([t,e]),2),i=io([n/2-o[0],r/2-o[1]],2),a=i[0],s=i[1];this.TRANSLATE_X+=a,this.TRANSLATE_Y+=s,this.emitGraphTransform("focusOn")},e.prototype.updateTranslateLimits=function(t){var e;e=io(Array.isArray(t)&&4===t.length?t:Ib[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},oo([$],e.prototype,"SCALE_X",void 0),oo([$],e.prototype,"SKEW_Y",void 0),oo([$],e.prototype,"SKEW_X",void 0),oo([$],e.prototype,"SCALE_Y",void 0),oo([$],e.prototype,"TRANSLATE_X",void 0),oo([$],e.prototype,"TRANSLATE_Y",void 0),oo([$],e.prototype,"ZOOM_SIZE",void 0),oo([te],e.prototype,"zoom",null),oo([te],e.prototype,"resetZoom",null),oo([te],e.prototype,"translate",null),oo([te],e.prototype,"focusOn",null),e}(),Rb=function(e){function n(n){var r=e.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(t){var e=t.deltaX,n=t.deltaY;r.setState({isDragging:!0});var o=r.props.graphModel,i=o.transformModel;!0!==o.editConfigModel.stopMoveGraph&&i.translate(e,n)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(t){var e=r.props,n=e.graphModel,o=n.editConfigModel,i=n.transformModel,a=n.gridSize,s=e.graphModel,u=t.deltaX,l=t.deltaY;if(o.stopScrollGraph||!0===t.ctrlKey){if(!o.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,p=c.x,d=c.y;i.zoom(t.deltaY<0,[p,d])}}else{if(t.preventDefault(),r.stepScrollX+=u,r.stepScrollY+=l,Math.abs(r.stepScrollX)>=a){var h=r.stepScrollX%a,f=r.stepScrollX-h;i.translate(-f*i.SCALE_X,0),r.stepScrollX=h}if(Math.abs(r.stepScrollY)>=a){var y=r.stepScrollY%a,v=r.stepScrollY-y;i.translate(0,-v*i.SCALE_Y),r.stepScrollY=y}}},r.clickHandler=function(e){if("canvas-overlay"===e.target.getAttribute("name")){var n=r.props.graphModel;n.selectElements.size>0&&n.clearSelectElements(),n.eventCenter.emit(t.EventType.BLANK_CLICK,{e:e})}},r.handleContextMenu=function(e){if("canvas-overlay"===e.target.getAttribute("name")){e.preventDefault();var n=r.props.graphModel,o=n.getPointByClient({x:e.clientX,y:e.clientY});n.eventCenter.emit(t.EventType.BLANK_CONTEXTMENU,{e:e,position:o})}},r.mouseDownHandler=function(e){var n=r.props.graphModel,o=n.eventCenter,i=n.editConfigModel,a=n.transformModel.SCALE_X,s=n.gridSize,u=e.target,l=!i.adjustEdge&&!i.adjustNodePosition;("canvas-overlay"===u.getAttribute("name")||l)&&(!0!==i.stopMoveGraph?(r.stepDrag.setStep(s*a),r.stepDrag.handleMouseDown(e)):o.emit(t.EventType.BLANK_MOUSEDOWN,{e:e}),r.clickHandler(e))};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new c_({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return eo(n,e),n.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,r=e.dnd,o=this.state.isDragging;return uo("svg",no({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:o?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},r.eventMap(),{children:uo("g",{transform:t,children:n})}))},n=oo([nx],n)}(Fn);function Lb(e){var n=e.x,r=void 0===n?0:n,o=e.y,i=void 0===o?0:o,a=e.value,s=e.fontSize,u=e.fill,l=void 0===u?"currentColor":u,c=e.overflowMode,p=void 0===c?"default":c,d=e.textWidth,h=void 0===d?"":d,f=e.model,y={textAnchor:"middle","dominant-baseline":"middle",x:r,y:i,fill:l};if(Object.entries(e).forEach((function(t){var e=io(t,2),n=e[0],r=e[1];"object"!==typeof r&&(y[n]=r)})),a){var v=String(a).split(/[\r\n]/g),g=v.length;if("default"!==p){var _=f.BaseType,m=f.modelType;if(_===t.ElementType.NODE&&m!==t.ModelType.TEXT_NODE||_===t.ElementType.EDGE&&h)return function(t){var e=t.value,n=t.fontSize,r=t.model,o=t.fontFamily,i=void 0===o?"":o,a=t.lineHeight,s=t.wrapPadding,u=void 0===s?"0, 0":s,l=t.overflowMode,c=t.x,p=t.y,d=r.width,h=r.textHeight,f=t.textWidth||d,y=String(e).split(/[\r\n]/g),v=y.length,g=Dm({rows:y,style:{fontSize:"".concat(n,"px"),width:"".concat(f,"px"),fontFamily:i,lineHeight:a,padding:u},rowsLength:v,className:"lf-get-text-height"}),_=r.height>g?r.height:g;h&&(_=h);var m="ellipsis"===l;m&&(_=n+2);return uo("g",{children:uo("foreignObject",{width:f,height:_,x:c-f/2,y:p-_/2,children:uo("div",{className:"lf-node-text-auto-wrap",style:{minHeight:_,width:f,padding:u},children:uo("div",{className:m?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:m?y.join(""):"",style:no({},t),children:y.map((function(t){return uo("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}(e)}if(g>1){var b=v.map((function(t,e){return uo("tspan",{className:"lf-text-tspan",x:r,y:i+(e-(g-1)/2)*(s+2),children:t})}));return uo("text",no({},y,{children:b}))}return uo("text",no({},y,{children:a}))}return null}function Bb(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(t).forEach((function(t){var n=io(t,2),r=n[0],o=n[1];"style"===r?e[r]=o:"object"!==typeof o&&(e[r]=o)})),uo("line",no({},e))}function zb(t){var e=t.x,n=t.y,r=t.width,o=t.height,i=t.className,a=t.radius,s=e-r/2,u=n-o/2,l={};return Object.entries(t).forEach((function(t){var e=io(t,2),n=e[0],r=e[1];"object"!==typeof r&&(l[n]=r)})),l.className=i?"lf-basic-shape ".concat(i):"lf-shape",a&&(l.rx=a,l.ry=a),l.x=s,l.y=u,uo("rect",no({},l))}function Hb(t){var e={d:""};return Object.entries(t).forEach((function(t){var n=io(t,2),r=n[0],o=n[1];"style"!==r&&"object"===typeof o||(e[r]=o)})),uo("path",no({},e))}function Ub(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.r,a=void 0===i?4:i,s=t.className,u={cx:n,cy:o,r:a,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(t).forEach((function(t){var e=io(t,2),n=e[0],r=e[1];"object"!==typeof r&&(u[n]=r)})),u.className=s?"lf-basic-shape ".concat(s):"lf-shape",uo("circle",no({},u))}function Xb(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.rx,a=void 0===i?4:i,s=t.ry,u=void 0===s?4:s,l=t.className,c={cx:n,cy:o,rx:a,ry:u,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(t).forEach((function(t){var e=io(t,2),n=e[0],r=e[1];"object"!==typeof r&&(c[n]=r)})),c.className=l?"lf-basic-shape ".concat(l):"lf-shape",uo("ellipse",no({},c))}function Gb(t){var e=t.points,n=t.className,r={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Object.entries(t).forEach((function(t){var e=io(t,2),n=e[0],o=e[1];"object"!==typeof o&&(r[n]=o)})),r.className=n?"lf-basic-shape ".concat(n):"lf-shape",r.points=e.map((function(t){return t.join(",")})).join(" "),uo("polygon",no({},r))}function Wb(t){var e={points:"",fill:"none"};return Object.entries(t).forEach((function(t){var n=io(t,2),r=n[0],o=n[1];"style"===r?e[r]=o:"object"!==typeof o&&(e[r]=o)})),uo("polyline",no({},e))}zb.defaultProps={className:"",radius:""};var Yb=function(e){function n(){var n=e.call(this)||this;return n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.bezierModel,s=o.type,u=i.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,l=u.x,c=u.y;a.updateAdjustAnchor({x:l,y:c},s),i.eventCenter.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.onDragEnd=function(){n.props.bezierModel.isDragging=!1},n.dragHandler=new c_({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return eo(n,e),n.prototype.render=function(){var t=this,e=this.props.position,n=e.x,r=e.y,o=this.props.bezierModel.getEdgeStyle().adjustAnchor;return uo(Ub,no({className:"lf-bezier-adjust-anchor",x:n,y:r},o,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},n}(Fn),Fb=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return eo(n,e),n.prototype.getBezierAdjust=function(t,e){var n=t.path,r=t.id,o=io(q_(n),4),i=o[0],a=o[1],s=o[2],u=o[3],l=t.getEdgeStyle().adjustLine,c=[];return c.push(uo(Bb,no({x1:i.x,y1:i.y,x2:a.x,y2:a.y},l))),c.push(uo(Yb,{position:a,bezierModel:t,graphModel:e,type:"sNext"},"".concat(r,"_ePre"))),c.push(uo(Bb,no({x1:u.x,y1:u.y,x2:s.x,y2:s.y},l))),c.push(uo(Yb,{position:s,bezierModel:t,graphModel:e,type:"ePre"},"".concat(r,"_sNext"))),c},n.prototype.selectedBezierEdge=function(){for(var e=this.props.graphModel,n=e.edges,r=[],o=0;o<n.length;o++){var i=n[o];i.isSelected&&i.modelType===t.ModelType.BEZIER_EDGE&&i.draggable&&r.push(this.getBezierAdjust(i,e))}return r},n.prototype.render=function(){return uo("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},n=oo([nx],n)}(Fn),Vb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){return uo("div",{className:"lf-background",children:uo("div",{style:this.props.background,className:"lf-background-area"})})},e}(Fn),Kb=function(t){function e(){var e=t.apply(this,ao([],io(arguments),!1))||this;return e.id=Jm(),e}return eo(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?2:s,l=Math.min(Math.max(2,u),r/4);return uo("g",{fill:a,opacity:o?1:0,children:[uo("circle",{cx:0,cy:0,r:l/2}),uo("circle",{cx:0,cy:r,r:l/2}),uo("circle",{cx:r,cy:0,r:l/2}),uo("circle",{cx:r,cy:r,r:l/2})]})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?1:s,l=Math.min(Math.max(1,u),r/2);return uo("path",{d:"M 0 0 H ".concat(r," V ").concat(r," H 0 Z"),stroke:a,strokeWidth:l,opacity:o?1:0,fill:"transparent"})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,r=void 0===n?1:n,o=t.graphModel.transformModel,i=[o.SCALE_X,o.SKEW_Y,o.SKEW_X,o.SCALE_Y,o.TRANSLATE_X,o.TRANSLATE_Y].join(","),a="matrix(".concat(i,")");return uo("div",{className:"lf-grid",children:uo("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[uo("defs",{children:uo("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:a,x:"0",y:"0",width:r,height:r,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),uo("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=oo([nx],e)}(Fn);!function(t){t.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},t.getGridOptions=function(e){var n=up(t.defaultProps);return Is(n,"number"==typeof e?{size:e}:"boolean"==typeof e?{visible:e}:e)}}(Kb||(Kb={}));var qb,Zb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){return uo("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:uo("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=oo([nx],e)}(Fn),$b=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return eo(n,e),n.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,r=n.hoverOutline,o=n.nodeSelectedOutline,i=[];return e.forEach((function(t){if(t.isHovered||t.isSelected){var e=t.isHovered,n=t.isSelected,a=t.x,s=t.y,u=t.width,l=t.height;if(o&&n||r&&e){var c=t.getOutlineStyle(),p={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(p[t]=c[t])})),e){var d=c.hover;p=no(no({},p),d)}i.push(uo(zb,no({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:u+10,height:l+10},p)))}}})),i},n.prototype.getEdgeOutline=function(){for(var e=this.props.graphModel,n=e.edges,r=e.editConfigModel,o=r.edgeSelectedOutline,i=r.hoverOutline,a=[],s=0;s<n.length;s++){var u=n[s];(o&&u.isSelected||i&&u.isHovered)&&(u.modelType===t.ModelType.LINE_EDGE?a.push(this.getLineOutline(u)):u.modelType===t.ModelType.POLYLINE_EDGE?a.push(this.getPolylineOutline(u)):u.modelType===t.ModelType.BEZIER_EDGE&&a.push(this.getBezierOutline(u)))}return a},n.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10,s=t.getOutlineStyle();return uo(zb,no({className:"lf-outline-edge",x:r,y:o,width:i,height:a},s))},n.prototype.getPolylineOutline=function(t){var e=t.points,n=X_(e),r=m_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return uo(zb,no({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.getBezierOutline=function(t){var e=t.path,n=q_(e),r=m_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return uo(zb,no({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.render=function(){return uo("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},n=oo([nx],n)}(Fn),Jb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,r=e.isShowHorizontal,o=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,u=void 0===s?0:s,l=a.y,c=void 0===l?0:l,p=no(no({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:r?null==i?void 0:i.stroke:"none"}),d=no(no({x1:u,y1:-1e5,x2:u,y2:1e5},i),{stroke:o?null==i?void 0:i.stroke:"none"});return uo("g",{className:"lf-snapline",children:[uo(Bb,no({},p)),uo(Bb,no({},d))]})},e=oo([nx],e)}(Fn),Qb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,e=t.tool,n=t.graphModel,r=n.textEditElement,o=e.getTools().map((function(t){return Xn(t,{textEditElement:r,graphModel:n,logicFlow:e.instance})}));return e.components=o,o},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,r=document.querySelector("#ToolOverlay_".concat(n.flowId)),o=e.getInstance();o.components.forEach((function(t){return t(o,r)})),o.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return uo("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=oo([nx],e)}(Fn),tE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var r=(0,this.props.getView)(t.type);return r?uo(r,{model:t,graphModel:e,overlay:n},t.id):null},e.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,r=e.tool,o=e.options,i=e.dnd,a=e.snaplineModel,s={};o.width&&(s.width="".concat(n.width,"px")),o.height&&(s.height="".concat(n.height,"px"));var u=o.grid&&Kb.getGridOptions(o.grid),l=n.fakeNode,c=n.editConfigModel.adjustEdge;return uo("div",{className:"lf-graph","flow-id":n.flowId,style:s,children:[uo(Rb,{graphModel:n,dnd:i,children:[uo("g",{className:"lf-base",children:xh(n.sortElements,(function(e){return t.getComponent(e,n)}))}),l?this.getComponent(l,n):""]}),uo(Zb,{graphModel:n,children:[uo($b,{graphModel:n}),c?uo(Fb,{graphModel:n}):"",!1!==o.snapline?uo(Jb,{snaplineModel:a}):""]}),uo(Qb,{graphModel:n,tool:r}),o.background&&uo(Vb,{background:o.background}),u&&uo(Kb,no({},u,{graphModel:n}))]})},e=oo([nx],e)}(Fn),eE=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(e){var r=e.event,o=n.props,i=o.anchorData,a=o.nodeModel,s=o.graphModel;s.selectNodeById(a.id),a.autoToFront&&s.toFront(a.id),s.eventCenter.emit(t.EventType.ANCHOR_DRAGSTART,{data:i,e:r,nodeModel:a}),n.setState({startX:i.x,startY:i.y,endX:i.x,endY:i.y})},n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=i.transformModel,l=i.eventCenter,c=i.width,p=i.height,d=i.editConfigModel,h=d.autoExpand,f=d.stopMoveGraph,y=r.clientX,v=r.clientY,g=i.getPointByClient({x:y,y:v}),_=g.domOverlayPosition,m=_.x,b=_.y,E=g.canvasOverlayPosition,x=E.x,w=E.y;n.t&&eb(n.t);var S=[];m<10?S=[10,0]:m+10>c?S=[-10,0]:b<10?S=[0,10]:b+10>p&&(S=[0,-10]),n.setState({endX:x,endY:w,dragging:!0}),n.moveAnchorEnd(x,w),S.length>0&&!f&&h&&(n.t=tb((function(){var t=io(S,2),e=t[0],r=t[1];u.translate(e,r);var o=n.state,i=o.endX,a=o.endY;n.setState({endX:i-e,endY:a-r}),n.moveAnchorEnd(i-e,a-r)}))),l.emit(t.EventType.ANCHOR_DRAG,{data:s,e:r,nodeModel:a})},n.onDragEnd=function(e){var r=e.event;n.t&&eb(n.t);var o=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var i=n.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData;o&&a.eventCenter.emit(t.EventType.ANCHOR_DRAGEND,{data:u,e:r,nodeModel:s,edgeModel:o})},n.checkEnd=function(e){var r,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=s.x,l=s.y,c=s.id,p=n.state,d=p.endX,h=p.endY,f=p.dragging,y=ym({x:d,y:h},i);if(n.preTargetNode&&n.preTargetNode.state!==t.ElementState.DEFAULT&&n.preTargetNode.setElementState(t.ElementState.DEFAULT),f&&y&&y.node){var v=y.node,g=y.anchor.id,_="".concat(a.id,"_").concat(v.id,"_").concat(g,"_").concat(c),m=n.sourceRuleResults.get(_)||{},b=m.isAllPass,E=m.msg,x=n.targetRuleResults.get(_)||{},w=x.isAllPass,S=x.msg;if(b&&w){v.setElementState(t.ElementState.DEFAULT);var M=i.getNodeModelById(y.node.id),A=null===(r=i.edgeGenerator)||void 0===r?void 0:r.call(i,a.getData(),null==M?void 0:M.getData()),O=i.addEdge(no(no({},A),{sourceNodeId:a.id,sourceAnchorId:c,startPoint:{x:u,y:l},targetNodeId:y.node.id,targetAnchorId:y.anchor.id,endPoint:{x:y.anchor.x,y:y.anchor.y}})),T=n.props.anchorData;return i.eventCenter.emit(t.EventType.ANCHOR_DROP,{data:T,e:e,nodeModel:a,edgeModel:O}),O}var N=v.getData();return i.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:N,msg:S||E||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new c_({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return eo(n,e),n.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,r=t.node.getAnchorShape(e);if(r)return r;var o=e.x,i=e.y,a=no(no({},n),null==n?void 0:n.hover);return uo("g",{children:[uo(Ub,no({className:"lf-node-anchor-hover"},a,{x:o,y:i})),uo(Ub,no({className:"lf-node-anchor"},n,{x:o,y:i}))]})},Object.defineProperty(n.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,r=e.getAnchorOutcomingEdge,o=t.anchorData.id;return{incomingEdgeList:n(o),outcomingEdgeList:r(o)}},enumerable:!1,configurable:!0}),n.prototype.moveAnchorEnd=function(e,n){var r,o,i=this.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData,l=ym({x:e,y:n},a);if(l){var c=l.node,p=l.anchor.id;if(this.preTargetNode&&this.preTargetNode!==l.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),u.id===p)return;this.preTargetNode=c;var d="".concat(s.id,"_").concat(c.id,"_").concat(p,"_").concat(u.id);if(!this.targetRuleResults.has(d)){var h=l.anchor,f=s.isAllowConnectedAsSource(c,u,h),y=c.isAllowConnectedAsTarget(s,u,h);this.sourceRuleResults.set(d,Cm(f)),this.targetRuleResults.set(d,Cm(y))}var v=(null!==(r=this.sourceRuleResults.get(d))&&void 0!==r?r:{}).isAllPass,g=(null!==(o=this.targetRuleResults.get(d))&&void 0!==o?o:{}).isAllPass;v&&g?c.setElementState(t.ElementState.ALLOW_CONNECT):c.setElementState(t.ElementState.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==t.ElementState.DEFAULT&&this.preTargetNode.setElementState(t.ElementState.DEFAULT)},n.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,r=t.endX,o=t.endY;return _m(e,n,r,o)>10},n.prototype.render=function(){var t=this,e=this.state,n=e.startX,r=e.startY,o=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,u=a.edgeStyle;return uo("g",{className:"lf-anchor",children:[uo("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(no({sourcePoint:{x:n,y:r},targetPoint:{x:o,y:i}},u)):uo(Bb,no({x1:n,y1:r,x2:o,y2:i},u,{"pointer-events":"none"})))]})},n}(Fn),nE=function(e){function n(n){var r=e.call(this,n)||this;return r.style={},r.onDragging=function(e){var n,o=e.event,i=r.props,a=i.graphModel,s=i.nodeModel,u=i.eventCenter,l=a.selectNodes,c=s.x,p=s.y,d=o.clientX,h=o.clientY,f=a.getPointByClient({x:d,y:h}).canvasOverlayPosition,y=f.x,v=f.y,g=new um(y-c,v-p),_=(null===(n=r.normal)||void 0===n?void 0:n.angle(g))-r.defaultAngle,m=new hm(-c,-p).rotate(_).translate(c,p).toString();s.transform=m,s.rotate=_;var b=xh(l,(function(t){return t.id}));-1===b.indexOf(s.id)&&(b=[s.id]);var E=av(b,(function(t,e){var n=a.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});b.forEach((function(t){a.getNodeEdges(t).forEach((function(t){if(E[t.sourceNodeId]){var e=a.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(E[t.targetNodeId]){e=a.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),u.emit(t.EventType.NODE_ROTATE,{e:o,nodeModel:s})},r.style=n.style,r.stepperDrag=new c_({onDragging:r.onDragging}),r}return eo(n,e),n.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,r=e.y,o=n+e.width/2+20,i=r-e.height/2-20;return this.normal=new um(1,0),this.defaultAngle=this.normal.angle(new um(o-n,i-r)),e.defaultAngle=this.defaultAngle,uo("g",{className:"lf-rotate-control",children:uo("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:uo(Ub,no({},this.style,{cx:o,cy:i}))})})},n}(Fn),rE=function(e){function n(n){var r=e.call(this)||this;r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.model,a=io(o.graphModel.transformModel.fixDeltaXY(e,n),2),s=a[0],u=a[1];i.moveText(s,u)},r.dblClickHandler=function(){r.props.editable&&r.props.model.setElementState(t.ElementState.TEXT_EDIT)},r.mouseDownHandle=function(t){var e=r.props,n=e.draggable,o=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(n||i)&&(r.stepDrag.model=o,r.stepDrag.handleMouseDown(t))};var o=n.draggable;return r.stepDrag=new c_({onDragging:r.onDragging,step:1,isStopPropagation:o}),r}return eo(n,e),n.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.text,o=n.editConfigModel,i=r.value,a=r.x,s=r.y,u=r.editable,l=r.draggable,c={x:a,y:s,className:"",value:i};u?c.className="lf-element-text":l||o.nodeTextDraggable?c.className="lf-text-draggable":c.className="lf-text-disabled";var p=e.getTextStyle();return uo(Lb,no({},c,p,{model:e}))},n.prototype.render=function(){if(this.props.model.text)return uo("g",{onMouseDown:this.mouseDownHandle,onDblClick:this.dblClickHandler,children:this.getShape()})},n}(Fn),oE=function(t){function e(e){var n=t.call(this,e)||this;return n.setHoverON=function(){n.setState({isHovered:!0})},n.setHoverOFF=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return eo(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.text,r=t.width,o=e.background||{};if(this.state.isHovered&&(null==e?void 0:e.hover)&&(null==e?void 0:e.hover.background)&&(o=no(no({},o),null==e?void 0:e.hover.background)),n&&n.value&&"transparent"!==o.fill){var i=null!=e?e:{},a=i.fontSize,s=i.overflowMode,u=i.lineHeight,l=i.wrapPadding,c=i.textWidth,p=n.value,d=n.x,h=n.y,f=String(p).split(/[\r\n]/g),y=f.length,v=void 0;if("autoWrap"===s&&c){var g=Dm({rows:f,style:{fontSize:"".concat(a,"px"),width:"".concat(c,"px"),lineHeight:u,padding:l},rowsLength:y,className:"lf-get-text-height"});v=no(no({},o),{x:d-1,y:h-1,width:c,height:g})}else{f&&f.forEach((function(t){Y_(t)}));var _=Pm({rows:f,fontSize:a,rowsLength:y}),m=_.width,b=_.height;if("ellipsis"===s&&(m=c||r,b=a+2),"string"==typeof o.wrapPadding){var E=o.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));E.length>0&&E.length<=4&&(1===E.length?E=[E[0],E[0],E[0],E[0]]:2===E.length?E=[E[0],E[1],E[0],E[1]]:3===E.length&&(E=[E[0],E[1],E[2],E[1]]),m+=E[1]+E[3],b+=E[0]+E[2],d+=(E[1]-E[3])/2,h+=(E[2]-E[0])/2)}v=no(no({},o),{x:d-1,y:h-1,width:m,height:b})}return uo(zb,no({},v))}},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.value,r=e.x,o=e.y;if(!n)return null;var i=t.getTextStyle(),a=no({x:r,y:o,className:"lf-element-text",value:n},i);return uo("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF,children:[this.getBackground(),uo(Lb,no({},a,{model:t}))]})},e}(rE);!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(qb||(qb={}));var iE,aE=function(e){function n(n){var r=e.call(this)||this;r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors;Yd(r.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(r=fh(n,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:r.x,y:r.y});else if(t.targetNodeId===e){var r;(r=fh(n,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:r.x,y:r.y})}}))},r.triggerResizeEvent=function(e,n){r.graphModel.eventCenter.emit(t.EventType.NODE_RESIZE,{preNodeData:e,nextNodeData:n})},r.recalcResizeInfo=function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=!1),void 0===o&&(o=!1);var i=up(e),a=i.deltaX,s=i.deltaY,u=i.width,l=i.height,c=i.PCTResizeInfo;if(c){var p=0,d=0;switch(t){case qb.LEFT_TOP:d=(-1*a-s)/4;break;case qb.RIGHT_TOP:d=(a-s)/4;break;case qb.RIGHT_BOTTOM:d=(a+s)/4;break;case qb.LEFT_BOTTOM:d=(-1*a+s)/4}0!==d&&(p=Math.round(d/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case qb.LEFT_TOP:a=u-h,s=l-f;break;case qb.RIGHT_TOP:a=h-u,s=l-f;break;case qb.RIGHT_BOTTOM:a=h-u,s=f-l;break;case qb.LEFT_BOTTOM:a=u-h,s=f-l}return i}switch(t){case qb.LEFT_TOP:i.width=r?u:u-a*n,i.height=o?l:l-s*n;break;case qb.RIGHT_TOP:i.width=r?u:u+a*n,i.height=o?l:l-s*n;break;case qb.RIGHT_BOTTOM:i.width=r?u:u+a*n,i.height=o?l:l+s*n;break;case qb.LEFT_BOTTOM:i.width=r?u:u-a*n,i.height=o?l:l+s*n}return i},r.resizeNode=function(t){var e=t.deltaX,n=t.deltaY,o=r.nodeModel,i=o.r,a=o.rx,s=o.ry,u=o.width,l=o.height,c=o.PCTResizeInfo,p=o.minWidth,d=o.minHeight,h=o.maxWidth,f=o.maxHeight,y=p===h,v=d===f,g={width:i||a||u,height:i||s||l,deltaX:e,deltaY:n,PCTResizeInfo:c},_=i||a&&s?.5:1,m=r.recalcResizeInfo(r.index,g,_,y,v);if(m.width<p||m.width>h||m.height<d||m.height>f)r.dragHandler.cancelDrag();else{m.deltaX=y?0:m.deltaX,m.deltaY=y?0:m.deltaY;var b=r.nodeModel.getData(),E=r.nodeModel.resize(m);console.log("nextNodeData ===>>>",E),r.updateEdgePointByAnchors(),r.triggerResizeEvent(b,E)}},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=io(r.graphModel.transformModel.fixDeltaXY(e,n),2),i=o[0],a=o[1];r.resizeNode({deltaX:i,deltaY:a})},r.onDragEnd=function(){var t=r.nodeModel.x,e=r.nodeModel.y;r.nodeModel.moveTo(t,e),r.updateEdgePointByAnchors()};var o=n.index,i=n.model,a=n.graphModel;return r.index=o,r.nodeModel=i,r.graphModel=a,r.dragHandler=new c_({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r}return eo(n,e),n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.direction,o=t.model.getResizeControlStyle();return uo("g",{className:"lf-resize-control lf-resize-control-".concat(r),children:uo(zb,no({className:"lf-resize-control-content",x:e,y:n},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(Fn),sE=function(t){function e(){return t.call(this)||this}return eo(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=Em(e),o=r.minX,i=r.minY,a=r.maxX,s=r.maxY;return xh([{index:qb.LEFT_TOP,direction:"nw",x:o,y:i},{index:qb.RIGHT_TOP,direction:"ne",x:a,y:i},{index:qb.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:qb.LEFT_BOTTOM,direction:"sw",x:o,y:s}],(function(t){return uo(aE,no({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getResizeOutlineStyle();return uo(zb,no({},i,{x:e,y:n,width:r,height:o}))},e.prototype.render=function(){return uo("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Fn),uE=function(e){function n(n){var r=e.call(this)||this;r.onDragStart=function(t){var e=t.event,n=r.props,o=n.model,i=n.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,u=a.y;r.moveOffset={dx:o.x-s,dy:o.y-u}}},r.onDragging=function(t){var e,n,o,i,a=t.event,s=r.props,u=s.model,l=s.graphModel,c=l.editConfigModel,p=c.stopMoveGraph,d=c.autoExpand,h=l.transformModel,f=l.selectNodes,y=l.width,v=l.height,g=l.gridSize;u.isDragging=!0;var _=a,m=_.clientX,b=_.clientY,E=l.getPointByClient({x:m,y:b}).canvasOverlayPosition,x=E.x,w=E.y,S=io(h.CanvasPointToHtmlPoint([x,w]),2),M=S[0],A=S[1];if(x+=null!==(n=null===(e=r.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==n?n:0,w+=null!==(i=null===(o=r.moveOffset)||void 0===o?void 0:o.dy)&&void 0!==i?i:0,x=nm(x,g),w=nm(w,g),y&&v){if(!d||p||!(M<0||A<0||M>y||A>v)){var O=io(h.CanvasPointToHtmlPoint([x-u.width/2,w-u.height/2]),2),T=O[0],N=O[1],D=io(h.CanvasPointToHtmlPoint([x+u.width/2,w+u.height/2]),2),P=D[0],C=D[1],j=Math.max(g,20),I=[];T<0?I=[j,0]:P>l.width?I=[-j,0]:N<0?I=[0,j]:C>l.height&&(I=[0,-j]),r.t&&eb(r.t),u.transform=new hm(-x,-w).rotate(u.rotate).translate(x,w).toString();var k=f.map((function(t){return t.id}));-1===k.indexOf(u.id)&&(k=[u.id]),I.length>0&&!p&&d?r.t=tb((function(){var t=io(I,2),e=t[0],n=t[1];h.translate(null!=e?e:0,null!=n?n:0);var r=-(null!=e?e:0)/h.SCALE_X,o=-(null!=n?n:0)/h.SCALE_X;l.moveNodes(k,r,o)})):l.moveNodes(k,x-u.x,w-u.y)}}else l.moveNode2Coordinate(u.id,x,w)},r.onDragEnd=function(){r.t&&eb(r.t),r.props.model.isDragging=!1},r.handleMouseUp=function(){var t=r.props.model;r.mouseUpDrag=t.isDragging},r.handleClick=function(e){var n=!1===r.mouseUpDrag;if(r.startTime){var o=r.props,i=o.model,a=o.graphModel;if(n){var s={data:i.getData(),e:e,position:a.getPointByClient({x:e.clientX,y:e.clientY}),isSelected:!1,isMultiple:!1},u=2===e.button,l=2===e.detail;if(!u){var c=a.editConfigModel,p=im(e,c);s.isMultiple=p,i.isSelected&&!l&&p?(s.isSelected=!1,i.setSelected(!1)):(a.selectNodeById(i.id,p),s.isSelected=!0,r.toFront()),l?(c.nodeTextEdit&&i.text.editable&&(i.setSelected(!1),a.setElementStateById(i.id,t.ElementState.TEXT_EDIT)),a.eventCenter.emit(t.EventType.NODE_DBCLICK,s)):(a.eventCenter.emit(t.EventType.ELEMENT_CLICK,s),a.eventCenter.emit(t.EventType.NODE_CLICK,s))}}}},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.model,i=n.graphModel,a=o.getData(),s=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,s.domOverlayPosition),o.isSelected||i.selectNodeById(o.id),i.eventCenter.emit(t.EventType.NODE_CONTEXTMENU,{data:a,e:e,position:s}),r.toFront()},r.handleMouseDown=function(t){var e=r.props,n=e.model,o=e.graphModel;r.startTime=(new Date).getTime(),o.editConfigModel.adjustNodePosition&&n.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.setHoverON=function(e){var n=r.props,o=n.model,i=n.graphModel;if(!o.isHovered){var a=o.getData();o.setHovered(!0),i.eventCenter.emit(t.EventType.NODE_MOUSEENTER,{data:a,e:e})}},r.setHoverOFF=function(e){var n=r.props,o=n.model,i=n.graphModel,a=o.getData();o.isHovered&&(o.setHovered(!1),i.eventCenter.emit(t.EventType.NODE_MOUSELEAVE,{data:a,e:e}))},r.onMouseOut=function(t){e_&&r.setHoverOFF(t)};var o=n.graphModel,i=o.gridSize,a=o.eventCenter,s=n.model;return r.stepDrag=new c_({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=ae((function(){return r.props}),(function(t){t&&t.model&&r.stepDrag.setModel(t.model)})),r}return eo(n,e),n.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},n.prototype.componentDidMount=function(){},n.prototype.componentDidUpdate=function(){},n.prototype.getAnchorShape=function(t){return null},n.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(o||s)&&!a?xh(n.anchors,(function(e,o){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return uo(eE,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:o,nodeModel:n,graphModel:r,setHoverOFF:t.setHoverOFF})})):[]},n.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableRotate,a=e.isHovered,s=e.getRotateControlStyle();if(o&&(r||a)&&i)return uo(nE,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:s})},n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableResize,a=e.isHovered,s=e.getResizeControlStyle();return o&&(r||a)&&i?uo(sE,{style:s,model:e,graphModel:n}):null},n.prototype.getText=function(){var e,n=this.props,r=n.model,o=n.graphModel;if(r.state===t.ElementState.TEXT_EDIT)return null;if(r.text){var i=o.editConfigModel,a=!1;return(r.text.draggable||i.nodeTextDraggable)&&(a=!0),uo(rE,{editable:i.nodeTextEdit&&(null===(e=r.text.editable)||void 0===e||e),model:r,graphModel:o,draggable:a})}return null},n.prototype.getStateClassName=function(){var e=this.props.model,n=e.state,r=e.isDragging,o=e.isSelected,i="lf-node";switch(n){case t.ElementState.ALLOW_CONNECT:i+=" lf-node-allow";break;case t.ElementState.NOT_ALLOW_CONNECT:i+=" lf-node-not-allow";break;default:i+=" lf-node-default"}return r&&(i+=" lf-isDragging"),o&&(i+=" lf-node-selected"),i},n.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},n.prototype.render=function(){var t,e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.hideAnchors,a=o.adjustNodePosition,s=o.allowRotate,u=o.allowResize,l=r.gridSize,c=r.transformModel.SCALE_X,p=n.isHitable,d=n.draggable,h=n.transform,f=n.getOuterGAttributes(),y=f.className,v=void 0===y?"":y,g=ro(f,["className"]),_=uo("g",{className:"lf-node-content",children:[uo("g",{transform:h,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),u&&this.getResizeControl()]}),!i&&this.getAnchors()]});return p?(a&&d&&this.stepDrag.setStep(l*c),t=uo("g",no({className:"".concat(this.getStateClassName()," ").concat(v),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverON,onMouseOver:this.setHoverON,onMouseLeave:this.setHoverOFF,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},g,{children:_}))):t=uo("g",no({className:"".concat(this.getStateClassName()," ").concat(v)},g,{children:_})),t},n.isObserved=!1,n}(Fn),lE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo(zb,no({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(uE),cE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.r,o=t.getNodeStyle();return uo(Ub,no({},o,{x:e,y:n,r:r}))},e}(uE),pE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),u={transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")};return uo("g",no({},u,{children:uo(Gb,no({},s,{points:a,x:n,y:r}))}))},e}(uE),dE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo("g",{children:uo(Gb,no({},e,{points:t.points,x:t.x,y:t.y}))})},e}(uE),hE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo(Xb,no({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(uE),fE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,r=t.height,o=t.x,i=t.y,a=no(no({},e.background),{x:o,y:i-1,width:n,height:r});return uo(zb,no({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return uo("g",{children:this.getBackground()})},e}(uE),yE=function(t){function e(){var e=t.apply(this,ao([],io(arguments),!1))||this;return e.ref={current:null},e}return eo(e,t),Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(t){t.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(t){this.setHtml(t)},e.prototype.shouldUpdate=function(){return(!this.preProperties||this.preProperties!==this.currentProperties)&&(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){console.log("HtmlNode ---\x3e>> componentDidMount - 初始化内容"),this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){console.log("HtmlNode ---\x3e>> componentDidUpdate - 更新节点内容"),this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.height,o=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),uo("foreignObject",no({},i,{x:e-o/2,y:n-r/2,width:o,height:r,ref:this.ref}))},e}(uE);t.AdjustType=void 0,(iE=t.AdjustType||(t.AdjustType={})).SOURCE="SOURCE",iE.TARGET="TARGET";var vE=function(e){function n(n){var r=e.call(this)||this;r.handleMouseDown=function(t){r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.onDragStart=function(){var t=r.props,e=t.x,n=t.y,o=t.edgeModel,i=o.startPoint,a=o.endPoint,s=o.pointsList;r.oldEdge={startPoint:i,endPoint:a,pointsList:s},r.setState({endX:e,endY:n,dragging:!0})},r.onDragging=function(e){var n=e.deltaX,o=e.deltaY,i=r.state,a=i.endX,s=i.endY,u=r.props,l=u.graphModel,c=u.type,p=l.transformModel,d=l.editConfigModel,h=io(p.moveCanvasPointByHtml([a,s],n,o),2),f=h[0],y=h[1];r.setState({endX:f,endY:y,dragging:!0});var v=r.props.edgeModel,g=ym({x:a,y:s},l);if(g&&g.node&&r.isAllowAdjust(g).pass){var _=void 0,m=v.startPoint,b=v.endPoint,E=v.sourceNode,x=v.targetNode;c===t.AdjustType.SOURCE?_={startPoint:{x:g.anchor.x,y:g.anchor.y},endPoint:{x:b.x,y:b.y},sourceNode:g.node,targetNode:x}:c===t.AdjustType.TARGET&&(_={startPoint:{x:m.x,y:m.y},endPoint:{x:g.anchor.x,y:g.anchor.y},sourceNode:E,targetNode:g.node}),v.updateAfterAdjustStartAndEnd(_)}else c===t.AdjustType.SOURCE?v.updateStartPoint({x:f,y:y}):c===t.AdjustType.TARGET&&v.updateEndPoint({x:f,y:y});v.text.value&&d.adjustEdge&&v.setText(Object.assign({},v.text,v.textPosition))},r.onDragEnd=function(e){var n,o,i,a=e.event;try{r.setState({dragging:!1});var s=r.props,u=s.graphModel,l=s.edgeModel,c=s.type,p=r.state,d=p.endX,h=p.endY,f=p.dragging,y=ym({x:d,y:h},u);if(!f)return;var v=!1,g=void 0;if(y&&y.node){var _=r.isAllowAdjust(y),m=_.pass,b=_.msg,E=_.newTargetNode;if(m){var x=l.getData(),w=x.text,S=x.sourceAnchorId,M=void 0===S?"":S,A=x.targetAnchorId,O=void 0===A?"":A,T=ro(x,["text","sourceAnchorId","targetAnchorId"]);if(g=no(no({sourceAnchorId:M,targetAnchorId:O},T),{text:(null==w?void 0:w.value)||""}),c===t.AdjustType.SOURCE){var N=u.getNodeModelById(y.node.id),D=u.getNodeModelById(l.targetNodeId),P=null===(n=u.edgeGenerator)||void 0===n?void 0:n.call(u,null==N?void 0:N.getData(),null==D?void 0:D.getData(),g);g=no(no({},P),{sourceNodeId:y.node.id,sourceAnchorId:y.anchor.id,startPoint:{x:y.anchor.x,y:y.anchor.y},targetNodeId:l.targetNodeId,endPoint:no({},l.endPoint)}),l.sourceNodeId===y.node.id&&l.sourceAnchorId===y.anchor.id&&(v=!0)}else if(c===t.AdjustType.TARGET){N=u.getNodeModelById(l.sourceNodeId),D=u.getNodeModelById(y.node.id),P=null===(o=u.edgeGenerator)||void 0===o?void 0:o.call(u,null==N?void 0:N.getData(),null==D?void 0:D.getData(),g);g=no(no({},P),{sourceNodeId:l.sourceNodeId,startPoint:no({},l.startPoint),targetNodeId:y.node.id,targetAnchorId:y.anchor.id,endPoint:{x:y.anchor.x,y:y.anchor.y}}),l.targetNodeId===y.node.id&&l.targetAnchorId===y.anchor.id&&(v=!0)}}else{v=!0;var C=E.getData();u.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:C,msg:b})}}else v=!0;if(v)r.recoveryEdge();else{var j=l.getData();u.deleteEdgeById(l.id);var I=u.addEdge(no({},g));u.eventCenter.emit(t.EventType.EDGE_EXCHANGE_NODE,{data:{newEdge:I.getData(),oldEdge:j}})}null===(i=r.preTargetNode)||void 0===i||i.setElementState(t.ElementState.DEFAULT)}finally{(u=r.props.graphModel).eventCenter.emit(t.EventType.ADJUST_POINT_DRAGEND,{e:a,data:r.stepDragData})}},r.recoveryEdge=function(){var e=r.props.edgeModel,n=r.oldEdge,o=n.startPoint,i=n.endPoint,a=n.pointsList;e.updateStartPoint(o),e.updateEndPoint(i),e.modelType!==t.ModelType.LINE_EDGE&&(e.pointsList=null!=a?a:[],e.initPoints())},r.getAdjustPointStyle=function(){return r.props.graphModel.theme.edgeAdjust},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var o=n.type,i=n.edgeModel,a=n.graphModel.eventCenter;return r.stepDragData={type:o,edgeData:i.getData()},r.stepDrag=new c_({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:a,data:r.stepDragData}),r}return eo(n,e),n.prototype.isAllowAdjust=function(e){var n,r,o,i,a=this.props,s=a.edgeModel,u=s.id,l=s.sourceNode,c=s.targetNode,p=s.sourceAnchorId,d=s.targetAnchorId,h=a.type;if(h===t.AdjustType.SOURCE?(n=e.node,r=c,o=e.anchor,i=c.getAnchorInfo(d)):(n=l,r=e.node,i=e.anchor,o=l.getAnchorInfo(p)),this.preTargetNode&&this.preTargetNode!==e.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),this.preTargetNode=e.node,i.id===o.id)return{pass:!1,msg:"",newTargetNode:r};var f="".concat(n.id,"_").concat(r.id,"_").concat(o.id,"_").concat(i.id);if(!this.targetRuleResults.has(f)){var y=n.isAllowConnectedAsSource(r,o,i,u),v=r.isAllowConnectedAsTarget(n,o,i,u);this.sourceRuleResults.set(f,Cm(y)),this.targetRuleResults.set(f,Cm(v))}var g=this.sourceRuleResults.get(f),_=g.isAllPass,m=g.msg,b=this.targetRuleResults.get(f),E=b.isAllPass,x=b.msg,w=_&&E?t.ElementState.ALLOW_CONNECT:t.ElementState.NOT_ALLOW_CONNECT;return h===t.AdjustType.SOURCE?n.setElementState(w):r.setElementState(w),{pass:_&&E,msg:x||m,newTargetNode:r}},n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.getAdjustPointShape,o=t.edgeModel,i=this.state.dragging;return uo("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":r(e,n,o)})},n}(Fn),gE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,r=e.start,o=e.end,i={start:r,end:o,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=p_(i),s=a.leftX,u=a.leftY,l=a.rightX,c=a.rightY;return no({d:"M".concat(s," ").concat(u," L").concat(o.x," ").concat(o.y," L").concat(l," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,r=t.stroke;return uo(Hb,{d:e,fill:t.fill,strokeWidth:n,stroke:r})},e.prototype.render=function(){return uo("g",{className:"lf-arrow",children:this.getShape()})},e}(Fn),_E=function(e){function n(){var n=e.call(this)||this;return n.textRef={current:null},n.handleHover=function(e,r){var o=n.props,i=o.model,a=o.graphModel.eventCenter;i.setHovered(e);var s=e?t.EventType.EDGE_MOUSEENTER:t.EventType.EDGE_MOUSELEAVE,u=i.getData();a.emit(s,{data:u,e:r})},n.setHoverON=function(t){n.props.model.isHovered||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverON(),n.handleHover(!0,t))},n.setHoverOFF=function(t){n.props.model.isHovered&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOFF(),n.handleHover(!1,t))},n.handleContextMenu=function(e){e.preventDefault(),n.contextMenuTime=(new Date).getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,o=r.model,i=r.graphModel,a=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,a.domOverlayPosition),n.toFront(),o.isSelected||i.selectEdgeById(o.id);var s=null==o?void 0:o.getData();i.eventCenter.emit(t.EventType.EDGE_CONTEXTMENU,{data:s,e:e,position:a})},n.handleMouseDown=function(t){t.stopPropagation(),n.startTime=(new Date).getTime()},n.handleMouseUp=function(e){if(n.startTime&&!((new Date).getTime()-n.startTime>200||2===e.button)){var r=2===e.detail,o=n.props,i=o.model,a=o.graphModel,s=null==i?void 0:i.getData(),u=a.getPointByClient({x:e.clientX,y:e.clientY});if(r){var l=a.editConfigModel,c=a.textEditElement;if(c&&c.id===i.id&&a.setElementStateById(i.id,t.ElementState.DEFAULT),l.edgeTextEdit&&i.text.editable&&a.setElementStateById(i.id,t.ElementState.TEXT_EDIT),i.modelType===t.ModelType.POLYLINE_EDGE){var p=i,d=a.getPointByClient({x:e.x,y:e.y}).canvasOverlayPosition,h=d.x,f=d.y,y=J_({x:h,y:f},p.points);p.dbClickPosition=y}a.eventCenter.emit(t.EventType.EDGE_DBCLICK,{data:s,e:e,position:u})}else a.eventCenter.emit(t.EventType.ELEMENT_CLICK,{data:s,e:e,position:u}),a.eventCenter.emit(t.EventType.EDGE_CLICK,{data:s,e:e,position:u});var v=a.editConfigModel;a.selectEdgeById(i.id,im(e,v)),n.toFront()}},n}return eo(n,e),n.prototype.getShape=function(){return uo("g",{children:this.getEdge()})},n.prototype.getTextStyle=function(){},n.prototype.getText=function(){var e=this.props,n=e.model,r=e.graphModel;if(n.state===t.ElementState.TEXT_EDIT)return null;var o=!1,i=r.editConfigModel;return(n.text.draggable||i.edgeTextDraggable)&&(o=!0),uo(oE,{ref:this.textRef,editable:i.edgeTextEdit&&n.text.editable,model:n,graphModel:r,draggable:o})},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:r}},n.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},n.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},n.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),r=n.refY,o=void 0===r?0:r,i=n.refX,a=void 0===i?2:i,s=io(this.getLastTwoPoints(),2),u=s[0],l=s[1],c="auto";return null!==u&&null!==l&&(c=sb(ab({x:l.x-u.x,y:l.y-u.y,z:0}))),uo("g",{children:uo("defs",{children:[uo("marker",{id:"marker-start-".concat(e),refX:-a,refY:o,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),uo("marker",{id:"marker-end-".concat(e),refX:a,refY:o,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},n.prototype.getStartArrow=function(){return uo("path",{})},n.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,r=t.offset,o=t.verticalLength;return uo("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(r," -").concat(o," L ").concat(r," ").concat(o," Z")})},n.prototype.getAdjustPointShape=function(t,e,n){var r=n.getAdjustPointStyle();return uo(Ub,no({className:"lf-edge-adjust-point"},r,{x:t,y:e}))},n.prototype.getAdjustPoints=function(){var e=this.props,n=e.model,r=e.graphModel,o=n.getAdjustStart(),i=n.getAdjustEnd();return uo("g",{children:[uo(vE,no({type:t.AdjustType.SOURCE},o,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r})),uo(vE,no({type:t.AdjustType.TARGET},i,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r}))]})},n.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},n.prototype.getAppendWidth=function(){return uo("g",{})},n.prototype.getAppend=function(){return uo("g",{className:"lf-edge-append",children:this.getAppendWidth()})},n.prototype.getEdge=function(){return null},n.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},n.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,r=t.isShowAdjustPoint;return uo("g",{children:[uo("g",{className:["lf-edge",!n&&"pointer-none",e&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverON,onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),r&&e?this.getAdjustPoints():""]})},n.isObserved=!1,n}(Fn),mE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,r=n.path,o=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return uo(Hb,no({d:r},e,i,o?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){return uo(Hb,{d:this.props.model.path,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,e=this.state.hover,n=t.isSelected,r=t.getArrowStyle().offset,o=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=io($_(o,r),2);return{start:i[0],end:i[1],hover:e,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,e=t.getArrowStyle().offset,n=t.pointsList.map((function(t){return{x:t.x,y:t.y}}));return $_(n,e)},e}(_E),bE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isAnimation,o=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return uo(Bb,no({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},o,r?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=V_({start:e,end:n}),o=r.d,i=r.strokeWidth,a=r.fill,s=r.strokeDasharray;return uo(Hb,{d:o,fill:a,strokeWidth:i,stroke:r.stroke,strokeDasharray:s})},e}(_E),EE=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(){var t=n.props.model;t.dragAppendStart(),n.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.props,i=o.model,a=o.graphModel;n.isDragging=!0;var s=a.transformModel,u=a.editConfigModel,l=io(s.fixDeltaXY(e,r),2),c=l[0],p=l[1],d=i,h=u.adjustEdgeMiddle;n.appendInfo=h?d.dragAppendSimple(n.appendInfo,{x:c,y:p}):d.dragAppend(n.appendInfo,{x:c,y:p})},n.onDragEnd=function(){var e,r=n.props,o=r.model,i=r.graphModel.eventCenter,a=o;a.dragAppendEnd(),n.isDragging=!1,a.isShowAdjustPoint=null!==(e=n.isShowAdjustPointTemp)&&void 0!==e&&e,n.appendInfo=void 0,i.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.beforeDragStart=function(t,e){e.draggable&&n.drag.handleMouseDown(t),n.appendInfo=e},n.drag=new c_({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return eo(n,e),n.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,r=t.arrowConfig,o=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,u=i.strokeDashoffset,l=i.animationName,c=i.animationDuration,p=i.animationIterationCount,d=i.animationTimingFunction,h=i.animationDirection;return uo(Wb,no({points:e},o,r,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:u,animationName:l,animationDuration:c,animationIterationCount:p,animationTimingFunction:d,animationDirection:h}}:{}))},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,r=this.state.hover,o=X_(e),i=o[0],a=o[0];return o.length>=2&&(i=o[o.length-2],a=o[o.length-1]),{start:i,end:a,hover:r,isSelected:n}},n.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=X_(t),n=e[0],r=e[0];return e.length>=2&&(n=e[e.length-2],r=e[e.length-1]),[n,r]},n.prototype.getAppendAttributes=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=p_(no(no({},o),{type:"start"})),a=p_(no(no({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},n.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,r=e.strokeWidth,o=e.fill,i=e.strokeDasharray;return uo(Hb,{d:n,fill:o,strokeWidth:r,stroke:e.stroke,strokeDasharray:i})},n.prototype.getAppendWidth=function(){for(var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.pointsList,i=n.draggable,a=[],s=o.length,u=function(e){var n="lf-polyline-append",u={start:{x:o[e].x,y:o[e].y},end:{x:o[e+1].x,y:o[e+1].y},startIndex:e,endIndex:e+1,direction:u_.HORIZONTAL,draggable:!0},c=uo("g",{className:n,children:l.getAppendShape(u)}),p=r.editConfigModel,d=p.adjustEdge,h=p.adjustEdgeMiddle;if(d&&i){var f=u.startIndex,y=u.endIndex,v=h&&(0===f||y===s-1);u.draggable=!v,u.start.x===u.end.x?(u.draggable&&(n+="-ew-resize"),u.direction=u_.VERTICAL):u.start.y===u.end.y&&(u.draggable&&(n+="-ns-resize"),u.direction=u_.HORIZONTAL),c=uo("g",{className:l.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(e){return t.beforeDragStart(e,u)},children:uo("g",{className:n,children:l.getAppendShape(u)})})}a.push(c)},l=this,c=0;c<s-1;c++)u(c);return uo("g",{children:a})},n}(_E),xE=function(){function e(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(t){n.nodeConfig&&!n.fakeNode&&(n.fakeNode=n.lf.createFakeNode(no(no({},n.nodeConfig),n.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(e){if(e.preventDefault(),n.fakeNode){var r=n.clientToLocalPoint({x:e.clientX,y:e.clientY}),o=r.x,i=r.y;n.fakeNode.moveTo(o,i);var a=n.fakeNode.getData();n.lf.setNodeSnapLine(a),n.lf.graphModel.eventCenter.emit(t.EventType.NODE_DND_DRAG,{data:a})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(e){n.lf.graphModel&&e&&n.nodeConfig&&(n.lf.addNode(no(no({},n.nodeConfig),n.clientToLocalPoint({x:e.clientX,y:e.clientY})),t.EventType.NODE_DND_ADD,e),e.preventDefault(),e.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return e.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,r=cu(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=o.x,a=o.y;return{x:nm(i,r),y:nm(a,r)}},e.prototype.startDrag=function(t){var e=this.lf.graphModel.editConfigModel;(null==e?void 0:e.isSilentMode)||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},e.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},e}(),wE=function(e){function n(n){var r=e.call(this,n)||this;return r.ref={current:null},r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(e){var n=r.props.graphModel.textEditElement;"Enter"===e.key&&e.altKey&&(null==n||n.setElementState(t.ElementState.DEFAULT))},r.inputHandler=function(t){var e=t.target.innerText,n=r.props.graphModel.textEditElement;n&&(r.__prevText={type:n.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:n.id})},r.keydownHandler=function(t){t.stopPropagation()},r.state={style:{left:0,top:0}},r}return eo(n,e),n.getDerivedStateFromProps=function(e){var n,r,o=e.textEditElement,i=e.graphModel,a=i.transformModel,s=i.theme,u=s.inputText;if(o){if(!(null===(n=o.text)||void 0===n?void 0:n.value)&&o.BaseType===t.ElementType.EDGE){var l=o.text,c=o.textPosition,p=c.x,d=c.y;l.x=p,l.y=d,o.setText(l)}var h={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===t.ElementType.EDGE){var f=s.edgeText,y=f.overflowMode,v=f.lineHeight,g=f.wrapPadding;(m=f.textWidth)&&"autoWrap"===y&&(r=no(no({},h),{width:m,minWidth:m,lineHeight:v,padding:g}))}else if(o.BaseType===t.ElementType.NODE){var _=s.nodeText,m=(y=_.overflowMode,v=_.lineHeight,g=_.wrapPadding,_.textWidth),b=o.width,E=o.modelType,x=o.textWidth||m||b;(E!==t.ModelType.TEXT_NODE&&"autoWrap"===y||E===t.ModelType.TEXT_NODE&&m)&&(r=no(no({},h),{width:x,minWidth:x,lineHeight:v,padding:g}))}var w=o.text,S=w.x,M=w.y,A=io(a.CanvasPointToHtmlPoint([S,M]),2),O=A[0],T=A[1];return{style:no(no({left:O,top:T},r),u)}}return null},n.prototype.componentDidUpdate=function(){var e=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var n=this.__prevText,r=n.text,o=n.id;e.updateText(o,r),e.eventCenter.emit(t.EventType.TEXT_UPDATE,{data:no({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},n.prototype.placeCaretAtEnd=function(t){if(void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();null==n||n.removeAllRanges(),null==n||n.addRange(e)}},n.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?uo("div",{contentEditable:!0,className:"lf-text-input",style:n,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:null===(t=e.text)||void 0===t?void 0:t.value},e.id):null},n.toolName="textEdit",n=oo([nx],n)}(Fn),SE=function(e){return e.modelType===t.ModelType.LINE_EDGE?function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-i/2,y:o-a/2,x1:r+i/2,y1:o+a/2}}(e):e.modelType===t.ModelType.POLYLINE_EDGE?function(t){var e=t.points,n=X_(e),r=m_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}}(e):e.modelType===t.ModelType.BEZIER_EDGE?function(t){var e=t.path,n=q_(e),r=m_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}}(e):void 0},ME=function(e){function n(n){var r=e.call(this,n)||this;r.handleMouseDown=function(t){r.stepDrag.handleMouseDown(t)},r.handleWheelEvent=function(t){var e,n;t.preventDefault();var o=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,u=t.ctrlKey,l=new WheelEvent("wheel",{deltaX:o,deltaY:i,clientX:a,clientY:s,ctrlKey:u});null===(n=null===(e=r.props.logicFlow.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===n||n.dispatchEvent(l)},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.graphModel,a=o.logicFlow.getTransform(),s=a.SCALE_X,u=a.SCALE_Y,l=i.getSelectElements(!0);i.moveNodes(l.nodes.map((function(t){return t.id})),e/s,n/u)},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.graphModel,i=n.graphModel,a=i.eventCenter,s=i.selectElements,u=o.getPointByClient({x:e.clientX,y:e.clientY}),l={nodes:[],edges:[]};ao([],io(s.values()),!1).forEach((function(e){e.BaseType===t.ElementType.NODE&&l.nodes.push(e.getData()),e.BaseType===t.ElementType.EDGE&&l.edges.push(e.getData())})),a.emit(t.EventType.SELECTION_CONTEXTMENU,{data:l,e:e,position:u})};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new c_({onDragging:r.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),r}return eo(n,e),n.prototype.render=function(){var e,n,r=this.props.graphModel,o=r.selectElements,i=r.transformModel,a=this.props.logicFlow.getTransform(),s=a.SCALE_X,u=a.SCALE_Y;if(!(o.size<=1)){var l=Number.MAX_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER;return o.forEach((function(e){var n;e.BaseType===t.ElementType.NODE&&(n=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{x:e-r/2,y:n-o/2,x1:e+r/2,y1:n+o/2}}(e)),e.BaseType===t.ElementType.EDGE&&(n=SE(e)),void 0!==n&&(l=Math.min(l,n.x),c=Math.min(c,n.y),p=Math.max(p,n.x1),d=Math.max(d,n.y1))})),e=io(i.CanvasPointToHtmlPoint([l,c]),2),l=e[0],c=e[1],n=io(i.CanvasPointToHtmlPoint([p,d]),2),p=n[0],d=n[1],uo("div",{className:"lf-multiple-select",style:{left:"".concat(l-20*s/2,"px"),top:"".concat(c-20*u/2,"px"),width:"".concat(p-l+20*s,"px"),height:"".concat(d-c+20*u,"px"),"border-width":"".concat(2*s,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},n.toolName="multipleSelect",n=oo([nx],n)}(Fn),AE=function(){function e(e){this.toolMap=new Map,this.instance=e,this.isDisabledTool(wE.toolName)||this.registerTool(wE.toolName,wE),this.isDisabledTool(ME.toolName)||this.registerTool(ME.toolName,ME);var n=e.graphModel;n.eventCenter.on("".concat(t.EventType.GRAPH_TRANSFORM,",").concat(t.EventType.NODE_CLICK,",").concat(t.EventType.BLANK_CLICK," "),(function(){var e,r=n.textEditElement,o=n.editConfigModel,i=o.edgeTextEdit,a=o.nodeTextEdit;(i||a)&&r&&(null===(e=n.textEditElement)||void 0===e||e.setElementState(t.ElementState.DEFAULT))}))}return e.prototype.isDisabledTool=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},e.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},e.prototype.getTools=function(){return Array.from(this.toolMap.values())},e.prototype.getInstance=function(){return this.instance},e}();var OE={},TE={get exports(){return OE},set exports(t){OE=t}};!function(t){!function(e,n,r){if(e){for(var o,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},a={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();v.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},v.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},v.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},v.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},v.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},v.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},v.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);o=null},v.init=function(){var t=v(n);for(var e in t)"_"!==e.charAt(0)&&(v[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},v.init(),e.Mousetrap=v,t.exports&&(t.exports=v)}function c(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return i[t.which]?i[t.which]:a[t.which]?a[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function h(t,e,n){return n||(n=function(){if(!o)for(var t in o={},i)t>95&&t<112||i.hasOwnProperty(t)&&(o[i[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function f(t,e){var n,r,o,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),o=0;o<n.length;++o)r=n[o],u[r]&&(r=u[r]),e&&"keypress"!=e&&s[r]&&(r=s[r],i.push("shift")),d(r)&&i.push(r);return{key:r,modifiers:i,action:e=h(r,i,e)}}function y(t,e){return null!==t&&t!==n&&(t===e||y(t.parentNode,e))}function v(t){var e=this;if(t=t||n,!(e instanceof v))return new v(t);e.target=t,e._callbacks={},e._directMap={};var r,o={},i=!1,a=!1,s=!1;function u(t){t=t||{};var e,n=!1;for(e in o)t[e]?n=!0:o[e]=0;n||(s=!1)}function l(t,n,r,i,a,s){var u,l,c,p,h=[],f=r.type;if(!e._callbacks[t])return[];for("keyup"==f&&d(t)&&(n=[t]),u=0;u<e._callbacks[t].length;++u)if(l=e._callbacks[t][u],(i||!l.seq||o[l.seq]==l.level)&&f==l.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||(c=n,p=l.modifiers,c.sort().join(",")===p.sort().join(",")))){var y=!i&&l.combo==a,v=i&&l.seq==i&&l.level==s;(y||v)&&e._callbacks[t].splice(u,1),h.push(l)}return h}function h(t,n,r,o){e.stopCallback(n,n.target||n.srcElement,r,o)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function y(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=p(t);n&&("keyup"!=t.type||i!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):i=!1)}function g(t,e,n,a){function l(e){return function(){s=e,++o[t],clearTimeout(r),r=setTimeout(u,1e3)}}function c(e){h(n,e,t),"keyup"!==a&&(i=p(e)),setTimeout(u,10)}o[t]=0;for(var d=0;d<e.length;++d){var y=d+1===e.length?c:l(a||f(e[d+1]).action);_(e[d],y,a,t,d)}}function _(t,n,r,o,i){e._directMap[t+":"+r]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?g(t,s,n,r):(a=f(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],l(a.key,a.modifiers,{type:a.action},o,t,i),e._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:t}))}e._handleKey=function(t,e,n){var r,o=l(t,e,n),i={},c=0,p=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;p=!0,i[o[r].seq]=1,h(o[r].callback,n,o[r].combo,o[r].seq)}else p||h(o[r].callback,n,o[r].combo);var f="keypress"==n.type&&a;n.type!=s||d(t)||f||u(i),a=p&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)_(t[r],e,n)},c(t,"keypress",y),c(t,"keydown",y),c(t,"keyup",y)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(TE);var NE=OE,DE=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new NE(this.target),t.keyboard.enabled&&!e.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var t,e=this,n=(null!==(t=this.options.keyboard)&&void 0!==t?t:{}).shortcuts;if(n)if(No(n))n.forEach((function(t){var n=t.keys,r=t.callback,o=t.action;return e.on(n,r,o)}));else{var r=n.keys,o=n.callback,i=n.action;this.on(r,o,i)}},t.prototype.on=function(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)},Object.defineProperty(t.prototype,"disabled",{get:function(){var t,e;return!0!==(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyboard)||void 0===e?void 0:e.enabled)},enumerable:!1,configurable:!0}),t.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},t.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return e.formatKey(t)}))},t.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}();function PE(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var CE=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(CE(Object.getPrototypeOf(t))||[])},jE=function(t){return function(t){var e=CE(t),n=e.filter((function(t,n){return e.indexOf(t)===n}));return n}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},IE="pending",kE="fulfilled",RE="rejected";function LE(t){switch(this.state){case IE:return t.pending&&t.pending(this.value);case RE:return t.rejected&&t.rejected(this.value);case kE:return t.fulfilled?t.fulfilled(this.value):this.value}}function BE(t,e){if(PE(arguments.length<=2,"fromPromise expects up to two arguments"),PE("function"==typeof t||"object"==typeof t&&t&&"function"==typeof t.then,"Please pass a promise or function to fromPromise"),!0===t.isPromiseBasedObservable)return t;"function"==typeof t&&(t=new Promise(t));var n=t;t.then(te("observableFromPromise-resolve",(function(t){n.value=t,n.state=kE})),te("observableFromPromise-reject",(function(t){n.value=t,n.state=RE}))),n.isPromiseBasedObservable=!0,n.case=LE;var r=e&&e.state===kE?e.value:void 0;return pe(n,{value:r,state:IE},{},{deep:!1}),n}!function(t){t.reject=te("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=RE,n.value=e,n})),t.resolve=te("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=kE,n.value=e,n}))}(BE||(BE={}));var zE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t,e){var n=this;ee((function(){n.current=e,n.subscription=t.subscribe(n)}))}t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(t){this.current=t},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(t){this.current=t,this.dispose()},zE([$.ref],t.prototype,"current",void 0),zE([te.bound],t.prototype,"next",null),zE([te.bound],t.prototype,"complete",null),zE([te.bound],t.prototype,"error",null)}();var HE=function(){return HE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},HE.apply(this,arguments)},UE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},XE=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function GE(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function WE(t){return hn(t)||Je(t)||nn(t)}function YE(t,e){var n=new WeakMap;function r(r){var a=n.get(r.object);!function(t,e){switch(t.type){case"add":o(t.newValue,e,t.name);break;case"update":i(t.oldValue),o(t.newValue,e,t.name||""+t.index);break;case"remove":case"delete":i(t.oldValue);break;case"splice":t.removed.map(i),t.added.forEach((function(n,r){return o(n,e,""+(t.index+r))}));for(var r=t.index+t.addedCount;r<t.object.length;r++)if(WE(t.object[r])){var a=n.get(t.object[r]);a&&(a.path=""+r)}}}(r,a),e(r,GE(a),t)}function o(t,e,i){if(WE(t)){var a=n.get(t);if(a){if(a.parent!==e||a.path!==i)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+GE(e)+"/"+i+"', but it already exists at '"+GE(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:De(t,r)};n.set(t,s),Oe(t).forEach((function(t){var e=t[0];return o(t[1],s,e)}))}}}function i(t){if(WE(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Ae(t).forEach(i)}}return o(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=$.map({}),this.localComputedValues=$.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},PE(hn(t),"createViewModel expects an observable object"),jE(t).forEach((function(n){if(n!==S&&"__mobxDidRunLazyInitializers"!==n){if(PE(-1===XE.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),xe(t,n)){var r=yn(t,n).derivation;e.localComputedValues.set(n,rt(r.bind(e)))}var o=Object.getOwnPropertyDescriptor(t,n),i=o?{enumerable:o.enumerable}:{};Object.defineProperty(e,n,HE(HE({},i),{configurable:!0,get:function(){return xe(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:te((function(t){t!==e.model[n]?e.localValues.set(n,t):e.localValues.delete(n)}))}))}}))}Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var t=this;Me(this.localValues).forEach((function(e){var n=t.localValues.get(e),r=t.model[e];Je(r)?r.replace(n):nn(r)?(r.clear(),r.merge(n)):Ee(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},UE([rt],t.prototype,"isDirty",null),UE([rt],t.prototype,"changedValues",null),UE([te.bound],t.prototype,"submit",null),UE([te.bound],t.prototype,"reset",null),UE([te.bound],t.prototype,"resetProperty",null)}();var FE=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r){var o=void 0===r?{}:r,i=o.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=o.keyToName,u=void 0===s?function(t){return""+t}:s,l=t.call(this)||this;l._keyToName=u,l._groupBy=n,l._ogmInfoKey=Symbol("ogmInfo"+a),l._base=e;for(var c=0;c<e.length;c++)l._addItem(e[c]);return l._disposeBaseObserver=De(l._base,(function(t){if("splice"===t.type)Re((function(){for(var e=0,n=t.removed;e<n.length;e++){var r=n[e];l._removeItem(r)}for(var o=0,i=t.added;o<i.length;o++){var a=i[o];l._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");Re((function(){l._removeItem(t.oldValue),l._addItem(t.newValue)}))}})),l}FE(e,t),e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(t){throw new Error("not supported")},e.prototype.set=function(t,e){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var t=0;t<this._base.length;t++){var e=this._base[t];e[this._ogmInfoKey].reaction(),delete e[this._ogmInfoKey]}},e.prototype._getGroupArr=function(e){var n=t.prototype.get.call(this,e);return void 0===n&&(n=$([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var r=t.prototype.get.call(this,e);1===r.length?t.prototype.delete.call(this,e):(n===r.length-1||(r[n]=r[r.length-1],r[n][this._ogmInfoKey].groupArrIndex=n),r.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),r=this._getGroupArr(n),o={groupByValue:n,groupArrIndex:r.length,reaction:ae((function(){return e._groupBy(t)}),(function(n,r){var o=t[e._ogmInfoKey];e._removeFromGroupArr(o.groupByValue,o.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),o.groupByValue=n,o.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:o}),r.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(en),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var VE=function(){function e(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return e.prototype.add=function(e){ff(zd(this.undos),e)||(this.undos.push(e),ff(this.curData,e)||(this.redos=[]),this.eventCenter.emit(t.EventType.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},e.prototype.undoAble=function(){return this.undos.length>1},e.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=up(e),e}},e.prototype.redoAble=function(){return this.redos.length>0},e.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=up(t),t}},e.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=YE(t,bd((function(){var n=t.modelToHistoryData();n&&e.add(no({},n))}),this.waitTime))},e}(),KE=null;function qE(t,e){return t.x+=e,t.y+=e,t.text&&(t.text.x+=e,t.text.y+=e),t}function ZE(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach((function(t){t.x+=e,t.y+=e})),t.text&&(t.text.x+=e,t.text.y+=e),t}var $E=40,JE=40;var QE=Symbol("plugin registered by Logicflow.use"),tx=function(){function e(e){var n,r=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return r.viewMap.set(t,e)},this.getView=function(t){return r.viewMap.get(t)};var o=t.Options.get(e);this.options=o,this.container=this.initContainer(o.container),this.graphModel=new Cb(no(no({},o),{container:this.container})),this.plugins=null!==(n=o.plugins)&&void 0!==n?n:[];var i,a,s,u,l=this.graphModel.eventCenter;this.tool=new AE(this),this.dnd=new xE({lf:this}),this.history=new VE(l),this.keyboard=new DE({lf:this,keyboard:o.keyboard}),!1!==o.snapline&&(this.snaplineModel=new jb(this.graphModel),function(t,e){t.on("node:mousemove",(function(t){var n=t.data;e.setNodeSnapLine(n)})),t.on("node:mouseup",(function(){e.clearSnapline()}))}(l,this.snaplineModel)),o.isSilentMode||(i=this,a=this.graphModel,s=i.keyboard,u=s.options.keyboard,s.on(["cmd + c","ctrl + c"],(function(){if(JE=$E,!(null==u?void 0:u.enabled))return!0;if(a.textEditElement)return!0;var t=i.options.guards,e=a.getSelectElements(!1);return t&&t.beforeClone&&!t.beforeClone(e)||0===e.nodes.length&&0===e.edges.length?(KE=null,!0):((KE=e).nodes.forEach((function(t){return qE(t,$E)})),KE.edges.forEach((function(t){return ZE(t,$E)})),!1)})),s.on(["cmd + v","ctrl + v"],(function(){if(!(null==u?void 0:u.enabled))return!0;if(a.textEditElement)return!0;if(KE&&(KE.nodes||KE.edges)){i.clearSelectElements();var t=i.addElements(KE,JE);if(!t)return!0;t.nodes.forEach((function(t){return i.selectElementById(t.id,!0)})),t.edges.forEach((function(t){return i.selectElementById(t.id,!0)})),KE.nodes.forEach((function(t){return qE(t,$E)})),KE.edges.forEach((function(t){return ZE(t,$E)})),JE+=$E}return!1})),s.on(["cmd + z","ctrl + z"],(function(){return!(null==u?void 0:u.enabled)||!!a.textEditElement||(i.undo(),!1)})),s.on(["cmd + y","ctrl + y"],(function(){return!(null==u?void 0:u.enabled)||!!a.textEditElement||(i.redo(),!1)})),s.on(["backspace"],(function(){if(!(null==u?void 0:u.enabled))return!0;if(a.textEditElement)return!0;var t=a.getSelectElements(!0);return i.clearSelectElements(),t.edges.forEach((function(t){return t.id&&i.deleteEdge(t.id)})),t.nodes.forEach((function(t){return t.id&&i.deleteNode(t.id)})),!1})),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return e.prototype.initContainer=function(t){var e=document.createElement("div");return e.style.position="relative",e.style.width="100%",e.style.height="100%",t.innerHTML="",t.appendChild(e),e},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var r={BaseEdge:_E,BaseEdgeModel:vb,BaseNode:uE,BaseNodeModel:bb,RectNode:lE,RectNodeModel:Mb,CircleNode:cE,CircleNodeModel:Eb,PolygonNode:pE,PolygonNodeModel:Sb,TextNode:fE,TextNodeModel:Ab,LineEdge:bE,LineEdgeModel:_b,DiamondNode:dE,DiamondNodeModel:xb,PolylineEdge:EE,PolylineEdgeModel:mb,BezierEdge:mE,BezierEdgeModel:gb,EllipseNode:hE,EllipseNodeModel:wb,HtmlNode:yE,HtmlNodeModel:Ob,h:Xn,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),e){var o=e(r),i=o.view,a=o.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=nx(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},e.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=nx(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},e.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),Yd(t,(function(t){e.registerElement(t)}))},e.prototype.defaultRegister=function(){var t=[{type:"rect",view:lE,model:Mb},{type:"circle",view:cE,model:Eb},{type:"polygon",view:pE,model:Sb},{type:"text",view:fE,model:Ab},{type:"ellipse",view:hE,model:wb},{type:"diamond",view:dE,model:xb},{type:"html",view:yE,model:Ob},{type:"line",view:bE,model:_b},{type:"polyline",view:EE,model:mb},{type:"bezier",view:mE,model:gb}];this.batchRegister(t)},e.prototype.addNode=function(e,n,r){return void 0===n&&(n=t.EventType.NODE_ADD),this.graphModel.addNode(e,n,r)},e.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteNode(t),o},e.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var r=this.options.guards;if(!(null==r?void 0:r.beforeClone)||r.beforeClone(n))return this.graphModel.cloneNode(t)}},e.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},e.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},e.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},e.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},e.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},e.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},e.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},e.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},e.prototype.createFakeNode=function(t){var e=this.graphModel.modelMap.get(t.type);if(!e)return console.warn("不存在为".concat(t.type,"类型的节点")),null;var n=new e(no(no({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},e.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},e.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},e.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},e.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},e.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},e.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},e.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},e.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,r=[],o=this.graphModel.edges;return e&&n?Yd(o,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&r.push(t)})):e?Yd(o,(function(t){t.sourceNodeId===e&&r.push(t)})):n&&Yd(o,(function(t){t.targetNodeId===n&&r.push(t)})),r},e.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},e.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},e.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteEdgeById(t),o},e.prototype.deleteEdgeByNodeId=function(t){var e=t.sourceNodeId,n=t.targetNodeId;e&&n?this.graphModel.deleteEdgeBySourceAndTarget(e,n):e?this.graphModel.deleteEdgeBySource(e):n&&this.graphModel.deleteEdgeByTarget(n)},e.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},e.prototype.addElements=function(t,e){var n=this,r=t.nodes,o=t.edges;void 0===e&&(e=40),console.log("addElements",r,o,e);var i={},a={nodes:[],edges:[]};return Yd(r,(function(t){var e=t.id,r=n.addNode(t);e&&(i[e]=r.id),a.nodes.push(r)})),Yd(o,(function(t){var e=t.sourceNodeId,r=t.targetNodeId;i[e]&&(e=i[e]),i[r]&&(r=i[r]);var o=n.graphModel.addEdge(no(no({},t),{sourceNodeId:e,targetNodeId:r}));a.edges.push(o)})),a},e.prototype.selectElementById=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),this.graphModel.selectElementById(t,e),!e&&n&&this.graphModel.toFront(t)},e.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},e.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},e.prototype.getModelById=function(t){return this.graphModel.getElement(t)},e.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},e.prototype.deleteElement=function(e){var n,r,o,i=this.getModelById(e);return!!i&&(null!==(o=null===(r=((n={})[t.ElementType.NODE]=this.deleteNode,n[t.ElementType.EDGE]=this.deleteEdge,n)[i.BaseType])||void 0===r?void 0:r.call(this,e))&&void 0!==o&&o)},e.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},e.prototype.getAreaElement=function(t,e,n,r,o){return void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.graphModel.getAreaElement(t,e,n,r,o).map((function(t){return t.getData()}))},e.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(n_(e))},e.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},e.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},e.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},e.prototype.editText=function(t){this.graphModel.editText(t)},e.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},e.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,r=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&r.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},e.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},e.prototype.setTheme=function(t){this.graphModel.setTheme(t)},e.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var r=n.getData();e={x:r.x,y:r.y}}var o=this.getEdgeModelById(t);if(o){var i=o.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},e.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,r=e.width,o=e.height,i=t.x,a=t.y;n.focusOn(i,a,r,o)},e.prototype.focusOn=function(t){if("string"==typeof t)this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var e=t.id,n=t.coordinate;e&&this.focusByElement(e),n&&this.focusByCoordinate(n)}},e.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},e.prototype.toFront=function(t){this.graphModel.toFront(t)},e.prototype.getPointByClient=function(t,e){return"object"==typeof t?this.graphModel.getPointByClient(t):"number"==typeof e?this.graphModel.getPointByClient({x:t,y:e}):void 0},e.prototype.getGraphData=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,ao([n],io(t),!1)):n},e.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},e.prototype.clearData=function(){this.graphModel.clearData()},e.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(n_(e)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),pr(t,e),"function"==typeof n&&n(),t&&t.__c}(uo(tE,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(t.EventType.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData()})},e.prototype.render=function(t){var e=up(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},e.prototype.undo=function(){if(this.history.undoAble()){var t=n_(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.redo=function(){if(this.history.redoAble()){var t=n_(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},e.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},e.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},e.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},e.prototype.getTransform=function(){var t=this.graphModel.transformModel;return{SCALE_X:t.SCALE_X,SCALE_Y:t.SCALE_Y,TRANSLATE_X:t.TRANSLATE_X,TRANSLATE_Y:t.TRANSLATE_Y}},e.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},e.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},e.prototype.translateCenter=function(){this.graphModel.translateCenter()},e.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},e.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},e.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},e.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},e.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},e.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},e.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},e.use=function(t,e){var n,r=t.pluginName;r||(console.warn("请给插件".concat(t.name||t.constructor.name,"指定pluginName!")),r=t.name),this.extensions.set(r,((n={})[QE]=QE,n.extension=t,n.props=e,n))},e.prototype.installPlugins=function(t){var n,r=this;void 0===t&&(t=[]),(null!==(n=this.plugins)&&void 0!==n?n:e.extensions).forEach((function(e){var n,o=null;e[QE]?(n=e.extension,o=e.props):n=e;var i=(null==n?void 0:n.pluginName)||(null==n?void 0:n.name);-1===t.indexOf(i)&&r.installPlugin(n,o)}))},e.prototype.installPlugin=function(t,n){var r;if("object"!=typeof t){var o=t,i=new o({lf:this,LogicFlow:e,options:null!==(r=this.options.pluginsOptions)&&void 0!==r?r:{},props:n});i.render&&this.components.push(i.render.bind(i)),this.extension[o.pluginName]=i}else{var a=t.pluginName,s=t.install,u=t.render;a&&(s&&s.call(t,this,e),u&&this.components.push(u.bind(t)),this.extension[a]=t)}},e.extensions=new Map,e}();!function(t){t.toStringTag="LF.".concat(t.name)}(tx||(tx={}));var ex=tx;function nx(t){return o.observer(t)}t.AdjustPoint=vE,t.Arrow=gE,t.BaseEdge=_E,t.BaseEdgeModel=vb,t.BaseNode=uE,t.BaseNodeModel=bb,t.BaseText=rE,t.BezierEdge=mE,t.BezierEdgeModel=gb,t.Circle=Ub,t.CircleNode=cE,t.CircleNodeModel=Eb,t.Component=Fn,t.DiamondNode=dE,t.DiamondNodeModel=xb,t.EditConfigModel=Db,t.Ellipse=Xb,t.EllipseNode=hE,t.EllipseNodeModel=wb,t.GraphModel=Cb,t.HtmlNode=yE,t.HtmlNodeModel=Ob,t.Keyboard=DE,t.Line=Bb,t.LineEdge=bE,t.LineEdgeModel=_b,t.LineText=oE,t.LogicFlow=ex,t.LogicFlowUtil=yb,t.Path=Hb,t.Polygon=Gb,t.PolygonNode=pE,t.PolygonNodeModel=Sb,t.Polyline=Wb,t.PolylineEdge=EE,t.PolylineEdgeModel=mb,t.Rect=zb,t.RectNode=lE,t.RectNodeModel=Mb,t.SnaplineModel=jb,t.Text=Lb,t.TextNode=fE,t.TextNodeModel=Ab,t.TransformModel=kb,t.createRef=Wn,t.default=ex,t.formateAnchorConnectValidateData=Cm,t.h=Xn,t.observer=nx,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
25
|
+
var Zg,$g,Jg=4294967295,Qg=Array.prototype,t_=Object.prototype.hasOwnProperty,e_=po?po.iterator:void 0,n_=Math.max,r_=Math.min,o_=function(t){return function(e,n,r){if(null==r){var o=zo(n),i=o&&Ps(n),a=i&&i.length&&Oh(n,i);(a?a.length:o)||(r=n,n=e,e=this)}return t(e,n,r)}}(qf);zi.after=Rg.after,zi.ary=Rg.ary,zi.assign=Gg.assign,zi.assignIn=Gg.assignIn,zi.assignInWith=Gg.assignInWith,zi.assignWith=Gg.assignWith,zi.at=Gg.at,zi.before=Rg.before,zi.bind=Rg.bind,zi.bindAll=Vg.bindAll,zi.bindKey=Rg.bindKey,zi.castArray=Bg.castArray,zi.chain=Wg.chain,zi.chunk=Lg.chunk,zi.compact=Lg.compact,zi.concat=Lg.concat,zi.cond=Vg.cond,zi.conforms=Vg.conforms,zi.constant=Vg.constant,zi.countBy=jg.countBy,zi.create=Gg.create,zi.curry=Rg.curry,zi.curryRight=Rg.curryRight,zi.debounce=Rg.debounce,zi.defaults=Gg.defaults,zi.defaultsDeep=Gg.defaultsDeep,zi.defer=Rg.defer,zi.delay=Rg.delay,zi.difference=Lg.difference,zi.differenceBy=Lg.differenceBy,zi.differenceWith=Lg.differenceWith,zi.drop=Lg.drop,zi.dropRight=Lg.dropRight,zi.dropRightWhile=Lg.dropRightWhile,zi.dropWhile=Lg.dropWhile,zi.fill=Lg.fill,zi.filter=jg.filter,zi.flatMap=jg.flatMap,zi.flatMapDeep=jg.flatMapDeep,zi.flatMapDepth=jg.flatMapDepth,zi.flatten=Lg.flatten,zi.flattenDeep=Lg.flattenDeep,zi.flattenDepth=Lg.flattenDepth,zi.flip=Rg.flip,zi.flow=Vg.flow,zi.flowRight=Vg.flowRight,zi.fromPairs=Lg.fromPairs,zi.functions=Gg.functions,zi.functionsIn=Gg.functionsIn,zi.groupBy=jg.groupBy,zi.initial=Lg.initial,zi.intersection=Lg.intersection,zi.intersectionBy=Lg.intersectionBy,zi.intersectionWith=Lg.intersectionWith,zi.invert=Gg.invert,zi.invertBy=Gg.invertBy,zi.invokeMap=jg.invokeMap,zi.iteratee=Vg.iteratee,zi.keyBy=jg.keyBy,zi.keys=Ps,zi.keysIn=Gg.keysIn,zi.map=jg.map,zi.mapKeys=Gg.mapKeys,zi.mapValues=Gg.mapValues,zi.matches=Vg.matches,zi.matchesProperty=Vg.matchesProperty,zi.memoize=Rg.memoize,zi.merge=Gg.merge,zi.mergeWith=Gg.mergeWith,zi.method=Vg.method,zi.methodOf=Vg.methodOf,zi.mixin=o_,zi.negate=Jf,zi.nthArg=Vg.nthArg,zi.omit=Gg.omit,zi.omitBy=Gg.omitBy,zi.once=Rg.once,zi.orderBy=jg.orderBy,zi.over=Vg.over,zi.overArgs=Rg.overArgs,zi.overEvery=Vg.overEvery,zi.overSome=Vg.overSome,zi.partial=Rg.partial,zi.partialRight=Rg.partialRight,zi.partition=jg.partition,zi.pick=Gg.pick,zi.pickBy=Gg.pickBy,zi.property=Vg.property,zi.propertyOf=Vg.propertyOf,zi.pull=Lg.pull,zi.pullAll=Lg.pullAll,zi.pullAllBy=Lg.pullAllBy,zi.pullAllWith=Lg.pullAllWith,zi.pullAt=Lg.pullAt,zi.range=Vg.range,zi.rangeRight=Vg.rangeRight,zi.rearg=Rg.rearg,zi.reject=jg.reject,zi.remove=Lg.remove,zi.rest=Rg.rest,zi.reverse=Lg.reverse,zi.sampleSize=jg.sampleSize,zi.set=Gg.set,zi.setWith=Gg.setWith,zi.shuffle=jg.shuffle,zi.slice=Lg.slice,zi.sortBy=jg.sortBy,zi.sortedUniq=Lg.sortedUniq,zi.sortedUniqBy=Lg.sortedUniqBy,zi.split=Yg.split,zi.spread=Rg.spread,zi.tail=Lg.tail,zi.take=Lg.take,zi.takeRight=Lg.takeRight,zi.takeRightWhile=Lg.takeRightWhile,zi.takeWhile=Lg.takeWhile,zi.tap=Wg.tap,zi.throttle=Rg.throttle,zi.thru=tg,zi.toArray=Bg.toArray,zi.toPairs=Gg.toPairs,zi.toPairsIn=Gg.toPairsIn,zi.toPath=Vg.toPath,zi.toPlainObject=Bg.toPlainObject,zi.transform=Gg.transform,zi.unary=Rg.unary,zi.union=Lg.union,zi.unionBy=Lg.unionBy,zi.unionWith=Lg.unionWith,zi.uniq=Lg.uniq,zi.uniqBy=Lg.uniqBy,zi.uniqWith=Lg.uniqWith,zi.unset=Gg.unset,zi.unzip=Lg.unzip,zi.unzipWith=Lg.unzipWith,zi.update=Gg.update,zi.updateWith=Gg.updateWith,zi.values=Gg.values,zi.valuesIn=Gg.valuesIn,zi.without=Lg.without,zi.words=Yg.words,zi.wrap=Rg.wrap,zi.xor=Lg.xor,zi.xorBy=Lg.xorBy,zi.xorWith=Lg.xorWith,zi.zip=Lg.zip,zi.zipObject=Lg.zipObject,zi.zipObjectDeep=Lg.zipObjectDeep,zi.zipWith=Lg.zipWith,zi.entries=Gg.toPairs,zi.entriesIn=Gg.toPairsIn,zi.extend=Gg.assignIn,zi.extendWith=Gg.assignInWith,o_(zi,zi),zi.add=zg.add,zi.attempt=Vg.attempt,zi.camelCase=Yg.camelCase,zi.capitalize=Yg.capitalize,zi.ceil=zg.ceil,zi.clamp=Ug,zi.clone=Bg.clone,zi.cloneDeep=Bg.cloneDeep,zi.cloneDeepWith=Bg.cloneDeepWith,zi.cloneWith=Bg.cloneWith,zi.conformsTo=Bg.conformsTo,zi.deburr=Yg.deburr,zi.defaultTo=Vg.defaultTo,zi.divide=zg.divide,zi.endsWith=Yg.endsWith,zi.eq=Bg.eq,zi.escape=Yg.escape,zi.escapeRegExp=Yg.escapeRegExp,zi.every=jg.every,zi.find=jg.find,zi.findIndex=Lg.findIndex,zi.findKey=Gg.findKey,zi.findLast=jg.findLast,zi.findLastIndex=Lg.findLastIndex,zi.findLastKey=Gg.findLastKey,zi.floor=zg.floor,zi.forEach=jg.forEach,zi.forEachRight=jg.forEachRight,zi.forIn=Gg.forIn,zi.forInRight=Gg.forInRight,zi.forOwn=Gg.forOwn,zi.forOwnRight=Gg.forOwnRight,zi.get=Gg.get,zi.gt=Bg.gt,zi.gte=Bg.gte,zi.has=Gg.has,zi.hasIn=Gg.hasIn,zi.head=Lg.head,zi.identity=Zo,zi.includes=jg.includes,zi.indexOf=Lg.indexOf,zi.inRange=Hg,zi.invoke=Gg.invoke,zi.isArguments=Bg.isArguments,zi.isArray=Oo,zi.isArrayBuffer=Bg.isArrayBuffer,zi.isArrayLike=Bg.isArrayLike,zi.isArrayLikeObject=Bg.isArrayLikeObject,zi.isBoolean=Bg.isBoolean,zi.isBuffer=Bg.isBuffer,zi.isDate=Bg.isDate,zi.isElement=Bg.isElement,zi.isEmpty=Bg.isEmpty,zi.isEqual=Bg.isEqual,zi.isEqualWith=Bg.isEqualWith,zi.isError=Bg.isError,zi.isFinite=Bg.isFinite,zi.isFunction=Bg.isFunction,zi.isInteger=Bg.isInteger,zi.isLength=Bg.isLength,zi.isMap=Bg.isMap,zi.isMatch=Bg.isMatch,zi.isMatchWith=Bg.isMatchWith,zi.isNaN=Bg.isNaN,zi.isNative=Bg.isNative,zi.isNil=Bg.isNil,zi.isNull=Bg.isNull,zi.isNumber=Bg.isNumber,zi.isObject=zo,zi.isObjectLike=Bg.isObjectLike,zi.isPlainObject=Bg.isPlainObject,zi.isRegExp=Bg.isRegExp,zi.isSafeInteger=Bg.isSafeInteger,zi.isSet=Bg.isSet,zi.isString=Bg.isString,zi.isSymbol=Bg.isSymbol,zi.isTypedArray=Bg.isTypedArray,zi.isUndefined=Bg.isUndefined,zi.isWeakMap=Bg.isWeakMap,zi.isWeakSet=Bg.isWeakSet,zi.join=Lg.join,zi.kebabCase=Yg.kebabCase,zi.last=Bp,zi.lastIndexOf=Lg.lastIndexOf,zi.lowerCase=Yg.lowerCase,zi.lowerFirst=Yg.lowerFirst,zi.lt=Bg.lt,zi.lte=Bg.lte,zi.max=zg.max,zi.maxBy=zg.maxBy,zi.mean=zg.mean,zi.meanBy=zg.meanBy,zi.min=zg.min,zi.minBy=zg.minBy,zi.stubArray=Vg.stubArray,zi.stubFalse=Vg.stubFalse,zi.stubObject=Vg.stubObject,zi.stubString=Vg.stubString,zi.stubTrue=Vg.stubTrue,zi.multiply=zg.multiply,zi.nth=Lg.nth,zi.noop=Vg.noop,zi.now=kg,zi.pad=Yg.pad,zi.padEnd=Yg.padEnd,zi.padStart=Yg.padStart,zi.parseInt=Yg.parseInt,zi.random=Xg,zi.reduce=jg.reduce,zi.reduceRight=jg.reduceRight,zi.repeat=Yg.repeat,zi.replace=Yg.replace,zi.result=Gg.result,zi.round=zg.round,zi.sample=jg.sample,zi.size=jg.size,zi.snakeCase=Yg.snakeCase,zi.some=jg.some,zi.sortedIndex=Lg.sortedIndex,zi.sortedIndexBy=Lg.sortedIndexBy,zi.sortedIndexOf=Lg.sortedIndexOf,zi.sortedLastIndex=Lg.sortedLastIndex,zi.sortedLastIndexBy=Lg.sortedLastIndexBy,zi.sortedLastIndexOf=Lg.sortedLastIndexOf,zi.startCase=Yg.startCase,zi.startsWith=Yg.startsWith,zi.subtract=zg.subtract,zi.sum=zg.sum,zi.sumBy=zg.sumBy,zi.template=Yg.template,zi.times=Vg.times,zi.toFinite=Bg.toFinite,zi.toInteger=qo,zi.toLength=Bg.toLength,zi.toLower=Yg.toLower,zi.toNumber=Bg.toNumber,zi.toSafeInteger=Bg.toSafeInteger,zi.toString=Bg.toString,zi.toUpper=Yg.toUpper,zi.trim=Yg.trim,zi.trimEnd=Yg.trimEnd,zi.trimStart=Yg.trimStart,zi.truncate=Yg.truncate,zi.unescape=Yg.unescape,zi.uniqueId=Vg.uniqueId,zi.upperCase=Yg.upperCase,zi.upperFirst=Yg.upperFirst,zi.each=jg.forEach,zi.eachRight=jg.forEachRight,zi.first=Lg.head,o_(zi,(Zg={},ap(zi,(function(t,e){t_.call(zi.prototype,e)||(Zg[e]=t)})),Zg),{chain:!1}),zi.VERSION="4.17.21",(zi.templateSettings=Yg.templateSettings).imports._=zi,$i(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){zi[t].placeholder=zi})),$i(["drop","take"],(function(t,e){Di.prototype[t]=function(n){n=void 0===n?1:n_(qo(n),0);var r=this.__filtered__&&!e?new Di(this):this.clone();return r.__filtered__?r.__takeCount__=r_(n,r.__takeCount__):r.__views__.push({size:r_(n,Jg),type:t+(r.__dir__<0?"Right":"")}),r},Di.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),$i(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Di.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ep(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),$i(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Di.prototype[t]=function(){return this[n](1).value()[0]}})),$i(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Di.prototype[t]=function(){return this.__filtered__?new Di(this):this[n](1)}})),Di.prototype.compact=function(){return this.filter(Zo)},Di.prototype.find=function(t){return this.filter(t).head()},Di.prototype.findLast=function(t){return this.reverse().find(t)},Di.prototype.invokeMap=Ja((function(t,e){return"function"==typeof t?new Di(this):this.map((function(n){return uf(n,t,e)}))})),Di.prototype.reject=function(t){return this.filter(Jf(ep(t)))},Di.prototype.slice=function(t,e){t=qo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Di(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=qo(e))<0?n.dropRight(-e):n.take(e-t)),n)},Di.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Di.prototype.toArray=function(){return this.take(Jg)},ap(Di.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=zi[r?"take"+("last"==e?"Right":""):e],i=r||/^find/.test(e);o&&(zi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Di,u=a[0],l=s||Oo(e),c=function(t){var e=o.apply(zi,du([t],a));return r&&d?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=i&&!d,f=s&&!p;if(!i&&l){e=f?e:new Di(this);var v=t.apply(e,a);return v.__actions__.push({func:tg,args:[c],thisArg:void 0}),new ji(v,d)}return h&&f?t.apply(this,a):(v=this.thru(c),h?r?v.value()[0]:v.value():v)})})),$i(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Qg[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);zi.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Oo(o)?o:[],t)}return this[n]((function(n){return e.apply(Oo(n)?n:[],t)}))}})),ap(Di.prototype,(function(t,e){var n=zi[e];if(n){var r=n.name+"";t_.call(Ci,r)||(Ci[r]=[]),Ci[r].push({name:e,func:n})}})),Ci[wa(void 0,2).name]=[{name:"wrapper",func:void 0}],Di.prototype.clone=function(){var t=new Di(this.__wrapped__);return t.__actions__=ki(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ki(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ki(this.__views__),t},Di.prototype.reverse=function(){if(this.__filtered__){var t=new Di(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Di.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Oo(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Kg(e,t+a);break;case"takeRight":t=Fg(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,d=c.length,p=0,h=qg(u,this.__takeCount__);if(!n||!r&&o==u&&h==u)return rg(t,this.__actions__);var f=[];t:for(;u--&&p<h;){for(var v=-1,y=t[l+=e];++v<d;){var g=c[v],_=g.iteratee,m=g.type,b=_(y);if(2==m)y=b;else if(!b){if(1==m)continue t;break t}}f[p++]=y}return f},zi.prototype.at=Wg.at,zi.prototype.chain=Wg.wrapperChain,zi.prototype.commit=Wg.commit,zi.prototype.next=Wg.next,zi.prototype.plant=Wg.plant,zi.prototype.reverse=Wg.reverse,zi.prototype.toJSON=zi.prototype.valueOf=zi.prototype.value=Wg.value,zi.prototype.first=zi.prototype.head,e_&&(zi.prototype[e_]=Wg.toIterator),t.Options=void 0,($g=t.Options||(t.Options={})).get=function(t){var e=no(t,[]);if(!t.container)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Is({},$g.defaults,e)},function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(t.Options||(t.Options={}));var i_={node:!1,edge:!1},a_={node:!0,edge:!0},s_=function(t){return t&&"boolean"!=typeof t?Vf(sd(i_),t):sd(!0===t?a_:i_)},u_=s_,l_=null!==lu(window,"navigator.userAgent","").match(/MSIE|Trident/);function c_(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var d_,p_,h_,f_,v_,y_,g_,__=200;t.ElementState=void 0,(d_=t.ElementState||(t.ElementState={}))[d_.DEFAULT=1]="DEFAULT",d_[d_.TEXT_EDIT=2]="TEXT_EDIT",d_[d_.SHOW_MENU=3]="SHOW_MENU",d_[d_.ALLOW_CONNECT=4]="ALLOW_CONNECT",d_[d_.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT",t.ElementType=void 0,(p_=t.ElementType||(t.ElementType={})).NODE="node",p_.EDGE="edge",p_.GRAPH="graph",t.ModelType=void 0,(h_=t.ModelType||(t.ModelType={})).NODE="node",h_.CIRCLE_NODE="circle-node",h_.POLYGON_NODE="polygon-node",h_.RECT_NODE="rect-node",h_.TEXT_NODE="text-node",h_.ELLIPSE_NODE="ellipse-node",h_.DIAMOND_NODE="diamond-node",h_.HTML_NODE="html-node",h_.CUSTOM_HTML_NODE="custom-html-node",h_.EDGE="edge",h_.LINE_EDGE="line-edge",h_.POLYLINE_EDGE="polyline-edge",h_.BEZIER_EDGE="bezier-edge",h_.GRAPH="graph",t.EventType=void 0,(f_=t.EventType||(t.EventType={})).ELEMENT_CLICK="element:click",f_.NODE_ADD="node:add",f_.NODE_DELETE="node:delete",f_.NODE_CLICK="node:click",f_.NODE_DBCLICK="node:dbclick",f_.NODE_GROUP_COPY="node:group-copy-add",f_.NODE_DND_ADD="node:dnd-add",f_.NODE_DND_DRAG="node:dnd-drag",f_.NODE_MOUSEDOWN="node:mousedown",f_.NODE_DRAGSTART="node:dragstart",f_.NODE_DRAG="node:drag",f_.NODE_DROP="node:drop",f_.NODE_MOUSEUP="node:mouseup",f_.NODE_MOUSEMOVE="node:mousemove",f_.NODE_MOUSEENTER="node:mouseenter",f_.NODE_MOUSELEAVE="node:mouseleave",f_.NODE_CONTEXTMENU="node:contextmenu",f_.NODE_ROTATE="node:rotate",f_.NODE_RESIZE="node:resize",f_.NODE_PROPERTIES_CHANGE="node:properties-change",f_.NODE_PROPERTIES_DELETE="node:properties-delete",f_.EDGE_ADD="edge:add",f_.EDGE_DELETE="edge:delete",f_.EDGE_CLICK="edge:click",f_.EDGE_DBCLICK="edge:dbclick",f_.EDGE_MOUSEENTER="edge:mouseenter",f_.EDGE_MOUSELEAVE="edge:mouseleave",f_.EDGE_CONTEXTMENU="edge:contextmenu",f_.EDGE_ADJUST="edge:adjust",f_.EDGE_EXCHANGE_NODE="edge:exchange-node",f_.ANCHOR_DRAGSTART="anchor:dragstart",f_.ANCHOR_DRAG="anchor:drag",f_.ANCHOR_DROP="anchor:drop",f_.ANCHOR_DRAGEND="anchor:dragend",f_.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",f_.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",f_.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",f_.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",f_.ADJUST_POINT_DRAG="adjustPoint:drag",f_.ADJUST_POINT_DROP="adjustPoint:drop",f_.ADJUST_POINT_DRAGEND="adjustPoint:dragend",f_.BLANK_MOUSEDOWN="blank:mousedown",f_.BLANK_DRAGSTART="blank:dragstart",f_.BLANK_DRAG="blank:drag",f_.BLANK_DROP="blank:drop",f_.BLANK_MOUSEMOVE="blank:mousemove",f_.BLANK_MOUSEUP="blank:mouseup",f_.BLANK_CLICK="blank:click",f_.BLANK_CONTEXTMENU="blank:contextmenu",f_.SELECTION_MOUSEDOWN="selection:mousedown",f_.SELECTION_DRAGSTART="selection:dragstart",f_.SELECTION_DRAG="selection:drag",f_.SELECTION_DROP="selection:drop",f_.SELECTION_MOUSEMOVE="selection:mousemove",f_.SELECTION_MOUSEUP="selection:mouseup",f_.SELECTION_CONTEXTMENU="selection:contextmenu",f_.CONNECTION_NOT_ALLOWED="connection:not-allowed",f_.TEXT_MOUSEDOWN="text:mousedown",f_.TEXT_DRAGSTART="text:dragstart",f_.TEXT_DRAG="text:drag",f_.TEXT_DROP="text:drop",f_.TEXT_CLICK="text:click",f_.TEXT_DBCLICK="text:dbclick",f_.TEXT_BLUR="text:blur",f_.TEXT_MOUSEMOVE="text:mousemove",f_.TEXT_MOUSEUP="text:mouseup",f_.TEXT_FOCUS="text:focus",f_.TEXT_ADD="text:add",f_.TEXT_UPDATE="text:update",f_.TEXT_CLEAR="text:clear",f_.LABEL_MOUSEDOWN="label:mousedown",f_.LABEL_DRAGSTART="label:dragstart",f_.LABEL_DRAG="label:drag",f_.LABEL_DROP="label:drop",f_.LABEL_CLICK="label:click",f_.LABEL_DBCLICK="label:dbclick",f_.LABEL_BLUR="label:blur",f_.LABEL_MOUSEMOVE="label:mousemove",f_.LABEL_MOUSEUP="label:mouseup",f_.LABEL_FOCUS="label:focus",f_.LABEL_ADD="label:add",f_.LABEL_UPDATE="label:update",f_.LABEL_CLEAR="label:clear",f_.LABEL_DELETE="label:delete",f_.LABEL_SHOULD_ADD="label:should-add",f_.LABEL_BATCH_ADD="label:batch-add",f_.LABEL_SHOULD_UPDATE="label:should-update",f_.LABEL_SHOULD_DELETE="label:should-delete",f_.LABEL_BATCH_DELETE="label:batch-delete",f_.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",f_.HISTORY_CHANGE="history:change",f_.GRAPH_TRANSFORM="graph:transform",f_.GRAPH_RENDERED="graph:rendered",f_.GRAPH_UPDATED="graph:updated",t.OverlapMode=void 0,(v_=t.OverlapMode||(t.OverlapMode={}))[v_.DEFAULT=0]="DEFAULT",v_[v_.INCREASE=1]="INCREASE",t.SegmentDirection=void 0,(y_=t.SegmentDirection||(t.SegmentDirection={})).HORIZONTAL="horizontal",y_.VERTICAL="vertical",t.TextMode=void 0,(g_=t.TextMode||(t.TextMode={})).TEXT="text",g_.LABEL="label";var m_=function(){function e(e){var n=e.onDragStart,r=void 0===n?Ni:n,o=e.onDragging,i=void 0===o?Ni:o,a=e.onDragEnd,s=void 0===a?Ni:a,u=e.eventType,l=void 0===u?"":u,c=e.eventCenter,d=e.step,p=void 0===d?1:d,h=e.isStopPropagation,f=void 0===h||h,v=e.model,y=e.data,g=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(e){var n,r,o=null===window||void 0===window?void 0:window.document;if(0===e.button){g.isStopPropagation&&e.stopPropagation(),g.isStartDragging=!0,g.startX=e.clientX,g.startY=e.clientY,o.addEventListener("mousemove",g.handleMouseMove,!1),o.addEventListener("mouseup",g.handleMouseUp,!1);var i=null===(n=g.model)||void 0===n?void 0:n.getData();null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_MOUSEDOWN")],{e:e,data:g.data||i}),g.startTime=(new Date).getTime()}},this.handleMouseMove=function(e){var n,r;if(g.isStopPropagation&&e.stopPropagation(),g.isStartDragging&&(g.sumDeltaX+=e.clientX-g.startX,g.sumDeltaY+=e.clientY-g.startY,g.startX=e.clientX,g.startY=e.clientY,g.step<=1||Math.abs(g.sumDeltaX)>g.step||Math.abs(g.sumDeltaY)>g.step)){var o=g.sumDeltaX%g.step,i=g.sumDeltaY%g.step,a=g.sumDeltaX-o,s=g.sumDeltaY-i;g.sumDeltaX=o,g.sumDeltaY=i;var u=null===(n=g.model)||void 0===n?void 0:n.getData();g.isDragging||(null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAGSTART")],{e:e,data:g.data||u}),g.onDragStart({event:e})),g.isDragging=!0,Promise.resolve().then((function(){var n,r;g.onDragging({deltaX:a,deltaY:s,event:e}),null===(n=g.eventCenter)||void 0===n||n.emit(t.EventType["".concat(g.eventType,"_MOUSEMOVE")],{deltaX:a,deltaY:s,e:e,data:g.data||u}),null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAG")],{e:e,data:g.data||u})}))}},this.handleMouseUp=function(e){var n=window.document;g.isStartDragging=!1,g.isStopPropagation&&e.stopPropagation(),Promise.resolve().then((function(){var r,o,i;n.removeEventListener("mousemove",g.handleMouseMove,!1),n.removeEventListener("mouseup",g.handleMouseUp,!1);var a=null===(r=g.model)||void 0===r?void 0:r.getData();null===(o=g.eventCenter)||void 0===o||o.emit(t.EventType["".concat(g.eventType,"_MOUSEUP")],{e:e,data:g.data||a}),g.isDragging&&(g.isDragging=!1,g.onDragEnd({event:e}),null===(i=g.eventCenter)||void 0===i||i.emit(t.EventType["".concat(g.eventType,"_DROP")],{e:e,data:g.data||a}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",g.handleMouseMove,!1),t.removeEventListener("mouseup",g.handleMouseUp,!1),g.onDragEnd({event:void 0}),g.isDragging=!1},this.onDragStart=r,this.onDragging=i,this.onDragEnd=s,this.step=p,this.isStopPropagation=f,this.eventType=l,this.eventCenter=c,this.model=v,this.data=y}return e.prototype.setStep=function(t){this.step=t},e.prototype.setModel=function(t){this.model=t},e}(),b_=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{x:e-r/2,y:n-o/2,x1:e+r/2,y1:n+o/2}},x_=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-i/2,y:o-a/2,x1:r+i/2,y1:o+a/2}},E_=function(t){var e=t.points,n=im(e),r=k_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}},M_=function(t){var e=t.path,n=hm(e),r=k_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}},w_=function(e){return e.modelType===t.ModelType.LINE_EDGE?x_(e):e.modelType===t.ModelType.POLYLINE_EDGE?E_(e):e.modelType===t.ModelType.BEZIER_EDGE?M_(e):void 0},T_=function(t,e,n,r){var o=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(0===o)return!1;var i=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/o,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/o;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-r.x)<=0&&(a-n.y)*(a-r.y)<=0&&{x:i,y:a}},S_=function(t,e,n){var r=t.x,o=t.y,i=e.x,a=e.y,s=n.x,u=n.y,l=(u-a)/(s-i),c=a-l*i;return r>=i&&r<=s&&o>=a&&o<=u&&Math.abs(o-l*r+c)<Number.EPSILON},A_=function(t){var e=t.start,n=t.end,r=t.offset,o=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),u=Math.atan(r/o),l=Math.sqrt(o*o+r*r);return"start"===i?n.x>=e.x?(a.leftX=e.x+l*Math.sin(s+u),a.leftY=e.y-l*Math.cos(s+u),a.rightX=e.x-l*Math.sin(s-u),a.rightY=e.y+l*Math.cos(s-u)):(a.leftX=e.x-l*Math.sin(s+u),a.leftY=e.y+l*Math.cos(s+u),a.rightX=e.x+l*Math.sin(s-u),a.rightY=e.y-l*Math.cos(s-u)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+l*Math.sin(s-u),a.leftY=n.y-l*Math.cos(s-u),a.rightX=n.x-l*Math.sin(s+u),a.rightY=n.y+l*Math.cos(s+u)):(a.leftX=n.x-l*Math.sin(s-u),a.leftY=n.y+l*Math.cos(s-u),a.rightX=n.x+l*Math.sin(s+u),a.rightY=n.y-l*Math.cos(s+u))),a},O_=function(t,e){var n;switch(t.type){case"line":default:n=new nx(t,e);break;case"polyline":n=new rx(t,e)}return n},D_=function(t,e){return 2*Math.abs(t.centerX-e.centerX)<t.width+e.width&&2*Math.abs(t.centerY-e.centerY)<t.height+e.height},N_=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},P_=function(t,e){var n=[t,{x:t.x,y:e.y},e];return N_(n)},C_=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},I_=function(e,n){var r=Math.abs(e.x-n.centerX),o=Math.abs(e.y-n.centerY);return r/n.width>o/n.height?t.SegmentDirection.HORIZONTAL:t.SegmentDirection.VERTICAL},L_=function(e,n,r){return I_(r,n)===t.SegmentDirection.HORIZONTAL?{x:r.x>e.centerX?e.maxX:e.minX,y:r.y}:{x:r.x,y:r.y>e.centerY?e.maxY:e.minY}},j_=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),o=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+o)/2,y:(r+i)/2,centerX:(n+o)/2,centerY:(r+i)/2,minX:n,minY:r,maxX:o,maxY:i,height:i-r,width:o-n}},k_=function(t,e){void 0===t&&(t=[]);var n=[],r=[];t.forEach((function(t){n.push(t.x),r.push(t.y)}));var o=Math.min.apply(Math,io([],oo(n),!1)),i=Math.max.apply(Math,io([],oo(n),!1)),a=Math.min.apply(Math,io([],oo(r),!1)),s=Math.max.apply(Math,io([],oo(r),!1)),u=i-o,l=s-a;return e&&(u+=e,l+=e),{centerX:(o+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:o,minY:a,x:(o+i)/2,y:(a+s)/2,height:l,width:u}},R_=function(t){var e=t.minX,n=t.minY,r=t.maxX,o=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:o},{x:e,y:o}]},B_=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},z_=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},U_=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},H_=function(t,e){return io(io([],oo(z_(t,e.x)),!1),oo(U_(t,e.y)),!1)},X_=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},G_=function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n},W_=function(t,e,n,r,o){return X_(t,e)+X_(t,n)+G_(t,[e,n,r,o])},Y_=function(t,e,n,r,o){o||(o=0),t.unshift(e[r]),n[r]&&n[r]!==r&&o<=100&&Y_(t,e,n,n[r],o+1)},V_=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},F_=function(t,e,n,r){var o=e.x-t.x,i=e.y-t.y,a=r.x-n.x,s=r.y-n.y,u=(-i*(t.x-n.x)+o*(t.y-n.y))/(-a*i+o*s),l=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+o*s);return u>=0&&u<=1&&l>=0&&l<=1},K_=function(t,e,n){if(0===n.width&&0===n.height)return!1;var r=oo(R_(n),4),o=r[0],i=r[1],a=r[2],s=r[3];return F_(t,e,o,i)||F_(t,e,o,s)||F_(t,e,i,a)||F_(t,e,a,s)},q_=function(t,e,n,r){var o=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||K_(t,e,n)||K_(t,e,r)||o.push(t))})),N_(o)},Z_=function(t,e,n,r,o,i,a){var s=[],u=[e],l={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=W_(e,n,e));var p={};t.forEach((function(t){t.id&&(p[t.id]=t)}));for(var h=function(){var h,f=1/0;if(u.forEach((function(t){t.id&&d[t.id]<f&&(f=d[t.id],h=t)})),h===n&&n.id){var v=[];return Y_(v,p,l,n.id),{value:v}}if(!h)return{value:[e,n]};V_(u,h),s.push(h),q_(t,h,r,o).forEach((function(t){if(-1===s.indexOf(t)&&(-1===u.indexOf(t)&&u.push(t),(null==h?void 0:h.id)&&(null==t?void 0:t.id))){var r=d[h.id]+X_(h,t);if(c[t.id]&&r>=c[t.id])return;l[t.id]=h.id,c[t.id]=r,d[t.id]=c[t.id]+W_(t,n,e,i,a)}}))};u.length;){var f=h();if("object"==typeof f)return f.value}return[e,n]},$_=function(t){return Hm(t)},J_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],o=t[e+1];n.x===r.x&&r.x===o.x||n.y===r.y&&r.y===o.y?t.splice(e,1):e++}return t},Q_=function(t,e,n,r,o){var i=$_(n),a=$_(r),s=C_(i,o),u=C_(a,o),l=L_(s,i,t),c=L_(u,a,e);if(D_(s,u))return io(io([t,l],oo(am(t,e,l,c)),!1),[c,e],!1);var d=k_([l,c]),p=j_(s,d),h=j_(u,d),f=[];f=(f=f.concat(R_(p))).concat(R_(h));var v={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[d,p,h].forEach((function(t){f=f.concat(H_(t,v).filter((function(t){return B_(t,s)&&B_(t,u)})))})),[{x:l.x,y:c.y},{x:c.x,y:l.y}].forEach((function(t){B_(t,s)&&B_(t,u)&&f.push(t)})),f.unshift(l),f.push(c),f=N_(f);var y=Z_(f,l,c,i,a,t,e);return y.unshift(t),y.push(e),y.length>2&&(y=J_(y)),N_(y)},tm=function(t){if(1===t.length){var e=oo(t,1)[0];return[e,e]}for(var n=t[0],r=t[1],o=Bm(n.x,n.y,r.x,r.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],u=Bm(a.x,a.y,s.x,s.y);u>o&&(o=u,n=a,r=s)}return[n,r]},em=function(t,e,n){var r=zm(t,n),o=zm(e,n);return r&&o},nm=function(t,e,n){var r=zm(t,n),o=zm(e,n);return!(r&&o)&&(r||o)},rm=function(t,e,n){for(var r=void 0,o=Hm(n),i=R_(o),a=0;a<i.length;a++){F_(t,e,i[a],i[(a+1)%i.length])&&(r=[i[a],i[(a+1)%i.length]])}if(r)return T_(t,e,r[0],r[1])},om=function(e,n){var r=void 0;return e.x===n.x?r=t.SegmentDirection.VERTICAL:e.y===n.y&&(r=t.SegmentDirection.HORIZONTAL),r},im=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=oo(t.split(","),2),r=e[0],o=e[1];n.push({x:Number(r),y:Number(o)})})),n},am=function(t,e,n,r){var o=[];if(om(t,n)===om(e,r))t.y===n.y?(o.push({x:n.x,y:(n.y+r.y)/2}),o.push({x:r.x,y:(n.y+r.y)/2})):(o.push({x:(n.x+r.x)/2,y:n.y}),o.push({x:(n.x+r.x)/2,y:r.y}));else{var i={x:n.x,y:r.y},a=S_(i,t,n),s=S_(i,e,r);if(a||s)i={x:r.x,y:n.y};else{var u=sm(i,t,n),l=sm(i,e,r);u&&l&&(i={x:r.x,y:n.y})}o.push(i)}return o},sm=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},um=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=r>=1&&r<=126||r>=65376&&r<=65439?1:2}return e},lm=void 0,cm=function(t,e){lm||(lm=document.createElement("canvas"));var n=lm.getContext("2d");return n.font=e,n.measureText(t).width},dm=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=A_(eo(eo({},o),{type:"start"})),a=A_(eo(eo({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},pm=function(t){var e=t.start,n=t.end,r=t.sourceNode,o=t.targetNode,i=t.offset,a=Hm(r),s=Hm(o),u=C_(a,i),l=C_(s,i);return{sNext:L_(u,a,e),ePre:L_(l,s,n)}},hm=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[fm(e[0]),fm(e[1]),fm(e[2]),fm(e[3])]},fm=function(t){var e=oo(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},vm=function(t,e){var n=oo(t,4);return[Xb(n[0],n[1],n[2],n[3],e),t[3]]},ym=function(t,e){for(var n,r=t.x,o=t.y,i=im(e),a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});if(s.forEach((function(t){var e=t.start,i=t.end;if(e.x===i.x){var s={x:e.x,y:o};if(S_(s,e,i))(u=Math.abs(e.x-r))<a&&(a=u,n=s)}else if(e.y===i.y){var u;s={x:r,y:e.y};if(S_(s,e,i))(u=Math.abs(e.y-o))<a&&(a=u,n=s)}})),!n){var l=s[0],c=l.start,d=l.end;n={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return n},gm=function(t){return Yv(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},_m=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function mm(t,e){return"function"!=typeof e?function(e,n,r){return Object.assign({type:t.edgeType},r)}:function(n,r,o){var i=e(n,r,o);return i?"string"==typeof i?Object.assign({},o,{type:i}):Object.assign({type:i},o):{type:t.edgeType}}}var bm=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return Wp(e,(function(t){var e=um(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}};function xm(t,e){return e*Math.round(t/e)||t}function Em(t,e){return t%e}function Mm(t,e,n){if(!t)return[];var r=Math.min.apply(Math,io([],oo(t.map((function(t){return t[0]}))),!1)),o=Math.max.apply(Math,io([],oo(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,io([],oo(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,io([],oo(t.map((function(t){return t[1]}))),!1)),s=-r,u=-i,l=t.map((function(t){var e=oo(t,2),n=e[0],r=e[1];return[n+s,r+u]})),c=e?e/(o-r):1,d=n?n/(a-i):1,p=Math.min(c,d);return l.map((function(t){var e=oo(t,2),n=e[0],r=e[1];return[n*p,r*p]}))}var wm=function(t,e,n){var r=oo(t,2),o=r[0],i=r[1],a=oo(e,2),s=a[0],u=a[1],l=oo(n,2),c=l[0],d=l[1];return o>s&&o<c&&i>u&&i<d},Tm=function(t,e){var n=!1;switch(e.multipleSelectKey){case"meta":n=t.metaKey;break;case"alt":n=t.altKey;break;case"shift":n=t.shiftKey;break;case"ctrl":n=t.ctrlKey;break;default:n=!1}return n};function Sm(t,e){return!!(t instanceof Om&&e instanceof Om)}var Am=function(t){function e(n,r,o){var i=t.call(this,3)||this;return i[0]=n,i[1]=r,i[2]=o,i.x=n,i.y=r,i.z=o,Object.setPrototypeOf(i,e.prototype),i}return to(e,t),e.prototype.add=function(t){if(Sm(this,t))return new Om(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new Dm((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(Sm(this,t))return new Om(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new Om(this.x-t.x,this.y-t.y):new Dm((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),Om=function(t){function e(n,r,o){var i=t.call(this,n,r,null!=o?o:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return to(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,r){return t+n*e[r]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(Am),Dm=function(t){function e(n,r){var o=t.call(this,n,r,1)||this;return Object.setPrototypeOf(o,e.prototype),o}return to(e,t),e.prototype.toString=function(){return"Point"},e}(Am),Nm=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.call(this,n.length)||this;return o.fill(new Array(3)),n.forEach((function(t,e){o[e]=t})),o.columns=n[0].length,o.rows=n.length,Object.setPrototypeOf(o,e.prototype),o}return to(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return io([],oo(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,io([void 0],oo(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var r=0;r<this.rows;r++)for(var o=this.getRow(r),i=function(e){var i=t.getColumn(e);n[r][e]=o.reduce((function(t,e,n){return t+e*i[n]}),0)},a=0;a<t.columns;a++)i(a);return new(e.bind.apply(e,io([void 0],oo(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new Dm(t[0],t[1])}))},e.prototype.toString=function(){var t=oo(this[0],2),e=t[0],n=t[1],r=oo(this[1],2),o=r[0],i=r[1],a=oo(this[2],2),s=a[0],u=a[1];return"matrix(".concat(e," ").concat(n," ").concat(o," ").concat(i," ").concat(s," ").concat(u,")")},e.prototype.translate=function(t,e){return this.cross(new Im(t,e))},e.prototype.rotate=function(t){return this.cross(new Pm(t))},e.prototype.scale=function(t,e){return this.cross(new Cm(t,e))},e}(Array),Pm=function(t){function e(n){var r=t.call(this,new Om(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Om(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Om(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return to(e,t),e.prototype.inverse=function(){return this.transpose()},e}(Nm),Cm=function(t){function e(n,r){var o=t.call(this,new Om(n,0,0),new Om(0,r,0),new Om(0,0,1))||this;return o.sx=n,o.sy=r,Object.setPrototypeOf(o,e.prototype),o}return to(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(Nm),Im=function(t){function e(n,r){var o=t.call(this,new Om(1,0,0),new Om(0,1,0),new Om(n,r,1))||this;return o.tx=n,o.ty=r,Object.setPrototypeOf(o,e.prototype),o}return to(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(Nm);ce({isolateGlobalState:!0});var Lm=function(t){return t.anchors},jm=function(t,e){for(var n,r=e.nodes,o=r.length-1;o>=0;o--){var i=r[o];if(Um(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!km(i,n.node,e)||(n=s)}}}return n},km=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},Rm=function(t,e){for(var n,r=Lm(e),o=Number.MAX_SAFE_INTEGER,i=0;i<r.length;i++){var a=Bm(t.x,t.y,r[i].x,r[i].y);a<o&&(o=a,n={index:i,anchor:eo(eo({},r[i]),{x:r[i].x,y:r[i].y,id:r[i].id})})}return n},Bm=function(t,e,n,r){return Math.hypot(t-n,e-r)},zm=function(t,e){var n=!1,r=Hm(e);return t.x>=r.minX-0&&t.x<=r.maxX+0&&t.y>=r.minY-0&&t.y<=r.maxY+0&&(n=!0),n},Um=function(t,e){var n=!1,r=Hm(e);return t.x>=r.minX-5&&t.x<=r.maxX+5&&t.y>=r.minY-5&&t.y<=r.maxY+5&&(n=!0),n},Hm=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{minX:e-r/2,minY:n-o/2,maxX:e+r/2,maxY:n+o/2,x:e,y:n,width:r,height:o,centerX:e,centerY:n}},Xm=function(t){var e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.radius;return[{x:n-o/2+a,y:r-i/2+a,r:a},{x:n+o/2-a,y:r-i/2+a,r:a},{x:n-o/2+a,y:r+i/2-a,r:a},{x:n+o/2-a,y:r+i/2-a,r:a}]},Gm=function(t,e,n){var r,o=Xm(n),i=Number.MAX_SAFE_INTEGER;return o.forEach((function(e){var n=Bm(t.x,t.y,e.x,e.y);n<i&&(i=n,r=e)})),Wm(t,e,r)},Wm=function(e,n,r){var o,i=r.x,a=r.y,s=r.r;if(n===t.SegmentDirection.HORIZONTAL){var u=i-Math.sqrt(s*s-(e.y-a)*(e.y-a)),l=i+Math.sqrt(s*s-(e.y-a)*(e.y-a));o={x:Math.abs(u-e.x)<Math.abs(l-e.x)?u:l,y:e.y}}else if(n===t.SegmentDirection.VERTICAL){var c=a-Math.sqrt(s*s-(e.x-i)*(e.x-i)),d=a+Math.sqrt(s*s-(e.x-i)*(e.x-i)),p=Math.abs(c-e.y)<Math.abs(d-e.y)?c:d;o={x:e.x,y:p}}return o},Ym=function(e,n){var r=Math.abs(e.x-n.x),o=Math.abs(e.y-n.y);return r/n.width>o/n.height?t.SegmentDirection.VERTICAL:t.SegmentDirection.HORIZONTAL},Vm=function(t,e){var n=e,r=!1,o=n.x,i=n.y,a=n.width,s=n.height,u=n.radius,l=o-a/2+u,c=o+a/2-u,d=i-s/2+u,p=i+s/2-u;return t.y===i+s/2||t.y===i-s/2?r=t.x>l&&t.x<c:t.x!==o+a/2&&t.x!==o-a/2||(r=t.y>d&&t.y<p),r},Fm=function(e,n,r){var o,i=r,a=i.x,s=i.y,u=i.rx,l=i.ry;if(n===t.SegmentDirection.HORIZONTAL){var c=a-Math.sqrt(u*u-(e.y-s)*(e.y-s)*u*u/(l*l)),d=a+Math.sqrt(u*u-(e.y-s)*(e.y-s)*u*u/(l*l));o={x:Math.abs(c-e.x)<Math.abs(d-e.x)?c:d,y:e.y}}else if(n===t.SegmentDirection.VERTICAL){var p=s-Math.sqrt(l*l-(e.x-a)*(e.x-a)*l*l/(u*u)),h=s+Math.sqrt(l*l-(e.x-a)*(e.x-a)*l*l/(u*u)),f=Math.abs(p-e.y)<Math.abs(h-e.y)?p:h;o={x:e.x,y:f}}return o},Km=function(e,n,r){for(var o,i=r.pointsPosition,a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});return s.forEach((function(r){var i=r.start,s=r.end,u=i,l=s;i.x>s.x&&(u=s,l=i);var c={x:e.x,y:e.y};if(u.x===l.x&&n===t.SegmentDirection.HORIZONTAL&&(c={x:u.x,y:e.y}),u.y===l.y&&n===t.SegmentDirection.VERTICAL&&(c={x:e.x,y:u.y}),u.x!==l.x&&u.y!==l.y){var d=(l.y-u.y)/(l.x-u.x),p=(u.x*l.y-l.x*u.y)/(u.x-l.x);n===t.SegmentDirection.HORIZONTAL?c={x:(e.y-p)/d,y:e.y}:n===t.SegmentDirection.VERTICAL&&(c={x:e.x,y:d*e.x+p})}if(S_(c,i,s)){var h=Bm(c.x,c.y,e.x,e.y);h<a&&(a=h,o=c)}})),o},qm=function(t){return Yv(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"])},Zm=function(t,e,n,r){var o=t.x,i=t.y;return e.x>t.x?o=t.x+n/2:e.x<t.x&&(o=t.x-n/2),e.y>t.y?i=t.y+r/2:e.y<t.y&&(i=t.y-r/2),{x:o,y:i}},$m=function(t){var e=t.rows,n=t.style,r=t.rowsLength,o=t.className,i=document.createElement("div");i.className=o,i.style.fontSize="".concat(n.fontSize),i.style.width="".concat(n.width),i.style.lineHeight="".concat(n.lineHeight),i.style.padding="".concat(n.padding),n.fontFamily&&(i.style.fontFamily="".concat(n.fontFamily)),r>1?e.forEach((function(t){var e=document.createElement("div");e.textContent=t,i.appendChild(e)})):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},Jm=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return e&&e.forEach((function(t){var e=um(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}},Qm=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let tb;const eb=new Uint8Array(16);function nb(){if(!tb&&(tb="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!tb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tb(eb)}var rb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const ob=[];for(let t=0;t<256;++t)ob.push((t+256).toString(16).slice(1));function ib(t,e=0){return ob[t[e+0]]+ob[t[e+1]]+ob[t[e+2]]+ob[t[e+3]]+"-"+ob[t[e+4]]+ob[t[e+5]]+"-"+ob[t[e+6]]+ob[t[e+7]]+"-"+ob[t[e+8]]+ob[t[e+9]]+"-"+ob[t[e+10]]+ob[t[e+11]]+ob[t[e+12]]+ob[t[e+13]]+ob[t[e+14]]+ob[t[e+15]]}function ab(t){if(!function(t){return"string"==typeof t&&rb.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function sb(t,e,n){function r(t,r,o,i){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=ab(r)),16!==(null===(a=r)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(r),s.set(t,r.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=s[t];return o}return ib(s)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function ub(t){return 14+(t+64>>>9<<4)+1}function lb(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function cb(t,e,n,r,o,i){return lb((a=lb(lb(e,t),lb(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function db(t,e,n,r,o,i,a){return cb(e&n|~e&r,t,e,o,i,a)}function pb(t,e,n,r,o,i,a){return cb(e&r|n&~r,t,e,o,i,a)}function hb(t,e,n,r,o,i,a){return cb(e^n^r,t,e,o,i,a)}function fb(t,e,n,r,o,i,a){return cb(n^(e|~r),t,e,o,i,a)}sb("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=t[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[ub(e)-1]=e;let n=1732584193,r=-271733879,o=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=r,u=o,l=i;n=db(n,r,o,i,t[e],7,-680876936),i=db(i,n,r,o,t[e+1],12,-389564586),o=db(o,i,n,r,t[e+2],17,606105819),r=db(r,o,i,n,t[e+3],22,-1044525330),n=db(n,r,o,i,t[e+4],7,-176418897),i=db(i,n,r,o,t[e+5],12,1200080426),o=db(o,i,n,r,t[e+6],17,-1473231341),r=db(r,o,i,n,t[e+7],22,-45705983),n=db(n,r,o,i,t[e+8],7,1770035416),i=db(i,n,r,o,t[e+9],12,-1958414417),o=db(o,i,n,r,t[e+10],17,-42063),r=db(r,o,i,n,t[e+11],22,-1990404162),n=db(n,r,o,i,t[e+12],7,1804603682),i=db(i,n,r,o,t[e+13],12,-40341101),o=db(o,i,n,r,t[e+14],17,-1502002290),r=db(r,o,i,n,t[e+15],22,1236535329),n=pb(n,r,o,i,t[e+1],5,-165796510),i=pb(i,n,r,o,t[e+6],9,-1069501632),o=pb(o,i,n,r,t[e+11],14,643717713),r=pb(r,o,i,n,t[e],20,-373897302),n=pb(n,r,o,i,t[e+5],5,-701558691),i=pb(i,n,r,o,t[e+10],9,38016083),o=pb(o,i,n,r,t[e+15],14,-660478335),r=pb(r,o,i,n,t[e+4],20,-405537848),n=pb(n,r,o,i,t[e+9],5,568446438),i=pb(i,n,r,o,t[e+14],9,-1019803690),o=pb(o,i,n,r,t[e+3],14,-187363961),r=pb(r,o,i,n,t[e+8],20,1163531501),n=pb(n,r,o,i,t[e+13],5,-1444681467),i=pb(i,n,r,o,t[e+2],9,-51403784),o=pb(o,i,n,r,t[e+7],14,1735328473),r=pb(r,o,i,n,t[e+12],20,-1926607734),n=hb(n,r,o,i,t[e+5],4,-378558),i=hb(i,n,r,o,t[e+8],11,-2022574463),o=hb(o,i,n,r,t[e+11],16,1839030562),r=hb(r,o,i,n,t[e+14],23,-35309556),n=hb(n,r,o,i,t[e+1],4,-1530992060),i=hb(i,n,r,o,t[e+4],11,1272893353),o=hb(o,i,n,r,t[e+7],16,-155497632),r=hb(r,o,i,n,t[e+10],23,-1094730640),n=hb(n,r,o,i,t[e+13],4,681279174),i=hb(i,n,r,o,t[e],11,-358537222),o=hb(o,i,n,r,t[e+3],16,-722521979),r=hb(r,o,i,n,t[e+6],23,76029189),n=hb(n,r,o,i,t[e+9],4,-640364487),i=hb(i,n,r,o,t[e+12],11,-421815835),o=hb(o,i,n,r,t[e+15],16,530742520),r=hb(r,o,i,n,t[e+2],23,-995338651),n=fb(n,r,o,i,t[e],6,-198630844),i=fb(i,n,r,o,t[e+7],10,1126891415),o=fb(o,i,n,r,t[e+14],15,-1416354905),r=fb(r,o,i,n,t[e+5],21,-57434055),n=fb(n,r,o,i,t[e+12],6,1700485571),i=fb(i,n,r,o,t[e+3],10,-1894986606),o=fb(o,i,n,r,t[e+10],15,-1051523),r=fb(r,o,i,n,t[e+1],21,-2054922799),n=fb(n,r,o,i,t[e+8],6,1873313359),i=fb(i,n,r,o,t[e+15],10,-30611744),o=fb(o,i,n,r,t[e+6],15,-1560198380),r=fb(r,o,i,n,t[e+13],21,1309151649),n=fb(n,r,o,i,t[e+4],6,-145523070),i=fb(i,n,r,o,t[e+11],10,-1120210379),o=fb(o,i,n,r,t[e+2],15,718787259),r=fb(r,o,i,n,t[e+9],21,-343485551),n=lb(n,a),r=lb(r,s),o=lb(o,u),i=lb(i,l)}return[n,r,o,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(ub(e));for(let r=0;r<e;r+=8)n[r>>5]|=(255&t[r/8])<<r%32;return n}(t),8*t.length))}));var vb={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function yb(t,e,n){if(vb.randomUUID&&!e&&!t)return vb.randomUUID();const r=(t=t||{}).random||(t.rng||nb)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return ib(r)}function gb(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function _b(t,e){return t<<e|t>>>32-e}sb("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=_b(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],a=n[1],s=n[2],u=n[3],l=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=_b(o,5)+gb(n,a,s,u)+l+e[n]+r[t]>>>0;l=u,u=s,s=_b(a,30)>>>0,a=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var mb,bb=function(){return yb()},xb=function(t,e){void 0===e&&(e="");var n=t.nodes.reduce((function(t,n){return t[n.id]=e+yb(),n.id=t[n.id],t}),{});return t.edges.forEach((function(t){t.id=e+yb(),t.sourceNodeId=n[t.sourceNodeId],t.targetNodeId=n[t.targetNodeId]})),t},Eb=new Map,Mb=function(t){var e=bb();var n=window.requestAnimationFrame((function n(){if(t(),Eb.get(e)){var r=window.requestAnimationFrame(n);Eb.set(e,r)}}));return Eb.set(e,n),e},wb=function(t){var e=Eb.get(t);e&&(window.cancelAnimationFrame(e),Eb.delete(t))};function Tb(e){var n=e.x,r=void 0===n?0:n,o=e.y,i=void 0===o?0:o,a=e.value,s=e.fontSize,u=void 0===s?12:s,l=e.fill,c=void 0===l?"currentColor":l,d=e.overflowMode,p=void 0===d?"default":d,h=e.textWidth,f=void 0===h?void 0:h,v=e.model,y={x:r,y:i,fill:c,fontSize:u,textAnchor:"middle",dominantBaseline:"central"};if(Wp($p(e),(function(t){var e=oo(t,2),n=e[0],r=e[1];"object"!=typeof r&&(y[n]=r)})),a){var g=String(a).split(/[\r\n]/g),_=g.length;if("default"!==p){var m=v.BaseType,b=v.modelType;if(m===t.ElementType.NODE&&b!==t.ModelType.TEXT_NODE||m===t.ElementType.EDGE&&f)return Sb(e)}if(_>1){var x=g.map((function(t,e){return so("tspan",{className:"lf-text-tspan",x:r,y:i+(e-(_-1)/2)*(u+2),children:t})}));return so("text",eo({},y,{children:x}))}return so("text",eo({},y,{children:a}))}return null}function Sb(t){var e=t.x,n=t.y,r=t.value,o=t.model,i=t.textWidth,a=t.fontSize,s=void 0===a?12:a,u=t.lineHeight,l=t.fontFamily,c=void 0===l?"":l,d=t.wrapPadding,p=void 0===d?"0, 0":d,h=t.overflowMode,f=o.width,v=o.height,y=o.textHeight,g=i||f,_=String(r).split(/[\r\n]/g),m=_.length,b=$m({rows:_,style:{fontSize:"".concat(s,"px"),width:"".concat(g,"px"),fontFamily:c,lineHeight:u,padding:p},rowsLength:m,className:"lf-get-text-height"}),x=v>b?v:b;y&&(x=y);var E="ellipsis"===h;return E&&(x=s+2),so("g",{children:so("foreignObject",{width:g,height:x,x:e-g/2,y:n-x/2,style:{overflow:"visible",textAlign:"left"},children:so("div",{className:"lf-node-text-auto-wrap",style:{minHeight:x,width:g,padding:p},children:so("div",{className:E?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:E?_.join(""):"",style:eo({},t),children:_.map((function(t){return so("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}function Ab(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Wp($p(t),(function(t){var n=oo(t,2),r=n[0],o=n[1];("style"===r||"object"!=typeof o)&&(e[r]=o)})),so("line",eo({},e))}function Ob(t){var e=t.x,n=t.y,r=t.width,o=t.height,i=t.className,a=t.strokeWidth,s=t.radius,u=void 0===s?0:s,l=e-r/2,c=n-o/2,d={};return d["stroke-width"]=a,Wp($p(t),(function(t){var e=oo(t,2),n=e[0],r=e[1];"object"!=typeof r&&(d[n]=r)})),d.className=i?"lf-basic-shape ".concat(i):"lf-basic-shape",u&&(d.rx=u,d.ry=u),d.x=l,d.y=c,so("rect",eo({},d))}function Db(t){var e={d:""};return Wp($p(t),(function(t){var n=oo(t,2),r=n[0],o=n[1];"style"!==r&&"object"==typeof o||(e[r]=o)})),so("path",eo({},e))}function Nb(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.r,a=void 0===i?4:i,s=t.className,u={cx:n,cy:o,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return Wp($p(t),(function(t){var e=oo(t,2),n=e[0],r=e[1];"object"!=typeof r&&(u[n]=r)})),u.className=s?"lf-basic-shape ".concat(s):"lf-basic-shape",so("circle",eo({},u))}function Pb(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.rx,a=void 0===i?4:i,s=t.ry,u=void 0===s?4:s,l=t.className,c={cx:n,cy:o,rx:a,ry:u,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return Wp($p(t),(function(t){var e=oo(t,2),n=e[0],r=e[1];"object"!=typeof r&&(c[n]=r)})),c.className=l?"lf-basic-shape ".concat(l):"lf-basic-shape",so("ellipse",eo({},c))}function Cb(t){var e=t.points,n=void 0===e?[]:e,r=t.className,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Wp($p(t),(function(t){var e=oo(t,2),n=e[0],r=e[1];"object"!=typeof r&&(o[n]=r)})),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",o.points=n.map((function(t){return t.join(",")})).join(" "),so("polygon",eo({},o))}function Ib(t){var e=t.className,n={points:"",fill:"none"};return Wp($p(t),(function(t){var e=oo(t,2),r=e[0],o=e[1];("style"===r||"object"!=typeof o)&&(n[r]=o)})),e&&(n.className="".concat(e)),so("polyline",eo({},n))}!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(mb||(mb={}));var Lb=function(e){function n(n){var r=e.call(this)||this;r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors;Wp(r.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(r=hh(n,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:r.x,y:r.y});else if(t.targetNodeId===e){var r;(r=hh(n,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:r.x,y:r.y})}}))},r.triggerResizeEvent=function(e,n,o,i,a,s){r.graphModel.eventCenter.emit(t.EventType.NODE_RESIZE,{preData:e,data:n,deltaX:o,deltaY:i,index:a,model:s})},r.recalcResizeInfo=function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=!1),void 0===o&&(o=!1);var i=sd(e),a=i.deltaX,s=i.deltaY,u=i.width,l=i.height,c=i.PCTResizeInfo;if(c){var d=0,p=0;switch(t){case mb.LEFT_TOP:p=(-1*a-s)/4;break;case mb.RIGHT_TOP:p=(a-s)/4;break;case mb.RIGHT_BOTTOM:p=(a+s)/4;break;case mb.LEFT_BOTTOM:p=(-1*a+s)/4}0!==p&&(d=Math.round(p/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case mb.LEFT_TOP:a=u-h,s=l-f;break;case mb.RIGHT_TOP:a=h-u,s=l-f;break;case mb.RIGHT_BOTTOM:a=h-u,s=f-l;break;case mb.LEFT_BOTTOM:a=u-h,s=f-l}return i}switch(t){case mb.LEFT_TOP:i.width=r?u:u-a*n,i.height=o?l:l-s*n;break;case mb.RIGHT_TOP:i.width=r?u:u+a*n,i.height=o?l:l-s*n;break;case mb.RIGHT_BOTTOM:i.width=r?u:u+a*n,i.height=o?l:l+s*n;break;case mb.LEFT_BOTTOM:i.width=r?u:u-a*n,i.height=o?l:l+s*n}return i},r.resizeNode=function(t){var e=t.deltaX,n=t.deltaY,o=r.index,i=r.props,a=i.model,s=i.graphModel;zb({deltaX:e,deltaY:n,index:o,nodeModel:a,graphModel:s,cancelCallback:function(){r.dragHandler.cancelDrag()}})},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=oo(r.graphModel.transformModel.fixDeltaXY(e,n),2),i=o[0],a=o[1];r.resizeNode({deltaX:i,deltaY:a})},r.onDragEnd=function(){var t=r.nodeModel.x,e=r.nodeModel.y;r.nodeModel.moveTo(t,e),r.updateEdgePointByAnchors()};var o=n.index,i=n.model,a=n.graphModel;return r.index=o,r.nodeModel=i,r.graphModel=a,r.dragHandler=new m_({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r}return to(n,e),n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.direction,o=t.model.getResizeControlStyle(),i=o.width,a=o.height,s=no(o,["width","height"]);return so("g",{className:"lf-resize-control lf-resize-control-".concat(r),children:[so(Ob,eo({className:"lf-resize-control-content",x:e,y:n,width:null!=i?i:7,height:null!=a?a:7},s)),so(Ob,{className:"lf-resize-control-content",x:e,y:n,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},n}(Vn),jb=function(t){function e(){return t.call(this)||this}return to(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=Hm(e),o=r.minX,i=r.minY,a=r.maxX,s=r.maxY;return xh([{index:mb.LEFT_TOP,direction:"nw",x:o,y:i},{index:mb.RIGHT_TOP,direction:"ne",x:a,y:i},{index:mb.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:mb.LEFT_BOTTOM,direction:"sw",x:o,y:s}],(function(t){return so(Lb,eo({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getResizeOutlineStyle();return so(Ob,eo({},i,{x:e,y:n,width:r,height:o}))},e.prototype.render=function(){return so("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Vn),kb=function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=!1),void 0===o&&(o=!1);var i=sd(e),a=i.deltaX,s=i.deltaY,u=i.width,l=i.height,c=i.PCTResizeInfo;if(c){var d=0,p=0;switch(t){case mb.LEFT_TOP:p=(-1*a-s)/4;break;case mb.RIGHT_TOP:p=(a-s)/4;break;case mb.RIGHT_BOTTOM:p=(a+s)/4;break;case mb.LEFT_BOTTOM:p=(-1*a+s)/4}0!==p&&(d=Math.round(p/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case mb.LEFT_TOP:a=u-h,s=l-f;break;case mb.RIGHT_TOP:a=h-u,s=l-f;break;case mb.RIGHT_BOTTOM:a=h-u,s=f-l;break;case mb.LEFT_BOTTOM:a=u-h,s=f-l}return i}switch(t){case mb.LEFT_TOP:i.width=r?u:u-a*n,i.height=o?l:l-s*n;break;case mb.RIGHT_TOP:i.width=r?u:u+a*n,i.height=o?l:l-s*n;break;case mb.RIGHT_BOTTOM:i.width=r?u:u+a*n,i.height=o?l:l+s*n;break;case mb.LEFT_BOTTOM:i.width=r?u:u-a*n,i.height=o?l:l+s*n}return i},Rb=function(t,e){var n=t.id,r=t.anchors;Wp(e.getNodeEdges(n),(function(t){if(t.sourceNodeId===n)(e=hh(r,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:e.x,y:e.y});else if(t.targetNodeId===n){var e;(e=hh(r,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:e.x,y:e.y})}}))},Bb=function(e,n,r,o,i,a,s){s.eventCenter.emit(t.EventType.NODE_RESIZE,{preData:e,data:n,deltaX:r,deltaY:o,index:i,model:a})},zb=function(t){var e=t.deltaX,n=t.deltaY,r=t.index,o=t.nodeModel,i=t.graphModel,a=t.cancelCallback,s=o.r,u=o.rx,l=o.ry,c=o.width,d=o.height,p=o.PCTResizeInfo,h=o.minWidth,f=o.minHeight,v=o.maxWidth,y=o.maxHeight,g=h===v,_=kb(r,{width:s||u||c,height:s||l||d,deltaX:e,deltaY:n,PCTResizeInfo:p},s||u&&l?.5:1,g,f===y);if(_.width<h||_.width>v||_.height<f||_.height>y)null==a||a();else{_.deltaX=g?0:_.deltaX,_.deltaY=g?0:_.deltaY;var m=o.getData(),b=o.resize(_);Rb(o,i),Bb(m,b,e,n,r,o,i)}},Ub=100,Hb={x:1,y:0,z:0};function Xb(t,e,n,r,o){for(var i=function(o){if(o<0||o>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-o,3)+3*e.x*o*Math.pow(1-o,2)+3*n.x*Math.pow(o,2)*(1-o)+r.x*Math.pow(o,3),y:t.y*Math.pow(1-o,3)+3*e.y*o*Math.pow(1-o,2)+3*n.y*Math.pow(o,2)*(1-o)+r.y*Math.pow(o,3)}},a=0,s=2,u=r.x,l=r.y,c=r;a<o&&s<50;){var d=(c=i(1-s/Ub)).x,p=c.y;a=Bm(u,l,d,p),s++}return c}function Gb(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function Wb(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),r=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,r){return t+e*n[r]}))}(Gb(t),Gb(e)));return n>=0?r:-r}(Hb,t)}function Yb(t){return t*(180/Math.PI)}var Vb={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Fb=function(t){var e=sd(Vb);return t&&(e=Vf(e,t)),e},Kb=Fb,qb=1e3,Zb=999,$b=function(){return++qb},Jb=function(){return--Zb},Qb=Object.freeze({__proto__:null,Matrix:Nm,Point:Dm,RotateMatrix:Pm,ScaleMatrix:Cm,StepDrag:m_,TranslateMatrix:Im,Vector:Om,action:te,cancelRaf:wb,computed:rt,configure:ce,costByPoints:G_,createEdgeGenerator:mm,createRaf:Mb,createUuid:bb,defaultAnimationOffConfig:i_,defaultAnimationOnConfig:a_,defaultTheme:Vb,degrees:Yb,distance:Bm,estimateDistance:X_,filterRepeatPoints:N_,formatAnchorConnectValidateData:Qm,formatData:c_,getAnchors:Lm,getAppendAttributes:dm,getBBoxCrossPointsByPoint:H_,getBBoxOfPoints:k_,getBBoxXCrossPoints:z_,getBBoxYCrossPoints:U_,getBezierControlPoints:pm,getBezierPoints:hm,getBoxByOriginNode:$_,getBytesLength:um,getClosestAnchor:Rm,getClosestPointOfPolyline:ym,getClosestRadiusCenter:Gm,getCrossPointInRect:rm,getCrossPointWithCircle:Wm,getCrossPointWithEllipse:Fm,getCrossPointWithPolygon:Km,getEndTangent:vm,getExpandedBBox:C_,getExpandedBBoxPoint:L_,getGridOffset:Em,getHtmlTextHeight:$m,getLongestEdge:tm,getMinIndex:Jb,getNextNeighborPoints:q_,getNodeAnchorPosition:Zm,getNodeBBox:Hm,getPointsFromBBox:R_,getPolylinePoints:Q_,getRectRadiusCircle:Xm,getSimplePoints:am,getSimplePolyline:P_,getSvgTextSize:bm,getSvgTextWidthHeight:Jm,getTextWidth:cm,getThetaOfVector:Wb,getZIndex:$b,handleResize:zb,heuristicCostEstimate:W_,inStraightLineOfRect:Vm,isBboxOverLapping:D_,isIe:l_,isInNode:zm,isInNodeBbox:Um,isMultipleSelect:Tm,isObservable:we,isPointInArea:wm,isPointOutsideBBox:B_,isSegmentCrossingBBox:K_,isSegmentsCrossNode:nm,isSegmentsInNode:em,isSegmentsIntersected:F_,mergeBBox:j_,normalizePolygon:Mm,observable:$,pathFinder:Z_,pickEdgeConfig:gm,pickNodeConfig:qm,pointDirection:I_,pointEdgeDirection:Ym,pointFilter:J_,points2PointsList:im,reaction:ae,rebuildPath:Y_,recalcResizeInfo:kb,refreshGraphId:xb,removeClosePointFromOpenList:V_,sampleCubic:Xb,segmentDirection:om,setupAnimation:s_,setupEdgeModel:O_,setupTheme:Fb,snapToGrid:xm,targetNodeInfo:jm,toJS:Le,triggerResizeEvent:Bb,twoPointDistance:_m,updateAnimation:u_,updateEdgePointByAnchors:Rb,updateTheme:Kb}),tx=function(){function e(e,n){var r;this.BaseType=t.ElementType.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=t.TextMode.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=t.ElementState.DEFAULT,this.modelType=t.ModelType.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=null!==(r=e.properties)&&void 0!==r?r:{},this.initEdgeData(e),this.setAttributes()}return e.prototype.initEdgeData=function(e){if(e.properties||(e.properties={}),!e.id){var n=this.graphModel.idGenerator,r=n&&n(e.type),o=this.createId();e.id=o||r||bb()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var i=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=i,Is(this,gm(e)),this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(this.zIndex=e.zIndex||$b()),this.setAnchors(),this.initPoints(),this.formatText(e)},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.getEdgeStyle=function(){return eo(eo({},this.graphModel.theme.baseEdge),this.style)},e.prototype.getAdjustPointStyle=function(){return eo({},this.graphModel.theme.edgeAdjust)},e.prototype.getTextStyle=function(){return sd(this.graphModel.theme.edgeText)},e.prototype.getEdgeAnimationStyle=function(){return sd(this.graphModel.theme.edgeAnimation)},e.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,r=this.isAnimation?e.stroke:t.stroke;return eo(eo(eo({},t),{fill:r,stroke:r}),n)},e.prototype.getOutlineStyle=function(){return sd(this.graphModel.theme.outline)},e.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(e.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),e.prototype.getBeginAnchor=function(t,e,n){var r,o,i=Lm(t);if(n){if(r=hh(i,(function(t){return t.id===n})))return r;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=_m(t,e);(void 0===o||n<o)&&(o=n,r=t)})),r},e.prototype.getEndAnchor=function(t,e){var n,r,o=this,i=Lm(t);if(e){if(n=hh(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(o.startPoint){var e=_m(t,o.startPoint);(void 0===r||e<r)&&(r=e,n=t)}})),n},e.prototype.getProperties=function(){return Le(this.properties)},e.prototype.getData=function(){var e=this.properties;we(e)&&(e=Le(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Is({},this.startPoint),endPoint:Is({},this.endPoint)};this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(n.zIndex=this.zIndex);var r=this.text,o=r.x,i=r.y,a=r.value;return a&&(n.text={x:o,y:i,value:a}),n},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.setProperty=function(t,e){var n,r=Le(this.properties);this.properties=eo(eo({},r),((n={})[t]=c_(e),n)),this.setAttributes()},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setProperties=function(t){this.properties=eo(eo({},Le(this.properties)),c_(t)),this.setAttributes()},e.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,r=e.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},e.prototype.setStyle=function(t,e){var n;this.style=eo(eo({},this.style),((n={})[t]=c_(e),n))},e.prototype.setStyles=function(t){this.style=eo(eo({},this.style),c_(t))},e.prototype.updateStyles=function(t){this.style=eo({},c_(t))},e.prototype.setTextMode=function(t){this.textMode=t},e.prototype.formatText=function(t){var e,n,r,o=this.textPosition,i=o.x,a=o.y,s=t.text,u={value:"",x:i,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?u=eo(eo({},u),{value:s}):(u=eo(eo({},u),{x:null!==(e=s.x)&&void 0!==e?e:i,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(r=s.value)&&void 0!==r?r:""}),Nf(s.draggable)||(u.draggable=s.draggable),Nf(s.editable)||(u.editable=s.editable))),this.text=u},e.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},e.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},e.prototype.setText=function(t){t&&Is(this.text,t)},e.prototype.updateText=function(t){this.text=eo(eo({},Le(this.text)),{value:t})},e.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.openEdgeAnimation=function(){this.isAnimation=!0},e.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.updateStartPoint=function(t){this.startPoint=t},e.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},e.prototype.updateEndPoint=function(t){this.endPoint=t},e.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},e.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},e.prototype.initPoints=function(){},e.prototype.updateAttributes=function(t){Is(this,t)},e.prototype.getAdjustStart=function(){return this.startPoint},e.prototype.getAdjustEnd=function(){return this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},e.BaseType=t.ElementType.EDGE,ro([$],e.prototype,"type",void 0),ro([$],e.prototype,"sourceNodeId",void 0),ro([$],e.prototype,"targetNodeId",void 0),ro([$],e.prototype,"startPoint",void 0),ro([$],e.prototype,"endPoint",void 0),ro([$],e.prototype,"textMode",void 0),ro([$],e.prototype,"text",void 0),ro([$],e.prototype,"properties",void 0),ro([$],e.prototype,"points",void 0),ro([$],e.prototype,"pointsList",void 0),ro([$],e.prototype,"isSelected",void 0),ro([$],e.prototype,"isHovered",void 0),ro([$],e.prototype,"isHitable",void 0),ro([$],e.prototype,"isHittable",void 0),ro([$],e.prototype,"draggable",void 0),ro([$],e.prototype,"visible",void 0),ro([$],e.prototype,"isAnimation",void 0),ro([$],e.prototype,"isShowAdjustPoint",void 0),ro([$],e.prototype,"zIndex",void 0),ro([$],e.prototype,"state",void 0),ro([$],e.prototype,"style",void 0),ro([$],e.prototype,"arrowConfig",void 0),ro([rt],e.prototype,"sourceNode",null),ro([rt],e.prototype,"targetNode",null),ro([rt],e.prototype,"textPosition",null),ro([te],e.prototype,"setProperty",null),ro([te],e.prototype,"deleteProperty",null),ro([te],e.prototype,"setProperties",null),ro([te],e.prototype,"changeEdgeId",null),ro([te],e.prototype,"setStyle",null),ro([te],e.prototype,"setStyles",null),ro([te],e.prototype,"updateStyles",null),ro([te],e.prototype,"setTextMode",null),ro([te],e.prototype,"formatText",null),ro([te],e.prototype,"resetTextPosition",null),ro([te],e.prototype,"moveText",null),ro([te],e.prototype,"setText",null),ro([te],e.prototype,"updateText",null),ro([te],e.prototype,"setAnchors",null),ro([te],e.prototype,"setSelected",null),ro([te],e.prototype,"setHovered",null),ro([te],e.prototype,"setHitable",null),ro([te],e.prototype,"setHittable",null),ro([te],e.prototype,"openEdgeAnimation",null),ro([te],e.prototype,"closeEdgeAnimation",null),ro([te],e.prototype,"setElementState",null),ro([te],e.prototype,"updateStartPoint",null),ro([te],e.prototype,"moveStartPoint",null),ro([te],e.prototype,"updateEndPoint",null),ro([te],e.prototype,"moveEndPoint",null),ro([te],e.prototype,"setZIndex",null),ro([te],e.prototype,"initPoints",null),ro([te],e.prototype,"updateAttributes",null),ro([te],e.prototype,"getAdjustStart",null),ro([te],e.prototype,"getAdjustEnd",null),ro([te],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(),ex=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.BEZIER_EDGE,o.path="",o.initEdgeData(n),o.setAttributes(),o}return to(n,e),n.prototype.initEdgeData=function(t){this.offset=100,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.bezier,n=e.prototype.getEdgeStyle.call(this),r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},n),sd(t)),sd(o))},n.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var r=n.x,o=n.y;t+=r,e+=o})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return eo(eo({},t),{pointsList:n})},n.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return pm({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},n.prototype.getPath=function(t){var e=oo(t,4),n=e[0],r=e[1],o=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(r.x," ").concat(r.y,",\n ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y)},n.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},n.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},n.prototype.updatePath=function(t,e){t=sd(t),e=sd(e);var n={x:this.startPoint.x,y:this.startPoint.y},r={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var o=this.getControls();t=o.sNext,e=o.ePre}this.pointsList=[n,t,e,r],this.path=this.getPath(this.pointsList)},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=oo(this.pointsList,3),r=n[1],o=n[2];r.x+=t,r.y+=e,this.updatePath(r,o)},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=oo(this.pointsList,3),r=n[1],o=n[2];o.x+=t,o.y+=e,this.updatePath(r,o)},n.prototype.updateAdjustAnchor=function(t,e){var n;"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(Is({},this.text,this.textPosition))},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode,i=pm({start:e,end:n,sourceNode:r,targetNode:o,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},ro([$],n.prototype,"path",void 0),ro([te],n.prototype,"initPoints",null),ro([te],n.prototype,"updatePoints",null),ro([te],n.prototype,"updateStartPoint",null),ro([te],n.prototype,"updateEndPoint",null),ro([te],n.prototype,"moveStartPoint",null),ro([te],n.prototype,"moveEndPoint",null),ro([te],n.prototype,"updateAdjustAnchor",null),ro([te],n.prototype,"getAdjustStart",null),ro([te],n.prototype,"getAdjustEnd",null),ro([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(tx),nx=function(e){function n(){var n=e.apply(this,io([],oo(arguments),!1))||this;return n.modelType=t.ModelType.LINE_EDGE,n}return to(n,e),n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.line,n=e.prototype.getEdgeStyle.call(this),r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},n),sd(t)),sd(o))},n.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n}(tx),rx=function(e){function n(){var n=e.apply(this,io([],oo(arguments),!1))||this;return n.modelType=t.ModelType.POLYLINE_EDGE,n.draggingPointList=[],n}return to(n,e),n.prototype.initEdgeData=function(t){this.offset=30,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.polyline,n=e.prototype.getEdgeStyle.call(this),r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},n),sd(t)),sd(o))},n.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var r=im(this.points),o=oo(tm(r),2),i=o[0],a=o[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},n.prototype.getAfterAnchor=function(e,n,r){var o,i;return r.forEach((function(r){var a;e===t.SegmentDirection.HORIZONTAL?a=Math.abs(n.y-r.y):e===t.SegmentDirection.VERTICAL&&(a=Math.abs(n.x-r.x)),(!i||i>a)&&(i=a,o=r)})),o},n.prototype.getCrossPoint=function(e,n,r){var o;return e===t.SegmentDirection.HORIZONTAL?o={x:r.x,y:n.y}:e===t.SegmentDirection.VERTICAL&&(o={x:n.x,y:r.y}),o},n.prototype.removeCrossPoints=function(t,e,n){var r=n.map((function(t){return t}));if(1===t){var o=r[t],i=r[e],a=r[t-1];if(em(a,o,this.sourceNode)){if(nm(o,i,this.sourceNode))(s=rm(o,i,this.sourceNode))&&(r[t]=s,r.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===o.x||e.y===a.y&&e.y===o.y)&&(Bm(e.x,e.y,o.x,o.y)<Bm(a.x,a.y,o.x,o.y)&&(r[t-1]=e))}))}if(e===n.length-2){var s,u=r[t],l=r[e],c=r[e+1];if(em(l,c,this.targetNode)){if(nm(u,l,this.targetNode))(s=rm(u,l,this.targetNode))&&(r[e]=s,r.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===l.x||t.y===c.y&&t.y===l.y)&&(Bm(t.x,t.y,l.x,l.y)<Bm(c.x,c.y,l.x,l.y)&&(r[e+1]=t))}))}return r},n.prototype.getDraggingPoints=function(t,e,n,r,o){var i=o.map((function(t){return t})),a=this.getAfterAnchor(t,n,r),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},n.prototype.updateCrossPoints=function(e){var n=e.map((function(t){return t})),r=e[0],o=e[1],i=e[n.length-2],a=e[n.length-1],s=this.sourceNode,u=this.targetNode,l=s.modelType,c=u.modelType,d=om(r,o),p=n[0];switch(l){case t.ModelType.RECT_NODE:if(0!==s.radius)Vm(r,s)||(p=Gm(r,d,s));break;case t.ModelType.CIRCLE_NODE:p=Wm(r,d,s);break;case t.ModelType.ELLIPSE_NODE:p=Fm(r,d,s);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:p=Km(r,d,s)}p&&(n[0]=p);var h=om(i,a),f=n[n.length-1];switch(c){case t.ModelType.RECT_NODE:if(0!==u.radius)Vm(a,u)||(f=Gm(a,h,u));break;case t.ModelType.CIRCLE_NODE:f=Wm(a,h,u);break;case t.ModelType.ELLIPSE_NODE:f=Fm(a,h,u);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:f=Km(a,h,u)}return f&&(n[n.length-1]=f),n},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},t,{pointsList:n})},n.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},n.prototype.updatePoints=function(){var t=Q_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},n.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var r=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},r),this.initPoints()},n.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},n.prototype.dragAppendSimple=function(e,n){var r;this.isDragging=!0;var o=e.start,i=e.end,a=e.startIndex,s=e.endIndex,u=e.direction,l=this.pointsList,c=l;return u===t.SegmentDirection.HORIZONTAL?(l[a]={x:o.x,y:o.y+n.y},l[s]={x:i.x,y:i.y+n.y},c=this.pointsList.map((function(t){return t}))):u===t.SegmentDirection.VERTICAL&&(l[a]={x:o.x+n.x,y:o.y},l[s]={x:i.x+n.x,y:i.y},c=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(c),this.draggingPointList=c,(null===(r=this.text)||void 0===r?void 0:r.value)&&this.setText(Is({},this.text,this.textPosition)),{start:Is({},l[a]),end:Is({},l[s]),startIndex:a,endIndex:s,direction:u}},n.prototype.dragAppend=function(e,n){var r;this.isDragging=!0;var o=e.start,i=e.end,a=e.startIndex,s=e.endIndex,u=e.direction,l=this.pointsList;if(u===t.SegmentDirection.HORIZONTAL){l[a]={x:o.x,y:o.y+n.y},l[s]={x:i.x,y:i.y+n.y};var c=this.pointsList.map((function(t){return t}));if(0!==a&&s!==this.pointsList.length-1&&(c=this.removeCrossPoints(a,s,c)),0===a){var d={x:o.x,y:o.y+n.y};if(!zm(d,this.sourceNode)){var p=this.sourceNode.anchors;c=this.getDraggingPoints(u,"start",d,p,c)}}if(s===this.pointsList.length-1){var h={x:i.x,y:i.y+n.y};if(!zm(h,this.targetNode)){p=this.targetNode.anchors;c=this.getDraggingPoints(u,"end",h,p,c)}}this.updatePointsAfterDrag(c),this.draggingPointList=c}else if(u===t.SegmentDirection.VERTICAL){l[a]={x:o.x+n.x,y:o.y},l[s]={x:i.x+n.x,y:i.y};c=this.pointsList.map((function(t){return t}));if(0!==a&&s!==this.pointsList.length-1&&(c=this.removeCrossPoints(a,s,c)),0===a){d={x:o.x+n.x,y:o.y};if(!zm(d,this.sourceNode)){p=this.sourceNode.anchors;c=this.getDraggingPoints(u,"start",d,p,c)}}if(s===this.pointsList.length-1){h={x:i.x+n.x,y:i.y};if(!zm(h,this.targetNode)){p=this.targetNode.anchors;c=this.getDraggingPoints(u,"end",h,p,c)}}this.updatePointsAfterDrag(c),this.draggingPointList=c}return(null===(r=this.text)||void 0===r?void 0:r.value)&&this.setText(Is({},this.text,this.textPosition)),{start:Is({},l[a]),end:Is({},l[s]),startIndex:a,endIndex:s,direction:u}},n.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=J_(im(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Is({},e);var n=t[t.length-1];this.endPoint=Is({},n)}this.isDragging=!1},n.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode;this.pointsList=Q_({x:e.x,y:e.y},{x:n.x,y:n.y},r,o,this.offset||0),this.initPoints()},ro([$],n.prototype,"dbClickPosition",void 0),ro([te],n.prototype,"initPoints",null),ro([te],n.prototype,"updatePoints",null),ro([te],n.prototype,"updateStartPoint",null),ro([te],n.prototype,"moveStartPoint",null),ro([te],n.prototype,"updateEndPoint",null),ro([te],n.prototype,"moveEndPoint",null),ro([te],n.prototype,"updatePointsList",null),ro([te],n.prototype,"dragAppendStart",null),ro([te],n.prototype,"dragAppendSimple",null),ro([te],n.prototype,"dragAppend",null),ro([te],n.prototype,"dragAppendEnd",null),ro([te],n.prototype,"updatePointsAfterDrag",null),ro([te],n.prototype,"getAdjustStart",null),ro([te],n.prototype,"getAdjustEnd",null),ro([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(tx),ox=function(){function e(e,n){var r;this.BaseType=t.ElementType.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=t.TextMode.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=t.ElementState.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=t.ModelType.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=null!==(r=e.properties)&&void 0!==r?r:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,r=this.y,o=void 0===r?0:r;this.transform=new Im(-n,-o).rotate(t).translate(n,o).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),e.prototype.initNodeData=function(e){if(e.properties||(e.properties={}),!e.id){var n=this.graphModel.idGenerator,r=n&&n(e.type),o=this.createId();e.id=o||r||bb()}this.formatText(e),Is(this,qm(e)),this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(this.zIndex=e.zIndex||$b())},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.setTextMode=function(t){this.textMode=t},e.prototype.formatText=function(t){var e,n,r,o=t.x,i=t.y,a=t.text,s={value:"",x:o,y:i,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=eo(eo({},s),{x:null!==(e=a.x)&&void 0!==e?e:o,y:null!==(n=a.y)&&void 0!==n?n:i,value:null!==(r=a.value)&&void 0!==r?r:""}),Nf(a.draggable)||(s.draggable=a.draggable),Nf(a.editable)||(s.draggable=a.draggable))),t.text=s},e.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},e.prototype.proportionalResize=function(){},e.prototype.getData=function(){var e=this.text,n=e.x,r=e.y,o=e.value,i=this.properties;we(i)&&(i=Le(i));var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(a.zIndex=this.zIndex),o&&(a.text={x:n,y:r,value:o}),a},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.getProperties=function(){return Le(this.properties)},e.prototype.getOuterGAttributes=function(){return{className:""}},e.prototype.getNodeStyle=function(){return eo(eo({},this.graphModel.theme.baseNode),this.style)},e.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,e=this.properties.textStyle,n=void 0===e?{}:e;return eo(eo({},sd(t)),sd(n))},e.prototype.getRotateControlStyle=function(){return sd(this.graphModel.theme.rotateControl)},e.prototype.getResizeControlStyle=function(){return sd(this.graphModel.theme.resizeControl)},e.prototype.getResizeOutlineStyle=function(){return sd(this.graphModel.theme.resizeOutline)},e.prototype.getAnchorStyle=function(t){return sd(this.graphModel.theme.anchor)},e.prototype.getAnchorLineStyle=function(t){return sd(this.graphModel.theme.anchorLine)},e.prototype.getOutlineStyle=function(){return sd(this.graphModel.theme.outline)},e.prototype.isAllowConnectedAsSource=function(t,e,n,r){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,this,t,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.getConnectedSourceRules=function(){return this.sourceRules},e.prototype.isAllowConnectedAsTarget=function(t,e,n,r){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,t,this,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.isAllowMoveNode=function(t,e){var n,r,o=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=s.next();!u.done;u=s.next()){var l=(0,u.value)(this,t,e);if(!l)return!1;if("object"==typeof l){var c=l;if(!c.x&&!c.y)return!1;o=o&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{x:o,y:i}},e.prototype.getConnectedTargetRules=function(){return this.targetRules},e.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,r=t.x,o=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:r+t[0],y:o+t[1]}:eo(eo({},t),{x:r+t.x,y:o+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.getTargetAnchor=function(t){return Rm(t,this)},e.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(e.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,r=e.y,o=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=oo(new Nm([e,i,1]).translate(-n,-r).rotate(o).translate(n,r)[0],2),s=a[0],u=a[1];t.x=s,t.y=u})),t},enumerable:!1,configurable:!0}),e.prototype.getAnchorInfo=function(t){if(!Sf(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},e.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},e.prototype.isAllowMoveByXORY=function(t,e,n){var r,o;if(n)r=!0,o=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(r=i,o=i):(r=i.x,o=i.y)}return{isAllowMoveX:r,isAllowMoveY:o}},e.prototype.move=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY;return o&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),o||i},e.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY,a=0,s=0;return o&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),i&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},e.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var r=t-this.x,o=e-this.y;return!(!n&&!this.isAllowMoveNode(r,o))&&(this.text&&this.moveText(r,o),this.x=t,this.y=e,!0)},e.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},e.prototype.updateText=function(t){this.text=eo(eo({},Le(this.text)),{value:t})},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},e.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},e.prototype.setRotatable=function(t){void 0===t&&(t=!0),this.rotatable=t},e.prototype.setResizable=function(t){void 0===t&&(t=!0),this.resizable=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.setProperty=function(e,n){var r,o=Le(this.properties),i=eo(eo({},o),((r={})[e]=c_(n),r));this.properties=i,this.setAttributes(),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[e],preProperties:o,properties:i})},e.prototype.setProperties=function(e){var n=Le(this.properties),r=eo(eo({},n),c_(e));this.properties=r,this.setAttributes();var o=[];Hf(e,(function(t,e){(Rh(n,e)&&n[e]!==t||!Rh(n,e))&&o.push(e)})),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:o,preProperties:n,properties:r})},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setStyle=function(t,e){var n;this.style=eo(eo({},this.style),((n={})[t]=c_(e),n))},e.prototype.setStyles=function(t){this.style=eo(eo({},this.style),c_(t))},e.prototype.updateStyles=function(t){this.style=eo({},c_(t))},e.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},e.prototype.updateAttributes=function(t){Is(this,t)},e.BaseType=t.ElementType.NODE,ro([$],e.prototype,"type",void 0),ro([$],e.prototype,"x",void 0),ro([$],e.prototype,"y",void 0),ro([$],e.prototype,"textMode",void 0),ro([$],e.prototype,"text",void 0),ro([$],e.prototype,"properties",void 0),ro([$],e.prototype,"_width",void 0),ro([$],e.prototype,"_height",void 0),ro([$],e.prototype,"anchorsOffset",void 0),ro([$],e.prototype,"isSelected",void 0),ro([$],e.prototype,"isHovered",void 0),ro([$],e.prototype,"isShowAnchor",void 0),ro([$],e.prototype,"isDragging",void 0),ro([$],e.prototype,"isHitable",void 0),ro([$],e.prototype,"isHittable",void 0),ro([$],e.prototype,"draggable",void 0),ro([$],e.prototype,"visible",void 0),ro([$],e.prototype,"rotatable",void 0),ro([$],e.prototype,"resizable",void 0),ro([$],e.prototype,"zIndex",void 0),ro([$],e.prototype,"state",void 0),ro([$],e.prototype,"autoToFront",void 0),ro([$],e.prototype,"style",void 0),ro([$],e.prototype,"transform",void 0),ro([$],e.prototype,"_rotate",void 0),ro([rt],e.prototype,"incoming",null),ro([rt],e.prototype,"outgoing",null),ro([te],e.prototype,"setTextMode",null),ro([te],e.prototype,"addNodeMoveRules",null),ro([te],e.prototype,"move",null),ro([te],e.prototype,"getMoveDistance",null),ro([te],e.prototype,"moveTo",null),ro([te],e.prototype,"moveText",null),ro([te],e.prototype,"updateText",null),ro([te],e.prototype,"setSelected",null),ro([te],e.prototype,"setHovered",null),ro([te],e.prototype,"setIsShowAnchor",null),ro([te],e.prototype,"setRotatable",null),ro([te],e.prototype,"setResizable",null),ro([te],e.prototype,"setHitable",null),ro([te],e.prototype,"setHittable",null),ro([te],e.prototype,"setElementState",null),ro([te],e.prototype,"setProperty",null),ro([te],e.prototype,"setProperties",null),ro([te],e.prototype,"deleteProperty",null),ro([te],e.prototype,"setStyle",null),ro([te],e.prototype,"setStyles",null),ro([te],e.prototype,"updateStyles",null),ro([te],e.prototype,"setZIndex",null),ro([te],e.prototype,"updateAttributes",null),e}(),ix=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.CIRCLE_NODE,o.r=50,o.setAttributes(),o}return to(n,e),Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties.r;t&&(this.r=t)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},t),sd(n)),sd(o))},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.r;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.deltaX,r=t.deltaY;return this.move(n/2,r/2),this.r=e,this.setProperties({r:e}),this.getData()},ro([$],n.prototype,"r",void 0),ro([rt],n.prototype,"width",null),ro([rt],n.prototype,"height",null),n}(ox),ax=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.DIAMOND_NODE,o.rx=30,o.ry=50,o.setAttributes(),o}return to(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},t),sd(n)),sd(o))},Object.defineProperty(n.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[[e,n-o],[e+r,n],[e,n+o],[e-r,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pointsPosition",{get:function(){return xh(this.points,(function(t){var e=oo(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Wp(this.points,(function(n){var r=oo(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Wp(this.points,(function(n){var r=oo(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this;return xh(this.points,(function(e,n){var r=oo(e,2);return{x:r[0],y:r[1],id:"".concat(t.id,"_").concat(n)}}))},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},ro([$],n.prototype,"rx",void 0),ro([$],n.prototype,"ry",void 0),ro([rt],n.prototype,"points",null),ro([rt],n.prototype,"pointsPosition",null),ro([rt],n.prototype,"width",null),ro([rt],n.prototype,"height",null),n}(ox),sx=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.ELLIPSE_NODE,o.rx=30,o.ry=45,o.setAttributes(),o}return to(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},t),sd(n)),sd(o))},Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},ro([$],n.prototype,"rx",void 0),ro([$],n.prototype,"ry",void 0),ro([rt],n.prototype,"width",null),ro([rt],n.prototype,"height",null),n}(ox),ux=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.setAttributes(),o}return to(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.points,r=t.width,o=t.height,i=n||this.points;this.points=Mm(i,r,o)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},t),sd(n)),sd(o))},Object.defineProperty(n.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return this.points.map((function(t){return{x:t[0]+e-r/2,y:t[1]+n-o/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=oo(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=oo(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,r=e.y,o=e.width,i=e.height;return e.points.map((function(e,a){var s=oo(e,2),u=s[0],l=s[1];return{x:n+u-o/2,y:r+l-i/2,id:"".concat(t.id,"_").concat(a)}}))},n.prototype.resize=function(t){var e=this,n=t.width,r=t.height,o=t.deltaX,i=t.deltaY;this.move(o/2,i/2);var a=xh(this.points,(function(t){var o=oo(t,2),i=o[0],a=o[1];return[i*n/e.width,a*r/e.height]}));return this.points=a,this.properties.points=a,this.getData()},ro([$],n.prototype,"points",void 0),ro([rt],n.prototype,"pointsPosition",null),ro([rt],n.prototype,"width",null),ro([rt],n.prototype,"height",null),n}(ox),lx=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.RECT_NODE,o.radius=0,o.setAttributes(),o}return to(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height,o=t.radius;n&&(this.width=n),r&&(this.height=r),o&&(this.radius=o)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,r=this.properties.style,o=void 0===r?{}:r;return eo(eo(eo({},t),sd(n)),sd(o))},ro([$],n.prototype,"radius",void 0),n}(ox),cx=function(e){function n(){var n=e.apply(this,io([],oo(arguments),!1))||this;return n.modelType=t.ModelType.TEXT_NODE,n}return to(n,e),n.prototype.getTextStyle=function(){var t=e.prototype.getTextStyle.call(this),n=this.graphModel.theme.text,r=this.properties.textStyle;return eo(eo(eo({},t),sd(n)),sd(r))},Object.defineProperty(n.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Jm({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Jm({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),ro([rt],n.prototype,"width",null),ro([rt],n.prototype,"height",null),n}(ox),dx=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.HTML_NODE,o.setAttributes(),o}return to(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height;n&&(this.width=n),r&&(this.height=r)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},n}(ox),px={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},hx=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],fx=function(){function e(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.textMode=t.TextMode.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=t.TextMode.TEXT,this.edgeTextMode=t.TextMode.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Is(this,this.computeConfig(e))}return e.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);Is(this,e)},e.prototype.computeConfig=function(t){var e=t.isSilentMode,n=t.textDraggable,r=t.textMode,o=t.textEdit,i=t.adjustEdgeStartAndEnd,a={};if(!1===e&&Is(a,this.stagedConfig),!0===e&&e!==this.isSilentMode){var s=Yv(px,hx);this.stagedConfig=Yv(this,hx),Is(a,s)}Nf(o)||Is(a,{nodeTextEdit:o,edgeTextEdit:o}),Nf(n)||Is(a,{nodeTextDraggable:n,edgeTextDraggable:n}),r&&Is(a,{nodeTextMode:r,edgeTextMode:r}),hf(i)&&Is(a,{adjustEdgeStart:i,adjustEdgeEnd:i});var u=Yv(t,hx);return Is(a,u)},e.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},e.prototype.getConfig=function(){return Yv(this,hx)},ro([$],e.prototype,"isSilentMode",void 0),ro([$],e.prototype,"stopZoomGraph",void 0),ro([$],e.prototype,"stopMoveGraph",void 0),ro([$],e.prototype,"stopScrollGraph",void 0),ro([$],e.prototype,"textMode",void 0),ro([$],e.prototype,"textEdit",void 0),ro([$],e.prototype,"textDraggable",void 0),ro([$],e.prototype,"nodeTextEdit",void 0),ro([$],e.prototype,"nodeTextDraggable",void 0),ro([$],e.prototype,"nodeTextMultiple",void 0),ro([$],e.prototype,"nodeTextVertical",void 0),ro([$],e.prototype,"nodeTextMode",void 0),ro([$],e.prototype,"edgeTextMode",void 0),ro([$],e.prototype,"edgeTextEdit",void 0),ro([$],e.prototype,"edgeTextDraggable",void 0),ro([$],e.prototype,"edgeTextMultiple",void 0),ro([$],e.prototype,"edgeTextVertical",void 0),ro([$],e.prototype,"hideAnchors",void 0),ro([$],e.prototype,"allowRotate",void 0),ro([$],e.prototype,"allowResize",void 0),ro([$],e.prototype,"hoverOutline",void 0),ro([$],e.prototype,"nodeSelectedOutline",void 0),ro([$],e.prototype,"adjustNodePosition",void 0),ro([$],e.prototype,"autoExpand",void 0),ro([$],e.prototype,"adjustEdge",void 0),ro([$],e.prototype,"adjustEdgeMiddle",void 0),ro([$],e.prototype,"adjustEdgeStartAndEnd",void 0),ro([$],e.prototype,"adjustEdgeStart",void 0),ro([$],e.prototype,"adjustEdgeEnd",void 0),ro([$],e.prototype,"edgeSelectedOutline",void 0),ro([te],e.prototype,"updateEditConfig",null),ro([te],e.prototype,"updateTextMode",null),e}(),vx=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var r=this;null==t||t.split(",").forEach((function(t){t=t.trim(),r._events[t]||(r._events[t]=[]),r._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var r=n._events[t]||[],o=n._events["*"]||[],i=function(r){for(var o=r.length,i=0;i<o;i++)if(r[i]){var a=r[i],s=a.callback;a.once&&(r.splice(i,1),0===r.length&&delete n._events[t],o--,i--),s.apply(n,[e])}};i(r),i(o)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var r=n._events[t]||[],o=r.length,i=0;i<o;i++)r[i].callback===e&&(r.splice(i,1),o--,i--);0===r.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),yx=function(){function e(e){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=t.OverlapMode.DEFAULT,this.gridSize=1,this.partial=!1;var n=e.container,r=e.partial,o=e.background,i=void 0===o?{}:o,a=e.grid,s=e.idGenerator,u=e.edgeGenerator,l=e.animation,c=e.customTrajectory;this.rootEl=n,this.partial=!!r,this.background=i,"object"==typeof a&&(this.gridSize=a.size||1),this.theme=Fb(e.style),this.edgeType=e.edgeType||"polyline",this.animation=s_(l),this.overlapMode=e.overlapMode||t.OverlapMode.DEFAULT,this.width=e.width||this.rootEl.getBoundingClientRect().width,this.height=e.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new vx,this.editConfigModel=new fx(e),this.transformModel=new mx(this.eventCenter,e),this.flowId=bb(),this.idGenerator=s,this.edgeGenerator=mm(this,u),this.customTrajectory=c}return Object.defineProperty(e.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modelsMap",{get:function(){return io(io([],oo(this.nodes),!1),oo(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortElements",{get:function(){for(var t=io(io([],oo(this.nodes),!1),oo(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],r=[this.width+__,this.height+__],o=0;o<t.length;o++){var i=t[o];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,r,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textEditElement",{get:function(){var e=this.nodes.find((function(e){return e.state===t.ElementState.TEXT_EDIT})),n=this.edges.find((function(e){return e.state===t.ElementState.TEXT_EDIT}));return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),e.prototype.getAreaElement=function(t,e,n,r,o){var i=this;void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[];return Wp(io(io([],oo(this.nodes),!1),oo(this.edges),!1),(function(s){var u=i.isElementInArea(s,t,e,n,r);o&&!s.visible||!u||a.push(s)})),a},e.prototype.getModel=function(t){return this.modelMap.get(t)},e.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},e.prototype.getPointByClient=function(t){var e=t.x,n=t.y,r=this.rootEl.getBoundingClientRect(),o={x:e-r.left,y:n-r.top},i=oo(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2);return{domOverlayPosition:o,canvasOverlayPosition:{x:i[0],y:i[1]}}},e.prototype.isElementInArea=function(e,n,r,o,i){var a;if(void 0===o&&(o=!0),void 0===i&&(i=!0),e.BaseType===t.ElementType.NODE){for(var s=Hm(e),u=s.minX,l=s.minY,c=s.maxX,d=s.maxY,p=[{x:u,y:l},{x:c,y:l},{x:c,y:d},{x:u,y:d}],h=i,f=0;f<p.length;f++){var v=p[f],y=v.x,g=v.y;if(y=(a=oo(this.transformModel.CanvasPointToHtmlPoint([y,g]),2))[0],g=a[1],wm([y,g],n,r)!==i){h=!i;break}}return h}if(e.BaseType===t.ElementType.EDGE){var _=e.startPoint,m=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([_.x,_.y]),x=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),E=wm(b,n,r),M=wm(x,n,r);return o?E&&M:E||M}return!1},e.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);if(t.nodes?this.nodes=xh(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=xh(t.edges,(function(t){var r,o=e.getModel(null!==(r=t.type)&&void 0!==r?r:n);if(!o)throw new Error("找不到".concat(t.type,"对应的边。"));return new o(t,e)}))}else this.edges=[]},e.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},e.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var r=this.nodes[n];if(r.isDragging){t=!0;break}e.push(r.getHistoryData())}if(t)return!1;for(var o=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){o=!0;break}i.push(s.getHistoryData())}return!o&&{nodes:e,edges:i}},e.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},e.prototype.getElement=function(t){return this.modelsMap[t]},e.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var r=this.edges[n],o=r.sourceNodeId===t,i=r.targetNodeId===t;(o||i)&&e.push(r)}return e},e.prototype.getSelectElements=function(e){void 0===e&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach((function(o){if(o.BaseType===t.ElementType.NODE&&r.nodes.push(o.getData()),o.BaseType===t.ElementType.EDGE){var i=o.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(e||a)&&r.edges.push(i)}})),r},e.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},e.prototype.changeNodeId=function(t,e){return e||(e=bb()),this.nodesMap[e]?(console.warn("当前流程图已存在节点".concat(e,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},e.prototype.changeEdgeId=function(t,e){return e||(e=bb()),this.edgesMap[e]?(console.warn("当前流程图已存在边: ".concat(e,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):(console.warn("当前流程图找不到边: ".concat(e,", 修改失败")),"")},e.prototype.getTextModel=function(e){var n=this.editConfigModel,r=n.textMode,o=n.nodeTextMode,i=n.edgeTextMode;return e.BaseType===t.ElementType.NODE?e.textMode||o||r||t.TextMode.TEXT:e.BaseType===t.ElementType.EDGE?e.textMode||i||r||t.TextMode.TEXT:void 0},e.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},e.prototype.setFakeNode=function(t){this.fakeNode=t},e.prototype.removeFakeNode=function(){this.fakeNode=null},e.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},e.prototype.toFront=function(e){var n,r,o,i=(null===(n=this.nodesMap[e])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[e])||void 0===r?void 0:r.model);i&&(this.overlapMode===t.OverlapMode.DEFAULT&&(null===(o=this.topElement)||void 0===o||o.setZIndex(),i.setZIndex(9999),this.topElement=i),this.overlapMode===t.OverlapMode.INCREASE&&this.setElementZIndex(e,"top"))},e.prototype.setElementZIndex=function(t,e){var n,r,o=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[t])||void 0===r?void 0:r.model);if(o){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=$b()),"bottom"===e&&(i=Jb())),o.setZIndex(i)}},e.prototype.deleteNode=function(e){var n=this.nodesMap[e].model.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(t.EventType.NODE_DELETE,{data:n})},e.prototype.addNode=function(e,n,r){void 0===n&&(n=t.EventType.NODE_ADD);var o=c_(e),i=o.id;i&&this.nodesMap[i]&&delete o.id;var a=this.getModelAfterSnapToGrid(o);this.nodes.push(a);var s={data:a.getData()};return r&&(s.e=r),this.eventCenter.emit(n,s),a},e.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,r=t.y;return n&&r&&(t.x=xm(n,this.gridSize),t.y=xm(r,this.gridSize),"object"==typeof t.text&&null!==t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-r)),new e(t,this)},e.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="","object"==typeof n.text&&null!==n.text&&(n.text.x+=30,n.text.y+=30);var r=this.addNode(n);return r.setSelected(!0),null==e||e.setSelected(!1),r.getData()}},e.prototype.moveNode=function(t,e,n,r){var o;void 0===r&&(r=!1);var i=this.nodesMap[t];i?(e=(o=oo(i.model.getMoveDistance(e,n,r),2))[0],n=o[1],this.moveEdge(t,e,n)):console.warn("不存在id为".concat(t,"的节点"))},e.prototype.moveNode2Coordinate=function(t,e,n,r){void 0===r&&(r=!1);var o=this.nodesMap[t];if(o){var i=o.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,r)}else console.warn("不存在id为".concat(t,"的节点"))},e.prototype.editText=function(e){this.setElementStateById(e,t.ElementState.TEXT_EDIT)},e.prototype.addEdge=function(e){var n=c_(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&delete n.id;var o=this.getModel(r);if(!o)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var i=new o(eo(eo({},n),{type:r}),this),a=i.getData();return this.edges.push(i),this.eventCenter.emit(t.EventType.EDGE_ADD,{data:a}),i},e.prototype.moveEdge=function(t,e,n){for(var r=0;r<this.edges.length;r++){var o=this.edges[r],i=o.textPosition,a=i.x,s=i.y,u=this.edges[r].sourceNodeId===t,l=this.edges[r].targetNodeId===t;u&&o.moveStartPoint(e,n),l&&o.moveEndPoint(e,n),(u||l)&&this.handleEdgeTextMove(o,a,s)}},e.prototype.handleEdgeTextMove=function(e,n,r){var o;if(e.customTextPosition)e.resetTextPosition();else{if(e.modelType===t.ModelType.POLYLINE_EDGE&&(null===(o=e.text)||void 0===o?void 0:o.value)){var i=e.text,a=ym(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}var s=e.textPosition,u=s.x,l=s.y;e.moveText(u-n,l-r)}},e.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var o=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:o})}},e.prototype.deleteEdgeById=function(e){if(this.edgesMap[e]){var n=this.edgesMap[e].index,r=this.edgesMap[e].model.getData();this.edges.splice(n,1),this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.setElementStateById=function(e,n,r){this.nodes.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)})),this.edges.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)}))},e.prototype.updateText=function(t,e){var n=hh(io(io([],oo(this.nodes),!1),oo(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},e.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},e.prototype.clearSelectElements=function(){var e;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===t.OverlapMode.DEFAULT&&(null===(e=this.topElement)||void 0===e||e.setZIndex())},e.prototype.moveNodes=function(e,n,r,o){var i,a,s,u=this;void 0===o&&(o=!1);for(var l=e.reduce((function(t,e){var i=u.nodesMap[e].model;return t[e]=i.getMoveDistance(n,r,o),t}),{}),c=0;c<this.edges.length;c++){var d=this.edges[c],p=d.textPosition,h=p.x,f=p.y,v=l[d.sourceNodeId],y=l[d.targetNodeId],g=void 0,_=void 0;v&&y&&d.modelType===t.ModelType.POLYLINE_EDGE?(g=(i=oo(v,2))[0],_=i[1],d.updatePointsList(g,_)):(v&&(g=(a=oo(v,2))[0],_=a[1],d.moveStartPoint(g,_)),y&&(g=(s=oo(y,2))[0],_=s[1],d.moveEndPoint(g,_))),(v||y)&&this.handleEdgeTextMove(d,h,f)}},e.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},e.prototype.setDefaultEdgeType=function(t){this.edgeType=t},e.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new o(r,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=Zm(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=Zm(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},e.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var i=new o(r,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},e.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},e.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},e.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},e.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},e.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){var o;r.targetNodeId===t&&n.push(null===(o=e.nodesMap[r.sourceNodeId])||void 0===o?void 0:o.model)})),n},e.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){r.sourceNodeId===t&&n.push(e.nodesMap[r.targetNodeId].model)})),n},e.prototype.setTheme=function(t){this.theme=Kb(eo(eo({},this.theme),t))},e.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,this.width&&this.height||console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},e.prototype.clearData=function(){this.nodes=[],this.edges=[]},e.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var r=t.x,o=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,u=void 0===s?0:s,l=r+i/2+u,c=r-i/2-u,d=o+a/2+u,p=o-a/2-u;e=e.concat([l,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([d,p].filter((function(t){return!Number.isNaN(t)})))}));var r=Math.min.apply(Math,io([],oo(e),!1)),o=Math.max.apply(Math,io([],oo(e),!1)),i=Math.min.apply(Math,io([],oo(n),!1)),a=o-r||0,s=Math.max.apply(Math,io([],oo(n),!1))-i||0;return{width:a,height:s,x:r+a/2,y:i+s/2}},e.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,r=t.height,o=t.rootEl,i=t.transformModel;if(e.length){var a=n||o.clientWidth,s=r||o.clientHeight,u=this.getVirtualRectSize(),l=u.x,c=u.y;i.focusOn(l,c,a,s)}},e.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,r=n.nodes,o=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(r.length){var u=o||a.clientWidth,l=i||a.clientHeight,c=this.getVirtualRectSize(),d=c.width,p=c.height,h=c.x,f=c.y,v=(d+e)/u,y=(p+t)/l,g=1/Math.max(v,y),_=[u/2,l/2];s.zoom(g,_),s.focusOn(h,f,u,l)}},e.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},e.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},e.prototype.getPartial=function(){return this.partial},e.prototype.setPartial=function(t){this.partial=t},ro([$],e.prototype,"width",void 0),ro([$],e.prototype,"height",void 0),ro([$],e.prototype,"edgeType",void 0),ro([$],e.prototype,"nodes",void 0),ro([$],e.prototype,"edges",void 0),ro([$],e.prototype,"fakeNode",void 0),ro([$],e.prototype,"overlapMode",void 0),ro([$],e.prototype,"background",void 0),ro([$],e.prototype,"gridSize",void 0),ro([$],e.prototype,"transformModel",void 0),ro([$],e.prototype,"editConfigModel",void 0),ro([$],e.prototype,"partial",void 0),ro([rt],e.prototype,"nodesMap",null),ro([rt],e.prototype,"edgesMap",null),ro([rt],e.prototype,"modelsMap",null),ro([rt],e.prototype,"sortElements",null),ro([rt],e.prototype,"textEditElement",null),ro([rt],e.prototype,"selectElements",null),ro([rt],e.prototype,"selectNodes",null),ro([te],e.prototype,"setTextMode",null),ro([te],e.prototype,"setFakeNode",null),ro([te],e.prototype,"removeFakeNode",null),ro([te],e.prototype,"setModel",null),ro([te],e.prototype,"toFront",null),ro([te],e.prototype,"setElementZIndex",null),ro([te],e.prototype,"deleteNode",null),ro([te],e.prototype,"addNode",null),ro([te],e.prototype,"cloneNode",null),ro([te],e.prototype,"moveNode",null),ro([te],e.prototype,"moveNode2Coordinate",null),ro([te],e.prototype,"editText",null),ro([te],e.prototype,"addEdge",null),ro([te],e.prototype,"moveEdge",null),ro([te],e.prototype,"deleteEdgeBySourceAndTarget",null),ro([te],e.prototype,"deleteEdgeById",null),ro([te],e.prototype,"deleteEdgeBySource",null),ro([te],e.prototype,"deleteEdgeByTarget",null),ro([te],e.prototype,"setElementStateById",null),ro([te],e.prototype,"updateText",null),ro([te],e.prototype,"selectNodeById",null),ro([te],e.prototype,"selectEdgeById",null),ro([te],e.prototype,"selectElementById",null),ro([te],e.prototype,"clearSelectElements",null),ro([te],e.prototype,"moveNodes",null),ro([te],e.prototype,"setDefaultEdgeType",null),ro([te],e.prototype,"changeNodeType",null),ro([te],e.prototype,"changeEdgeType",null),ro([te],e.prototype,"getNodeIncomingEdge",null),ro([te],e.prototype,"getNodeOutgoingEdge",null),ro([te],e.prototype,"getAnchorIncomingEdge",null),ro([te],e.prototype,"getAnchorOutcomingEdge",null),ro([te],e.prototype,"getNodeIncomingNode",null),ro([te],e.prototype,"getNodeOutgoingNode",null),ro([te],e.prototype,"setTheme",null),ro([te],e.prototype,"resize",null),ro([te],e.prototype,"clearData",null),ro([te],e.prototype,"translateCenter",null),ro([te],e.prototype,"fitView",null),ro([te],e.prototype,"openEdgeAnimation",null),ro([te],e.prototype,"closeEdgeAnimation",null),ro([te],e.prototype,"setPartial",null),e}(),gx=function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}return t.prototype.getStyle=function(){return eo({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,r=t.y,o=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(o=!0),r===s.y&&(i=!0),o&&i))break}return{isShowVertical:o,isShowHorizontal:i,position:{x:n,y:r}}},t.prototype.getHorizontalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Hm(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Hm(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Hm(l);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){r=!0,o=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){r=!0,o=n.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:eo(eo({},this.position),{y:o})}},t.prototype.getVerticalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Hm(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Hm(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Hm(l);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){r=!0,o=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){r=!0,o=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:eo(eo({},this.position),{x:o})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),r=n.isShowHorizontal,o=n.isShowVertical;if(!r){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!o){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},ro([$],t.prototype,"isShowHorizontal",void 0),ro([$],t.prototype,"isShowVertical",void 0),ro([$],t.prototype,"position",void 0),ro([te],t.prototype,"clearSnapline",null),ro([te],t.prototype,"setNodeSnapLine",null),t}(),_x={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},mx=function(){function e(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,r=void 0!==n&&n;this.updateTranslateLimits(r)}return e.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},e.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},e.prototype.HtmlPointToCanvasPoint=function(t){var e=oo(t,2),n=e[0],r=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},e.prototype.CanvasPointToHtmlPoint=function(t){var e=oo(t,2),n=e[0],r=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},e.prototype.moveCanvasPointByHtml=function(t,e,n){var r=oo(t,2),o=r[0],i=r[1];return[o+e/this.SCALE_X,i+n/this.SCALE_Y]},e.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},e.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},e.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,r=this.SCALE_Y;return"number"==typeof t?(n=t,r=t):t?(n+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=r,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},e.prototype.emitGraphTransform=function(e){this.eventCenter.emit(t.EventType.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},e.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},e.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},e.prototype.focusOn=function(t,e,n,r){var o=oo(this.CanvasPointToHtmlPoint([t,e]),2),i=oo([n/2-o[0],r/2-o[1]],2),a=i[0],s=i[1];this.TRANSLATE_X+=a,this.TRANSLATE_Y+=s,this.emitGraphTransform("focusOn")},e.prototype.updateTranslateLimits=function(t){var e;e=oo(Array.isArray(t)&&4===t.length?t:_x[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},ro([$],e.prototype,"SCALE_X",void 0),ro([$],e.prototype,"SKEW_Y",void 0),ro([$],e.prototype,"SKEW_X",void 0),ro([$],e.prototype,"SCALE_Y",void 0),ro([$],e.prototype,"TRANSLATE_X",void 0),ro([$],e.prototype,"TRANSLATE_Y",void 0),ro([$],e.prototype,"ZOOM_SIZE",void 0),ro([te],e.prototype,"zoom",null),ro([te],e.prototype,"resetZoom",null),ro([te],e.prototype,"translate",null),ro([te],e.prototype,"focusOn",null),e}(),bx=function(e){function n(n){var r=e.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(t){var e=t.deltaX,n=t.deltaY;r.setState({isDragging:!0});var o=r.props.graphModel,i=o.transformModel;!0!==o.editConfigModel.stopMoveGraph&&i.translate(e,n)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(t){var e=r.props,n=e.graphModel,o=n.editConfigModel,i=n.transformModel,a=n.gridSize,s=e.graphModel,u=t.deltaX,l=t.deltaY;if(o.stopScrollGraph||t.ctrlKey||t.metaKey){if(!o.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,d=c.x,p=c.y;i.zoom(t.deltaY<0,[d,p])}}else{if(t.preventDefault(),r.stepScrollX+=u,r.stepScrollY+=l,Math.abs(r.stepScrollX)>=a){var h=r.stepScrollX%a,f=r.stepScrollX-h;i.translate(-f*i.SCALE_X,0),r.stepScrollX=h}if(Math.abs(r.stepScrollY)>=a){var v=r.stepScrollY%a,y=r.stepScrollY-v;i.translate(0,-y*i.SCALE_Y),r.stepScrollY=v}}},r.clickHandler=function(e){if("canvas-overlay"===e.target.getAttribute("name")){var n=r.props.graphModel;n.selectElements.size>0&&n.clearSelectElements(),n.eventCenter.emit(t.EventType.BLANK_CLICK,{e:e})}},r.handleContextMenu=function(e){if("canvas-overlay"===e.target.getAttribute("name")){e.preventDefault();var n=r.props.graphModel,o=n.getPointByClient({x:e.clientX,y:e.clientY});n.eventCenter.emit(t.EventType.BLANK_CONTEXTMENU,{e:e,position:o})}},r.mouseDownHandler=function(e){var n=r.props.graphModel,o=n.eventCenter,i=n.editConfigModel,a=n.transformModel.SCALE_X,s=n.gridSize,u=e.target,l=!i.adjustEdge&&!i.adjustNodePosition;("canvas-overlay"===u.getAttribute("name")||l)&&(!0!==i.stopMoveGraph?(r.stepDrag.setStep(s*a),r.stepDrag.handleMouseDown(e)):o.emit(t.EventType.BLANK_MOUSEDOWN,{e:e}),r.clickHandler(e))};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new m_({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return to(n,e),n.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,r=e.dnd,o=this.state.isDragging;return so("svg",eo({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:o?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},r.eventMap(),{children:so("g",{transform:t,children:n})}))},n=ro([IE],n)}(Vn),xx=function(e){function n(){var n=e.call(this)||this;return n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.bezierModel,s=o.type,u=i.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,l=u.x,c=u.y;a.updateAdjustAnchor({x:l,y:c},s),i.eventCenter.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.onDragEnd=function(){n.props.bezierModel.isDragging=!1},n.dragHandler=new m_({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return to(n,e),n.prototype.render=function(){var t=this,e=this.props.position,n=e.x,r=e.y,o=this.props.bezierModel.getEdgeStyle().adjustAnchor;return so(Nb,eo({className:"lf-bezier-adjust-anchor",x:n,y:r},o,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},n}(Vn),Ex=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return to(n,e),n.prototype.getBezierAdjust=function(t,e){var n=t.path,r=t.id,o=oo(hm(n),4),i=o[0],a=o[1],s=o[2],u=o[3],l=t.getEdgeStyle().adjustLine,c=[];return c.push(so(Ab,eo({x1:i.x,y1:i.y,x2:a.x,y2:a.y},l))),c.push(so(xx,{position:a,bezierModel:t,graphModel:e,type:"sNext"},"".concat(r,"_ePre"))),c.push(so(Ab,eo({x1:u.x,y1:u.y,x2:s.x,y2:s.y},l))),c.push(so(xx,{position:s,bezierModel:t,graphModel:e,type:"ePre"},"".concat(r,"_sNext"))),c},n.prototype.selectedBezierEdge=function(){for(var e=this.props.graphModel,n=e.edges,r=[],o=0;o<n.length;o++){var i=n[o];i.isSelected&&i.modelType===t.ModelType.BEZIER_EDGE&&i.draggable&&r.push(this.getBezierAdjust(i,e))}return r},n.prototype.render=function(){return so("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},n=ro([IE],n)}(Vn),Mx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.render=function(){return so("div",{className:"lf-background",children:so("div",{style:this.props.background,className:"lf-background-area"})})},e}(Vn),wx=function(t){function e(){var e=t.apply(this,io([],oo(arguments),!1))||this;return e.id=bb(),e}return to(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?2:s,l=Math.min(Math.max(2,u),r/4);return so("g",{fill:a,opacity:o?1:0,children:[so("circle",{cx:0,cy:0,r:l/2}),so("circle",{cx:0,cy:r,r:l/2}),so("circle",{cx:r,cy:0,r:l/2}),so("circle",{cx:r,cy:r,r:l/2})]})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?1:s,l=Math.min(Math.max(1,u),r/2);return so("path",{d:"M 0 0 H ".concat(r," V ").concat(r," H 0 Z"),stroke:a,strokeWidth:l,opacity:o?1:0,fill:"transparent"})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,r=void 0===n?1:n,o=t.graphModel.transformModel,i=[o.SCALE_X,o.SKEW_Y,o.SKEW_X,o.SCALE_Y,o.TRANSLATE_X,o.TRANSLATE_Y].join(","),a="matrix(".concat(i,")");return so("div",{className:"lf-grid",children:so("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[so("defs",{children:so("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:a,x:"0",y:"0",width:r,height:r,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),so("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=ro([IE],e)}(Vn);!function(t){t.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},t.getGridOptions=function(e){var n=sd(t.defaultProps);return Is(n,"number"==typeof e?{size:e}:"boolean"==typeof e?{visible:e}:e)}}(wx||(wx={}));var Tx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.render=function(){return so("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:so("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=ro([IE],e)}(Vn),Sx=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return to(n,e),n.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,r=n.hoverOutline,o=n.nodeSelectedOutline,i=[];return e.forEach((function(t){if(t.isHovered||t.isSelected){var e=t.isHovered,n=t.isSelected,a=t.x,s=t.y,u=t.width,l=t.height;if(o&&n||r&&e){var c=t.getOutlineStyle(),d={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(d[t]=c[t])})),e){var p=c.hover;d=eo(eo({},d),p)}i.push(so(Ob,eo({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:u+10,height:l+10},d)))}}})),i},n.prototype.getEdgeOutline=function(){for(var e=this.props.graphModel,n=e.edges,r=e.editConfigModel,o=r.edgeSelectedOutline,i=r.hoverOutline,a=[],s=0;s<n.length;s++){var u=n[s];(o&&u.isSelected||i&&u.isHovered)&&(u.modelType===t.ModelType.LINE_EDGE?a.push(this.getLineOutline(u)):u.modelType===t.ModelType.POLYLINE_EDGE?a.push(this.getPolylineOutline(u)):u.modelType===t.ModelType.BEZIER_EDGE&&a.push(this.getBezierOutline(u)))}return a},n.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10,s=t.getOutlineStyle();return so(Ob,eo({className:"lf-outline-edge",x:r,y:o,width:i,height:a},s))},n.prototype.getPolylineOutline=function(t){var e=t.points,n=im(e),r=k_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return so(Ob,eo({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.getBezierOutline=function(t){var e=t.path,n=hm(e),r=k_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return so(Ob,eo({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.render=function(){return so("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},n=ro([IE],n)}(Vn),Ax=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,r=e.isShowHorizontal,o=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,u=void 0===s?0:s,l=a.y,c=void 0===l?0:l,d=eo(eo({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:r?null==i?void 0:i.stroke:"none"}),p=eo(eo({x1:u,y1:-1e5,x2:u,y2:1e5},i),{stroke:o?null==i?void 0:i.stroke:"none"});return so("g",{className:"lf-snapline",children:[so(Ab,eo({},d)),so(Ab,eo({},p))]})},e=ro([IE],e)}(Vn),Ox=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,e=t.tool,n=t.graphModel,r=n.textEditElement,o=e.getTools().map((function(t){return Xn(t,{textEditElement:r,graphModel:n,lf:e.instance})}));return e.components=o,o},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,r=document.querySelector("#ToolOverlay_".concat(n.flowId)),o=e.getInstance();o.components.forEach((function(t){return t(o,r)})),o.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return so("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=ro([IE],e)}(Vn),Dx=function(e){function n(){var t=e.apply(this,io([],oo(arguments),!1))||this;return t.handleResize=function(){t.props.graphModel.resize()},t}return to(n,e),n.prototype.componentDidMount=function(){window.addEventListener("resize",Qy(this.handleResize,200))},n.prototype.componentDidUpdate=function(){var e=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(t.EventType.GRAPH_UPDATED,{data:e})},n.prototype.componentWillUnmount=function(){window.removeEventListener("resize",Qy(this.handleResize,200))},n.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var r=(0,this.props.getView)(t.type);return r?so(r,{model:t,graphModel:e,overlay:n},t.id):null},n.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,r=e.tool,o=e.options,i=e.dnd,a=e.snaplineModel;o.width&&"".concat(n.width,"px"),o.height&&"".concat(n.height,"px");var s=o.grid&&wx.getGridOptions(o.grid),u=n.fakeNode,l=n.editConfigModel.adjustEdge;return so("div",{className:"lf-graph","flow-id":n.flowId,children:[so(bx,{graphModel:n,dnd:i,children:[so("g",{className:"lf-base",children:xh(n.sortElements,(function(e){return t.getComponent(e,n)}))}),u?this.getComponent(u,n):""]}),so(Tx,{graphModel:n,children:[so(Sx,{graphModel:n}),l?so(Ex,{graphModel:n}):"",!1!==o.snapline?so(Ax,{snaplineModel:a}):""]}),so(Ox,{graphModel:n,tool:r}),o.background&&so(Mx,{background:o.background}),s&&so(wx,eo({},s,{graphModel:n}))]})},n=ro([IE],n)}(Vn),Nx=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(e){var r=e.event,o=n.props,i=o.anchorData,a=o.nodeModel,s=o.graphModel;s.selectNodeById(a.id),a.autoToFront&&s.toFront(a.id),s.eventCenter.emit(t.EventType.ANCHOR_DRAGSTART,{data:i,e:r,nodeModel:a}),n.setState({startX:i.x,startY:i.y,endX:i.x,endY:i.y})},n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=i.transformModel,l=i.eventCenter,c=i.width,d=i.height,p=i.editConfigModel,h=p.autoExpand,f=p.stopMoveGraph;if(r){var v=r.clientX,y=r.clientY,g=i.getPointByClient({x:v,y:y}),_=g.domOverlayPosition,m=_.x,b=_.y,x=g.canvasOverlayPosition,E=x.x,M=x.y;n.t&&wb(n.t);var w=[];m<10?w=[10,0]:m+10>c?w=[-10,0]:b<10?w=[0,10]:b+10>d&&(w=[0,-10]),n.setState({endX:E,endY:M,dragging:!0}),n.moveAnchorEnd(E,M),w.length>0&&!f&&h&&(n.t=Mb((function(){var t=oo(w,2),e=t[0],r=t[1];u.translate(e,r);var o=n.state,i=o.endX,a=o.endY;n.setState({endX:i-e,endY:a-r}),n.moveAnchorEnd(i-e,a-r)}))),l.emit(t.EventType.ANCHOR_DRAG,{data:s,e:r,nodeModel:a})}},n.onDragEnd=function(e){var r=e.event;n.t&&wb(n.t);var o=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var i=n.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData;o&&a.eventCenter.emit(t.EventType.ANCHOR_DRAGEND,{data:u,e:r,nodeModel:s,edgeModel:o})},n.checkEnd=function(e){var r,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=s.x,l=s.y,c=s.id,d=n.state,p=d.endX,h=d.endY,f=d.dragging,v=jm({x:p,y:h},i);if(n.preTargetNode&&n.preTargetNode.state!==t.ElementState.DEFAULT&&n.preTargetNode.setElementState(t.ElementState.DEFAULT),f&&v&&v.node){var y=v.node,g=v.anchor.id,_="".concat(a.id,"_").concat(y.id,"_").concat(g,"_").concat(c),m=n.sourceRuleResults.get(_)||{},b=m.isAllPass,x=m.msg,E=n.targetRuleResults.get(_)||{},M=E.isAllPass,w=E.msg;if(b&&M){y.setElementState(t.ElementState.DEFAULT);var T=i.getNodeModelById(v.node.id),S=null===(r=i.edgeGenerator)||void 0===r?void 0:r.call(i,a.getData(),null==T?void 0:T.getData()),A=i.addEdge(eo(eo({},S),{sourceNodeId:a.id,sourceAnchorId:c,startPoint:{x:u,y:l},targetNodeId:v.node.id,targetAnchorId:v.anchor.id,endPoint:{x:v.anchor.x,y:v.anchor.y}})),O=n.props.anchorData;return i.eventCenter.emit(t.EventType.ANCHOR_DROP,{data:O,e:e,nodeModel:a,edgeModel:A}),A}var D=y.getData();return i.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:D,msg:w||x||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new m_({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return to(n,e),n.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,r=t.node.getAnchorShape(e);if(r)return r;var o=e.x,i=e.y,a=eo(eo({},n),null==n?void 0:n.hover);return so("g",{children:[so(Nb,eo({className:"lf-node-anchor-hover"},a,{x:o,y:i})),so(Nb,eo({className:"lf-node-anchor"},n,{x:o,y:i}))]})},Object.defineProperty(n.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,r=e.getAnchorOutcomingEdge,o=t.anchorData.id;return{incomingEdgeList:n(o),outcomingEdgeList:r(o)}},enumerable:!1,configurable:!0}),n.prototype.moveAnchorEnd=function(e,n){var r,o,i=this.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData,l=jm({x:e,y:n},a);if(l){var c=l.node,d=l.anchor.id;if(this.preTargetNode&&this.preTargetNode!==l.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),u.id===d)return;this.preTargetNode=c;var p="".concat(s.id,"_").concat(c.id,"_").concat(d,"_").concat(u.id);if(!this.targetRuleResults.has(p)){var h=l.anchor,f=s.isAllowConnectedAsSource(c,u,h),v=c.isAllowConnectedAsTarget(s,u,h);this.sourceRuleResults.set(p,Qm(f)),this.targetRuleResults.set(p,Qm(v))}var y=(null!==(r=this.sourceRuleResults.get(p))&&void 0!==r?r:{}).isAllPass,g=(null!==(o=this.targetRuleResults.get(p))&&void 0!==o?o:{}).isAllPass;y&&g?c.setElementState(t.ElementState.ALLOW_CONNECT):c.setElementState(t.ElementState.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==t.ElementState.DEFAULT&&this.preTargetNode.setElementState(t.ElementState.DEFAULT)},n.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,r=t.endX,o=t.endY;return Bm(e,n,r,o)>10},n.prototype.render=function(){var t=this,e=this.state,n=e.startX,r=e.startY,o=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,u=a.edgeStyle;return so("g",{className:"lf-anchor",children:[so("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(eo({sourcePoint:{x:n,y:r},targetPoint:{x:o,y:i}},u)):so(Ab,eo({x1:n,y1:r,x2:o,y2:i},u,{"pointer-events":"none"})))]})},n}(Vn),Px=function(e){function n(n){var r=e.call(this,n)||this;return r.style={},r.onDragging=function(e){var n,o=e.event,i=r.props,a=i.graphModel,s=i.nodeModel,u=i.eventCenter,l=a.selectNodes,c=s.x,d=s.y,p=o.clientX,h=o.clientY,f=a.getPointByClient({x:p,y:h}).canvasOverlayPosition,v=f.x,y=f.y,g=new Om(v-c,y-d),_=(null===(n=r.normal)||void 0===n?void 0:n.angle(g))-r.defaultAngle,m=new Im(-c,-d).rotate(_).translate(c,d).toString();s.transform=m,s.rotate=_;var b=xh(l,(function(t){return t.id}));-1===b.indexOf(s.id)&&(b=[s.id]);var x=hy(b,(function(t,e){var n=a.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});b.forEach((function(t){a.getNodeEdges(t).forEach((function(t){if(x[t.sourceNodeId]){var e=a.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(x[t.targetNodeId]){e=a.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),u.emit(t.EventType.NODE_ROTATE,{e:o,model:s,data:s.getData()})},r.style=n.style,r.stepperDrag=new m_({onDragging:r.onDragging}),r}return to(n,e),n.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,r=e.y,o=n+e.width/2+20,i=r-e.height/2-20;return this.normal=new Om(1,0),this.defaultAngle=this.normal.angle(new Om(o-n,i-r)),e.defaultAngle=this.defaultAngle,so("g",{className:"lf-rotate-control",children:so("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:so(Nb,eo({},this.style,{cx:o,cy:i}))})})},n}(Vn),Cx={},Ix={get exports(){return Cx},set exports(t){Cx=t}};
|
|
26
|
+
/*!
|
|
27
|
+
Copyright (c) 2018 Jed Watson.
|
|
28
|
+
Licensed under the MIT License (MIT), see
|
|
29
|
+
http://jedwatson.github.io/classnames
|
|
30
|
+
*/
|
|
31
|
+
!function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=o(t,r(n)))}return t}function r(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var i in t)e.call(t,i)&&t[i]&&(r=o(r,i));return r}function o(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(Ix);var Lx,jx=Cx,kx=function(e){function n(n){var r=e.call(this)||this;r.mouseDownHandler=function(t){var e=r.props,n=e.draggable,o=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(null!=n?n:i)&&(r.stepperDrag.model=o,r.stepperDrag.handleMouseDown(t))},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.model,a=o.graphModel.transformModel;if(e&&n){var s=oo(a.fixDeltaXY(e,n),2),u=s[0],l=s[1];i.moveText(u,l)}},r.dbClickHandler=function(){var e=r.props,n=e.editable,o=e.graphModel.eventCenter,i=e.model;n&&i.setElementState(t.ElementState.TEXT_EDIT),o.emit(t.EventType.TEXT_DBCLICK,{data:i.text,model:i})};var o=n.draggable;return r.stepperDrag=new m_({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:o}),r}return to(n,e),n.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel,r=e.text,o=r.value,i=r.x,a=r.y,s=r.editable,u=r.draggable,l={x:i,y:a,className:"",value:o},c=e.getTextStyle(),d=n.nodeTextDraggable||u;return so(Tb,eo({},l,c,{className:jx({"lf-element-text":s,"lf-text-draggable":!s&&d,"lf-text-disabled":!s&&!d}),model:e}))},n.prototype.render=function(){if(this.props.model.text)return so("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},n}(Vn),Rx=function(t){function e(e){var n=t.call(this,e)||this;return n.setHoverOn=function(){n.setState({isHovered:!0})},n.setHoverOff=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return to(e,t),e.prototype.getBackground=function(){var t=this.state.isHovered,e=this.props.model,n=e.text,r=e.getTextStyle(),o=r.background||{};if(t&&r.hover&&r.hover.background&&(o=eo(eo({},o),r.hover.background)),(null==n?void 0:n.value)&&"transparent"!==(null==o?void 0:o.fill)){var i=r.fontSize,a=r.textWidth,s=r.lineHeight,u=r.overflowMode,l=o.wrapPadding,c=null==n?void 0:n.value.split(/[\r\n]/g),d=c.length,p=n.x,h=n.y,f={};if("autoWrap"===u&&a){var v=$m({rows:c,style:{fontSize:"".concat(i,"px"),width:"".concat(a,"px"),lineHeight:s,padding:l},rowsLength:d,className:"lf-get-text-height"});f=eo(eo({},o),{x:p,y:h,width:a,height:v})}else{var y=bm({rows:c,rowsLength:d,fontSize:i}),g=y.width,_=y.height;if("ellipsis"===u&&(g=a,_=i+2),"string"==typeof o.wrapPadding){var m=o.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));if(m.length>0&&m.length<=4){if(1===m.length){var b=oo(m,1)[0];m=[b,b,b,b]}else if(2===m.length){var x=oo(m,2),E=x[0];m=[E,M=x[1],E,M]}else if(3===m.length){var M,w=oo(m,3);m=[w[0],M=w[1],w[2],M]}var T=oo(m,4),S=T[0],A=T[1],O=T[2],D=T[3];g+=A+D,_+=S+O,p+=(A-D)/2,h+=(O-S)/2}}f=eo(eo({},o),{x:p-1,y:h-1,width:g,height:_})}return so(Ob,eo({},f))}return null},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.x,r=e.y,o=e.value;if(!o)return null;var i=t.getTextStyle(),a=eo({x:n,y:r,value:o,model:t,className:"lf-element-text"},i);return so("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),so(Tb,eo({},a))]})},e}(kx),Bx=function(e){function n(n){var r=e.call(this)||this;r.onDragStart=function(t){var e=t.event,n=r.props,o=n.model,i=n.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,u=a.y;r.moveOffset={dx:o.x-s,dy:o.y-u}}},r.onDragging=function(t){var e,n,o,i,a=t.event,s=r.props,u=s.model,l=s.graphModel,c=l.editConfigModel,d=c.stopMoveGraph,p=c.autoExpand,h=l.transformModel,f=l.selectNodes,v=l.width,y=l.height,g=l.gridSize;u.isDragging=!0;var _=a,m=_.clientX,b=_.clientY,x=l.getPointByClient({x:m,y:b}).canvasOverlayPosition,E=x.x,M=x.y,w=oo(h.CanvasPointToHtmlPoint([E,M]),2),T=w[0],S=w[1];if(E+=null!==(n=null===(e=r.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==n?n:0,M+=null!==(i=null===(o=r.moveOffset)||void 0===o?void 0:o.dy)&&void 0!==i?i:0,E=xm(E,g),M=xm(M,g),v&&y){if(!p||d||!(T<0||S<0||T>v||S>y)){var A=oo(h.CanvasPointToHtmlPoint([E-u.width/2,M-u.height/2]),2),O=A[0],D=A[1],N=oo(h.CanvasPointToHtmlPoint([E+u.width/2,M+u.height/2]),2),P=N[0],C=N[1],I=Math.max(g,20),L=[];O<0?L=[I,0]:P>l.width?L=[-I,0]:D<0?L=[0,I]:C>l.height&&(L=[0,-I]),r.t&&wb(r.t),u.transform=new Im(-E,-M).rotate(u.rotate).translate(E,M).toString();var j=f.map((function(t){return t.id}));-1===j.indexOf(u.id)&&(j=[u.id]),L.length>0&&!d&&p?r.t=Mb((function(){var t=oo(L,2),e=t[0],n=t[1];h.translate(null!=e?e:0,null!=n?n:0);var r=-(null!=e?e:0)/h.SCALE_X,o=-(null!=n?n:0)/h.SCALE_X;l.moveNodes(j,r,o)})):l.moveNodes(j,E-u.x,M-u.y)}}else l.moveNode2Coordinate(u.id,E,M)},r.onDragEnd=function(){r.t&&wb(r.t),r.props.model.isDragging=!1},r.onMouseOut=function(t){l_&&r.setHoverOff(t)},r.handleMouseUp=function(){var t=r.props.model;r.mouseUpDrag=t.isDragging},r.handleClick=function(e){var n=!1===r.mouseUpDrag;if(r.startTime){var o=r.props,i=o.model,a=o.graphModel;if(n){var s={data:i.getData(),e:e,position:a.getPointByClient({x:e.clientX,y:e.clientY}),isSelected:!1,isMultiple:!1},u=2===e.button,l=2===e.detail;if(!u){var c=a.editConfigModel,d=Tm(e,c);s.isMultiple=d,i.isSelected&&!l&&d?(s.isSelected=!1,i.setSelected(!1)):(a.selectNodeById(i.id,d),s.isSelected=!0,r.toFront()),l?(c.nodeTextEdit&&i.text.editable&&(i.setSelected(!1),a.setElementStateById(i.id,t.ElementState.TEXT_EDIT)),a.eventCenter.emit(t.EventType.NODE_DBCLICK,s)):(a.eventCenter.emit(t.EventType.ELEMENT_CLICK,s),a.eventCenter.emit(t.EventType.NODE_CLICK,s))}}}},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.model,i=n.graphModel,a=o.getData(),s=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,s.domOverlayPosition),o.isSelected||i.selectNodeById(o.id),i.eventCenter.emit(t.EventType.NODE_CONTEXTMENU,{data:a,e:e,position:s}),r.toFront()},r.handleMouseDown=function(t){var e=r.props,n=e.model,o=e.graphModel;r.startTime=(new Date).getTime(),o.editConfigModel.adjustNodePosition&&n.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.setHoverOn=function(e){var n=r.props,o=n.model,i=n.graphModel;if(!o.isHovered){var a=o.getData();o.setHovered(!0),i.eventCenter.emit(t.EventType.NODE_MOUSEENTER,{data:a,e:e})}},r.setHoverOff=function(e){var n=r.props,o=n.model,i=n.graphModel,a=o.getData();o.isHovered&&(o.setHovered(!1),i.eventCenter.emit(t.EventType.NODE_MOUSELEAVE,{data:a,e:e}))};var o=n.graphModel,i=o.gridSize,a=o.eventCenter,s=n.model;return r.stepDrag=new m_({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=ae((function(){return r.props}),(function(t){t&&t.model&&r.stepDrag.setModel(t.model)})),r}return to(n,e),n.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},n.prototype.componentDidMount=function(){},n.prototype.componentDidUpdate=function(){},n.prototype.getAnchorShape=function(t){return null},n.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(o||s)&&!a?xh(n.anchors,(function(e,o){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return so(Nx,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:o,nodeModel:n,graphModel:r,setHoverOff:t.setHoverOff})})):[]},n.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=n.editConfigModel,o=r.isSilentMode,i=r.allowRotate,a=e.isSelected,s=e.isHitable,u=e.rotatable,l=e.isHovered,c=i&&u,d=e.getRotateControlStyle();if(!o&&s&&(a||l)&&c)return so(Px,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:d})},n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=n.editConfigModel,o=r.isSilentMode,i=r.allowResize,a=e.isSelected,s=e.isHitable,u=e.resizable,l=e.isHovered,c=i&&u,d=e.getResizeControlStyle();return!o&&s&&(a||l)&&c?so(jb,{style:d,model:e,graphModel:n}):null},n.prototype.getText=function(){var e,n=this.props,r=n.model,o=n.graphModel,i=o.editConfigModel;if(i.nodeTextMode!==t.TextMode.TEXT)return null;if(r.state===t.ElementState.TEXT_EDIT)return null;if(r.text){var a=!1;return i.nodeTextDraggable&&r.text.draggable&&(a=!0),so(kx,{editable:i.nodeTextEdit&&(null===(e=r.text.editable)||void 0===e||e),model:r,graphModel:o,draggable:a})}return null},n.prototype.getStateClassName=function(){var e=this.props.model,n=e.state,r=e.isDragging,o=e.isSelected,i="lf-node";switch(n){case t.ElementState.ALLOW_CONNECT:i+=" lf-node-allow";break;case t.ElementState.NOT_ALLOW_CONNECT:i+=" lf-node-not-allow";break;default:i+=" lf-node-default"}return r&&(i+=" lf-dragging"),o&&(i+=" lf-node-selected"),i},n.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},n.prototype.render=function(){var t,e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.hideAnchors,a=o.adjustNodePosition,s=o.allowRotate,u=o.allowResize,l=r.gridSize,c=r.transformModel.SCALE_X,d=n.isHitable,p=n.draggable,h=n.transform,f=n.getOuterGAttributes(),v=f.className,y=void 0===v?"":v,g=no(f,["className"]),_=so("g",{className:"lf-node-content",children:[so("g",{transform:h,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),u&&this.getResizeControl()]}),!i&&this.getAnchors()]});return d?(a&&p&&this.stepDrag.setStep(l*c),t=so("g",eo({className:"".concat(this.getStateClassName()," ").concat(y),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},g,{children:_}))):t=so("g",eo({className:"".concat(this.getStateClassName()," ").concat(y)},g,{children:_})),t},n.isObserved=!1,n}(Vn),zx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return so(Ob,eo({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(Bx),Ux=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.r,o=t.getNodeStyle();return so(Nb,eo({},o,{x:e,y:n,r:r}))},e}(Bx),Hx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),u={transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")};return so("g",eo({},u,{children:so(Cb,eo({},s,{points:a,x:n,y:r}))}))},e}(Bx),Xx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return so("g",{children:so(Cb,eo({},e,{points:t.points,x:t.x,y:t.y}))})},e}(Bx),Gx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return so(Pb,eo({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(Bx),Wx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,r=t.height,o=t.x,i=t.y,a=eo(eo({},e.background),{x:o,y:i,width:n,height:r});return so(Ob,eo({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return so("g",{children:this.getBackground()})},e}(Bx),Yx=function(t){function e(){var e=t.apply(this,io([],oo(arguments),!1))||this;return e.ref={current:null},e}return to(e,t),Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(t){t.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(t){this.setHtml(t)},e.prototype.shouldUpdate=function(){return(!this.preProperties||this.preProperties!==this.currentProperties)&&(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.height,o=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),so("foreignObject",eo({},i,{x:e-o/2,y:n-r/2,width:o,height:r,ref:this.ref}))},e}(Bx);t.AdjustType=void 0,(Lx=t.AdjustType||(t.AdjustType={})).SOURCE="SOURCE",Lx.TARGET="TARGET";var Vx=function(e){function n(n){var r=e.call(this)||this;r.handleMouseDown=function(t){r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.onDragStart=function(){var t=r.props,e=t.x,n=t.y,o=t.edgeModel,i=o.startPoint,a=o.endPoint,s=o.pointsList;r.oldEdge={startPoint:i,endPoint:a,pointsList:s},r.setState({endX:e,endY:n,dragging:!0})},r.onDragging=function(e){var n=e.deltaX,o=e.deltaY,i=r.state,a=i.endX,s=i.endY,u=r.props,l=u.graphModel,c=u.type,d=l.transformModel,p=l.editConfigModel,h=oo(d.moveCanvasPointByHtml([a,s],n,o),2),f=h[0],v=h[1];r.setState({endX:f,endY:v,dragging:!0});var y=r.props.edgeModel,g=jm({x:a,y:s},l);if(g&&g.node&&r.isAllowAdjust(g).pass){var _=y.startPoint,m=y.endPoint,b=y.sourceNode,x=y.targetNode,E=c===t.AdjustType.SOURCE?{startPoint:{x:g.anchor.x,y:g.anchor.y},endPoint:{x:m.x,y:m.y},sourceNode:g.node,targetNode:x}:{startPoint:{x:_.x,y:_.y},endPoint:{x:g.anchor.x,y:g.anchor.y},sourceNode:b,targetNode:g.node};y.updateAfterAdjustStartAndEnd(E)}else c===t.AdjustType.SOURCE?y.updateStartPoint({x:f,y:v}):y.updateEndPoint({x:f,y:v});y.text.value&&p.adjustEdge&&y.setText(Object.assign({},y.text,y.textPosition))},r.onDragEnd=function(e){var n,o,i,a=e.event;try{r.setState({dragging:!1});var s=r.props,u=s.graphModel,l=s.edgeModel,c=s.type,d=r.state,p=d.endX,h=d.endY,f=d.dragging,v=jm({x:p,y:h},u);if(!f)return;var y=!1,g=void 0;if(v&&v.node){var _=r.isAllowAdjust(v),m=_.pass,b=_.msg,x=_.newTargetNode;if(m){var E=l.getData(),M=E.text,w=E.sourceAnchorId,T=void 0===w?"":w,S=E.targetAnchorId,A=void 0===S?"":S,O=no(E,["text","sourceAnchorId","targetAnchorId"]);if(g=eo(eo({sourceAnchorId:T,targetAnchorId:A},O),{text:(null==M?void 0:M.value)||""}),c===t.AdjustType.SOURCE){var D=u.getNodeModelById(v.node.id),N=u.getNodeModelById(l.targetNodeId),P=null===(n=u.edgeGenerator)||void 0===n?void 0:n.call(u,null==D?void 0:D.getData(),null==N?void 0:N.getData(),g);g=eo(eo({},P),{sourceNodeId:v.node.id,sourceAnchorId:v.anchor.id,startPoint:{x:v.anchor.x,y:v.anchor.y},targetNodeId:l.targetNodeId,endPoint:eo({},l.endPoint)}),l.sourceNodeId===v.node.id&&l.sourceAnchorId===v.anchor.id&&(y=!0)}else if(c===t.AdjustType.TARGET){D=u.getNodeModelById(l.sourceNodeId),N=u.getNodeModelById(v.node.id),P=null===(o=u.edgeGenerator)||void 0===o?void 0:o.call(u,null==D?void 0:D.getData(),null==N?void 0:N.getData(),g);g=eo(eo({},P),{sourceNodeId:l.sourceNodeId,startPoint:eo({},l.startPoint),targetNodeId:v.node.id,targetAnchorId:v.anchor.id,endPoint:{x:v.anchor.x,y:v.anchor.y}}),l.targetNodeId===v.node.id&&l.targetAnchorId===v.anchor.id&&(y=!0)}}else{y=!0;var C=x.getData();u.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:C,msg:b})}}else y=!0;if(y)r.recoveryEdge();else{var I=l.getData();u.deleteEdgeById(l.id);var L=u.addEdge(eo({},g));u.eventCenter.emit(t.EventType.EDGE_EXCHANGE_NODE,{data:{newEdge:L.getData(),oldEdge:I}})}null===(i=r.preTargetNode)||void 0===i||i.setElementState(t.ElementState.DEFAULT)}finally{(u=r.props.graphModel).eventCenter.emit(t.EventType.ADJUST_POINT_DRAGEND,{e:a,data:r.stepDragData})}},r.recoveryEdge=function(){var e=r.props.edgeModel,n=r.oldEdge,o=n.startPoint,i=n.endPoint,a=n.pointsList;e.updateStartPoint(o),e.updateEndPoint(i),e.modelType!==t.ModelType.LINE_EDGE&&(e.pointsList=null!=a?a:[],e.initPoints())},r.getAdjustPointStyle=function(){return r.props.graphModel.theme.edgeAdjust},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var o=n.type,i=n.edgeModel,a=n.graphModel.eventCenter;return r.stepDragData={type:o,edgeData:i.getData()},r.stepDrag=new m_({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:a,data:r.stepDragData}),r}return to(n,e),n.prototype.isAllowAdjust=function(e){var n,r,o,i,a=this.props,s=a.edgeModel,u=s.id,l=s.sourceNode,c=s.targetNode,d=s.sourceAnchorId,p=s.targetAnchorId,h=a.type;if(h===t.AdjustType.SOURCE?(n=e.node,r=c,o=e.anchor,i=c.getAnchorInfo(p)):(n=l,r=e.node,i=e.anchor,o=l.getAnchorInfo(d)),this.preTargetNode&&this.preTargetNode!==e.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),this.preTargetNode=e.node,i.id===o.id)return{pass:!1,msg:"",newTargetNode:r};var f="".concat(n.id,"_").concat(r.id,"_").concat(o.id,"_").concat(i.id);if(!this.targetRuleResults.has(f)){var v=n.isAllowConnectedAsSource(r,o,i,u),y=r.isAllowConnectedAsTarget(n,o,i,u);this.sourceRuleResults.set(f,Qm(v)),this.targetRuleResults.set(f,Qm(y))}var g=this.sourceRuleResults.get(f),_=g.isAllPass,m=g.msg,b=this.targetRuleResults.get(f),x=b.isAllPass,E=b.msg,M=_&&x?t.ElementState.ALLOW_CONNECT:t.ElementState.NOT_ALLOW_CONNECT;return h===t.AdjustType.SOURCE?n.setElementState(M):r.setElementState(M),{pass:_&&x,msg:E||m,newTargetNode:r}},n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.getAdjustPointShape,o=t.edgeModel,i=this.state.dragging;return so("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":r(e,n,o)})},n}(Vn),Fx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,r=e.start,o=e.end,i={start:r,end:o,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=A_(i),s=a.leftX,u=a.leftY,l=a.rightX,c=a.rightY;return eo({d:"M".concat(s," ").concat(u," L").concat(o.x," ").concat(o.y," L").concat(l," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,r=t.stroke;return so(Db,{d:e,fill:t.fill,strokeWidth:n,stroke:r})},e.prototype.render=function(){return so("g",{className:"lf-arrow",children:this.getShape()})},e}(Vn),Kx=function(e){function n(){var n=e.call(this)||this;return n.textRef={current:null},n.handleHover=function(e,r){var o=n.props,i=o.model,a=o.graphModel.eventCenter;i.setHovered(e);var s=e?t.EventType.EDGE_MOUSEENTER:t.EventType.EDGE_MOUSELEAVE,u=i.getData();a.emit(s,{data:u,e:r})},n.setHoverOn=function(t){n.props.model.isHovered||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,t))},n.setHoverOff=function(t){n.props.model.isHovered&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,t))},n.handleContextMenu=function(e){e.preventDefault(),n.contextMenuTime=(new Date).getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,o=r.model,i=r.graphModel,a=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,a.domOverlayPosition),n.toFront(),o.isSelected||i.selectEdgeById(o.id);var s=null==o?void 0:o.getData();i.eventCenter.emit(t.EventType.EDGE_CONTEXTMENU,{data:s,e:e,position:a})},n.handleMouseDown=function(t){t.stopPropagation(),n.startTime=(new Date).getTime()},n.handleMouseUp=function(e){if(n.startTime&&!((new Date).getTime()-n.startTime>200||2===e.button)){var r=2===e.detail,o=n.props,i=o.model,a=o.graphModel,s=null==i?void 0:i.getData(),u=a.getPointByClient({x:e.clientX,y:e.clientY});if(r){var l=a.editConfigModel,c=a.textEditElement,d=i.id,p=i.text,h=i.modelType;if(c&&c.id===d&&a.setElementStateById(d,t.ElementState.DEFAULT),l.edgeTextEdit&&p.editable&&(i.setSelected(!1),a.setElementStateById(d,t.ElementState.TEXT_EDIT)),h===t.ModelType.POLYLINE_EDGE){var f=i,v=a.getPointByClient({x:e.x,y:e.y}).canvasOverlayPosition,y=v.x,g=v.y;f.dbClickPosition=ym({x:y,y:g},f.points)}a.eventCenter.emit(t.EventType.EDGE_DBCLICK,{data:s,e:e,position:u})}else a.eventCenter.emit(t.EventType.ELEMENT_CLICK,{data:s,e:e,position:u}),a.eventCenter.emit(t.EventType.EDGE_CLICK,{data:s,e:e,position:u});var _=a.editConfigModel;a.selectEdgeById(i.id,Tm(e,_)),n.toFront()}},n}return to(n,e),n.prototype.getShape=function(){return so("g",{children:this.getEdge()})},n.prototype.getTextStyle=function(){},n.prototype.getText=function(){var e,n=this.props,r=n.model,o=n.graphModel,i=o.editConfigModel;if(i.edgeTextMode!==t.TextMode.TEXT)return null;if(r.state===t.ElementState.TEXT_EDIT)return null;if(r.text){var a=!1;return i.edgeTextDraggable&&r.text.draggable&&(a=!0),so(Rx,{ref:this.textRef,editable:i.edgeTextEdit&&(null===(e=r.text.editable)||void 0===e||e),model:r,graphModel:o,draggable:a})}return null},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:r}},n.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},n.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},n.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),r=n.refY,o=void 0===r?0:r,i=n.refX,a=void 0===i?2:i,s=oo(this.getLastTwoPoints(),2),u=s[0],l=s[1],c="auto";return null!==u&&null!==l&&(c=Yb(Wb({x:l.x-u.x,y:l.y-u.y,z:0}))),so("g",{children:so("defs",{children:[so("marker",{id:"marker-start-".concat(e),refX:-a,refY:o,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),so("marker",{id:"marker-end-".concat(e),refX:a,refY:o,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},n.prototype.getStartArrow=function(){return so("path",{})},n.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,r=t.offset,o=t.verticalLength;return so("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(r," -").concat(o," L ").concat(r," ").concat(o," Z")})},n.prototype.getAdjustPointShape=function(t,e,n){var r=n.getAdjustPointStyle();return so(Nb,eo({className:"lf-edge-adjust-point"},r,{x:t,y:e}))},n.prototype.getAdjustPoints=function(){var e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.adjustEdgeStartAndEnd,a=o.adjustEdgeStart,s=o.adjustEdgeEnd,u=n.getAdjustStart(),l=n.getAdjustEnd();return so("g",{children:[i&&a&&so(Vx,eo({type:t.AdjustType.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r})),i&&s&&so(Vx,eo({type:t.AdjustType.TARGET},l,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r}))]})},n.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},n.prototype.getAppendWidth=function(){return so("g",{})},n.prototype.getAppend=function(){return so("g",{className:"lf-edge-append",children:this.getAppendWidth()})},n.prototype.getEdge=function(){return null},n.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},n.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,r=t.isShowAdjustPoint;return so("g",{children:[so("g",{className:["lf-edge",!n&&"pointer-none",e&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),r&&e?this.getAdjustPoints():""]})},n.isObserved=!1,n}(Vn),qx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,r=n.path,o=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,d=a.animationDuration,p=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return so(Db,eo({d:r},e,i,o?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:d,animationIterationCount:p,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){return so(Db,{d:this.props.model.path,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,e=this.state.hover,n=t.isSelected,r=t.getArrowStyle().offset,o=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=oo(vm(o,r),2);return{start:i[0],end:i[1],hover:e,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,e=t.getArrowStyle().offset,n=t.pointsList.map((function(t){return{x:t.x,y:t.y}}));return vm(n,e)},e}(Kx),Zx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return to(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isAnimation,o=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,d=a.animationDuration,p=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return so(Ab,eo({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},o,r?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:d,animationIterationCount:p,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=dm({start:e,end:n}),o=r.d,i=r.strokeWidth,a=r.fill,s=r.strokeDasharray;return so(Db,{d:o,fill:a,strokeWidth:i,stroke:r.stroke,strokeDasharray:s})},e}(Kx),$x=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(){var t=n.props.model;t.dragAppendStart(),n.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.props,i=o.model,a=o.graphModel;n.isDragging=!0;var s=a.transformModel,u=a.editConfigModel,l=oo(s.fixDeltaXY(e,r),2),c=l[0],d=l[1],p=i,h=u.adjustEdgeMiddle;n.appendInfo=h?p.dragAppendSimple(n.appendInfo,{x:c,y:d}):p.dragAppend(n.appendInfo,{x:c,y:d})},n.onDragEnd=function(){var e,r=n.props,o=r.model,i=r.graphModel.eventCenter,a=o;a.dragAppendEnd(),n.isDragging=!1,a.isShowAdjustPoint=null!==(e=n.isShowAdjustPointTemp)&&void 0!==e&&e,n.appendInfo=void 0,i.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.beforeDragStart=function(t,e){e.draggable&&n.drag.handleMouseDown(t),n.appendInfo=e},n.drag=new m_({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return to(n,e),n.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,r=t.arrowConfig,o=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,u=i.strokeDashoffset,l=i.animationName,c=i.animationDuration,d=i.animationIterationCount,p=i.animationTimingFunction,h=i.animationDirection;return so(Ib,eo({points:e},o,r,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:u,animationName:l,animationDuration:c,animationIterationCount:d,animationTimingFunction:p,animationDirection:h}}:{}))},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,r=this.state.hover,o=im(e),i=o[0],a=o[0];return o.length>=2&&(i=o[o.length-2],a=o[o.length-1]),{start:i,end:a,hover:r,isSelected:n}},n.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=im(t),n=e[0],r=e[0];return e.length>=2&&(n=e[e.length-2],r=e[e.length-1]),[n,r]},n.prototype.getAppendAttributes=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=A_(eo(eo({},o),{type:"start"})),a=A_(eo(eo({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},n.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,r=e.strokeWidth,o=e.fill,i=e.strokeDasharray;return so(Db,{d:n,fill:o,strokeWidth:r,stroke:e.stroke,strokeDasharray:i})},n.prototype.getAppendWidth=function(){for(var e=this,n=this.props,r=n.model,o=n.graphModel,i=r.pointsList,a=r.draggable,s=[],u=i.length,l=function(n){var r="lf-polyline-append",l={start:{x:i[n].x,y:i[n].y},end:{x:i[n+1].x,y:i[n+1].y},startIndex:n,endIndex:n+1,direction:t.SegmentDirection.HORIZONTAL,draggable:!0},d=so("g",{className:r,children:c.getAppendShape(l)}),p=o.editConfigModel,h=p.adjustEdge,f=p.adjustEdgeMiddle;if(h&&a){var v=l.startIndex,y=l.endIndex,g=f&&(0===v||y===u-1);l.draggable=!g,l.start.x===l.end.x?(l.draggable&&(r+="-ew-resize"),l.direction=t.SegmentDirection.VERTICAL):l.start.y===l.end.y&&(l.draggable&&(r+="-ns-resize"),l.direction=t.SegmentDirection.HORIZONTAL),d=so("g",{className:c.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(t){return e.beforeDragStart(t,l)},children:so("g",{className:r,children:c.getAppendShape(l)})})}s.push(d)},c=this,d=0;d<u-1;d++)l(d);return so("g",{children:s})},n}(Kx),Jx=function(){function e(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(t){n.nodeConfig&&!n.fakeNode&&(n.fakeNode=n.lf.createFakeNode(eo(eo({},n.nodeConfig),n.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(e){if(e.preventDefault(),n.fakeNode){var r=n.clientToLocalPoint({x:e.clientX,y:e.clientY}),o=r.x,i=r.y;n.fakeNode.moveTo(o,i);var a=n.fakeNode.getData();n.lf.setNodeSnapLine(a),n.lf.graphModel.eventCenter.emit(t.EventType.NODE_DND_DRAG,{data:a})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(e){n.lf.graphModel&&e&&n.nodeConfig&&(n.lf.addNode(eo(eo({},n.nodeConfig),n.clientToLocalPoint({x:e.clientX,y:e.clientY})),t.EventType.NODE_DND_ADD,e),e.preventDefault(),e.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return e.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,r=lu(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=o.x,a=o.y;return{x:xm(i,r),y:xm(a,r)}},e.prototype.startDrag=function(t){var e=this.lf.graphModel.editConfigModel;(null==e?void 0:e.isSilentMode)||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},e.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},e}();var Qx=function(e){function n(n){var r=e.call(this,n)||this;return r.ref={current:null},r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(e){var n=r.props.graphModel.textEditElement;"Enter"===e.key&&e.altKey&&(null==n||n.setElementState(t.ElementState.DEFAULT))},r.inputHandler=function(t){var e=t.target.innerText,n=r.props.graphModel.textEditElement;n&&(r.__prevText={type:n.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:n.id})},r.keydownHandler=function(t){t.stopPropagation()},r.state={style:{left:0,top:0}},r}return to(n,e),n.getDerivedStateFromProps=function(e){var n,r,o=e.textEditElement,i=e.graphModel,a=i.transformModel,s=i.theme,u=s.inputText;if(o){if(!(null===(n=o.text)||void 0===n?void 0:n.value)&&o.BaseType===t.ElementType.EDGE){var l=o.text,c=o.textPosition,d=c.x,p=c.y;l.x=d,l.y=p,o.setText(l)}var h={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===t.ElementType.EDGE){var f=s.edgeText,v=f.overflowMode,y=f.lineHeight,g=f.wrapPadding;(m=f.textWidth)&&"autoWrap"===v&&(r=eo(eo({},h),{width:m,minWidth:m,lineHeight:y,padding:g}))}else if(o.BaseType===t.ElementType.NODE){var _=s.nodeText,m=(v=_.overflowMode,y=_.lineHeight,g=_.wrapPadding,_.textWidth),b=o.width,x=o.modelType,E=o.textWidth||m||b;(x!==t.ModelType.TEXT_NODE&&"autoWrap"===v||x===t.ModelType.TEXT_NODE&&m)&&(r=eo(eo({},h),{width:E,minWidth:E,lineHeight:y,padding:g}))}var M=o.text,w=M.x,T=M.y,S=oo(a.CanvasPointToHtmlPoint([w,T]),2),A=S[0],O=S[1];return{style:eo(eo({left:A,top:O},r),u)}}return null},n.prototype.componentDidUpdate=function(){var e=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var n=this.__prevText,r=n.text,o=n.id;e.updateText(o,r),e.eventCenter.emit(t.EventType.TEXT_UPDATE,{data:eo({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},n.prototype.placeCaretAtEnd=function(t){if(void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();null==n||n.removeAllRanges(),null==n||n.addRange(e)}},n.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?so("div",{contentEditable:!0,className:"lf-text-input",style:n,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:null===(t=e.text)||void 0===t?void 0:t.value},e.id):null},n.toolName="text-edit-tool",n=ro([IE],n)}(Vn),tE=function(e){function n(n){var r=e.call(this,n)||this;r.handleMouseDown=function(t){r.stepDrag.handleMouseDown(t)},r.handleWheelEvent=function(t){var e,n;t.preventDefault();var o=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,u=t.ctrlKey,l=new WheelEvent("wheel",{deltaX:o,deltaY:i,clientX:a,clientY:s,ctrlKey:u});null===(n=null===(e=r.props.lf.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===n||n.dispatchEvent(l)},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.graphModel,a=o.lf.getTransform(),s=a.SCALE_X,u=a.SCALE_Y,l=i.getSelectElements(!0);i.moveNodes(l.nodes.map((function(t){return t.id})),e/s,n/u)},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.graphModel,i=n.graphModel,a=i.eventCenter,s=i.selectElements,u=o.getPointByClient({x:e.clientX,y:e.clientY}),l={nodes:[],edges:[]};io([],oo(s.values()),!1).forEach((function(e){e.BaseType===t.ElementType.NODE&&l.nodes.push(e.getData()),e.BaseType===t.ElementType.EDGE&&l.edges.push(e.getData())})),a.emit(t.EventType.SELECTION_CONTEXTMENU,{data:l,e:e,position:u})};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new m_({onDragging:r.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),r}return to(n,e),n.prototype.render=function(){var e,n,r=this.props.graphModel,o=r.selectElements,i=r.transformModel,a=this.props.lf.getTransform(),s=a.SCALE_X,u=a.SCALE_Y;if(!(o.size<=1)){var l=Number.MAX_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER;return o.forEach((function(e){var n;e.BaseType===t.ElementType.NODE&&(n=b_(e)),e.BaseType===t.ElementType.EDGE&&(n=w_(e)),void 0!==n&&(l=Math.min(l,n.x),c=Math.min(c,n.y),d=Math.max(d,n.x1),p=Math.max(p,n.y1))})),e=oo(i.CanvasPointToHtmlPoint([l,c]),2),l=e[0],c=e[1],n=oo(i.CanvasPointToHtmlPoint([d,p]),2),d=n[0],p=n[1],so("div",{className:"lf-multiple-select",style:{left:"".concat(l-20*s/2,"px"),top:"".concat(c-20*u/2,"px"),width:"".concat(d-l+20*s,"px"),height:"".concat(p-c+20*u,"px"),"border-width":"".concat(2*s,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},n.toolName="multiple-select-tool",n=ro([IE],n)}(Vn),eE=[Qx,tE],nE=function(){function e(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,Wp(eE,(function(t){n.isDisabled(t.toolName)||n.registerTool(t.toolName,t)}));var r=e.graphModel;r.eventCenter.on("".concat(t.EventType.GRAPH_TRANSFORM,",").concat(t.EventType.NODE_CLICK,",").concat(t.EventType.BLANK_CLICK," "),(function(){var e,n=r.textEditElement,o=r.editConfigModel,i=o.edgeTextEdit,a=o.nodeTextEdit;(i||a)&&n&&(null===(e=r.textEditElement)||void 0===e||e.setElementState(t.ElementState.DEFAULT))}))}return e.prototype.isDisabled=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},e.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},e.prototype.disableTool=function(t){var e=this.toolMap.get(t);if(e)return this.disabledToolMap.set(t,e),this.toolMap.delete(t),!0;throw new Error("禁用失败,不存在名为 ${tool} 的工具")},e.prototype.enableTool=function(t){var e=this.disabledToolMap.get(t);if(e)return this.toolMap.set(t,e),this.disabledToolMap.delete(t),!0;throw new Error("不存在名为 ${tool} 的工具")},e.prototype.getTools=function(){return Array.from(this.toolMap.values())},e.prototype.getInstance=function(){return this.instance},ro([$],e.prototype,"toolMap",void 0),ro([te],e.prototype,"disableTool",null),ro([te],e.prototype,"enableTool",null),e}();function rE(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var oE=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(oE(Object.getPrototypeOf(t))||[])},iE=function(t){return function(t){var e=oE(t),n=e.filter((function(t,n){return e.indexOf(t)===n}));return n}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},aE="pending",sE="fulfilled",uE="rejected";function lE(t){switch(this.state){case aE:return t.pending&&t.pending(this.value);case uE:return t.rejected&&t.rejected(this.value);case sE:return t.fulfilled?t.fulfilled(this.value):this.value}}function cE(t,e){if(rE(arguments.length<=2,"fromPromise expects up to two arguments"),rE("function"==typeof t||"object"==typeof t&&t&&"function"==typeof t.then,"Please pass a promise or function to fromPromise"),!0===t.isPromiseBasedObservable)return t;"function"==typeof t&&(t=new Promise(t));var n=t;t.then(te("observableFromPromise-resolve",(function(t){n.value=t,n.state=sE})),te("observableFromPromise-reject",(function(t){n.value=t,n.state=uE}))),n.isPromiseBasedObservable=!0,n.case=lE;var r=e&&e.state===sE?e.value:void 0;return de(n,{value:r,state:aE},{},{deep:!1}),n}!function(t){t.reject=te("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=uE,n.value=e,n})),t.resolve=te("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=sE,n.value=e,n}))}(cE||(cE={}));var dE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t,e){var n=this;ee((function(){n.current=e,n.subscription=t.subscribe(n)}))}t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(t){this.current=t},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(t){this.current=t,this.dispose()},dE([$.ref],t.prototype,"current",void 0),dE([te.bound],t.prototype,"next",null),dE([te.bound],t.prototype,"complete",null),dE([te.bound],t.prototype,"error",null)}();var pE=function(){return pE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pE.apply(this,arguments)},hE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},fE=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function vE(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function yE(t){return hn(t)||Je(t)||nn(t)}function gE(t,e){var n=new WeakMap;function r(r){var a=n.get(r.object);!function(t,e){switch(t.type){case"add":o(t.newValue,e,t.name);break;case"update":i(t.oldValue),o(t.newValue,e,t.name||""+t.index);break;case"remove":case"delete":i(t.oldValue);break;case"splice":t.removed.map(i),t.added.forEach((function(n,r){return o(n,e,""+(t.index+r))}));for(var r=t.index+t.addedCount;r<t.object.length;r++)if(yE(t.object[r])){var a=n.get(t.object[r]);a&&(a.path=""+r)}}}(r,a),e(r,vE(a),t)}function o(t,e,i){if(yE(t)){var a=n.get(t);if(a){if(a.parent!==e||a.path!==i)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+vE(e)+"/"+i+"', but it already exists at '"+vE(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:Ne(t,r)};n.set(t,s),Ae(t).forEach((function(t){var e=t[0];return o(t[1],s,e)}))}}}function i(t){if(yE(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Se(t).forEach(i)}}return o(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=$.map({}),this.localComputedValues=$.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},rE(hn(t),"createViewModel expects an observable object"),iE(t).forEach((function(n){if(n!==w&&"__mobxDidRunLazyInitializers"!==n){if(rE(-1===fE.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),Ee(t,n)){var r=vn(t,n).derivation;e.localComputedValues.set(n,rt(r.bind(e)))}var o=Object.getOwnPropertyDescriptor(t,n),i=o?{enumerable:o.enumerable}:{};Object.defineProperty(e,n,pE(pE({},i),{configurable:!0,get:function(){return Ee(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:te((function(t){t!==e.model[n]?e.localValues.set(n,t):e.localValues.delete(n)}))}))}}))}Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var t=this;Te(this.localValues).forEach((function(e){var n=t.localValues.get(e),r=t.model[e];Je(r)?r.replace(n):nn(r)?(r.clear(),r.merge(n)):xe(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},hE([rt],t.prototype,"isDirty",null),hE([rt],t.prototype,"changedValues",null),hE([te.bound],t.prototype,"submit",null),hE([te.bound],t.prototype,"reset",null),hE([te.bound],t.prototype,"resetProperty",null)}();var _E=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r){var o=void 0===r?{}:r,i=o.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=o.keyToName,u=void 0===s?function(t){return""+t}:s,l=t.call(this)||this;l._keyToName=u,l._groupBy=n,l._ogmInfoKey=Symbol("ogmInfo"+a),l._base=e;for(var c=0;c<e.length;c++)l._addItem(e[c]);return l._disposeBaseObserver=Ne(l._base,(function(t){if("splice"===t.type)ke((function(){for(var e=0,n=t.removed;e<n.length;e++){var r=n[e];l._removeItem(r)}for(var o=0,i=t.added;o<i.length;o++){var a=i[o];l._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");ke((function(){l._removeItem(t.oldValue),l._addItem(t.newValue)}))}})),l}_E(e,t),e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(t){throw new Error("not supported")},e.prototype.set=function(t,e){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var t=0;t<this._base.length;t++){var e=this._base[t];e[this._ogmInfoKey].reaction(),delete e[this._ogmInfoKey]}},e.prototype._getGroupArr=function(e){var n=t.prototype.get.call(this,e);return void 0===n&&(n=$([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var r=t.prototype.get.call(this,e);1===r.length?t.prototype.delete.call(this,e):(n===r.length-1||(r[n]=r[r.length-1],r[n][this._ogmInfoKey].groupArrIndex=n),r.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),r=this._getGroupArr(n),o={groupByValue:n,groupArrIndex:r.length,reaction:ae((function(){return e._groupBy(t)}),(function(n,r){var o=t[e._ogmInfoKey];e._removeFromGroupArr(o.groupByValue,o.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),o.groupByValue=n,o.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:o}),r.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(en),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var mE=function(){function e(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return e.prototype.add=function(e){bf(Bp(this.undos),e)||(this.undos.push(e),bf(this.curData,e)||(this.redos=[]),this.eventCenter.emit(t.EventType.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},e.prototype.undoAble=function(){return this.undos.length>1},e.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=sd(e),e}},e.prototype.redoAble=function(){return this.redos.length>0},e.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=sd(t),t}},e.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=gE(t,mp((function(){var n=t.modelToHistoryData();n&&e.add(eo({},n))}),this.waitTime))},e}(),bE={},xE={get exports(){return bE},set exports(t){bE=t}};!function(t){!function(e,n){if(e){for(var r,o={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},u=1;u<20;++u)o[111+u]="f"+u;for(u=0;u<=9;++u)o[u+96]=u.toString();v.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},v.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},v.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},v.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},v.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(f(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},v.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},v.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);r=null},v.init=function(){var t=v(n);for(var e in t)"_"!==e.charAt(0)&&(v[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},v.init(),e.Mousetrap=v,t.exports&&(t.exports=v)}function l(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function c(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return o[t.which]?o[t.which]:i[t.which]?i[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(t,e,n){return n||(n=function(){if(!r)for(var t in r={},o)t>95&&t<112||o.hasOwnProperty(t)&&(r[o[t]]=t);return r}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function h(t,e){var n,r,o,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),o=0;o<n.length;++o)r=n[o],s[r]&&(r=s[r]),e&&"keypress"!=e&&a[r]&&(r=a[r],i.push("shift")),d(r)&&i.push(r);return{key:r,modifiers:i,action:e=p(r,i,e)}}function f(t,e){return null!==t&&t!==n&&(t===e||f(t.parentNode,e))}function v(t){var e=this;if(t=t||n,!(e instanceof v))return new v(t);e.target=t,e._callbacks={},e._directMap={};var r,o={},i=!1,a=!1,s=!1;function u(t){t=t||{};var e,n=!1;for(e in o)t[e]?n=!0:o[e]=0;n||(s=!1)}function p(t,n,r,i,a,s){var u,l,c,p,h=[],f=r.type;if(!e._callbacks[t])return[];for("keyup"==f&&d(t)&&(n=[t]),u=0;u<e._callbacks[t].length;++u)if(l=e._callbacks[t][u],(i||!l.seq||o[l.seq]==l.level)&&f==l.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||(c=n,p=l.modifiers,c.sort().join(",")===p.sort().join(",")))){var v=!i&&l.combo==a,y=i&&l.seq==i&&l.level==s;(v||y)&&e._callbacks[t].splice(u,1),h.push(l)}return h}function f(t,n,r,o){e.stopCallback(n,n.target||n.srcElement,r,o)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function y(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=c(t);n&&("keyup"!=t.type||i!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):i=!1)}function g(t,e,n,a){function l(e){return function(){s=e,++o[t],clearTimeout(r),r=setTimeout(u,1e3)}}function d(e){f(n,e,t),"keyup"!==a&&(i=c(e)),setTimeout(u,10)}o[t]=0;for(var p=0;p<e.length;++p){var v=p+1===e.length?d:l(a||h(e[p+1]).action);_(e[p],v,a,t,p)}}function _(t,n,r,o,i){e._directMap[t+":"+r]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?g(t,s,n,r):(a=h(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],p(a.key,a.modifiers,{type:a.action},o,t,i),e._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:t}))}e._handleKey=function(t,e,n){var r,o=p(t,e,n),i={},l=0,c=!1;for(r=0;r<o.length;++r)o[r].seq&&(l=Math.max(l,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=l)continue;c=!0,i[o[r].seq]=1,f(o[r].callback,n,o[r].combo,o[r].seq)}else c||f(o[r].callback,n,o[r].combo);var h="keypress"==n.type&&a;n.type!=s||d(t)||h||u(i),a=c&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)_(t[r],e,n)},l(t,"keypress",y),l(t,"keydown",y),l(t,"keyup",y)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(xE);var EE=bE,ME=null;function wE(t,e){return t.x+=e,t.y+=e,mf(t.text)||(t.text.x+=e,t.text.y+=e),t}function TE(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach((function(t){t.x+=e,t.y+=e})),mf(t.text)||(t.text.x+=e,t.text.y+=e),t}var SE=40,AE=40;function OE(t,e){var n=t.keyboard,r=n.options.keyboard;n.on(["cmd + c","ctrl + c"],(function(){if(AE=SE,!(null==r?void 0:r.enabled))return!0;if(e.textEditElement)return!0;var n=t.options.guards,o=e.getSelectElements(!1);return!(!n||!n.beforeClone||n.beforeClone(o))||0===o.nodes.length&&0===o.edges.length?(ME=null,!0):((ME=o).nodes.forEach((function(t){return wE(t,SE)})),ME.edges.forEach((function(t){return TE(t,SE)})),!1)})),n.on(["cmd + v","ctrl + v"],(function(){if(!(null==r?void 0:r.enabled))return!0;if(e.textEditElement)return!0;if(ME&&(ME.nodes||ME.edges)){t.clearSelectElements();var n=t.addElements(ME,AE);if(!n)return!0;n.nodes.forEach((function(e){return t.selectElementById(e.id,!0)})),n.edges.forEach((function(e){return t.selectElementById(e.id,!0)})),ME.nodes.forEach((function(t){return wE(t,SE)})),ME.edges.forEach((function(t){return TE(t,SE)})),AE+=SE}return!1})),n.on(["cmd + z","ctrl + z"],(function(){return!(null==r?void 0:r.enabled)||(!!e.textEditElement||(t.undo(),!1))})),n.on(["cmd + y","ctrl + y"],(function(){return!(null==r?void 0:r.enabled)||(!!e.textEditElement||(t.redo(),!1))})),n.on(["backspace"],(function(){if(!(null==r?void 0:r.enabled))return!0;if(e.textEditElement)return!0;var n=e.getSelectElements(!0);return t.clearSelectElements(),n.edges.forEach((function(e){return e.id&&t.deleteEdge(e.id)})),n.nodes.forEach((function(e){return e.id&&t.deleteNode(e.id)})),!1}))}var DE=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new EE(this.target),t.keyboard.enabled&&!e.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var t,e=this,n=(null!==(t=this.options.keyboard)&&void 0!==t?t:{}).shortcuts;if(n)if(Oo(n))n.forEach((function(t){var n=t.keys,r=t.callback,o=t.action;return e.on(n,r,o)}));else{var r=n.keys,o=n.callback,i=n.action;this.on(r,o,i)}},t.prototype.on=function(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)},Object.defineProperty(t.prototype,"disabled",{get:function(){var t,e;return!0!==(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyboard)||void 0===e?void 0:e.enabled)},enumerable:!1,configurable:!0}),t.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},t.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return e.formatKey(t)}))},t.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}(),NE=Symbol("plugin registered by Logicflow.use"),PE=function(){function e(e){var n,r=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return r.viewMap.set(t,e)},this.getView=function(t){return r.viewMap.get(t)};var o=t.Options.get(e),i=o.container,a=o.width,s=o.height;this.options=o,this.container=this.initContainer(i,a,s),this.graphModel=new yx(eo(eo({},o),{container:this.container})),this.plugins=null!==(n=o.plugins)&&void 0!==n?n:[];var u=this.graphModel.eventCenter;this.tool=new nE(this),this.dnd=new Jx({lf:this}),this.history=new mE(u),this.keyboard=new DE({lf:this,keyboard:o.keyboard}),!1!==o.snapline&&(this.snaplineModel=new gx(this.graphModel),function(t,e){t.on("node:mousemove",(function(t){var n=t.data;e.setNodeSnapLine(n)})),t.on("node:mouseup",(function(){e.clearSnapline()}))}(u,this.snaplineModel)),o.isSilentMode||(OE(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return e.prototype.initContainer=function(t,e,n){var r=document.createElement("div");return r.style.position="relative",r.style.width=e?"".concat(e,"px"):"100%",r.style.height=n?"".concat(n,"px"):"100%",t.innerHTML="",t.appendChild(r),r},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var r={BaseEdge:Kx,BaseEdgeModel:tx,BaseNode:Bx,BaseNodeModel:ox,RectNode:zx,RectNodeModel:lx,CircleNode:Ux,CircleNodeModel:ix,PolygonNode:Hx,PolygonNodeModel:ux,TextNode:Wx,TextNodeModel:cx,LineEdge:Zx,LineEdgeModel:nx,DiamondNode:Xx,DiamondNodeModel:ax,PolylineEdge:$x,PolylineEdgeModel:rx,BezierEdge:qx,BezierEdgeModel:ex,EllipseNode:Gx,EllipseNodeModel:sx,HtmlNode:Yx,HtmlNodeModel:dx,h:Xn,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),e){var o=e(r),i=o.view,a=o.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=IE(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},e.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=IE(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},e.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),Wp(t,(function(t){e.registerElement(t)}))},e.prototype.defaultRegister=function(){var t=[{type:"rect",view:zx,model:lx},{type:"circle",view:Ux,model:ix},{type:"polygon",view:Hx,model:ux},{type:"text",view:Wx,model:cx},{type:"ellipse",view:Gx,model:sx},{type:"diamond",view:Xx,model:ax},{type:"html",view:Yx,model:dx},{type:"line",view:Zx,model:nx},{type:"polyline",view:$x,model:rx},{type:"bezier",view:qx,model:ex}];this.batchRegister(t)},e.prototype.addNode=function(e,n,r){return void 0===n&&(n=t.EventType.NODE_ADD),this.graphModel.addNode(e,n,r)},e.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteNode(t),o},e.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var r=this.options.guards;if(!(null==r?void 0:r.beforeClone)||r.beforeClone(n))return this.graphModel.cloneNode(t)}},e.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},e.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},e.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},e.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},e.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},e.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},e.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},e.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},e.prototype.createFakeNode=function(t){var e=this.graphModel.modelMap.get(t.type);if(!e)return console.warn("不存在为".concat(t.type,"类型的节点")),null;var n=new e(eo(eo({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},e.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},e.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},e.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},e.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},e.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},e.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},e.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},e.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,r=[],o=this.graphModel.edges;return e&&n?Wp(o,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&r.push(t)})):e?Wp(o,(function(t){t.sourceNodeId===e&&r.push(t)})):n&&Wp(o,(function(t){t.targetNodeId===n&&r.push(t)})),r},e.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},e.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},e.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteEdgeById(t),o},e.prototype.deleteEdgeByNodeId=function(t){var e=t.sourceNodeId,n=t.targetNodeId;e&&n?this.graphModel.deleteEdgeBySourceAndTarget(e,n):e?this.graphModel.deleteEdgeBySource(e):n&&this.graphModel.deleteEdgeByTarget(n)},e.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},e.prototype.addElements=function(t,e){var n=this,r=t.nodes,o=t.edges;void 0===e&&(e=40),console.log("distance",e);var i={},a={nodes:[],edges:[]};return Wp(r,(function(t){var e=t.id,r=n.addNode(t);e&&(i[e]=r.id),a.nodes.push(r)})),Wp(o,(function(t){var e=t.sourceNodeId,r=t.targetNodeId;i[e]&&(e=i[e]),i[r]&&(r=i[r]);var o=n.graphModel.addEdge(eo(eo({},t),{sourceNodeId:e,targetNodeId:r}));a.edges.push(o)})),a},e.prototype.selectElementById=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),this.graphModel.selectElementById(t,e),!e&&n&&this.graphModel.toFront(t)},e.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},e.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},e.prototype.getModelById=function(t){return this.graphModel.getElement(t)},e.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},e.prototype.deleteElement=function(e){var n,r,o,i=this.getModelById(e);return!!i&&(null!==(o=null===(r=((n={})[t.ElementType.NODE]=this.deleteNode,n[t.ElementType.EDGE]=this.deleteEdge,n)[i.BaseType])||void 0===r?void 0:r.call(this,e))&&void 0!==o&&o)},e.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},e.prototype.getAreaElement=function(t,e,n,r,o){return void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.graphModel.getAreaElement(t,e,n,r,o).map((function(t){return t.getData()}))},e.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(c_(e))},e.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},e.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},e.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},e.prototype.editText=function(t){this.graphModel.editText(t)},e.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},e.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,r=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&r.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},e.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},e.prototype.setTheme=function(t){this.graphModel.setTheme(t)},e.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var r=n.getData();e={x:r.x,y:r.y}}var o=this.getEdgeModelById(t);if(o){var i=o.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},e.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,r=e.width,o=e.height,i=t.x,a=t.y;n.focusOn(i,a,r,o)},e.prototype.focusOn=function(t){if("string"==typeof t)this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var e=t.id,n=t.coordinate;e&&this.focusByElement(e),n&&this.focusByCoordinate(n)}},e.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},e.prototype.toFront=function(t){this.graphModel.toFront(t)},e.prototype.getPointByClient=function(t,e){return"object"==typeof t?this.graphModel.getPointByClient(t):"number"==typeof e?this.graphModel.getPointByClient({x:t,y:e}):void 0},e.prototype.getGraphData=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,io([n],oo(t),!1)):n},e.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},e.prototype.clearData=function(){this.graphModel.clearData()},e.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(c_(e)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),dr(t,e),"function"==typeof n&&n(),t&&t.__c}(so(Dx,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(t.EventType.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},e.prototype.render=function(t){var e=sd(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},e.prototype.undo=function(){if(this.history.undoAble()){var t=c_(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.redo=function(){if(this.history.redoAble()){var t=c_(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},e.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},e.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},e.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},e.prototype.getTransform=function(){var t=this.graphModel.transformModel;return{SCALE_X:t.SCALE_X,SCALE_Y:t.SCALE_Y,TRANSLATE_X:t.TRANSLATE_X,TRANSLATE_Y:t.TRANSLATE_Y}},e.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},e.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},e.prototype.translateCenter=function(){this.graphModel.translateCenter()},e.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},e.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},e.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},e.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},e.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},e.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},e.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},e.use=function(t,e){var n,r=t.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,((n={})[NE]=NE,n.extension=t,n.props=e,n))},e.prototype.installPlugins=function(t){var n=this;void 0===t&&(t=[]);var r=Array.from(e.extensions,(function(t){return oo(t,2)[1]}));Wp(io(io([],oo(this.plugins),!1),oo(r),!1),(function(e){var r,o;NE in e?(r=e.extension,o=e.props):r=e;var i=null==r?void 0:r.pluginName;-1===Vh(t,i)&&n.installPlugin(r,o)}))},e.prototype.installPlugin=function(t,n){var r,o;if("pluginName"in t&&"install"in t){var i=t.pluginName,a=t.install,s=t.render;i&&(a&&a.call(t,this,e),s&&this.components.push(s.bind(t)),this.extension[i]=t)}else{var u=t,l=u.pluginName,c=new u({lf:this,LogicFlow:e,props:n,options:null!==(o=null===(r=this.options.pluginsOptions)||void 0===r?void 0:r[l])&&void 0!==o?o:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[l]=c}},e.extensions=new Map,e}();!function(t){t.toStringTag="LF.".concat(t.name)}(PE||(PE={}));var CE=PE;function IE(t){return o.observer(t)}t.AdjustPoint=Vx,t.Arrow=Fx,t.BaseEdge=Kx,t.BaseEdgeModel=tx,t.BaseNode=Bx,t.BaseNodeModel=ox,t.BaseText=kx,t.BezierEdge=qx,t.BezierEdgeModel=ex,t.Circle=Nb,t.CircleNode=Ux,t.CircleNodeModel=ix,t.Component=Vn,t.DEFAULT_GRID_SIZE=10,t.DEFAULT_VISIBLE_SPACE=__,t.DiamondNode=Xx,t.DiamondNodeModel=ax,t.ELEMENT_MAX_Z_INDEX=9999,t.EditConfigModel=fx,t.Ellipse=Pb,t.EllipseNode=Gx,t.EllipseNodeModel=sx,t.EventEmitter=vx,t.GraphModel=yx,t.HtmlNode=Yx,t.HtmlNodeModel=dx,t.Keyboard=DE,t.Line=Ab,t.LineEdge=Zx,t.LineEdgeModel=nx,t.LineText=Rx,t.LogicFlow=CE,t.LogicFlowUtil=Qb,t.Matrix=Nm,t.Path=Db,t.Point=Dm,t.Polygon=Cb,t.PolygonNode=Hx,t.PolygonNodeModel=ux,t.Polyline=Ib,t.PolylineEdge=$x,t.PolylineEdgeModel=rx,t.Rect=Ob,t.RectNode=zx,t.RectNodeModel=lx,t.RotateMatrix=Pm,t.ScaleMatrix=Cm,t.SnaplineModel=gx,t.StepDrag=m_,t.Text=Tb,t.TextNode=Wx,t.TextNodeModel=cx,t.Tool=nE,t.TransformModel=mx,t.TranslateMatrix=Im,t.Vector=Om,t.action=te,t.cancelRaf=wb,t.computed=rt,t.configure=ce,t.costByPoints=G_,t.createEdgeGenerator=mm,t.createRaf=Mb,t.createRef=Wn,t.createUuid=bb,t.default=CE,t.defaultAnimationOffConfig=i_,t.defaultAnimationOnConfig=a_,t.defaultTheme=Vb,t.degrees=Yb,t.distance=Bm,t.estimateDistance=X_,t.filterRepeatPoints=N_,t.formatAnchorConnectValidateData=Qm,t.formatData=c_,t.getAnchors=Lm,t.getAppendAttributes=dm,t.getBBoxCrossPointsByPoint=H_,t.getBBoxOfPoints=k_,t.getBBoxXCrossPoints=z_,t.getBBoxYCrossPoints=U_,t.getBezierControlPoints=pm,t.getBezierOutline=M_,t.getBezierPoints=hm,t.getBoxByOriginNode=$_,t.getBytesLength=um,t.getClosestAnchor=Rm,t.getClosestPointOfPolyline=ym,t.getClosestRadiusCenter=Gm,t.getCrossPointInRect=rm,t.getCrossPointOfLine=T_,t.getCrossPointWithCircle=Wm,t.getCrossPointWithEllipse=Fm,t.getCrossPointWithPolygon=Km,t.getEdgeOutline=w_,t.getEndTangent=vm,t.getExpandedBBox=C_,t.getExpandedBBoxPoint=L_,t.getGridOffset=Em,t.getHtmlTextHeight=$m,t.getLineOutline=x_,t.getLongestEdge=tm,t.getMinIndex=Jb,t.getNextNeighborPoints=q_,t.getNodeAnchorPosition=Zm,t.getNodeBBox=Hm,t.getNodeOutline=b_,t.getPointsFromBBox=R_,t.getPolylineOutline=E_,t.getPolylinePoints=Q_,t.getRectRadiusCircle=Xm,t.getSimplePoints=am,t.getSimplePolyline=P_,t.getSvgTextSize=bm,t.getSvgTextWidthHeight=Jm,t.getTextWidth=cm,t.getThetaOfVector=Wb,t.getVerticalPointOfLine=A_,t.getZIndex=$b,t.h=Xn,t.handleResize=zb,t.heuristicCostEstimate=W_,t.inStraightLineOfRect=Vm,t.initDefaultShortcut=OE,t.isBboxOverLapping=D_,t.isIe=l_,t.isInNode=zm,t.isInNodeBbox=Um,t.isInSegment=S_,t.isMultipleSelect=Tm,t.isObservable=we,t.isPointInArea=wm,t.isPointOutsideBBox=B_,t.isSegmentCrossingBBox=K_,t.isSegmentsCrossNode=nm,t.isSegmentsInNode=em,t.isSegmentsIntersected=F_,t.mergeBBox=j_,t.normalizePolygon=Mm,t.observable=$,t.observer=IE,t.pathFinder=Z_,t.pickEdgeConfig=gm,t.pickNodeConfig=qm,t.pointDirection=I_,t.pointEdgeDirection=Ym,t.pointFilter=J_,t.points2PointsList=im,t.reaction=ae,t.rebuildPath=Y_,t.recalcResizeInfo=kb,t.refreshGraphId=xb,t.removeClosePointFromOpenList=V_,t.renderHtmlText=Sb,t.sampleCubic=Xb,t.segmentDirection=om,t.setupAnimation=s_,t.setupEdgeModel=O_,t.setupTheme=Fb,t.snapToGrid=xm,t.targetNodeInfo=jm,t.toJS=Le,t.transformEdgeData=function(t,e){var n=t.startPoint,r=t.endPoint,o=t.pointsList,i=t.text,a=no(t,["startPoint","endPoint","pointsList","text"]);a.id="";var s={x:n.x+e,y:n.y+e},u={x:r.x+e,y:r.y+e},l=xh(o,(function(t){return{x:t.x+e,y:t.y+e}})),c=i?eo(eo({},i),{x:i.x+e,y:i.y+e}):void 0;return eo(eo({},a),{startPoint:s,endPoint:u,pointsList:l,text:c})},t.transformNodeData=function(t,e){var n=t.x,r=t.y,o=t.text,i=o?{x:o.x+e,y:o.y+e,value:o.value}:void 0;return eo(eo({},t),{id:"",x:n+e,y:r+e,text:i})},t.translateEdgeData=TE,t.translateNodeData=wE,t.triggerResizeEvent=Bb,t.twoPointDistance=_m,t.updateAnimation=u_,t.updateEdgePointByAnchors=Rb,t.updateTheme=Kb,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
26
32
|
//# sourceMappingURL=index.min.js.map
|