@mdesignable/core 1.0.0-beta.64
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/LICENSE.md +20 -0
- package/README.md +1 -0
- package/dist/designable.core.umd.production.js +10 -0
- package/dist/designable.core.umd.production.min.js +23505 -0
- package/esm/drivers/DragDropDriver.d.ts +14 -0
- package/esm/drivers/DragDropDriver.js +157 -0
- package/esm/drivers/KeyboardDriver.d.ts +7 -0
- package/esm/drivers/KeyboardDriver.js +90 -0
- package/esm/drivers/MouseClickDriver.d.ts +8 -0
- package/esm/drivers/MouseClickDriver.js +95 -0
- package/esm/drivers/MouseMoveDriver.d.ts +8 -0
- package/esm/drivers/MouseMoveDriver.js +75 -0
- package/esm/drivers/ViewportResizeDriver.d.ts +10 -0
- package/esm/drivers/ViewportResizeDriver.js +95 -0
- package/esm/drivers/ViewportScrollDriver.d.ts +8 -0
- package/esm/drivers/ViewportScrollDriver.js +74 -0
- package/esm/drivers/index.d.ts +6 -0
- package/esm/drivers/index.js +6 -0
- package/esm/effects/index.d.ts +11 -0
- package/esm/effects/index.js +11 -0
- package/esm/effects/useAutoScrollEffect.d.ts +2 -0
- package/esm/effects/useAutoScrollEffect.js +65 -0
- package/esm/effects/useContentEditableEffect.d.ts +2 -0
- package/esm/effects/useContentEditableEffect.js +167 -0
- package/esm/effects/useCursorEffect.d.ts +2 -0
- package/esm/effects/useCursorEffect.js +55 -0
- package/esm/effects/useDragDropEffect.d.ts +2 -0
- package/esm/effects/useDragDropEffect.js +168 -0
- package/esm/effects/useFreeSelectionEffect.d.ts +2 -0
- package/esm/effects/useFreeSelectionEffect.js +59 -0
- package/esm/effects/useKeyboardEffect.d.ts +2 -0
- package/esm/effects/useKeyboardEffect.js +17 -0
- package/esm/effects/useResizeEffect.d.ts +2 -0
- package/esm/effects/useResizeEffect.js +80 -0
- package/esm/effects/useSelectionEffect.d.ts +2 -0
- package/esm/effects/useSelectionEffect.js +68 -0
- package/esm/effects/useTranslateEffect.d.ts +2 -0
- package/esm/effects/useTranslateEffect.js +58 -0
- package/esm/effects/useViewportEffect.d.ts +2 -0
- package/esm/effects/useViewportEffect.js +31 -0
- package/esm/effects/useWorkspaceEffect.d.ts +2 -0
- package/esm/effects/useWorkspaceEffect.js +29 -0
- package/esm/events/cursor/AbstractCursorEvent.d.ts +21 -0
- package/esm/events/cursor/AbstractCursorEvent.js +40 -0
- package/esm/events/cursor/DragMoveEvent.d.ts +5 -0
- package/esm/events/cursor/DragMoveEvent.js +51 -0
- package/esm/events/cursor/DragStartEvent.d.ts +5 -0
- package/esm/events/cursor/DragStartEvent.js +51 -0
- package/esm/events/cursor/DragStopEvent.d.ts +5 -0
- package/esm/events/cursor/DragStopEvent.js +51 -0
- package/esm/events/cursor/MouseClickEvent.d.ts +8 -0
- package/esm/events/cursor/MouseClickEvent.js +61 -0
- package/esm/events/cursor/MouseMoveEvent.d.ts +5 -0
- package/esm/events/cursor/MouseMoveEvent.js +51 -0
- package/esm/events/cursor/index.d.ts +5 -0
- package/esm/events/cursor/index.js +5 -0
- package/esm/events/history/AbstractHistoryEvent.d.ts +6 -0
- package/esm/events/history/AbstractHistoryEvent.js +7 -0
- package/esm/events/history/HistoryGotoEvent.d.ts +5 -0
- package/esm/events/history/HistoryGotoEvent.js +51 -0
- package/esm/events/history/HistoryPushEvent.d.ts +5 -0
- package/esm/events/history/HistoryPushEvent.js +51 -0
- package/esm/events/history/HistoryRedoEvent.d.ts +5 -0
- package/esm/events/history/HistoryRedoEvent.js +51 -0
- package/esm/events/history/HistoryUndoEvent.d.ts +5 -0
- package/esm/events/history/HistoryUndoEvent.js +51 -0
- package/esm/events/history/index.d.ts +4 -0
- package/esm/events/history/index.js +4 -0
- package/esm/events/index.d.ts +6 -0
- package/esm/events/index.js +6 -0
- package/esm/events/keyboard/AbstractKeyboardEvent.d.ts +15 -0
- package/esm/events/keyboard/AbstractKeyboardEvent.js +61 -0
- package/esm/events/keyboard/KeyDownEvent.d.ts +5 -0
- package/esm/events/keyboard/KeyDownEvent.js +51 -0
- package/esm/events/keyboard/KeyUpEvent.d.ts +5 -0
- package/esm/events/keyboard/KeyUpEvent.js +51 -0
- package/esm/events/keyboard/index.d.ts +2 -0
- package/esm/events/keyboard/index.js +2 -0
- package/esm/events/mutation/AbstractMutationNodeEvent.d.ts +13 -0
- package/esm/events/mutation/AbstractMutationNodeEvent.js +7 -0
- package/esm/events/mutation/AppendNodeEvent.d.ts +5 -0
- package/esm/events/mutation/AppendNodeEvent.js +51 -0
- package/esm/events/mutation/CloneNodeEvent.d.ts +5 -0
- package/esm/events/mutation/CloneNodeEvent.js +51 -0
- package/esm/events/mutation/DragNodeEvent.d.ts +5 -0
- package/esm/events/mutation/DragNodeEvent.js +51 -0
- package/esm/events/mutation/DropNodeEvent.d.ts +5 -0
- package/esm/events/mutation/DropNodeEvent.js +51 -0
- package/esm/events/mutation/FromNodeEvent.d.ts +13 -0
- package/esm/events/mutation/FromNodeEvent.js +8 -0
- package/esm/events/mutation/HoverNodeEvent.d.ts +5 -0
- package/esm/events/mutation/HoverNodeEvent.js +51 -0
- package/esm/events/mutation/InsertAfterEvent.d.ts +5 -0
- package/esm/events/mutation/InsertAfterEvent.js +51 -0
- package/esm/events/mutation/InsertBeforeEvent.d.ts +5 -0
- package/esm/events/mutation/InsertBeforeEvent.js +51 -0
- package/esm/events/mutation/InsertChildrenEvent.d.ts +5 -0
- package/esm/events/mutation/InsertChildrenEvent.js +51 -0
- package/esm/events/mutation/PrependNodeEvent.d.ts +5 -0
- package/esm/events/mutation/PrependNodeEvent.js +51 -0
- package/esm/events/mutation/RemoveNodeEvent.d.ts +5 -0
- package/esm/events/mutation/RemoveNodeEvent.js +51 -0
- package/esm/events/mutation/SelectNodeEvent.d.ts +5 -0
- package/esm/events/mutation/SelectNodeEvent.js +51 -0
- package/esm/events/mutation/UnSelectNodeEvent.d.ts +5 -0
- package/esm/events/mutation/UnSelectNodeEvent.js +51 -0
- package/esm/events/mutation/UpdateChildrenEvent.d.ts +5 -0
- package/esm/events/mutation/UpdateChildrenEvent.js +51 -0
- package/esm/events/mutation/UpdateNodePropsEvent.d.ts +5 -0
- package/esm/events/mutation/UpdateNodePropsEvent.js +51 -0
- package/esm/events/mutation/UserSelectNodeEvent.d.ts +5 -0
- package/esm/events/mutation/UserSelectNodeEvent.js +51 -0
- package/esm/events/mutation/WrapNodeEvent.d.ts +5 -0
- package/esm/events/mutation/WrapNodeEvent.js +51 -0
- package/esm/events/mutation/index.d.ts +16 -0
- package/esm/events/mutation/index.js +16 -0
- package/esm/events/viewport/AbstractViewportEvent.d.ts +16 -0
- package/esm/events/viewport/AbstractViewportEvent.js +17 -0
- package/esm/events/viewport/ViewportResizeEvent.d.ts +5 -0
- package/esm/events/viewport/ViewportResizeEvent.js +51 -0
- package/esm/events/viewport/ViewportScrollEvent.d.ts +5 -0
- package/esm/events/viewport/ViewportScrollEvent.js +51 -0
- package/esm/events/viewport/index.d.ts +2 -0
- package/esm/events/viewport/index.js +2 -0
- package/esm/events/workbench/AbstractWorkspaceEvent.d.ts +7 -0
- package/esm/events/workbench/AbstractWorkspaceEvent.js +7 -0
- package/esm/events/workbench/AddWorkspaceEvent.d.ts +5 -0
- package/esm/events/workbench/AddWorkspaceEvent.js +51 -0
- package/esm/events/workbench/RemoveWorkspaceEvent.d.ts +5 -0
- package/esm/events/workbench/RemoveWorkspaceEvent.js +51 -0
- package/esm/events/workbench/SwitchWorkspaceEvent.d.ts +5 -0
- package/esm/events/workbench/SwitchWorkspaceEvent.js +51 -0
- package/esm/events/workbench/index.d.ts +3 -0
- package/esm/events/workbench/index.js +3 -0
- package/esm/exports.d.ts +5 -0
- package/esm/exports.js +5 -0
- package/esm/externals.d.ts +12 -0
- package/esm/externals.js +113 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +24 -0
- package/esm/internals.d.ts +3 -0
- package/esm/internals.js +34 -0
- package/esm/models/Cursor.d.ts +60 -0
- package/esm/models/Cursor.js +151 -0
- package/esm/models/Engine.d.ts +29 -0
- package/esm/models/Engine.js +112 -0
- package/esm/models/History.d.ts +34 -0
- package/esm/models/History.js +110 -0
- package/esm/models/Hover.d.ts +14 -0
- package/esm/models/Hover.js +38 -0
- package/esm/models/Keyboard.d.ts +29 -0
- package/esm/models/Keyboard.js +126 -0
- package/esm/models/MoveHelper.d.ts +66 -0
- package/esm/models/MoveHelper.js +363 -0
- package/esm/models/Operation.d.ts +29 -0
- package/esm/models/Operation.js +75 -0
- package/esm/models/Screen.d.ts +31 -0
- package/esm/models/Screen.js +73 -0
- package/esm/models/Selection.d.ts +29 -0
- package/esm/models/Selection.js +192 -0
- package/esm/models/Shortcut.d.ts +20 -0
- package/esm/models/Shortcut.js +69 -0
- package/esm/models/SnapLine.d.ts +27 -0
- package/esm/models/SnapLine.js +141 -0
- package/esm/models/SpaceBlock.d.ts +40 -0
- package/esm/models/SpaceBlock.js +171 -0
- package/esm/models/TransformHelper.d.ts +80 -0
- package/esm/models/TransformHelper.js +601 -0
- package/esm/models/TreeNode.d.ts +115 -0
- package/esm/models/TreeNode.js +932 -0
- package/esm/models/Viewport.d.ts +90 -0
- package/esm/models/Viewport.js +474 -0
- package/esm/models/Workbench.d.ts +23 -0
- package/esm/models/Workbench.js +98 -0
- package/esm/models/Workspace.d.ts +41 -0
- package/esm/models/Workspace.js +95 -0
- package/esm/models/index.d.ts +13 -0
- package/esm/models/index.js +13 -0
- package/esm/presets.d.ts +4 -0
- package/esm/presets.js +38 -0
- package/esm/registry.d.ts +16 -0
- package/esm/registry.js +123 -0
- package/esm/shortcuts/CursorSwitch.d.ts +2 -0
- package/esm/shortcuts/CursorSwitch.js +10 -0
- package/esm/shortcuts/MultiSelection.d.ts +5 -0
- package/esm/shortcuts/MultiSelection.js +27 -0
- package/esm/shortcuts/NodeMutation.d.ts +7 -0
- package/esm/shortcuts/NodeMutation.js +40 -0
- package/esm/shortcuts/QuickSelection.d.ts +3 -0
- package/esm/shortcuts/QuickSelection.js +85 -0
- package/esm/shortcuts/UndoRedo.d.ts +3 -0
- package/esm/shortcuts/UndoRedo.js +27 -0
- package/esm/shortcuts/index.d.ts +5 -0
- package/esm/shortcuts/index.js +5 -0
- package/esm/types.d.ts +131 -0
- package/esm/types.js +1 -0
- package/lib/drivers/DragDropDriver.d.ts +14 -0
- package/lib/drivers/DragDropDriver.js +160 -0
- package/lib/drivers/KeyboardDriver.d.ts +7 -0
- package/lib/drivers/KeyboardDriver.js +93 -0
- package/lib/drivers/MouseClickDriver.d.ts +8 -0
- package/lib/drivers/MouseClickDriver.js +98 -0
- package/lib/drivers/MouseMoveDriver.d.ts +8 -0
- package/lib/drivers/MouseMoveDriver.js +78 -0
- package/lib/drivers/ViewportResizeDriver.d.ts +10 -0
- package/lib/drivers/ViewportResizeDriver.js +98 -0
- package/lib/drivers/ViewportScrollDriver.d.ts +8 -0
- package/lib/drivers/ViewportScrollDriver.js +77 -0
- package/lib/drivers/index.d.ts +6 -0
- package/lib/drivers/index.js +22 -0
- package/lib/effects/index.d.ts +11 -0
- package/lib/effects/index.js +27 -0
- package/lib/effects/useAutoScrollEffect.d.ts +2 -0
- package/lib/effects/useAutoScrollEffect.js +69 -0
- package/lib/effects/useContentEditableEffect.d.ts +2 -0
- package/lib/effects/useContentEditableEffect.js +171 -0
- package/lib/effects/useCursorEffect.d.ts +2 -0
- package/lib/effects/useCursorEffect.js +59 -0
- package/lib/effects/useDragDropEffect.d.ts +2 -0
- package/lib/effects/useDragDropEffect.js +172 -0
- package/lib/effects/useFreeSelectionEffect.d.ts +2 -0
- package/lib/effects/useFreeSelectionEffect.js +63 -0
- package/lib/effects/useKeyboardEffect.d.ts +2 -0
- package/lib/effects/useKeyboardEffect.js +21 -0
- package/lib/effects/useResizeEffect.d.ts +2 -0
- package/lib/effects/useResizeEffect.js +84 -0
- package/lib/effects/useSelectionEffect.d.ts +2 -0
- package/lib/effects/useSelectionEffect.js +72 -0
- package/lib/effects/useTranslateEffect.d.ts +2 -0
- package/lib/effects/useTranslateEffect.js +62 -0
- package/lib/effects/useViewportEffect.d.ts +2 -0
- package/lib/effects/useViewportEffect.js +35 -0
- package/lib/effects/useWorkspaceEffect.d.ts +2 -0
- package/lib/effects/useWorkspaceEffect.js +33 -0
- package/lib/events/cursor/AbstractCursorEvent.d.ts +21 -0
- package/lib/events/cursor/AbstractCursorEvent.js +43 -0
- package/lib/events/cursor/DragMoveEvent.d.ts +5 -0
- package/lib/events/cursor/DragMoveEvent.js +54 -0
- package/lib/events/cursor/DragStartEvent.d.ts +5 -0
- package/lib/events/cursor/DragStartEvent.js +54 -0
- package/lib/events/cursor/DragStopEvent.d.ts +5 -0
- package/lib/events/cursor/DragStopEvent.js +54 -0
- package/lib/events/cursor/MouseClickEvent.d.ts +8 -0
- package/lib/events/cursor/MouseClickEvent.js +64 -0
- package/lib/events/cursor/MouseMoveEvent.d.ts +5 -0
- package/lib/events/cursor/MouseMoveEvent.js +54 -0
- package/lib/events/cursor/index.d.ts +5 -0
- package/lib/events/cursor/index.js +21 -0
- package/lib/events/history/AbstractHistoryEvent.d.ts +6 -0
- package/lib/events/history/AbstractHistoryEvent.js +10 -0
- package/lib/events/history/HistoryGotoEvent.d.ts +5 -0
- package/lib/events/history/HistoryGotoEvent.js +54 -0
- package/lib/events/history/HistoryPushEvent.d.ts +5 -0
- package/lib/events/history/HistoryPushEvent.js +54 -0
- package/lib/events/history/HistoryRedoEvent.d.ts +5 -0
- package/lib/events/history/HistoryRedoEvent.js +54 -0
- package/lib/events/history/HistoryUndoEvent.d.ts +5 -0
- package/lib/events/history/HistoryUndoEvent.js +54 -0
- package/lib/events/history/index.d.ts +4 -0
- package/lib/events/history/index.js +20 -0
- package/lib/events/index.d.ts +6 -0
- package/lib/events/index.js +22 -0
- package/lib/events/keyboard/AbstractKeyboardEvent.d.ts +15 -0
- package/lib/events/keyboard/AbstractKeyboardEvent.js +64 -0
- package/lib/events/keyboard/KeyDownEvent.d.ts +5 -0
- package/lib/events/keyboard/KeyDownEvent.js +54 -0
- package/lib/events/keyboard/KeyUpEvent.d.ts +5 -0
- package/lib/events/keyboard/KeyUpEvent.js +54 -0
- package/lib/events/keyboard/index.d.ts +2 -0
- package/lib/events/keyboard/index.js +18 -0
- package/lib/events/mutation/AbstractMutationNodeEvent.d.ts +13 -0
- package/lib/events/mutation/AbstractMutationNodeEvent.js +10 -0
- package/lib/events/mutation/AppendNodeEvent.d.ts +5 -0
- package/lib/events/mutation/AppendNodeEvent.js +54 -0
- package/lib/events/mutation/CloneNodeEvent.d.ts +5 -0
- package/lib/events/mutation/CloneNodeEvent.js +54 -0
- package/lib/events/mutation/DragNodeEvent.d.ts +5 -0
- package/lib/events/mutation/DragNodeEvent.js +54 -0
- package/lib/events/mutation/DropNodeEvent.d.ts +5 -0
- package/lib/events/mutation/DropNodeEvent.js +54 -0
- package/lib/events/mutation/FromNodeEvent.d.ts +13 -0
- package/lib/events/mutation/FromNodeEvent.js +11 -0
- package/lib/events/mutation/HoverNodeEvent.d.ts +5 -0
- package/lib/events/mutation/HoverNodeEvent.js +54 -0
- package/lib/events/mutation/InsertAfterEvent.d.ts +5 -0
- package/lib/events/mutation/InsertAfterEvent.js +54 -0
- package/lib/events/mutation/InsertBeforeEvent.d.ts +5 -0
- package/lib/events/mutation/InsertBeforeEvent.js +54 -0
- package/lib/events/mutation/InsertChildrenEvent.d.ts +5 -0
- package/lib/events/mutation/InsertChildrenEvent.js +54 -0
- package/lib/events/mutation/PrependNodeEvent.d.ts +5 -0
- package/lib/events/mutation/PrependNodeEvent.js +54 -0
- package/lib/events/mutation/RemoveNodeEvent.d.ts +5 -0
- package/lib/events/mutation/RemoveNodeEvent.js +54 -0
- package/lib/events/mutation/SelectNodeEvent.d.ts +5 -0
- package/lib/events/mutation/SelectNodeEvent.js +54 -0
- package/lib/events/mutation/UnSelectNodeEvent.d.ts +5 -0
- package/lib/events/mutation/UnSelectNodeEvent.js +54 -0
- package/lib/events/mutation/UpdateChildrenEvent.d.ts +5 -0
- package/lib/events/mutation/UpdateChildrenEvent.js +54 -0
- package/lib/events/mutation/UpdateNodePropsEvent.d.ts +5 -0
- package/lib/events/mutation/UpdateNodePropsEvent.js +54 -0
- package/lib/events/mutation/UserSelectNodeEvent.d.ts +5 -0
- package/lib/events/mutation/UserSelectNodeEvent.js +54 -0
- package/lib/events/mutation/WrapNodeEvent.d.ts +5 -0
- package/lib/events/mutation/WrapNodeEvent.js +54 -0
- package/lib/events/mutation/index.d.ts +16 -0
- package/lib/events/mutation/index.js +32 -0
- package/lib/events/viewport/AbstractViewportEvent.d.ts +16 -0
- package/lib/events/viewport/AbstractViewportEvent.js +20 -0
- package/lib/events/viewport/ViewportResizeEvent.d.ts +5 -0
- package/lib/events/viewport/ViewportResizeEvent.js +54 -0
- package/lib/events/viewport/ViewportScrollEvent.d.ts +5 -0
- package/lib/events/viewport/ViewportScrollEvent.js +54 -0
- package/lib/events/viewport/index.d.ts +2 -0
- package/lib/events/viewport/index.js +18 -0
- package/lib/events/workbench/AbstractWorkspaceEvent.d.ts +7 -0
- package/lib/events/workbench/AbstractWorkspaceEvent.js +10 -0
- package/lib/events/workbench/AddWorkspaceEvent.d.ts +5 -0
- package/lib/events/workbench/AddWorkspaceEvent.js +54 -0
- package/lib/events/workbench/RemoveWorkspaceEvent.d.ts +5 -0
- package/lib/events/workbench/RemoveWorkspaceEvent.js +54 -0
- package/lib/events/workbench/SwitchWorkspaceEvent.d.ts +5 -0
- package/lib/events/workbench/SwitchWorkspaceEvent.js +54 -0
- package/lib/events/workbench/index.d.ts +3 -0
- package/lib/events/workbench/index.js +19 -0
- package/lib/exports.d.ts +5 -0
- package/lib/exports.js +21 -0
- package/lib/externals.d.ts +12 -0
- package/lib/externals.js +126 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +52 -0
- package/lib/internals.d.ts +3 -0
- package/lib/internals.js +40 -0
- package/lib/models/Cursor.d.ts +60 -0
- package/lib/models/Cursor.js +154 -0
- package/lib/models/Engine.d.ts +29 -0
- package/lib/models/Engine.js +115 -0
- package/lib/models/History.d.ts +34 -0
- package/lib/models/History.js +113 -0
- package/lib/models/Hover.d.ts +14 -0
- package/lib/models/Hover.js +41 -0
- package/lib/models/Keyboard.d.ts +29 -0
- package/lib/models/Keyboard.js +129 -0
- package/lib/models/MoveHelper.d.ts +66 -0
- package/lib/models/MoveHelper.js +366 -0
- package/lib/models/Operation.d.ts +29 -0
- package/lib/models/Operation.js +78 -0
- package/lib/models/Screen.d.ts +31 -0
- package/lib/models/Screen.js +76 -0
- package/lib/models/Selection.d.ts +29 -0
- package/lib/models/Selection.js +195 -0
- package/lib/models/Shortcut.d.ts +20 -0
- package/lib/models/Shortcut.js +72 -0
- package/lib/models/SnapLine.d.ts +27 -0
- package/lib/models/SnapLine.js +144 -0
- package/lib/models/SpaceBlock.d.ts +40 -0
- package/lib/models/SpaceBlock.js +174 -0
- package/lib/models/TransformHelper.d.ts +80 -0
- package/lib/models/TransformHelper.js +604 -0
- package/lib/models/TreeNode.d.ts +115 -0
- package/lib/models/TreeNode.js +935 -0
- package/lib/models/Viewport.d.ts +90 -0
- package/lib/models/Viewport.js +477 -0
- package/lib/models/Workbench.d.ts +23 -0
- package/lib/models/Workbench.js +101 -0
- package/lib/models/Workspace.d.ts +41 -0
- package/lib/models/Workspace.js +98 -0
- package/lib/models/index.d.ts +13 -0
- package/lib/models/index.js +29 -0
- package/lib/presets.d.ts +4 -0
- package/lib/presets.js +41 -0
- package/lib/registry.d.ts +16 -0
- package/lib/registry.js +126 -0
- package/lib/shortcuts/CursorSwitch.d.ts +2 -0
- package/lib/shortcuts/CursorSwitch.js +13 -0
- package/lib/shortcuts/MultiSelection.d.ts +5 -0
- package/lib/shortcuts/MultiSelection.js +30 -0
- package/lib/shortcuts/NodeMutation.d.ts +7 -0
- package/lib/shortcuts/NodeMutation.js +43 -0
- package/lib/shortcuts/QuickSelection.d.ts +3 -0
- package/lib/shortcuts/QuickSelection.js +88 -0
- package/lib/shortcuts/UndoRedo.d.ts +3 -0
- package/lib/shortcuts/UndoRedo.js +30 -0
- package/lib/shortcuts/index.d.ts +5 -0
- package/lib/shortcuts/index.js +21 -0
- package/lib/types.d.ts +131 -0
- package/lib/types.js +2 -0
- package/package.json +49 -0
package/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015-present, Alibaba Group Holding Limited. All rights reserved.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# @designable/core
|
@@ -0,0 +1,10 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Designable=e.Designable||{},e.Designable.Core={}))}(this,(function(e){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)};function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s,u=function(){function e(e){this.data=e||{clientX:0,clientY:0,pageX:0,pageY:0,target:null,view:Designable.Shared.globalThisPolyfill},this.transformCoordinates()}return e.prototype.transformCoordinates=function(){var e,t=((null===(e=this.data)||void 0===e?void 0:e.view)||{}).frameElement;if(t&&this.data.view!==Designable.Shared.globalThisPolyfill){var n=t.getBoundingClientRect(),r=n.width/t.offsetWidth;this.data.topClientX=this.data.clientX*r+n.x,this.data.topClientY=this.data.clientY*r+n.y,this.data.topPageX=this.data.pageX+n.x-this.data.view.scrollX,this.data.topPageY=this.data.pageY+n.y-this.data.view.scrollY;var i=document.elementFromPoint(this.data.topPageX,this.data.topClientY);i!==t&&(this.data.target=i)}else this.data.topClientX=this.data.clientX,this.data.topClientY=this.data.clientY,this.data.topPageX=this.data.pageX,this.data.topPageY=this.data.pageY},e}(),c=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="drag:move",t}return n(t,e),t}(u),l=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="drag:start",t}return n(t,e),t}(u),h=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="drag:stop",t}return n(t,e),t}(u),f=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="mouse:click",t}return n(t,e),t}(u),p=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="mouse:dblclick",t}return n(t,e),t}(u),d=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="mouse:move",t}return n(t,e),t}(u),v=function(){function e(e){this.data=Designable.Shared.getKeyCodeFromEvent(e),this.originEvent=e}return Object.defineProperty(e.prototype,"eventType",{get:function(){return this.originEvent.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ctrlKey",{get:function(){return this.originEvent.ctrlKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shiftKey",{get:function(){return this.originEvent.shiftKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metaKey",{get:function(){return this.originEvent.metaKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"altkey",{get:function(){return this.originEvent.altKey},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this.originEvent.preventDefault?this.originEvent.preventDefault():this.originEvent.returnValue=!1},e.prototype.stopPropagation=function(){var e;(null===(e=this.originEvent)||void 0===e?void 0:e.stopPropagation)?this.originEvent.stopPropagation():this.originEvent.cancelBubble=!0},e}(),g=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="key:down",t}return n(t,e),t}(v),y=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="key:up",t}return n(t,e),t}(v),b=function(e){this.data=e},m=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="drag:node",t}return n(t,e),t}(b),w=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="drop:node",t}return n(t,e),t}(b),S=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="hover:node",t}return n(t,e),t}(b),_=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="insert:after",t}return n(t,e),t}(b),R=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="insert:before",t}return n(t,e),t}(b),E=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="insert:children",t}return n(t,e),t}(b),D=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="prepend:node",t}return n(t,e),t}(b),C=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="remove:node",t}return n(t,e),t}(b),N=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="select:node",t}return n(t,e),t}(b),P=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="unselect:node",t}return n(t,e),t}(b),k=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="update:children",t}return n(t,e),t}(b),x=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="update:node:props",t}return n(t,e),t}(b),O=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="wrap:node",t}return n(t,e),t}(b),T=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="clone:node",t}return n(t,e),t}(b),A=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="append:node",t}return n(t,e),t}(b),I=function(e){this.type="from:node",this.data=e},F=function(e){this.data=e||{scrollX:Designable.Shared.globalThisPolyfill.scrollX,scrollY:Designable.Shared.globalThisPolyfill.scrollY,width:Designable.Shared.globalThisPolyfill.innerWidth,height:Designable.Shared.globalThisPolyfill.innerHeight,innerWidth:Designable.Shared.globalThisPolyfill.innerWidth,innerHeight:Designable.Shared.globalThisPolyfill.innerHeight,view:Designable.Shared.globalThisPolyfill,target:Designable.Shared.globalThisPolyfill}},B=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="viewport:resize",t}return n(t,e),t}(F),L=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="viewport:scroll",t}return n(t,e),t}(F),W=function(e){this.data=e},j=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="add:workspace",t}return n(t,e),t}(W),M=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="remove:workspace",t}return n(t,e),t}(W),z=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="switch:workspace",t}return n(t,e),t}(W),X=function(e){this.data=e},V=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="history:undo",t}return n(t,e),t}(X),Y=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="history:redo",t}return n(t,e),t}(X),U=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="history:goto",t}return n(t,e),t}(X),q=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.type="history:push",t}return n(t,e),t}(X),H={dragging:!1,onMouseDownAt:0,startEvent:null,moveEvent:null},K=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.mouseDownTimer=null,t.onMouseDown=function(e){var n,r;if(0===e.button&&!e.ctrlKey&&!e.metaKey)return!(!e.target.isContentEditable&&"true"!==e.target.contentEditable)||void((null===(r=null===(n=e.target)||void 0===n?void 0:n.closest)||void 0===r?void 0:r.call(n,".monaco-editor"))||(H.startEvent=e,H.dragging=!1,H.onMouseDownAt=Date.now(),t.batchAddEventListener("mouseup",t.onMouseUp),t.batchAddEventListener("dragend",t.onMouseUp),t.batchAddEventListener("dragstart",t.onStartDrag),t.batchAddEventListener("mousemove",t.onDistanceChange)))},t.onMouseUp=function(e){H.dragging&&t.dispatch(new h({clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,view:e.view})),t.batchRemoveEventListener("contextmenu",t.onContextMenuWhileDragging,!0),t.batchRemoveEventListener("mouseup",t.onMouseUp),t.batchRemoveEventListener("mousedown",t.onMouseDown),t.batchRemoveEventListener("dragover",t.onMouseMove),t.batchRemoveEventListener("mousemove",t.onMouseMove),t.batchRemoveEventListener("mousemove",t.onDistanceChange),H.dragging=!1},t.onMouseMove=function(e){var n,r;e.clientX===(null===(n=H.moveEvent)||void 0===n?void 0:n.clientX)&&e.clientY===(null===(r=H.moveEvent)||void 0===r?void 0:r.clientY)||(t.dispatch(new c({clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,view:e.view})),H.moveEvent=e)},t.onContextMenuWhileDragging=function(e){e.preventDefault()},t.onStartDrag=function(e){H.dragging||(H.startEvent=H.startEvent||e,t.batchAddEventListener("dragover",t.onMouseMove),t.batchAddEventListener("mousemove",t.onMouseMove),t.batchAddEventListener("contextmenu",t.onContextMenuWhileDragging,!0),t.dispatch(new l({clientX:H.startEvent.clientX,clientY:H.startEvent.clientY,pageX:H.startEvent.pageX,pageY:H.startEvent.pageY,target:H.startEvent.target,view:H.startEvent.view})),H.dragging=!0)},t.onDistanceChange=function(e){var n=Math.sqrt(Math.pow(e.pageX-H.startEvent.pageX,2)+Math.pow(e.pageY-H.startEvent.pageY,2));Date.now()-H.onMouseDownAt>10&&e!==H.startEvent&&n>4&&(t.batchRemoveEventListener("mousemove",t.onDistanceChange),t.onStartDrag(e))},t}return n(t,e),t.prototype.attach=function(){this.batchAddEventListener("mousedown",this.onMouseDown,!0)},t.prototype.detach=function(){H.dragging=!1,H.moveEvent=null,H.onMouseDownAt=null,H.startEvent=null,this.batchRemoveEventListener("mousedown",this.onMouseDown,!0),this.batchRemoveEventListener("dragstart",this.onStartDrag),this.batchRemoveEventListener("dragend",this.onMouseUp),this.batchRemoveEventListener("dragover",this.onMouseMove),this.batchRemoveEventListener("mouseup",this.onMouseUp),this.batchRemoveEventListener("mousemove",this.onMouseMove),this.batchRemoveEventListener("mousemove",this.onDistanceChange),this.batchRemoveEventListener("contextmenu",this.onContextMenuWhileDragging,!0)},t}(Designable.Shared.EventDriver),$=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.onMouseClick=function(e){var n=e.target;(null==n?void 0:n.closest("*[".concat(t.engine.props.clickStopPropagationAttrName,"]")))||t.dispatch(new f({clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,view:e.view}))},t.onMouseDoubleClick=function(e){var n=e.target;(null==n?void 0:n.closest("*[".concat(t.engine.props.clickStopPropagationAttrName,"]")))||t.dispatch(new p({clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,view:e.view}))},t}return n(t,e),t.prototype.attach=function(){this.addEventListener("click",this.onMouseClick,{mode:"onlyChild"}),this.addEventListener("dblclick",this.onMouseDoubleClick,{mode:"onlyChild"})},t.prototype.detach=function(){this.removeEventListener("click",this.onMouseClick,{mode:"onlyChild"}),this.removeEventListener("dblclick",this.onMouseDoubleClick,{mode:"onlyChild"})},t}(Designable.Shared.EventDriver),G=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.request=null,t.onMouseMove=function(e){t.request=requestAnimationFrame((function(){cancelAnimationFrame(t.request),t.dispatch(new d({clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,view:e.view}))}))},t}return n(t,e),t.prototype.attach=function(){this.addEventListener("mousemove",this.onMouseMove,{mode:"onlyOne"})},t.prototype.detach=function(){this.removeEventListener("mouseover",this.onMouseMove,{mode:"onlyOne"})},t}(Designable.Shared.EventDriver),Z=[],J="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(s||(s={}));var Q,ee=function(e){return Object.freeze(e)},te=function(e,t){this.inlineSize=e,this.blockSize=t,ee(this)},ne=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ee(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),re=function(e){return e instanceof SVGElement&&"getBBox"in e},ie=function(e){if(re(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},oe=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},ae="undefined"!=typeof window?window:{},se=new WeakMap,ue=/auto|scroll/,ce=/^tb|vertical/,le=/msie|trident/i.test(ae.navigator&&ae.navigator.userAgent),he=function(e){return parseFloat(e||"0")},fe=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new te((n?t:e)||0,(n?e:t)||0)},pe=ee({devicePixelContentBoxSize:fe(),borderBoxSize:fe(),contentBoxSize:fe(),contentRect:new ne(0,0,0,0)}),de=function(e,t){if(void 0===t&&(t=!1),se.has(e)&&!t)return se.get(e);if(ie(e))return se.set(e,pe),pe;var n=getComputedStyle(e),r=re(e)&&e.ownerSVGElement&&e.getBBox(),i=!le&&"border-box"===n.boxSizing,o=ce.test(n.writingMode||""),a=!r&&ue.test(n.overflowY||""),s=!r&&ue.test(n.overflowX||""),u=r?0:he(n.paddingTop),c=r?0:he(n.paddingRight),l=r?0:he(n.paddingBottom),h=r?0:he(n.paddingLeft),f=r?0:he(n.borderTopWidth),p=r?0:he(n.borderRightWidth),d=r?0:he(n.borderBottomWidth),v=h+c,g=u+l,y=(r?0:he(n.borderLeftWidth))+p,b=f+d,m=s?e.offsetHeight-b-e.clientHeight:0,w=a?e.offsetWidth-y-e.clientWidth:0,S=i?v+y:0,_=i?g+b:0,R=r?r.width:he(n.width)-S-w,E=r?r.height:he(n.height)-_-m,D=R+v+w+y,C=E+g+m+b,N=ee({devicePixelContentBoxSize:fe(Math.round(R*devicePixelRatio),Math.round(E*devicePixelRatio),o),borderBoxSize:fe(D,C,o),contentBoxSize:fe(R,E,o),contentRect:new ne(h,u,R,E)});return se.set(e,N),N},ve=function(e,t,n){var r=de(e,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case s.DEVICE_PIXEL_CONTENT_BOX:return a;case s.BORDER_BOX:return i;default:return o}},ge=function(e){var t=de(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=ee([t.borderBoxSize]),this.contentBoxSize=ee([t.contentBoxSize]),this.devicePixelContentBoxSize=ee([t.devicePixelContentBoxSize])},ye=function(e){if(ie(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},be=function(){var e=1/0,t=[];Z.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new ge(t.target),i=ye(t.target);r.push(n),t.lastReportedSize=ve(t.target,t.observedBox),i<e&&(e=i)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},me=function(e){Z.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(ye(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},we=function(){var e,t=0;for(me(t);Z.some((function(e){return e.activeTargets.length>0}));)t=be(),me(t);return Z.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:J}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=J),window.dispatchEvent(e)),t>0},Se=[],_e=function(e){if(!Q){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Se.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Q=function(){n.textContent="".concat(t?t--:t++)}}Se.push(e),Q()},Re=0,Ee={attributes:!0,characterData:!0,childList:!0,subtree:!0},De=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ce=function(e){return void 0===e&&(e=0),Date.now()+e},Ne=!1,Pe=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!Ne){Ne=!0;var n,r=Ce(e);n=function(){var n=!1;try{n=we()}finally{if(Ne=!1,e=r-Ce(),!Re)return;n?t.run(1e3):e>0?t.run(e):t.start()}},_e((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Ee)};document.body?t():ae.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),De.forEach((function(t){return ae.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),De.forEach((function(t){return ae.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ke=function(e){!Re&&e>0&&Pe.start(),!(Re+=e)&&Pe.stop()},xe=function(){function e(e,t){this.target=e,this.observedBox=t||s.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=ve(this.target,this.observedBox,!0);return e=this.target,re(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Oe=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Te=new WeakMap,Ae=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Ie=function(){function e(){}return e.connect=function(e,t){var n=new Oe(e,t);Te.set(e,n)},e.observe=function(e,t,n){var r=Te.get(e),i=0===r.observationTargets.length;Ae(r.observationTargets,t)<0&&(i&&Z.push(r),r.observationTargets.push(new xe(t,n&&n.box)),ke(1),Pe.schedule())},e.unobserve=function(e,t){var n=Te.get(e),r=Ae(n.observationTargets,t),i=1===n.observationTargets.length;r>=0&&(i&&Z.splice(Z.indexOf(n),1),n.observationTargets.splice(r,1),ke(-1))},e.disconnect=function(e){var t=this,n=Te.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),Fe=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ie.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!oe(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ie.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!oe(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ie.unobserve(this,e)},e.prototype.disconnect=function(){Ie.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),Be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};
|
2
|
+
/**
|
3
|
+
* @license
|
4
|
+
* Lodash <https://lodash.com/>
|
5
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
6
|
+
* Released under MIT license <https://lodash.com/license>
|
7
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
8
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
9
|
+
*/
|
10
|
+
var Le=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,u=64,c=128,l=256,h=1/0,f=9007199254740991,p=NaN,d=4294967295,v=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",u],["rearg",l]],g="[object Arguments]",y="[object Array]",b="[object Boolean]",m="[object Date]",w="[object Error]",S="[object Function]",_="[object GeneratorFunction]",R="[object Map]",E="[object Number]",D="[object Object]",C="[object Promise]",N="[object RegExp]",P="[object Set]",k="[object String]",x="[object Symbol]",O="[object WeakMap]",T="[object ArrayBuffer]",A="[object DataView]",I="[object Float32Array]",F="[object Float64Array]",B="[object Int8Array]",L="[object Int16Array]",W="[object Int32Array]",j="[object Uint8Array]",M="[object Uint8ClampedArray]",z="[object Uint16Array]",X="[object Uint32Array]",V=/\b__p \+= '';/g,Y=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,K=RegExp(q.source),$=RegExp(H.source),G=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,re=RegExp(ne.source),ie=/^\s+/,oe=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,_e="\\ud800-\\udfff",Re="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",De="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Ne="\\ufe0e\\ufe0f",Pe="\\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",ke="['’]",xe="["+_e+"]",Oe="["+Pe+"]",Te="["+Re+"]",Ae="\\d+",Ie="["+Ee+"]",Fe="["+De+"]",Le="[^"+_e+Pe+Ae+Ee+De+Ce+"]",We="\\ud83c[\\udffb-\\udfff]",je="[^"+_e+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",Xe="["+Ce+"]",Ve="\\u200d",Ye="(?:"+Fe+"|"+Le+")",Ue="(?:"+Xe+"|"+Le+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Te+"|"+We+")"+"?",$e="["+Ne+"]?",Ge=$e+Ke+("(?:"+Ve+"(?:"+[je,Me,ze].join("|")+")"+$e+Ke+")*"),Ze="(?:"+[Ie,Me,ze].join("|")+")"+Ge,Je="(?:"+[je+Te+"?",Te,Me,ze,xe].join("|")+")",Qe=RegExp(ke,"g"),et=RegExp(Te,"g"),tt=RegExp(We+"(?="+We+")|"+Je+Ge,"g"),nt=RegExp([Xe+"?"+Fe+"+"+qe+"(?="+[Oe,Xe,"$"].join("|")+")",Ue+"+"+He+"(?="+[Oe,Xe+Ye,"$"].join("|")+")",Xe+"?"+Ye+"+"+qe,Xe+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ze].join("|"),"g"),rt=RegExp("["+Ve+_e+Re+Ne+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[I]=st[F]=st[B]=st[L]=st[W]=st[j]=st[M]=st[z]=st[X]=!0,st[g]=st[y]=st[T]=st[b]=st[A]=st[m]=st[w]=st[S]=st[R]=st[E]=st[D]=st[N]=st[P]=st[k]=st[O]=!1;var ut={};ut[g]=ut[y]=ut[T]=ut[A]=ut[b]=ut[m]=ut[I]=ut[F]=ut[B]=ut[L]=ut[W]=ut[R]=ut[E]=ut[D]=ut[N]=ut[P]=ut[k]=ut[x]=ut[j]=ut[M]=ut[z]=ut[X]=!0,ut[w]=ut[S]=ut[O]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lt=parseFloat,ht=parseInt,ft="object"==typeof Be&&Be&&Be.Object===Object&&Be,pt="object"==typeof self&&self&&self.Object===Object&&self,dt=ft||pt||Function("return this")(),vt=t&&!t.nodeType&&t,gt=vt&&e&&!e.nodeType&&e,yt=gt&>.exports===vt,bt=yt&&ft.process,mt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=mt&&mt.isArrayBuffer,St=mt&&mt.isDate,_t=mt&&mt.isMap,Rt=mt&&mt.isRegExp,Et=mt&&mt.isSet,Dt=mt&&mt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Nt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function Pt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function xt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Ot(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Tt(e,t){return!!(null==e?0:e.length)&&Xt(e,t,0)>-1}function At(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Ft(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Bt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Lt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Wt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var jt=qt("length");function Mt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function zt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Xt(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):zt(e,Yt,n)}function Vt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Yt(e){return e!=e}function Ut(e,t){var n=null==e?0:e.length;return n?$t(e,t)/n:p}function qt(e){return function(t){return null==t?n:t[e]}}function Ht(e){return function(t){return null==e?n:e[t]}}function Kt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function $t(e,t){for(var r,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==n&&(r=r===n?a:r+a)}return r}function Gt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Zt(e){return e?e.slice(0,vn(e)+1).replace(ie,""):e}function Jt(e){return function(t){return e(t)}}function Qt(e,t){return It(t,(function(t){return e[t]}))}function en(e,t){return e.has(t)}function tn(e,t){for(var n=-1,r=e.length;++n<r&&Xt(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length;n--&&Xt(t,e[n],0)>-1;);return n}var rn=Ht({"À":"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"}),on=Ht({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+ct[e]}function sn(e){return rt.test(e)}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==o||(e[n]=o,a[i++]=n)}return a}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function fn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):jt(e)}function dn(e){return sn(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.split("")}(e)}function vn(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var gn=Ht({"&":"&","<":"<",">":">",""":'"',"'":"'"});var yn=function e(t){var oe,_e=(t=null==t?dt:yn.defaults(dt.Object(),t,yn.pick(dt,ot))).Array,Re=t.Date,Ee=t.Error,De=t.Function,Ce=t.Math,Ne=t.Object,Pe=t.RegExp,ke=t.String,xe=t.TypeError,Oe=_e.prototype,Te=De.prototype,Ae=Ne.prototype,Ie=t["__core-js_shared__"],Fe=Te.toString,Be=Ae.hasOwnProperty,Le=0,We=(oe=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||""))?"Symbol(src)_1."+oe:"",je=Ae.toString,Me=Fe.call(Ne),ze=dt._,Xe=Pe("^"+Fe.call(Be).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=yt?t.Buffer:n,Ye=t.Symbol,Ue=t.Uint8Array,qe=Ve?Ve.allocUnsafe:n,He=cn(Ne.getPrototypeOf,Ne),Ke=Ne.create,$e=Ae.propertyIsEnumerable,Ge=Oe.splice,Ze=Ye?Ye.isConcatSpreadable:n,Je=Ye?Ye.iterator:n,tt=Ye?Ye.toStringTag:n,rt=function(){try{var e=fo(Ne,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ft=Re&&Re.now!==dt.Date.now&&Re.now,pt=t.setTimeout!==dt.setTimeout&&t.setTimeout,vt=Ce.ceil,gt=Ce.floor,bt=Ne.getOwnPropertySymbols,mt=Ve?Ve.isBuffer:n,jt=t.isFinite,Ht=Oe.join,bn=cn(Ne.keys,Ne),mn=Ce.max,wn=Ce.min,Sn=Re.now,_n=t.parseInt,Rn=Ce.random,En=Oe.reverse,Dn=fo(t,"DataView"),Cn=fo(t,"Map"),Nn=fo(t,"Promise"),Pn=fo(t,"Set"),kn=fo(t,"WeakMap"),xn=fo(Ne,"create"),On=kn&&new kn,Tn={},An=jo(Dn),In=jo(Cn),Fn=jo(Nn),Bn=jo(Pn),Ln=jo(kn),Wn=Ye?Ye.prototype:n,jn=Wn?Wn.valueOf:n,Mn=Wn?Wn.toString:n;function zn(e){if(ns(e)&&!Ua(e)&&!(e instanceof Un)){if(e instanceof Yn)return e;if(Be.call(e,"__wrapped__"))return Mo(e)}return new Yn(e)}var Xn=function(){function e(){}return function(t){if(!ts(t))return{};if(Ke)return Ke(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Vn(){}function Yn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Kn;++t<n;)this.add(e[t])}function Gn(e){var t=this.__data__=new Hn(e);this.size=t.size}function Zn(e,t){var n=Ua(e),r=!n&&Ya(e),i=!n&&!r&&$a(e),o=!n&&!r&&!i&&ls(e),a=n||r||i||o,s=a?Gt(e.length,ke):[],u=s.length;for(var c in e)!t&&!Be.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,u))||s.push(c);return s}function Jn(e){var t=e.length;return t?e[$r(0,t-1)]:n}function Qn(e,t){return Bo(xi(e),ur(t,0,e.length))}function er(e){return Bo(xi(e))}function tr(e,t,r){(r!==n&&!za(e[t],r)||r===n&&!(t in e))&&ar(e,t,r)}function nr(e,t,r){var i=e[t];Be.call(e,t)&&za(i,r)&&(r!==n||t in e)||ar(e,t,r)}function rr(e,t){for(var n=e.length;n--;)if(za(e[n][0],t))return n;return-1}function ir(e,t,n,r){return pr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function or(e,t){return e&&Oi(t,Ts(t),e)}function ar(e,t,n){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function sr(e,t){for(var r=-1,i=t.length,o=_e(i),a=null==e;++r<i;)o[r]=a?n:Ns(e,t[r]);return o}function ur(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function cr(e,t,r,i,o,a){var s,u=1&t,c=2&t,l=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!ts(e))return e;var h=Ua(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return xi(e,s)}else{var f=go(e),p=f==S||f==_;if($a(e))return Ei(e,u);if(f==D||f==g||p&&!o){if(s=c||p?{}:bo(e),!u)return c?function(e,t){return Oi(e,vo(e),t)}(e,function(e,t){return e&&Oi(t,As(t),e)}(s,e)):function(e,t){return Oi(e,po(e),t)}(e,or(s,e))}else{if(!ut[f])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case T:return Di(e);case b:case m:return new r(+e);case A:return function(e,t){var n=t?Di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case I:case F:case B:case L:case W:case j:case M:case z:case X:return Ci(e,n);case R:return new r;case E:case k:return new r(e);case N:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case P:return new r;case x:return i=e,jn?Ne(jn.call(i)):{}}var i}(e,f,u)}}a||(a=new Gn);var d=a.get(e);if(d)return d;a.set(e,s),ss(e)?e.forEach((function(n){s.add(cr(n,t,r,n,e,a))})):rs(e)&&e.forEach((function(n,i){s.set(i,cr(n,t,r,i,e,a))}));var v=h?n:(l?c?oo:io:c?As:Ts)(e);return Pt(v||e,(function(n,i){v&&(n=e[i=n]),nr(s,i,cr(n,t,r,i,e,a))})),s}function lr(e,t,r){var i=r.length;if(null==e)return!i;for(e=Ne(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function hr(e,t,i){if("function"!=typeof e)throw new xe(r);return To((function(){e.apply(n,i)}),t)}function fr(e,t,n,r){var i=-1,o=Tt,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=It(t,Jt(n))),r?(o=At,a=!1):t.length>=200&&(o=en,a=!1,t=new $n(t));e:for(;++i<s;){var l=e[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,a&&h==h){for(var f=c;f--;)if(t[f]===h)continue e;u.push(l)}else o(t,h,r)||u.push(l)}return u}zn.templateSettings={escape:G,evaluate:Z,interpolate:J,variable:"",imports:{_:zn}},zn.prototype=Vn.prototype,zn.prototype.constructor=zn,Yn.prototype=Xn(Vn.prototype),Yn.prototype.constructor=Yn,Un.prototype=Xn(Vn.prototype),Un.prototype.constructor=Un,qn.prototype.clear=function(){this.__data__=xn?xn(null):{},this.size=0},qn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},qn.prototype.get=function(e){var t=this.__data__;if(xn){var r=t[e];return r===i?n:r}return Be.call(t,e)?t[e]:n},qn.prototype.has=function(e){var t=this.__data__;return xn?t[e]!==n:Be.call(t,e)},qn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xn&&t===n?i:t,this},Hn.prototype.clear=function(){this.__data__=[],this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=rr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,!0)},Hn.prototype.get=function(e){var t=this.__data__,r=rr(t,e);return r<0?n:t[r][1]},Hn.prototype.has=function(e){return rr(this.__data__,e)>-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=rr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Cn||Hn),string:new qn}},Kn.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Kn.prototype.get=function(e){return lo(this,e).get(e)},Kn.prototype.has=function(e){return lo(this,e).has(e)},Kn.prototype.set=function(e,t){var n=lo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},$n.prototype.add=$n.prototype.push=function(e){return this.__data__.set(e,i),this},$n.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gn.prototype.get=function(e){return this.__data__.get(e)},Gn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(e,t),this.size=n.size,this};var pr=Ii(Sr),dr=Ii(_r,!0);function vr(e,t){var n=!0;return pr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function gr(e,t,r){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(u===n?s==s&&!cs(s):r(s,u)))var u=s,c=a}return c}function yr(e,t){var n=[];return pr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function br(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=mo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?br(s,t-1,n,r,i):Ft(i,s):r||(i[i.length]=s)}return i}var mr=Fi(),wr=Fi(!0);function Sr(e,t){return e&&mr(e,t,Ts)}function _r(e,t){return e&&wr(e,t,Ts)}function Rr(e,t){return Ot(t,(function(t){return Ja(e[t])}))}function Er(e,t){for(var r=0,i=(t=wi(t,e)).length;null!=e&&r<i;)e=e[Wo(t[r++])];return r&&r==i?e:n}function Dr(e,t,n){var r=t(e);return Ua(e)?r:Ft(r,n(e))}function Cr(e){return null==e?e===n?"[object Undefined]":"[object Null]":tt&&tt in Ne(e)?function(e){var t=Be.call(e,tt),r=e[tt];try{e[tt]=n;var i=!0}catch(e){}var o=je.call(e);i&&(t?e[tt]=r:delete e[tt]);return o}(e):function(e){return je.call(e)}(e)}function Nr(e,t){return e>t}function Pr(e,t){return null!=e&&Be.call(e,t)}function kr(e,t){return null!=e&&t in Ne(e)}function xr(e,t,r){for(var i=r?At:Tt,o=e[0].length,a=e.length,s=a,u=_e(a),c=1/0,l=[];s--;){var h=e[s];s&&t&&(h=It(h,Jt(t))),c=wn(h.length,c),u[s]=!r&&(t||o>=120&&h.length>=120)?new $n(s&&h):n}h=e[0];var f=-1,p=u[0];e:for(;++f<o&&l.length<c;){var d=h[f],v=t?t(d):d;if(d=r||0!==d?d:0,!(p?en(p,v):i(l,v,r))){for(s=a;--s;){var g=u[s];if(!(g?en(g,v):i(e[s],v,r)))continue e}p&&p.push(v),l.push(d)}}return l}function Or(e,t,r){var i=null==(e=ko(e,t=wi(t,e)))?e:e[Wo(Zo(t))];return null==i?n:Ct(i,e,r)}function Tr(e){return ns(e)&&Cr(e)==g}function Ar(e,t,r,i,o){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,r,i,o,a){var s=Ua(e),u=Ua(t),c=s?y:go(e),l=u?y:go(t),h=(c=c==g?D:c)==D,f=(l=l==g?D:l)==D,p=c==l;if(p&&$a(e)){if(!$a(t))return!1;s=!0,h=!1}if(p&&!h)return a||(a=new Gn),s||ls(e)?no(e,t,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case b:case m:case E:return za(+e,+t);case w:return e.name==t.name&&e.message==t.message;case N:case k:return e==t+"";case R:var s=un;case P:var u=1&r;if(s||(s=hn),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=no(s(e),s(t),r,i,o,a);return a.delete(e),l;case x:if(jn)return jn.call(e)==jn.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var d=h&&Be.call(e,"__wrapped__"),v=f&&Be.call(t,"__wrapped__");if(d||v){var S=d?e.value():e,_=v?t.value():t;return a||(a=new Gn),o(S,_,r,i,a)}}if(!p)return!1;return a||(a=new Gn),function(e,t,r,i,o,a){var s=1&r,u=io(e),c=u.length,l=io(t),h=l.length;if(c!=h&&!s)return!1;var f=c;for(;f--;){var p=u[f];if(!(s?p in t:Be.call(t,p)))return!1}var d=a.get(e),v=a.get(t);if(d&&v)return d==t&&v==e;var g=!0;a.set(e,t),a.set(t,e);var y=s;for(;++f<c;){var b=e[p=u[f]],m=t[p];if(i)var w=s?i(m,b,p,t,e,a):i(b,m,p,e,t,a);if(!(w===n?b===m||o(b,m,r,i,a):w)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var S=e.constructor,_=t.constructor;S==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof S&&S instanceof S&&"function"==typeof _&&_ instanceof _||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,r,i,o,a)}(e,t,r,i,Ar,o))}function Ir(e,t,r,i){var o=r.length,a=o,s=!i;if(null==e)return!a;for(e=Ne(e);o--;){var u=r[o];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<a;){var c=(u=r[o])[0],l=e[c],h=u[1];if(s&&u[2]){if(l===n&&!(c in e))return!1}else{var f=new Gn;if(i)var p=i(l,h,c,e,t,f);if(!(p===n?Ar(h,l,3,i,f):p))return!1}}return!0}function Fr(e){return!(!ts(e)||(t=e,We&&We in t))&&(Ja(e)?Xe:ge).test(jo(e));var t}function Br(e){return"function"==typeof e?e:null==e?iu:"object"==typeof e?Ua(e)?Xr(e[0],e[1]):zr(e):pu(e)}function Lr(e){if(!Do(e))return bn(e);var t=[];for(var n in Ne(e))Be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Wr(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Ne(e))t.push(n);return t}(e);var t=Do(e),n=[];for(var r in e)("constructor"!=r||!t&&Be.call(e,r))&&n.push(r);return n}function jr(e,t){return e<t}function Mr(e,t){var n=-1,r=Ha(e)?_e(e.length):[];return pr(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function zr(e){var t=ho(e);return 1==t.length&&t[0][2]?No(t[0][0],t[0][1]):function(n){return n===e||Ir(n,e,t)}}function Xr(e,t){return _o(e)&&Co(t)?No(Wo(e),t):function(r){var i=Ns(r,e);return i===n&&i===t?Ps(r,e):Ar(t,i,3)}}function Vr(e,t,r,i,o){e!==t&&mr(t,(function(a,s){if(o||(o=new Gn),ts(a))!function(e,t,r,i,o,a,s){var u=xo(e,r),c=xo(t,r),l=s.get(c);if(l)return void tr(e,r,l);var h=a?a(u,c,r+"",e,t,s):n,f=h===n;if(f){var p=Ua(c),d=!p&&$a(c),v=!p&&!d&&ls(c);h=c,p||d||v?Ua(u)?h=u:Ka(u)?h=xi(u):d?(f=!1,h=Ei(c,!0)):v?(f=!1,h=Ci(c,!0)):h=[]:os(c)||Ya(c)?(h=u,Ya(u)?h=bs(u):ts(u)&&!Ja(u)||(h=bo(c))):f=!1}f&&(s.set(c,h),o(h,c,i,a,s),s.delete(c));tr(e,r,h)}(e,t,s,r,Vr,i,o);else{var u=i?i(xo(e,s),a,s+"",e,t,o):n;u===n&&(u=a),tr(e,s,u)}}),As)}function Yr(e,t){var r=e.length;if(r)return wo(t+=t<0?r:0,r)?e[t]:n}function Ur(e,t,n){t=t.length?It(t,(function(e){return Ua(e)?function(t){return Er(t,1===e.length?e[0]:e)}:e})):[iu];var r=-1;t=It(t,Jt(co()));var i=Mr(e,(function(e,n,i){var o=It(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var u=Ni(i[r],o[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Er(e,a);n(s,a)&&ei(o,wi(a,e),s)}return o}function Hr(e,t,n,r){var i=r?Vt:Xt,o=-1,a=t.length,s=e;for(e===t&&(t=xi(t)),n&&(s=It(e,Jt(n)));++o<a;)for(var u=0,c=t[o],l=n?n(c):c;(u=i(s,l,u,r))>-1;)s!==e&&Ge.call(s,u,1),Ge.call(e,u,1);return e}function Kr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?Ge.call(e,i,1):fi(e,i)}}return e}function $r(e,t){return e+gt(Rn()*(t-e+1))}function Gr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Zr(e,t){return Ao(Po(e,t,iu),e+"")}function Jr(e){return Jn(zs(e))}function Qr(e,t){var n=zs(e);return Bo(n,ur(t,0,n.length))}function ei(e,t,r,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,u=e;null!=u&&++o<a;){var c=Wo(t[o]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var h=u[c];(l=i?i(h,c,u):n)===n&&(l=ts(h)?h:wo(t[o+1])?[]:{})}nr(u,c,l),u=u[c]}return e}var ti=On?function(e,t){return On.set(e,t),e}:iu,ni=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:tu(t),writable:!0})}:iu;function ri(e){return Bo(zs(e))}function ii(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=_e(i);++r<i;)o[r]=e[r+t];return o}function oi(e,t){var n;return pr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function ai(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!cs(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return si(e,t,iu,n)}function si(e,t,r,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,u=null===t,c=cs(t),l=t===n;o<a;){var h=gt((o+a)/2),f=r(e[h]),p=f!==n,d=null===f,v=f==f,g=cs(f);if(s)var y=i||v;else y=l?v&&(i||p):u?v&&p&&(i||!d):c?v&&p&&!d&&(i||!g):!d&&!g&&(i?f<=t:f<t);y?o=h+1:a=h}return wn(a,4294967294)}function ui(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!za(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function ci(e){return"number"==typeof e?e:cs(e)?p:+e}function li(e){if("string"==typeof e)return e;if(Ua(e))return It(e,li)+"";if(cs(e))return Mn?Mn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Tt,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=At;else if(o>=200){var c=t?null:Gi(e);if(c)return hn(c);a=!1,i=en,u=new $n}else u=t?[]:s;e:for(;++r<o;){var l=e[r],h=t?t(l):l;if(l=n||0!==l?l:0,a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),s.push(l)}else i(u,h,n)||(u!==s&&u.push(h),s.push(l))}return s}function fi(e,t){return null==(e=ko(e,t=wi(t,e)))||delete e[Wo(Zo(t))]}function pi(e,t,n,r){return ei(e,t,n(Er(e,t)),r)}function di(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?ii(e,r?0:o,r?o+1:i):ii(e,r?o+1:0,r?i:o)}function vi(e,t){var n=e;return n instanceof Un&&(n=n.value()),Bt(t,(function(e,t){return t.func.apply(t.thisArg,Ft([e],t.args))}),n)}function gi(e,t,n){var r=e.length;if(r<2)return r?hi(e[0]):[];for(var i=-1,o=_e(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=fr(o[i]||a,e[s],t,n));return hi(br(o,1),t,n)}function yi(e,t,r){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var u=i<a?t[i]:n;r(s,e[i],u)}return s}function bi(e){return Ka(e)?e:[]}function mi(e){return"function"==typeof e?e:iu}function wi(e,t){return Ua(e)?e:_o(e,t)?[e]:Lo(ms(e))}var Si=Zr;function _i(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:ii(e,t,r)}var Ri=ct||function(e){return dt.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function Di(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function Ci(e,t){var n=t?Di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ni(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=cs(e),s=t!==n,u=null===t,c=t==t,l=cs(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!l&&e<t||l&&r&&o&&!i&&!a||u&&r&&o||!s&&o||!c)return-1}return 0}function Pi(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,u=t.length,c=mn(o-a,0),l=_e(u+c),h=!r;++s<u;)l[s]=t[s];for(;++i<a;)(h||i<o)&&(l[n[i]]=e[i]);for(;c--;)l[s++]=e[i++];return l}function ki(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,u=-1,c=t.length,l=mn(o-s,0),h=_e(l+c),f=!r;++i<l;)h[i]=e[i];for(var p=i;++u<c;)h[p+u]=t[u];for(;++a<s;)(f||i<o)&&(h[p+n[a]]=e[i++]);return h}function xi(e,t){var n=-1,r=e.length;for(t||(t=_e(r));++n<r;)t[n]=e[n];return t}function Oi(e,t,r,i){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var u=t[a],c=i?i(r[u],e[u],u,r,e):n;c===n&&(c=e[u]),o?ar(r,u,c):nr(r,u,c)}return r}function Ti(e,t){return function(n,r){var i=Ua(n)?Nt:ir,o=t?t():{};return i(n,e,co(r,2),o)}}function Ai(e){return Zr((function(t,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&So(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=Ne(t);++i<o;){var u=r[i];u&&e(t,u,i,a)}return t}))}function Ii(e,t){return function(n,r){if(null==n)return n;if(!Ha(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Ne(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Fi(e){return function(t,n,r){for(var i=-1,o=Ne(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}function Bi(e){return function(t){var r=sn(t=ms(t))?dn(t):n,i=r?r[0]:t.charAt(0),o=r?_i(r,1).join(""):t.slice(1);return i[e]()+o}}function Li(e){return function(t){return Bt(Js(Ys(t).replace(Qe,"")),e,"")}}function Wi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Xn(e.prototype),r=e.apply(n,t);return ts(r)?r:n}}function ji(e){return function(t,r,i){var o=Ne(t);if(!Ha(t)){var a=co(r,3);t=Ts(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,i);return s>-1?o[a?t[s]:s]:n}}function Mi(e){return ro((function(t){var i=t.length,o=i,a=Yn.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new xe(r);if(a&&!u&&"wrapper"==so(s))var u=new Yn([],!0)}for(o=u?o:i;++o<i;){var c=so(s=t[o]),l="wrapper"==c?ao(s):n;u=l&&Ro(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[so(l[0])].apply(u,l[3]):1==s.length&&Ro(s)?u[c]():u.thru(s)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&Ua(n))return u.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}}))}function zi(e,t,r,i,o,a,s,u,l,h){var f=t&c,p=1&t,d=2&t,v=24&t,g=512&t,y=d?n:Wi(e);return function c(){for(var b=arguments.length,m=_e(b),w=b;w--;)m[w]=arguments[w];if(v)var S=uo(c),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(m,S);if(i&&(m=Pi(m,i,o,v)),a&&(m=ki(m,a,s,v)),b-=_,v&&b<h){var R=ln(m,S);return Ki(e,t,zi,c.placeholder,r,m,R,u,l,h-b)}var E=p?r:this,D=d?E[e]:e;return b=m.length,u?m=function(e,t){var r=e.length,i=wn(t.length,r),o=xi(e);for(;i--;){var a=t[i];e[i]=wo(a,r)?o[a]:n}return e}(m,u):g&&b>1&&m.reverse(),f&&l<b&&(m.length=l),this&&this!==dt&&this instanceof c&&(D=y||Wi(D)),D.apply(E,m)}}function Xi(e,t){return function(n,r){return function(e,t,n,r){return Sr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Vi(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=li(r),i=li(i)):(r=ci(r),i=ci(i)),o=e(r,i)}return o}}function Yi(e){return ro((function(t){return t=It(t,Jt(co())),Zr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function Ui(e,t){var r=(t=t===n?" ":li(t)).length;if(r<2)return r?Gr(t,e):t;var i=Gr(t,vt(e/pn(t)));return sn(t)?_i(dn(i),0,e).join(""):i.slice(0,e)}function qi(e){return function(t,r,i){return i&&"number"!=typeof i&&So(t,r,i)&&(r=i=n),t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n,r){for(var i=-1,o=mn(vt((t-e)/(n||1)),0),a=_e(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,r,i=i===n?t<r?1:-1:ds(i),e)}}function Hi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ys(t),n=ys(n)),e(t,n)}}function Ki(e,t,r,i,o,a,c,l,h,f){var p=8&t;t|=p?s:u,4&(t&=~(p?u:s))||(t&=-4);var d=[e,t,o,p?a:n,p?c:n,p?n:a,p?n:c,l,h,f],v=r.apply(n,d);return Ro(e)&&Oo(v,d),v.placeholder=i,Io(v,e,t)}function $i(e){var t=Ce[e];return function(e,n){if(e=ys(e),(n=null==n?0:wn(vs(n),292))&&jt(e)){var r=(ms(e)+"e").split("e");return+((r=(ms(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Gi=Pn&&1/hn(new Pn([,-0]))[1]==h?function(e){return new Pn(e)}:cu;function Zi(e){return function(t){var n=go(t);return n==R?un(t):n==P?fn(t):function(e,t){return It(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ji(e,t,i,h,f,p,d,v){var g=2&t;if(!g&&"function"!=typeof e)throw new xe(r);var y=h?h.length:0;if(y||(t&=-97,h=f=n),d=d===n?d:mn(vs(d),0),v=v===n?v:vs(v),y-=f?f.length:0,t&u){var b=h,m=f;h=f=n}var w=g?n:ao(e),S=[e,t,i,h,f,b,m,p,d,v];if(w&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,s=r==c&&8==n||r==c&&n==l&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var h=e[3];e[3]=h?Pi(h,u,t[4]):u,e[4]=h?ln(e[3],o):t[4]}(u=t[5])&&(h=e[5],e[5]=h?ki(h,u,t[6]):u,e[6]=h?ln(e[5],o):t[6]);(u=t[7])&&(e[7]=u);r&c&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(S,w),e=S[0],t=S[1],i=S[2],h=S[3],f=S[4],!(v=S[9]=S[9]===n?g?0:e.length:mn(S[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==a?function(e,t,r){var i=Wi(e);return function o(){for(var a=arguments.length,s=_e(a),u=a,c=uo(o);u--;)s[u]=arguments[u];var l=a<3&&s[0]!==c&&s[a-1]!==c?[]:ln(s,c);return(a-=l.length)<r?Ki(e,t,zi,o.placeholder,n,s,l,n,n,r-a):Ct(this&&this!==dt&&this instanceof o?i:e,this,s)}}(e,t,v):t!=s&&33!=t||f.length?zi.apply(n,S):function(e,t,n,r){var i=1&t,o=Wi(e);return function t(){for(var a=-1,s=arguments.length,u=-1,c=r.length,l=_e(c+s),h=this&&this!==dt&&this instanceof t?o:e;++u<c;)l[u]=r[u];for(;s--;)l[u++]=arguments[++a];return Ct(h,i?n:this,l)}}(e,t,i,h);else var _=function(e,t,n){var r=1&t,i=Wi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,i);return Io((w?ti:Oo)(_,S),e,t)}function Qi(e,t,r,i){return e===n||za(e,Ae[r])&&!Be.call(i,r)?t:e}function eo(e,t,r,i,o,a){return ts(e)&&ts(t)&&(a.set(t,e),Vr(e,t,n,eo,a),a.delete(t)),e}function to(e){return os(e)?n:e}function no(e,t,r,i,o,a){var s=1&r,u=e.length,c=t.length;if(u!=c&&!(s&&c>u))return!1;var l=a.get(e),h=a.get(t);if(l&&h)return l==t&&h==e;var f=-1,p=!0,d=2&r?new $n:n;for(a.set(e,t),a.set(t,e);++f<u;){var v=e[f],g=t[f];if(i)var y=s?i(g,v,f,t,e,a):i(v,g,f,e,t,a);if(y!==n){if(y)continue;p=!1;break}if(d){if(!Wt(t,(function(e,t){if(!en(d,t)&&(v===e||o(v,e,r,i,a)))return d.push(t)}))){p=!1;break}}else if(v!==g&&!o(v,g,r,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function ro(e){return Ao(Po(e,n,qo),e+"")}function io(e){return Dr(e,Ts,po)}function oo(e){return Dr(e,As,vo)}var ao=On?function(e){return On.get(e)}:cu;function so(e){for(var t=e.name+"",n=Tn[t],r=Be.call(Tn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function uo(e){return(Be.call(zn,"placeholder")?zn:e).placeholder}function co(){var e=zn.iteratee||ou;return e=e===ou?Br:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ho(e){for(var t=Ts(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Co(i)]}return t}function fo(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Fr(r)?r:n}var po=bt?function(e){return null==e?[]:(e=Ne(e),Ot(bt(e),(function(t){return $e.call(e,t)})))}:gu,vo=bt?function(e){for(var t=[];e;)Ft(t,po(e)),e=He(e);return t}:gu,go=Cr;function yo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=Wo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&es(i)&&wo(a,i)&&(Ua(e)||Ya(e))}function bo(e){return"function"!=typeof e.constructor||Do(e)?{}:Xn(He(e))}function mo(e){return Ua(e)||Ya(e)||!!(Ze&&e&&e[Ze])}function wo(e,t){var n=typeof e;return!!(t=null==t?f:t)&&("number"==n||"symbol"!=n&&be.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,n){if(!ts(n))return!1;var r=typeof t;return!!("number"==r?Ha(n)&&wo(t,n.length):"string"==r&&t in n)&&za(n[t],e)}function _o(e,t){if(Ua(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!cs(e))||(ee.test(e)||!Q.test(e)||null!=t&&e in Ne(t))}function Ro(e){var t=so(e),n=zn[t];if("function"!=typeof n||!(t in Un.prototype))return!1;if(e===n)return!0;var r=ao(n);return!!r&&e===r[0]}(Dn&&go(new Dn(new ArrayBuffer(1)))!=A||Cn&&go(new Cn)!=R||Nn&&go(Nn.resolve())!=C||Pn&&go(new Pn)!=P||kn&&go(new kn)!=O)&&(go=function(e){var t=Cr(e),r=t==D?e.constructor:n,i=r?jo(r):"";if(i)switch(i){case An:return A;case In:return R;case Fn:return C;case Bn:return P;case Ln:return O}return t});var Eo=Ie?Ja:yu;function Do(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function Co(e){return e==e&&!ts(e)}function No(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==n||e in Ne(r)))}}function Po(e,t,r){return t=mn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=mn(n.length-t,0),a=_e(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=_e(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),Ct(e,this,s)}}function ko(e,t){return t.length<2?e:Er(e,ii(t,0,-1))}function xo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Oo=Fo(ti),To=pt||function(e,t){return dt.setTimeout(e,t)},Ao=Fo(ni);function Io(e,t,n){var r=t+"";return Ao(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Pt(v,(function(n){var r="_."+n[0];t&n[1]&&!Tt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ue):[]}(r),n)))}function Fo(e){var t=0,r=0;return function(){var i=Sn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Bo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var a=$r(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Lo=function(e){var t=Fa(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,n,r,i){t.push(r?i.replace(he,"$1"):n||e)})),t}));function Wo(e){if("string"==typeof e||cs(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Mo(e){if(e instanceof Un)return e.clone();var t=new Yn(e.__wrapped__,e.__chain__);return t.__actions__=xi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Zr((function(e,t){return Ka(e)?fr(e,br(t,1,Ka,!0)):[]})),Xo=Zr((function(e,t){var r=Zo(t);return Ka(r)&&(r=n),Ka(e)?fr(e,br(t,1,Ka,!0),co(r,2)):[]})),Vo=Zr((function(e,t){var r=Zo(t);return Ka(r)&&(r=n),Ka(e)?fr(e,br(t,1,Ka,!0),n,r):[]}));function Yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:vs(n);return i<0&&(i=mn(r+i,0)),zt(e,co(t,3),i)}function Uo(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=vs(r),o=r<0?mn(i+o,0):wn(o,i-1)),zt(e,co(t,3),o,!0)}function qo(e){return(null==e?0:e.length)?br(e,1):[]}function Ho(e){return e&&e.length?e[0]:n}var Ko=Zr((function(e){var t=It(e,bi);return t.length&&t[0]===e[0]?xr(t):[]})),$o=Zr((function(e){var t=Zo(e),r=It(e,bi);return t===Zo(r)?t=n:r.pop(),r.length&&r[0]===e[0]?xr(r,co(t,2)):[]})),Go=Zr((function(e){var t=Zo(e),r=It(e,bi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?xr(r,n,t):[]}));function Zo(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Jo=Zr(Qo);function Qo(e,t){return e&&e.length&&t&&t.length?Hr(e,t):e}var ea=ro((function(e,t){var n=null==e?0:e.length,r=sr(e,t);return Kr(e,It(t,(function(e){return wo(e,n)?+e:e})).sort(Ni)),r}));function ta(e){return null==e?e:En.call(e)}var na=Zr((function(e){return hi(br(e,1,Ka,!0))})),ra=Zr((function(e){var t=Zo(e);return Ka(t)&&(t=n),hi(br(e,1,Ka,!0),co(t,2))})),ia=Zr((function(e){var t=Zo(e);return t="function"==typeof t?t:n,hi(br(e,1,Ka,!0),n,t)}));function oa(e){if(!e||!e.length)return[];var t=0;return e=Ot(e,(function(e){if(Ka(e))return t=mn(e.length,t),!0})),Gt(t,(function(t){return It(e,qt(t))}))}function aa(e,t){if(!e||!e.length)return[];var r=oa(e);return null==t?r:It(r,(function(e){return Ct(t,n,e)}))}var sa=Zr((function(e,t){return Ka(e)?fr(e,t):[]})),ua=Zr((function(e){return gi(Ot(e,Ka))})),ca=Zr((function(e){var t=Zo(e);return Ka(t)&&(t=n),gi(Ot(e,Ka),co(t,2))})),la=Zr((function(e){var t=Zo(e);return t="function"==typeof t?t:n,gi(Ot(e,Ka),n,t)})),ha=Zr(oa);var fa=Zr((function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,aa(e,r)}));function pa(e){var t=zn(e);return t.__chain__=!0,t}function da(e,t){return t(e)}var va=ro((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return sr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Un&&wo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:da,args:[o],thisArg:n}),new Yn(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(o)}));var ga=Ti((function(e,t,n){Be.call(e,n)?++e[n]:ar(e,n,1)}));var ya=ji(Yo),ba=ji(Uo);function ma(e,t){return(Ua(e)?Pt:pr)(e,co(t,3))}function wa(e,t){return(Ua(e)?kt:dr)(e,co(t,3))}var Sa=Ti((function(e,t,n){Be.call(e,n)?e[n].push(t):ar(e,n,[t])}));var _a=Zr((function(e,t,n){var r=-1,i="function"==typeof t,o=Ha(e)?_e(e.length):[];return pr(e,(function(e){o[++r]=i?Ct(t,e,n):Or(e,t,n)})),o})),Ra=Ti((function(e,t,n){ar(e,n,t)}));function Ea(e,t){return(Ua(e)?It:Mr)(e,co(t,3))}var Da=Ti((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ca=Zr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&So(e,t[0],t[1])?t=[]:n>2&&So(t[0],t[1],t[2])&&(t=[t[0]]),Ur(e,br(t,1),[])})),Na=ft||function(){return dt.Date.now()};function Pa(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ji(e,c,n,n,n,n,t)}function ka(e,t){var i;if("function"!=typeof t)throw new xe(r);return e=vs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var xa=Zr((function(e,t,n){var r=1;if(n.length){var i=ln(n,uo(xa));r|=s}return Ji(e,r,t,n,i)})),Oa=Zr((function(e,t,n){var r=3;if(n.length){var i=ln(n,uo(Oa));r|=s}return Ji(t,r,e,n,i)}));function Ta(e,t,i){var o,a,s,u,c,l,h=0,f=!1,p=!1,d=!0;if("function"!=typeof e)throw new xe(r);function v(t){var r=o,i=a;return o=a=n,h=t,u=e.apply(i,r)}function g(e){var r=e-l;return l===n||r>=t||r<0||p&&e-h>=s}function y(){var e=Na();if(g(e))return b(e);c=To(y,function(e){var n=t-(e-l);return p?wn(n,s-(e-h)):n}(e))}function b(e){return c=n,d&&o?v(e):(o=a=n,u)}function m(){var e=Na(),r=g(e);if(o=arguments,a=this,l=e,r){if(c===n)return function(e){return h=e,c=To(y,t),f?v(e):u}(l);if(p)return Ri(c),c=To(y,t),v(l)}return c===n&&(c=To(y,t)),u}return t=ys(t)||0,ts(i)&&(f=!!i.leading,s=(p="maxWait"in i)?mn(ys(i.maxWait)||0,t):s,d="trailing"in i?!!i.trailing:d),m.cancel=function(){c!==n&&Ri(c),h=0,o=l=a=c=n},m.flush=function(){return c===n?u:b(Na())},m}var Aa=Zr((function(e,t){return hr(e,1,t)})),Ia=Zr((function(e,t,n){return hr(e,ys(t)||0,n)}));function Fa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Fa.Cache||Kn),n}function Ba(e){if("function"!=typeof e)throw new xe(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fa.Cache=Kn;var La=Si((function(e,t){var n=(t=1==t.length&&Ua(t[0])?It(t[0],Jt(co())):It(br(t,1),Jt(co()))).length;return Zr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Wa=Zr((function(e,t){var r=ln(t,uo(Wa));return Ji(e,s,n,t,r)})),ja=Zr((function(e,t){var r=ln(t,uo(ja));return Ji(e,u,n,t,r)})),Ma=ro((function(e,t){return Ji(e,l,n,n,n,t)}));function za(e,t){return e===t||e!=e&&t!=t}var Xa=Hi(Nr),Va=Hi((function(e,t){return e>=t})),Ya=Tr(function(){return arguments}())?Tr:function(e){return ns(e)&&Be.call(e,"callee")&&!$e.call(e,"callee")},Ua=_e.isArray,qa=wt?Jt(wt):function(e){return ns(e)&&Cr(e)==T};function Ha(e){return null!=e&&es(e.length)&&!Ja(e)}function Ka(e){return ns(e)&&Ha(e)}var $a=mt||yu,Ga=St?Jt(St):function(e){return ns(e)&&Cr(e)==m};function Za(e){if(!ns(e))return!1;var t=Cr(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Ja(e){if(!ts(e))return!1;var t=Cr(e);return t==S||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==vs(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var rs=_t?Jt(_t):function(e){return ns(e)&&go(e)==R};function is(e){return"number"==typeof e||ns(e)&&Cr(e)==E}function os(e){if(!ns(e)||Cr(e)!=D)return!1;var t=He(e);if(null===t)return!0;var n=Be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Fe.call(n)==Me}var as=Rt?Jt(Rt):function(e){return ns(e)&&Cr(e)==N};var ss=Et?Jt(Et):function(e){return ns(e)&&go(e)==P};function us(e){return"string"==typeof e||!Ua(e)&&ns(e)&&Cr(e)==k}function cs(e){return"symbol"==typeof e||ns(e)&&Cr(e)==x}var ls=Dt?Jt(Dt):function(e){return ns(e)&&es(e.length)&&!!st[Cr(e)]};var hs=Hi(jr),fs=Hi((function(e,t){return e<=t}));function ps(e){if(!e)return[];if(Ha(e))return us(e)?dn(e):xi(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=go(e);return(t==R?un:t==P?hn:zs)(e)}function ds(e){return e?(e=ys(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vs(e){var t=ds(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?ur(vs(e),0,d):0}function ys(e){if("number"==typeof e)return e;if(cs(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var n=ve.test(e);return n||ye.test(e)?ht(e.slice(2),n?2:8):de.test(e)?p:+e}function bs(e){return Oi(e,As(e))}function ms(e){return null==e?"":li(e)}var ws=Ai((function(e,t){if(Do(t)||Ha(t))Oi(t,Ts(t),e);else for(var n in t)Be.call(t,n)&&nr(e,n,t[n])})),Ss=Ai((function(e,t){Oi(t,As(t),e)})),_s=Ai((function(e,t,n,r){Oi(t,As(t),e,r)})),Rs=Ai((function(e,t,n,r){Oi(t,Ts(t),e,r)})),Es=ro(sr);var Ds=Zr((function(e,t){e=Ne(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&So(t[0],t[1],o)&&(i=1);++r<i;)for(var a=t[r],s=As(a),u=-1,c=s.length;++u<c;){var l=s[u],h=e[l];(h===n||za(h,Ae[l])&&!Be.call(e,l))&&(e[l]=a[l])}return e})),Cs=Zr((function(e){return e.push(n,eo),Ct(Fs,n,e)}));function Ns(e,t,r){var i=null==e?n:Er(e,t);return i===n?r:i}function Ps(e,t){return null!=e&&yo(e,t,kr)}var ks=Xi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=n}),tu(iu)),xs=Xi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Be.call(e,t)?e[t].push(n):e[t]=[n]}),co),Os=Zr(Or);function Ts(e){return Ha(e)?Zn(e):Lr(e)}function As(e){return Ha(e)?Zn(e,!0):Wr(e)}var Is=Ai((function(e,t,n){Vr(e,t,n)})),Fs=Ai((function(e,t,n,r){Vr(e,t,n,r)})),Bs=ro((function(e,t){var n={};if(null==e)return n;var r=!1;t=It(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Oi(e,oo(e),n),r&&(n=cr(n,7,to));for(var i=t.length;i--;)fi(n,t[i]);return n}));var Ls=ro((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ps(e,n)}))}(e,t)}));function Ws(e,t){if(null==e)return{};var n=It(oo(e),(function(e){return[e]}));return t=co(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var js=Zi(Ts),Ms=Zi(As);function zs(e){return null==e?[]:Qt(e,Ts(e))}var Xs=Li((function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}));function Vs(e){return Zs(ms(e).toLowerCase())}function Ys(e){return(e=ms(e))&&e.replace(me,rn).replace(et,"")}var Us=Li((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),qs=Li((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Hs=Bi("toLowerCase");var Ks=Li((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Li((function(e,t,n){return e+(n?" ":"")+Zs(t)}));var Gs=Li((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zs=Bi("toUpperCase");function Js(e,t,r){return e=ms(e),(t=r?n:t)===n?function(e){return it.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Qs=Zr((function(e,t){try{return Ct(e,n,t)}catch(e){return Za(e)?e:new Ee(e)}})),eu=ro((function(e,t){return Pt(t,(function(t){t=Wo(t),ar(e,t,xa(e[t],e))})),e}));function tu(e){return function(){return e}}var nu=Mi(),ru=Mi(!0);function iu(e){return e}function ou(e){return Br("function"==typeof e?e:cr(e,1))}var au=Zr((function(e,t){return function(n){return Or(n,e,t)}})),su=Zr((function(e,t){return function(n){return Or(e,n,t)}}));function uu(e,t,n){var r=Ts(t),i=Rr(t,r);null!=n||ts(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Rr(t,Ts(t)));var o=!(ts(n)&&"chain"in n&&!n.chain),a=Ja(e);return Pt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=xi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Ft([this.value()],arguments))})})),e}function cu(){}var lu=Yi(It),hu=Yi(xt),fu=Yi(Wt);function pu(e){return _o(e)?qt(Wo(e)):function(e){return function(t){return Er(t,e)}}(e)}var du=qi(),vu=qi(!0);function gu(){return[]}function yu(){return!1}var bu=Vi((function(e,t){return e+t}),0),mu=$i("ceil"),wu=Vi((function(e,t){return e/t}),1),Su=$i("floor");var _u,Ru=Vi((function(e,t){return e*t}),1),Eu=$i("round"),Du=Vi((function(e,t){return e-t}),0);return zn.after=function(e,t){if("function"!=typeof t)throw new xe(r);return e=vs(e),function(){if(--e<1)return t.apply(this,arguments)}},zn.ary=Pa,zn.assign=ws,zn.assignIn=Ss,zn.assignInWith=_s,zn.assignWith=Rs,zn.at=Es,zn.before=ka,zn.bind=xa,zn.bindAll=eu,zn.bindKey=Oa,zn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ua(e)?e:[e]},zn.chain=pa,zn.chunk=function(e,t,r){t=(r?So(e,t,r):t===n)?1:mn(vs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=_e(vt(i/t));o<i;)s[a++]=ii(e,o,o+=t);return s},zn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},zn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=_e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Ft(Ua(n)?xi(n):[n],br(t,1))},zn.cond=function(e){var t=null==e?0:e.length,n=co();return e=t?It(e,(function(e){if("function"!=typeof e[1])throw new xe(r);return[n(e[0]),e[1]]})):[],Zr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},zn.conforms=function(e){return function(e){var t=Ts(e);return function(n){return lr(n,e,t)}}(cr(e,1))},zn.constant=tu,zn.countBy=ga,zn.create=function(e,t){var n=Xn(e);return null==t?n:or(n,t)},zn.curry=function e(t,r,i){var o=Ji(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},zn.curryRight=function e(t,r,i){var o=Ji(t,a,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},zn.debounce=Ta,zn.defaults=Ds,zn.defaultsDeep=Cs,zn.defer=Aa,zn.delay=Ia,zn.difference=zo,zn.differenceBy=Xo,zn.differenceWith=Vo,zn.drop=function(e,t,r){var i=null==e?0:e.length;return i?ii(e,(t=r||t===n?1:vs(t))<0?0:t,i):[]},zn.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?ii(e,0,(t=i-(t=r||t===n?1:vs(t)))<0?0:t):[]},zn.dropRightWhile=function(e,t){return e&&e.length?di(e,co(t,3),!0,!0):[]},zn.dropWhile=function(e,t){return e&&e.length?di(e,co(t,3),!0):[]},zn.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&So(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=vs(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:vs(i))<0&&(i+=o),i=r>i?0:gs(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},zn.filter=function(e,t){return(Ua(e)?Ot:yr)(e,co(t,3))},zn.flatMap=function(e,t){return br(Ea(e,t),1)},zn.flatMapDeep=function(e,t){return br(Ea(e,t),h)},zn.flatMapDepth=function(e,t,r){return r=r===n?1:vs(r),br(Ea(e,t),r)},zn.flatten=qo,zn.flattenDeep=function(e){return(null==e?0:e.length)?br(e,h):[]},zn.flattenDepth=function(e,t){return(null==e?0:e.length)?br(e,t=t===n?1:vs(t)):[]},zn.flip=function(e){return Ji(e,512)},zn.flow=nu,zn.flowRight=ru,zn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},zn.functions=function(e){return null==e?[]:Rr(e,Ts(e))},zn.functionsIn=function(e){return null==e?[]:Rr(e,As(e))},zn.groupBy=Sa,zn.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},zn.intersection=Ko,zn.intersectionBy=$o,zn.intersectionWith=Go,zn.invert=ks,zn.invertBy=xs,zn.invokeMap=_a,zn.iteratee=ou,zn.keyBy=Ra,zn.keys=Ts,zn.keysIn=As,zn.map=Ea,zn.mapKeys=function(e,t){var n={};return t=co(t,3),Sr(e,(function(e,r,i){ar(n,t(e,r,i),e)})),n},zn.mapValues=function(e,t){var n={};return t=co(t,3),Sr(e,(function(e,r,i){ar(n,r,t(e,r,i))})),n},zn.matches=function(e){return zr(cr(e,1))},zn.matchesProperty=function(e,t){return Xr(e,cr(t,1))},zn.memoize=Fa,zn.merge=Is,zn.mergeWith=Fs,zn.method=au,zn.methodOf=su,zn.mixin=uu,zn.negate=Ba,zn.nthArg=function(e){return e=vs(e),Zr((function(t){return Yr(t,e)}))},zn.omit=Bs,zn.omitBy=function(e,t){return Ws(e,Ba(co(t)))},zn.once=function(e){return ka(2,e)},zn.orderBy=function(e,t,r,i){return null==e?[]:(Ua(t)||(t=null==t?[]:[t]),Ua(r=i?n:r)||(r=null==r?[]:[r]),Ur(e,t,r))},zn.over=lu,zn.overArgs=La,zn.overEvery=hu,zn.overSome=fu,zn.partial=Wa,zn.partialRight=ja,zn.partition=Da,zn.pick=Ls,zn.pickBy=Ws,zn.property=pu,zn.propertyOf=function(e){return function(t){return null==e?n:Er(e,t)}},zn.pull=Jo,zn.pullAll=Qo,zn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Hr(e,t,co(n,2)):e},zn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Hr(e,t,n,r):e},zn.pullAt=ea,zn.range=du,zn.rangeRight=vu,zn.rearg=Ma,zn.reject=function(e,t){return(Ua(e)?Ot:yr)(e,Ba(co(t,3)))},zn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=co(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Kr(e,i),n},zn.rest=function(e,t){if("function"!=typeof e)throw new xe(r);return Zr(e,t=t===n?t:vs(t))},zn.reverse=ta,zn.sampleSize=function(e,t,r){return t=(r?So(e,t,r):t===n)?1:vs(t),(Ua(e)?Qn:Qr)(e,t)},zn.set=function(e,t,n){return null==e?e:ei(e,t,n)},zn.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:ei(e,t,r,i)},zn.shuffle=function(e){return(Ua(e)?er:ri)(e)},zn.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&So(e,t,r)?(t=0,r=i):(t=null==t?0:vs(t),r=r===n?i:vs(r)),ii(e,t,r)):[]},zn.sortBy=Ca,zn.sortedUniq=function(e){return e&&e.length?ui(e):[]},zn.sortedUniqBy=function(e,t){return e&&e.length?ui(e,co(t,2)):[]},zn.split=function(e,t,r){return r&&"number"!=typeof r&&So(e,t,r)&&(t=r=n),(r=r===n?d:r>>>0)?(e=ms(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=li(t))&&sn(e)?_i(dn(e),0,r):e.split(t,r):[]},zn.spread=function(e,t){if("function"!=typeof e)throw new xe(r);return t=null==t?0:mn(vs(t),0),Zr((function(n){var r=n[t],i=_i(n,0,t);return r&&Ft(i,r),Ct(e,this,i)}))},zn.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zn.take=function(e,t,r){return e&&e.length?ii(e,0,(t=r||t===n?1:vs(t))<0?0:t):[]},zn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=r||t===n?1:vs(t)))<0?0:t,i):[]},zn.takeRightWhile=function(e,t){return e&&e.length?di(e,co(t,3),!1,!0):[]},zn.takeWhile=function(e,t){return e&&e.length?di(e,co(t,3)):[]},zn.tap=function(e,t){return t(e),e},zn.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new xe(r);return ts(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ta(e,t,{leading:i,maxWait:t,trailing:o})},zn.thru=da,zn.toArray=ps,zn.toPairs=js,zn.toPairsIn=Ms,zn.toPath=function(e){return Ua(e)?It(e,Wo):cs(e)?[e]:xi(Lo(ms(e)))},zn.toPlainObject=bs,zn.transform=function(e,t,n){var r=Ua(e),i=r||$a(e)||ls(e);if(t=co(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:ts(e)&&Ja(o)?Xn(He(e)):{}}return(i?Pt:Sr)(e,(function(e,r,i){return t(n,e,r,i)})),n},zn.unary=function(e){return Pa(e,1)},zn.union=na,zn.unionBy=ra,zn.unionWith=ia,zn.uniq=function(e){return e&&e.length?hi(e):[]},zn.uniqBy=function(e,t){return e&&e.length?hi(e,co(t,2)):[]},zn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?hi(e,n,t):[]},zn.unset=function(e,t){return null==e||fi(e,t)},zn.unzip=oa,zn.unzipWith=aa,zn.update=function(e,t,n){return null==e?e:pi(e,t,mi(n))},zn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:pi(e,t,mi(r),i)},zn.values=zs,zn.valuesIn=function(e){return null==e?[]:Qt(e,As(e))},zn.without=sa,zn.words=Js,zn.wrap=function(e,t){return Wa(mi(t),e)},zn.xor=ua,zn.xorBy=ca,zn.xorWith=la,zn.zip=ha,zn.zipObject=function(e,t){return yi(e||[],t||[],nr)},zn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zn.zipWith=fa,zn.entries=js,zn.entriesIn=Ms,zn.extend=Ss,zn.extendWith=_s,uu(zn,zn),zn.add=bu,zn.attempt=Qs,zn.camelCase=Xs,zn.capitalize=Vs,zn.ceil=mu,zn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ys(r))==r?r:0),t!==n&&(t=(t=ys(t))==t?t:0),ur(ys(e),t,r)},zn.clone=function(e){return cr(e,4)},zn.cloneDeep=function(e){return cr(e,5)},zn.cloneDeepWith=function(e,t){return cr(e,5,t="function"==typeof t?t:n)},zn.cloneWith=function(e,t){return cr(e,4,t="function"==typeof t?t:n)},zn.conformsTo=function(e,t){return null==t||lr(e,t,Ts(t))},zn.deburr=Ys,zn.defaultTo=function(e,t){return null==e||e!=e?t:e},zn.divide=wu,zn.endsWith=function(e,t,r){e=ms(e),t=li(t);var i=e.length,o=r=r===n?i:ur(vs(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},zn.eq=za,zn.escape=function(e){return(e=ms(e))&&$.test(e)?e.replace(H,on):e},zn.escapeRegExp=function(e){return(e=ms(e))&&re.test(e)?e.replace(ne,"\\$&"):e},zn.every=function(e,t,r){var i=Ua(e)?xt:vr;return r&&So(e,t,r)&&(t=n),i(e,co(t,3))},zn.find=ya,zn.findIndex=Yo,zn.findKey=function(e,t){return Mt(e,co(t,3),Sr)},zn.findLast=ba,zn.findLastIndex=Uo,zn.findLastKey=function(e,t){return Mt(e,co(t,3),_r)},zn.floor=Su,zn.forEach=ma,zn.forEachRight=wa,zn.forIn=function(e,t){return null==e?e:mr(e,co(t,3),As)},zn.forInRight=function(e,t){return null==e?e:wr(e,co(t,3),As)},zn.forOwn=function(e,t){return e&&Sr(e,co(t,3))},zn.forOwnRight=function(e,t){return e&&_r(e,co(t,3))},zn.get=Ns,zn.gt=Xa,zn.gte=Va,zn.has=function(e,t){return null!=e&&yo(e,t,Pr)},zn.hasIn=Ps,zn.head=Ho,zn.identity=iu,zn.includes=function(e,t,n,r){e=Ha(e)?e:zs(e),n=n&&!r?vs(n):0;var i=e.length;return n<0&&(n=mn(i+n,0)),us(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Xt(e,t,n)>-1},zn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:vs(n);return i<0&&(i=mn(r+i,0)),Xt(e,t,i)},zn.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=wn(t,n)&&e<mn(t,n)}(e=ys(e),t,r)},zn.invoke=Os,zn.isArguments=Ya,zn.isArray=Ua,zn.isArrayBuffer=qa,zn.isArrayLike=Ha,zn.isArrayLikeObject=Ka,zn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Cr(e)==b},zn.isBuffer=$a,zn.isDate=Ga,zn.isElement=function(e){return ns(e)&&1===e.nodeType&&!os(e)},zn.isEmpty=function(e){if(null==e)return!0;if(Ha(e)&&(Ua(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||ls(e)||Ya(e)))return!e.length;var t=go(e);if(t==R||t==P)return!e.size;if(Do(e))return!Lr(e).length;for(var n in e)if(Be.call(e,n))return!1;return!0},zn.isEqual=function(e,t){return Ar(e,t)},zn.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Ar(e,t,n,r):!!i},zn.isError=Za,zn.isFinite=function(e){return"number"==typeof e&&jt(e)},zn.isFunction=Ja,zn.isInteger=Qa,zn.isLength=es,zn.isMap=rs,zn.isMatch=function(e,t){return e===t||Ir(e,t,ho(t))},zn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Ir(e,t,ho(t),r)},zn.isNaN=function(e){return is(e)&&e!=+e},zn.isNative=function(e){if(Eo(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(e)},zn.isNil=function(e){return null==e},zn.isNull=function(e){return null===e},zn.isNumber=is,zn.isObject=ts,zn.isObjectLike=ns,zn.isPlainObject=os,zn.isRegExp=as,zn.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=f},zn.isSet=ss,zn.isString=us,zn.isSymbol=cs,zn.isTypedArray=ls,zn.isUndefined=function(e){return e===n},zn.isWeakMap=function(e){return ns(e)&&go(e)==O},zn.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Cr(e)},zn.join=function(e,t){return null==e?"":Ht.call(e,t)},zn.kebabCase=Us,zn.last=Zo,zn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=vs(r))<0?mn(i+o,0):wn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):zt(e,Yt,o,!0)},zn.lowerCase=qs,zn.lowerFirst=Hs,zn.lt=hs,zn.lte=fs,zn.max=function(e){return e&&e.length?gr(e,iu,Nr):n},zn.maxBy=function(e,t){return e&&e.length?gr(e,co(t,2),Nr):n},zn.mean=function(e){return Ut(e,iu)},zn.meanBy=function(e,t){return Ut(e,co(t,2))},zn.min=function(e){return e&&e.length?gr(e,iu,jr):n},zn.minBy=function(e,t){return e&&e.length?gr(e,co(t,2),jr):n},zn.stubArray=gu,zn.stubFalse=yu,zn.stubObject=function(){return{}},zn.stubString=function(){return""},zn.stubTrue=function(){return!0},zn.multiply=Ru,zn.nth=function(e,t){return e&&e.length?Yr(e,vs(t)):n},zn.noConflict=function(){return dt._===this&&(dt._=ze),this},zn.noop=cu,zn.now=Na,zn.pad=function(e,t,n){e=ms(e);var r=(t=vs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ui(gt(i),n)+e+Ui(vt(i),n)},zn.padEnd=function(e,t,n){e=ms(e);var r=(t=vs(t))?pn(e):0;return t&&r<t?e+Ui(t-r,n):e},zn.padStart=function(e,t,n){e=ms(e);var r=(t=vs(t))?pn(e):0;return t&&r<t?Ui(t-r,n)+e:e},zn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ms(e).replace(ie,""),t||0)},zn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&So(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=ds(e),t===n?(t=e,e=0):t=ds(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=Rn();return wn(e+o*(t-e+lt("1e-"+((o+"").length-1))),t)}return $r(e,t)},zn.reduce=function(e,t,n){var r=Ua(e)?Bt:Kt,i=arguments.length<3;return r(e,co(t,4),n,i,pr)},zn.reduceRight=function(e,t,n){var r=Ua(e)?Lt:Kt,i=arguments.length<3;return r(e,co(t,4),n,i,dr)},zn.repeat=function(e,t,r){return t=(r?So(e,t,r):t===n)?1:vs(t),Gr(ms(e),t)},zn.replace=function(){var e=arguments,t=ms(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zn.result=function(e,t,r){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=n);++i<o;){var a=null==e?n:e[Wo(t[i])];a===n&&(i=o,a=r),e=Ja(a)?a.call(e):a}return e},zn.round=Eu,zn.runInContext=e,zn.sample=function(e){return(Ua(e)?Jn:Jr)(e)},zn.size=function(e){if(null==e)return 0;if(Ha(e))return us(e)?pn(e):e.length;var t=go(e);return t==R||t==P?e.size:Lr(e).length},zn.snakeCase=Ks,zn.some=function(e,t,r){var i=Ua(e)?Wt:oi;return r&&So(e,t,r)&&(t=n),i(e,co(t,3))},zn.sortedIndex=function(e,t){return ai(e,t)},zn.sortedIndexBy=function(e,t,n){return si(e,t,co(n,2))},zn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ai(e,t);if(r<n&&za(e[r],t))return r}return-1},zn.sortedLastIndex=function(e,t){return ai(e,t,!0)},zn.sortedLastIndexBy=function(e,t,n){return si(e,t,co(n,2),!0)},zn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ai(e,t,!0)-1;if(za(e[n],t))return n}return-1},zn.startCase=$s,zn.startsWith=function(e,t,n){return e=ms(e),n=null==n?0:ur(vs(n),0,e.length),t=li(t),e.slice(n,n+t.length)==t},zn.subtract=Du,zn.sum=function(e){return e&&e.length?$t(e,iu):0},zn.sumBy=function(e,t){return e&&e.length?$t(e,co(t,2)):0},zn.template=function(e,t,r){var i=zn.templateSettings;r&&So(e,t,r)&&(t=n),e=ms(e),t=_s({},t,i,Qi);var o,a,s=_s({},t.imports,i.imports,Qi),u=Ts(s),c=Qt(s,u),l=0,h=t.interpolate||we,f="__p += '",p=Pe((t.escape||we).source+"|"+h.source+"|"+(h===J?fe:we).source+"|"+(t.evaluate||we).source+"|$","g"),d="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";e.replace(p,(function(t,n,r,i,s,u){return r||(r=i),f+=e.slice(l,u).replace(Se,an),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),f+="';\n";var v=Be.call(t,"variable")&&t.variable;if(v){if(le.test(v))throw new Ee("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(V,""):f).replace(Y,"$1").replace(U,"$1;"),f="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Qs((function(){return De(u,d+"return "+f).apply(n,c)}));if(g.source=f,Za(g))throw g;return g},zn.times=function(e,t){if((e=vs(e))<1||e>f)return[];var n=d,r=wn(e,d);t=co(t),e-=d;for(var i=Gt(r,t);++n<e;)t(n);return i},zn.toFinite=ds,zn.toInteger=vs,zn.toLength=gs,zn.toLower=function(e){return ms(e).toLowerCase()},zn.toNumber=ys,zn.toSafeInteger=function(e){return e?ur(vs(e),-9007199254740991,f):0===e?e:0},zn.toString=ms,zn.toUpper=function(e){return ms(e).toUpperCase()},zn.trim=function(e,t,r){if((e=ms(e))&&(r||t===n))return Zt(e);if(!e||!(t=li(t)))return e;var i=dn(e),o=dn(t);return _i(i,tn(i,o),nn(i,o)+1).join("")},zn.trimEnd=function(e,t,r){if((e=ms(e))&&(r||t===n))return e.slice(0,vn(e)+1);if(!e||!(t=li(t)))return e;var i=dn(e);return _i(i,0,nn(i,dn(t))+1).join("")},zn.trimStart=function(e,t,r){if((e=ms(e))&&(r||t===n))return e.replace(ie,"");if(!e||!(t=li(t)))return e;var i=dn(e);return _i(i,tn(i,dn(t))).join("")},zn.truncate=function(e,t){var r=30,i="...";if(ts(t)){var o="separator"in t?t.separator:o;r="length"in t?vs(t.length):r,i="omission"in t?li(t.omission):i}var a=(e=ms(e)).length;if(sn(e)){var s=dn(e);a=s.length}if(r>=a)return e;var u=r-pn(i);if(u<1)return i;var c=s?_i(s,0,u).join(""):e.slice(0,u);if(o===n)return c+i;if(s&&(u+=c.length-u),as(o)){if(e.slice(u).search(o)){var l,h=c;for(o.global||(o=Pe(o.source,ms(pe.exec(o))+"g")),o.lastIndex=0;l=o.exec(h);)var f=l.index;c=c.slice(0,f===n?u:f)}}else if(e.indexOf(li(o),u)!=u){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+i},zn.unescape=function(e){return(e=ms(e))&&K.test(e)?e.replace(q,gn):e},zn.uniqueId=function(e){var t=++Le;return ms(e)+t},zn.upperCase=Gs,zn.upperFirst=Zs,zn.each=ma,zn.eachRight=wa,zn.first=Ho,uu(zn,(_u={},Sr(zn,(function(e,t){Be.call(zn.prototype,t)||(_u[t]=e)})),_u),{chain:!1}),zn.VERSION="4.17.21",Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zn[e].placeholder=zn})),Pt(["drop","take"],(function(e,t){Un.prototype[e]=function(r){r=r===n?1:mn(vs(r),0);var i=this.__filtered__&&!t?new Un(this):this.clone();return i.__filtered__?i.__takeCount__=wn(r,i.__takeCount__):i.__views__.push({size:wn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Pt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Pt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}})),Pt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(iu)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Zr((function(e,t){return"function"==typeof e?new Un(this):this.map((function(n){return Or(n,e,t)}))})),Un.prototype.reject=function(e){return this.filter(Ba(co(e)))},Un.prototype.slice=function(e,t){e=vs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=vs(t))<0?r.dropRight(-t):r.take(t-e)),r)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(d)},Sr(Un.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,u=t instanceof Un,c=s[0],l=u||Ua(t),h=function(e){var t=o.apply(zn,Ft([e],s));return i&&f?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var f=this.__chain__,p=!!this.__actions__.length,d=a&&!f,v=u&&!p;if(!a&&l){t=v?t:new Un(this);var g=e.apply(t,s);return g.__actions__.push({func:da,args:[h],thisArg:n}),new Yn(g,f)}return d&&v?e.apply(this,s):(g=this.thru(h),d?i?g.value()[0]:g.value():g)})})),Pt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);zn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ua(i)?i:[],e)}return this[n]((function(n){return t.apply(Ua(n)?n:[],e)}))}})),Sr(Un.prototype,(function(e,t){var n=zn[t];if(n){var r=n.name+"";Be.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:t,func:n})}})),Tn[zi(n,2).name]=[{name:"wrapper",func:n}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=xi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=xi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=xi(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ua(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=mn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,c=r?s:a-1,l=this.__iteratees__,h=l.length,f=0,p=wn(u,this.__takeCount__);if(!n||!r&&i==u&&p==u)return vi(e,this.__actions__);var d=[];e:for(;u--&&f<p;){for(var v=-1,g=e[c+=t];++v<h;){var y=l[v],b=y.iteratee,m=y.type,w=b(g);if(2==m)g=w;else if(!w){if(1==m)continue e;break e}}d[f++]=g}return d},zn.prototype.at=va,zn.prototype.chain=function(){return pa(this)},zn.prototype.commit=function(){return new Yn(this.value(),this.__chain__)},zn.prototype.next=function(){this.__values__===n&&(this.__values__=ps(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},zn.prototype.plant=function(e){for(var t,r=this;r instanceof Vn;){var i=Mo(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},zn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:da,args:[ta],thisArg:n}),new Yn(t,this.__chain__)}return this.thru(ta)},zn.prototype.toJSON=zn.prototype.valueOf=zn.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},zn.prototype.first=zn.prototype.head,Je&&(zn.prototype[Je]=function(){return this}),zn}();gt?((gt.exports=yn)._=yn,vt._=yn):dt._=yn}).call(Be)})),We=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.request=null,t.resizeObserver=null,t.onResize=Le.debounce((function(e){e.preventDefault&&e.preventDefault(),t.request=requestAnimationFrame((function(){cancelAnimationFrame(t.request),t.dispatch(new B({scrollX:t.contentWindow.scrollX,scrollY:t.contentWindow.scrollY,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight,innerHeight:t.contentWindow.innerHeight,innerWidth:t.contentWindow.innerWidth,view:t.contentWindow,target:e.target||t.container}))}))}),500),t}return n(t,e),t.prototype.attach=function(){this.contentWindow&&this.contentWindow!==Designable.Shared.globalThisPolyfill?this.addEventListener("resize",this.onResize):this.container&&this.container!==document&&(this.resizeObserver=new Fe(this.onResize),this.resizeObserver.observe(this.container))},t.prototype.detach=function(){this.contentWindow&&this.contentWindow!==Designable.Shared.globalThisPolyfill?this.removeEventListener("resize",this.onResize):this.resizeObserver&&this.container&&this.container!==document&&(this.resizeObserver.unobserve(this.container),this.resizeObserver.disconnect())},t}(Designable.Shared.EventDriver),je=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.request=null,t.onScroll=function(e){e.preventDefault(),t.request=Designable.Shared.globalThisPolyfill.requestAnimationFrame((function(){t.dispatch(new L({scrollX:t.contentWindow.scrollX,scrollY:t.contentWindow.scrollY,width:t.contentWindow.document.body.clientWidth,height:t.contentWindow.document.body.clientHeight,innerHeight:t.contentWindow.innerHeight,innerWidth:t.contentWindow.innerWidth,view:t.contentWindow,target:e.target})),cancelAnimationFrame(t.request)}))},t}return n(t,e),t.prototype.attach=function(){this.addEventListener("scroll",this.onScroll)},t.prototype.detach=function(){this.removeEventListener("scroll",this.onScroll)},t}(Designable.Shared.EventDriver);var Me,ze,Xe,Ve=function(e){function t(){var t=e.apply(this,a([],o(arguments),!1))||this;return t.onKeyDown=function(e){var n,r,i;(n=e.target,r=n.tagName,i=!0,(n.isContentEditable||("INPUT"===r||"TEXTAREA"===r||"SELECT"===r||customElements.get(r.toLocaleLowerCase()))&&!n.readOnly)&&(i=!1),i)&&t.dispatch(new g(e))},t.onKeyUp=function(e){t.dispatch(new y(e))},t}return n(t,e),t.prototype.attach=function(){this.addEventListener("keydown",this.onKeyDown,{mode:"onlyParent"}),this.addEventListener("keyup",this.onKeyUp,{mode:"onlyParent"})},t.prototype.detach=function(){this.removeEventListener("keydown",this.onKeyDown,{mode:"onlyParent"}),this.removeEventListener("keyup",this.onKeyUp,{mode:"onlyParent"})},t}(Designable.Shared.EventDriver),Ye=function(e){return String(e).replace(/\s+/g,"_").toLocaleLowerCase()},Ue=function(e,t){if(Designable.Shared.isPlainObj(e)&&Designable.Shared.isPlainObj(t))return Designable.Shared.each(t,(function(t,n){var r=Ye(n),i=Ue(e[n]||e[r],t);e[r]=i})),e;if(Designable.Shared.isPlainObj(t)){var n=Array.isArray(t)?[]:{};return Designable.Shared.each(t,(function(e,t){var r=Ue(void 0,e);n[Ye(t)]=r})),n}return t},qe=function(e){var t=Ze.value,n=Ye(e);return Ge.value[n]?n:(Designable.Shared.each(Ge.value,(function(e,r){if(r.indexOf(n)>-1||String(n).indexOf(r)>-1)return t=r,!1})),t)},He=function(e,t){var n=function(t){return e.includes(t)};Designable.Shared.each(t,(function(r){if(r&&$t(r)){var i=r.Behavior;Designable.Shared.each(i,(function(r){if(!n(r)){var i=r.name;Designable.Shared.each(r.extends,(function(r){var o=function(e){for(var n in t)for(var r=t[n].Behavior,i=0;i<r.length;i++)if(r[i].name===e)return r[i]}(r);if(!o)throw new Error("No ".concat(r," behavior that ").concat(i," depends on"));n(o)||e.unshift(o)})),e.push(r)}}))}}))},Ke=Formily.Reactive.observable.ref([]),$e=Formily.Reactive.observable.ref({}),Ge=Formily.Reactive.observable.ref({}),Ze=Formily.Reactive.observable.ref(function(){var e;return Designable.Shared.globalThisPolyfill.navigator&&(Designable.Shared.globalThisPolyfill.navigator.browserlanguage||(null===(e=Designable.Shared.globalThisPolyfill.navigator)||void 0===e?void 0:e.language))||"en"}()),Je={setDesignerLanguage:function(e){Ze.value=e},setDesignerBehaviors:function(e){Ke.value=e.reduce((function(e,t){return $t(t)?e.concat(t.Behavior):Gt(t)?e.concat(t):e}),[])},getDesignerBehaviors:function(e){return Ke.value.filter((function(t){return t.selector(e)}))},getDesignerIcon:function(e){return $e[e]},getDesignerLanguage:function(){return qe(Ze.value)},getDesignerMessage:function(e,t){var n=qe(Ze.value),r=t?t[n]:Ge.value[n];if(r)return Formily.Path.Path.getIn(r,Ye(e));for(var i in Ge.value){var o=Formily.Path.Path.getIn(Ge.value[i],Ye(e));if(o)return o}},registerDesignerIcons:function(e){Object.assign($e,e)},registerDesignerLocales:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];e.forEach((function(e){Ue(Ge.value,e)}))},registerDesignerBehaviors:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];e.forEach((function(e){He(n,e)})),n.length&&(Ke.value=n)}},Qe=Je,et=new Map,tt=new Map,nt=function(e){e.parent&&(e.parent.children=e.parent.children.filter((function(t){return t!==e})))},rt=function(e,t){var n=function(e){e.depth=e.parent?e.parent.depth+1:0,e.children.forEach(n)},r=function(e){e.parent=t,e.root=t.root,n(e)},i=function(e){r(e),rt(e.children,e)};return e.map((function(e){var o;return e===t||(t.isSourceNode?i(e):e.isSourceNode?(e=e.clone(t),n(e)):!e.isRoot&&e.isInOperation?(null===(o=e.operation)||void 0===o||o.selection.remove(e),nt(e),r(e)):i(e),et.has(e.id)||(et.set(e.id,e),tt.set(e.componentName,e.designerProps))),e}))},it=function(e,t){return rt([e],t)[0]},ot=function(){function e(t,n){if(this.depth=0,this.hidden=!1,this.componentName="NO_NAME_COMPONENT",this.sourceName="",this.props={},this.children=[],t instanceof e)return t;this.id=t.id||Designable.Shared.uid(),n?(this.parent=n,this.depth=n.depth+1,this.root=n.root,et.set(this.id,this)):(this.root=this,this.rootOperation=t.operation,this.isSelfSourceNode=t.isSourceNode||!1,et.set(this.id,this)),t&&this.from(t),this.makeObservable()}return e.prototype.makeObservable=function(){Formily.Reactive.define(this,{componentName:Formily.Reactive.observable.ref,props:Formily.Reactive.observable,hidden:Formily.Reactive.observable.ref,children:Formily.Reactive.observable.shallow,designerProps:Formily.Reactive.observable.computed,designerLocales:Formily.Reactive.observable.computed,wrap:Formily.Reactive.action,prepend:Formily.Reactive.action,append:Formily.Reactive.action,insertAfter:Formily.Reactive.action,insertBefore:Formily.Reactive.action,remove:Formily.Reactive.action,setProps:Formily.Reactive.action,setChildren:Formily.Reactive.action,setComponentName:Formily.Reactive.action})},Object.defineProperty(e.prototype,"designerProps",{get:function(){var e=this;return Qe.getDesignerBehaviors(this).reduce((function(t,n){return n.designerProps?(Object.assign(t,(r=e,i=n.designerProps,Designable.Shared.isFn(i)?i(r):i)),t):t;var r,i}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"designerLocales",{get:function(){return Qe.getDesignerBehaviors(this).reduce((function(e,t){return t.designerLocales?(Ue(e,t.designerLocales),e):e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previous",{get:function(){if(this.parent!==this&&this.parent)return this.parent.children[this.index-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){if(this.parent!==this&&this.parent)return this.parent.children[this.index+1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"siblings",{get:function(){var e=this;return this.parent?this.parent.children.filter((function(t){return t!==e})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.parent!==this&&this.parent?this.parent.children.indexOf(this):0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"descendants",{get:function(){return this.children.reduce((function(e,t){return e.concat(t).concat(t.descendants)}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this===this.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInOperation",{get:function(){return!!this.operation},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.children[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSourceNode",{get:function(){return this.root.isSelfSourceNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operation",{get:function(){var e;return null===(e=this.root)||void 0===e?void 0:e.rootOperation},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewport",{get:function(){var e,t;return null===(t=null===(e=this.operation)||void 0===e?void 0:e.workspace)||void 0===t?void 0:t.viewport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outline",{get:function(){var e,t;return null===(t=null===(e=this.operation)||void 0===e?void 0:e.workspace)||void 0===t?void 0:t.outline},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"moveLayout",{get:function(){var e;return null===(e=this.viewport)||void 0===e?void 0:e.getValidNodeLayout(this)},enumerable:!1,configurable:!0}),e.prototype.getElement=function(e){var t;return void 0===e&&(e="viewport"),null===(t=this[e])||void 0===t?void 0:t.findElementById(this.id)},e.prototype.getValidElement=function(e){var t;return void 0===e&&(e="viewport"),null===(t=this[e])||void 0===t?void 0:t.getValidNodeElement(this)},e.prototype.getElementRect=function(e){var t;return void 0===e&&(e="viewport"),null===(t=this[e])||void 0===t?void 0:t.getElementRect(this.getElement(e))},e.prototype.getValidElementRect=function(e){var t;return void 0===e&&(e="viewport"),null===(t=this[e])||void 0===t?void 0:t.getValidNodeRect(this)},e.prototype.getElementOffsetRect=function(e){var t;return void 0===e&&(e="viewport"),null===(t=this[e])||void 0===t?void 0:t.getElementOffsetRect(this.getElement(e))},e.prototype.getValidElementOffsetRect=function(e){var t;return void 0===e&&(e="viewport"),null===(t=this[e])||void 0===t?void 0:t.getValidNodeOffsetRect(this)},e.prototype.getPrevious=function(e){return void 0===e&&(e=1),this.parent.children[this.index-e]},e.prototype.getAfter=function(e){return void 0===e&&(e=1),this.parent.children[this.index+e]},e.prototype.getSibling=function(e){return void 0===e&&(e=0),this.parent.children[e]},e.prototype.getParents=function(e){var t=e||this;return(null==t?void 0:t.parent)?[t.parent].concat(this.getParents(t.parent)):[]},e.prototype.getParentByDepth=function(e){void 0===e&&(e=0);var t=this.parent;return(null==t?void 0:t.depth)===e?t:null==t?void 0:t.getParentByDepth(e)},e.prototype.getMessage=function(e){return Qe.getDesignerMessage(e,this.designerLocales)},e.prototype.isMyAncestor=function(e){return e!==this&&this.parent!==e&&e.contains(this)},e.prototype.isMyParent=function(e){return this.parent===e},e.prototype.isMyParents=function(e){return e!==this&&(this.isMyParent(e)||this.isMyAncestor(e))},e.prototype.isMyChild=function(e){return e.isMyParent(this)},e.prototype.isMyChildren=function(e){return e.isMyParents(this)},e.prototype.takeSnapshot=function(e){var t;null===(t=this.operation)||void 0===t||t.snapshot(e)},e.prototype.triggerMutation=function(e,t,n){if(this.operation){var r=this.operation.dispatch(e,t)||n;return this.takeSnapshot(null==e?void 0:e.type),r}if(Designable.Shared.isFn(t))return t()},e.prototype.find=function(e){if(e(this))return this;var t=void 0;return this.eachChildren((function(n){if(e(n))return t=n,!1})),t},e.prototype.findAll=function(e){var t=[];return e(this)&&t.push(this),this.eachChildren((function(n){e(n)&&t.push(n)})),t},e.prototype.distanceTo=function(e){return this.root!==e.root||this.parent!==e.parent?1/0:Math.abs(this.index-e.index)},e.prototype.crossSiblings=function(e){if(this.parent!==e.parent)return[];for(var t=Math.min(this.index,e.index),n=Math.max(this.index,e.index),r=[],i=t+1;i<n;i++)r.push(this.parent.children[i]);return r},e.prototype.allowSibling=function(e){var t,n,r;return!1!==(null===(n=null===(t=this.designerProps)||void 0===t?void 0:t.allowSiblings)||void 0===n?void 0:n.call(t,this,e))&&(null===(r=this.parent)||void 0===r?void 0:r.allowAppend(e))},e.prototype.allowDrop=function(e){return!Designable.Shared.isFn(this.designerProps.allowDrop)||this.designerProps.allowDrop(e)},e.prototype.allowAppend=function(e){var t,n,r,i=this;return!!(null===(t=this.designerProps)||void 0===t?void 0:t.droppable)&&(!1!==(null===(r=null===(n=this.designerProps)||void 0===n?void 0:n.allowAppend)||void 0===r?void 0:r.call(n,this,e))&&(!e.some((function(e){return!e.allowDrop(i)}))&&(this.root,!0)))},e.prototype.allowClone=function(){var e;return this!==this.root&&(null===(e=this.designerProps.cloneable)||void 0===e||e)},e.prototype.allowDrag=function(){var e;return!(this===this.root&&!this.isSourceNode)&&(null===(e=this.designerProps.draggable)||void 0===e||e)},e.prototype.allowResize=function(){if(this===this.root&&!this.isSourceNode)return!1;var e=this.designerProps.resizable;return!!e&&(e.width&&e.height?["x","y"]:e.width?["x"]:["y"])},e.prototype.allowRotate=function(){},e.prototype.allowRound=function(){},e.prototype.allowScale=function(){},e.prototype.allowTranslate=function(){if(this===this.root&&!this.isSourceNode)return!1;var e=this.designerProps.translatable;return!(!(null==e?void 0:e.x)||!(null==e?void 0:e.y))},e.prototype.allowDelete=function(){var e;return this!==this.root&&(null===(e=this.designerProps.deletable)||void 0===e||e)},e.prototype.findById=function(e){var t;if(e)return this.id===e?this:(null===(t=this.children)||void 0===t?void 0:t.length)>0?et.get(e):void 0},e.prototype.contains=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.every((function(t){return t===e||(null==t?void 0:t.parent)===e||(null==t?void 0:t.getParentByDepth(e.depth))===e}))},e.prototype.eachTree=function(e){var t;Designable.Shared.isFn(e)&&(e(this.root),null===(t=this.root)||void 0===t||t.eachChildren(e))},e.prototype.eachChildren=function(e){if(Designable.Shared.isFn(e))for(var t=0;t<this.children.length;t++){var n=this.children[t];if(!1===e(n))return;n.eachChildren(e)}},e.prototype.resetNodesParent=function(e,t){var n=this;return rt(e.filter((function(e){return e!==n})),t)},e.prototype.setProps=function(e){var t=this;return this.triggerMutation(new x({target:this,source:null}),(function(){Object.assign(t.props,e)}))},e.prototype.setComponentName=function(e){this.componentName=e},e.prototype.prepend=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.some((function(t){return t.contains(e)})))return[];var r=t.map((function(e){return e.parent})),i=this.resetNodesParent(t,this);return i.length?this.triggerMutation(new D({originSourceParents:r,target:this,source:i}),(function(){return e.children=i.concat(e.children),i}),[]):[]},e.prototype.append=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.some((function(t){return t.contains(e)})))return[];var r=t.map((function(e){return e.parent})),i=this.resetNodesParent(t,this);return i.length?this.triggerMutation(new A({originSourceParents:r,target:this,source:i}),(function(){return e.children=e.children.concat(i),i}),[]):[]},e.prototype.wrap=function(e){var t=this;if(e!==this){var n=this.parent;return this.triggerMutation(new O({target:this,source:e}),(function(){return it(t,e),it(e,n),e}))}},e.prototype.insertAfter=function(){for(var e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.parent;if(n.some((function(e){return e.contains(t)})))return[];if(null===(e=null==i?void 0:i.children)||void 0===e?void 0:e.length){var o=n.map((function(e){return e.parent})),a=this.resetNodesParent(n,i);return a.length?this.triggerMutation(new _({originSourceParents:o,target:this,source:a}),(function(){return i.children=i.children.reduce((function(e,n){return n===t?e.concat([n]).concat(a):e.concat([n])}),[]),a}),[]):[]}return[]},e.prototype.insertBefore=function(){for(var e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.parent;if(n.some((function(e){return e.contains(t)})))return[];if(null===(e=null==i?void 0:i.children)||void 0===e?void 0:e.length){var o=n.map((function(e){return e.parent})),a=this.resetNodesParent(n,i);return a.length?this.triggerMutation(new R({originSourceParents:o,target:this,source:a}),(function(){return i.children=i.children.reduce((function(e,n){return n===t?e.concat(a).concat([n]):e.concat([n])}),[]),a}),[]):[]}return[]},e.prototype.insertChildren=function(e){for(var t,n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(r.some((function(e){return e.contains(n)})))return[];if(null===(t=this.children)||void 0===t?void 0:t.length){var o=r.map((function(e){return e.parent})),a=this.resetNodesParent(r,this);return a.length?this.triggerMutation(new E({originSourceParents:o,target:this,source:a}),(function(){return n.children=n.children.reduce((function(t,n,r){return r===e?t.concat(a).concat([n]):t.concat([n])}),[]),a}),[]):[]}return[]},e.prototype.setChildren=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.map((function(e){return e.parent})),i=this.resetNodesParent(t,this);return this.triggerMutation(new k({originSourceParents:r,target:this,source:i}),(function(){return e.children=i,i}),[])},e.prototype.setNodeChildren=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.setChildren.apply(this,a([],o(e),!1))},e.prototype.remove=function(){var e=this;return this.triggerMutation(new C({target:this,source:null}),(function(){nt(e),et.delete(e.id)}))},e.prototype.clone=function(t){var n=new e({id:Designable.Shared.uid(),componentName:this.componentName,sourceName:this.sourceName,props:Formily.Reactive.toJS(this.props),children:[]},t||this.parent);return n.children=rt(this.children.map((function(e){return e.clone(n)})),n),this.triggerMutation(new T({target:this,source:n}),(function(){return n}))},e.prototype.from=function(t){var n=this;if(t)return this.triggerMutation(new I({target:this,source:t}),(function(){var r,i,o;t.id&&t.id!==n.id&&(et.delete(n.id),et.set(t.id,n),n.id=t.id),t.componentName&&(n.componentName=t.componentName),n.props=null!==(r=t.props)&&void 0!==r?r:{},t.hidden&&(n.hidden=t.hidden),t.children&&(n.children=(null===(o=null===(i=t.children)||void 0===i?void 0:i.map)||void 0===o?void 0:o.call(i,(function(t){return new e(t,n)})))||[])}))},e.prototype.serialize=function(){return{id:this.id,componentName:this.componentName,sourceName:this.sourceName,props:Formily.Reactive.toJS(this.props),hidden:this.hidden,children:this.children.map((function(e){return e.serialize()}))}},e.create=function(t,n){return new e(t,n)},e.findById=function(e){return et.get(e)},e.remove=function(e){var t,n;void 0===e&&(e=[]);for(var r=e.length-1;r>=0;r--){var i=e[r];if(i.allowDelete()){var o=i.previous,a=i.next;i.remove(),null===(t=i.operation)||void 0===t||t.selection.select(o||(a||i.parent)),null===(n=i.operation)||void 0===n||n.hover.clear()}}},e.sort=function(e){return void 0===e&&(e=[]),e.sort((function(e,t){return e.depth!==t.depth?0:e.index-t.index>=0?1:-1}))},e.clone=function(t){void 0===t&&(t=[]);var n={},r={},i=e.sort(t).filter((function(e){return!t.some((function(t){return e.isMyParents(t)}))}));Designable.Shared.each(i,(function(e){var t,i,o,a,s,u,c;e!==e.root&&e.allowClone()&&(null==e?void 0:e.operation)&&(n[null===(t=null==e?void 0:e.parent)||void 0===t?void 0:t.id]=n[null===(i=null==e?void 0:e.parent)||void 0===i?void 0:i.id]||[],n[null===(o=null==e?void 0:e.parent)||void 0===o?void 0:o.id].push(e),r[null===(a=null==e?void 0:e.parent)||void 0===a?void 0:a.id]?e.index>r[null===(s=null==e?void 0:e.parent)||void 0===s?void 0:s.id].index&&(r[null===(u=null==e?void 0:e.parent)||void 0===u?void 0:u.id]=e):r[null===(c=null==e?void 0:e.parent)||void 0===c?void 0:c.id]=e)}));var s=new Map;Designable.Shared.each(n,(function(e,t){var n=r[t];Designable.Shared.each(e,(function(e){var t,r,i=e.clone();if(i)if((null===(t=e.operation)||void 0===t?void 0:t.selection.has(e))&&n.parent.allowAppend([i]))n.insertAfter(i),n=n.next;else if(1===e.operation.selection.length){var o=null===(r=e.operation)||void 0===r?void 0:r.tree.findById(e.operation.selection.first),a=s.get(o);a||(a=[],s.set(o,a)),o&&o.allowAppend([i])&&a.push(i)}}))})),s.forEach((function(e,t){e.length&&t.append.apply(t,a([],o(e),!1))}))},e.filterResizable=function(e){return void 0===e&&(e=[]),e.filter((function(e){return e.allowResize()}))},e.filterRotatable=function(e){return void 0===e&&(e=[]),e.filter((function(e){return e.allowRotate()}))},e.filterScalable=function(e){return void 0===e&&(e=[]),e.filter((function(e){return e.allowScale()}))},e.filterRoundable=function(e){return void 0===e&&(e=[]),e.filter((function(e){return e.allowRound()}))},e.filterTranslatable=function(e){return void 0===e&&(e=[]),e.filter((function(e){return e.allowTranslate()}))},e.filterDraggable=function(e){return void 0===e&&(e=[]),e.reduce((function(e,t){var n;if(!t.allowDrag())return e;if(Designable.Shared.isFn(null===(n=null==t?void 0:t.designerProps)||void 0===n?void 0:n.getDragNodes)){var r=t.designerProps.getDragNodes(t);return r?e.concat(r):e}return"$$ResourceNode$$"===t.componentName?e.concat(t.children):e.concat([t])}),[])},e.filterDroppable=function(e,t){return void 0===e&&(e=[]),e.reduce((function(e,n){var r;if(!n.allowDrop(t))return e;if(Designable.Shared.isFn(null===(r=n.designerProps)||void 0===r?void 0:r.getDropNodes)){var i=n.isSourceNode?n.clone(n.parent):n,o=n.designerProps.getDropNodes(i,t);return o?e.concat(o):e}return"$$ResourceNode$$"===n.componentName?e.concat(n.children):e.concat([n])}),[])},e}(),at=function(){function e(e){var t,n;this.scrollX=0,this.scrollY=0,this.width=0,this.height=0,this.mounted=!1,this.nodeElementsStore={},this.workspace=e.workspace,this.engine=e.engine,this.moveSensitive=null!==(t=e.moveSensitive)&&void 0!==t&&t,this.moveInsertionType=null!==(n=e.moveInsertionType)&&void 0!==n?n:"all",this.viewportElement=e.viewportElement,this.contentWindow=e.contentWindow,this.nodeIdAttrName=e.nodeIdAttrName,this.digestViewport(),this.makeObservable(),this.attachEvents()}return Object.defineProperty(e.prototype,"isScrollLeft",{get:function(){return 0===this.scrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isScrollTop",{get:function(){return 0===this.scrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isScrollRight",{get:function(){var e,t,n;return this.isIframe?this.width+this.contentWindow.scrollX>=(null===(n=null===(t=null===(e=this.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body)||void 0===n?void 0:n.scrollWidth):this.viewportElement?this.viewportElement.offsetWidth+this.scrollX>=this.viewportElement.scrollWidth:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isScrollBottom",{get:function(){var e,t;return this.isIframe?!!(null===(t=null===(e=this.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body)&&this.height+this.contentWindow.scrollY>=this.contentWindow.document.body.scrollHeight:this.viewportElement?!!this.viewportElement&&this.viewportElement.offsetHeight+this.viewportElement.scrollTop>=this.viewportElement.scrollHeight:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportRoot",{get:function(){var e,t;return this.isIframe?null===(t=null===(e=this.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.body:this.viewportElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMaster",{get:function(){return this.contentWindow===Designable.Shared.globalThisPolyfill},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isIframe",{get:function(){var e;return!!(null===(e=this.contentWindow)||void 0===e?void 0:e.frameElement)&&!this.isMaster},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scrollContainer",{get:function(){return this.isIframe?this.contentWindow:this.viewportElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rect",{get:function(){var e=this.viewportElement;if(e)return e.getBoundingClientRect()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"innerRect",{get:function(){var e=this.rect;return new Designable.Shared.Rect(0,0,null==e?void 0:e.width,null==e?void 0:e.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){var e=this.rect;return e?e.x:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){var e=this.rect;return e?e.y:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){if(!this.viewportElement)return 1;var e=this.viewportElement.getBoundingClientRect(),t=this.viewportElement.offsetWidth;return e.width&&t?Math.round(e.width/t):1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dragScrollXDelta",{get:function(){return this.scrollX-this.dragStartSnapshot.scrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dragScrollYDelta",{get:function(){return this.scrollY-this.dragStartSnapshot.scrollY},enumerable:!1,configurable:!0}),e.prototype.cacheElements=function(){var e,t=this;this.nodeElementsStore={},null===(e=this.viewportRoot)||void 0===e||e.querySelectorAll("*[".concat(this.nodeIdAttrName,"]")).forEach((function(e){var n=e.getAttribute(t.nodeIdAttrName);t.nodeElementsStore[n]=t.nodeElementsStore[n]||[],t.nodeElementsStore[n].push(e)}))},e.prototype.clearCache=function(){this.nodeElementsStore={}},e.prototype.getCurrentData=function(){var e,t,n,r,i,o,a,s,u={};return this.isIframe?(u.scrollX=(null===(e=this.contentWindow)||void 0===e?void 0:e.scrollX)||0,u.scrollY=(null===(t=this.contentWindow)||void 0===t?void 0:t.scrollY)||0,u.width=(null===(n=this.contentWindow)||void 0===n?void 0:n.innerWidth)||0,u.height=(null===(r=this.contentWindow)||void 0===r?void 0:r.innerHeight)||0):this.viewportElement&&(u.scrollX=(null===(i=this.viewportElement)||void 0===i?void 0:i.scrollLeft)||0,u.scrollY=(null===(o=this.viewportElement)||void 0===o?void 0:o.scrollTop)||0,u.width=(null===(a=this.viewportElement)||void 0===a?void 0:a.clientWidth)||0,u.height=(null===(s=this.viewportElement)||void 0===s?void 0:s.clientHeight)||0),u},e.prototype.takeDragStartSnapshot=function(){this.dragStartSnapshot=this.getCurrentData()},e.prototype.digestViewport=function(){Object.assign(this,this.getCurrentData())},e.prototype.elementFromPoint=function(e){var t;if(null===(t=this.contentWindow)||void 0===t?void 0:t.document)return this.contentWindow.document.elementFromPoint(e.x,e.y)},e.prototype.matchViewport=function(e){var t;return this.isIframe?e===this.viewportElement||e===this.contentWindow||e===(null===(t=this.contentWindow)||void 0===t?void 0:t.document):e===this.viewportElement},e.prototype.attachEvents=function(){var e=this,t=this.engine;Designable.Shared.cancelIdle(this.attachRequest),this.attachRequest=Designable.Shared.requestIdle((function(){t&&(e.isIframe?e.workspace.attachEvents(e.contentWindow,e.contentWindow):Designable.Shared.isHTMLElement(e.viewportElement)&&e.workspace.attachEvents(e.viewportElement,e.contentWindow))}))},e.prototype.detachEvents=function(){this.isIframe?(this.workspace.detachEvents(this.contentWindow),this.workspace.detachEvents(this.viewportElement)):this.viewportElement&&this.workspace.detachEvents(this.viewportElement)},e.prototype.onMount=function(e,t){this.mounted=!0,this.viewportElement=e,this.contentWindow=t,this.attachEvents(),this.digestViewport()},e.prototype.onUnmount=function(){this.mounted=!1,this.detachEvents()},e.prototype.isPointInViewport=function(e,t){return!!this.rect&&(!!this.containsElement(document.elementFromPoint(e.x,e.y))&&Designable.Shared.isPointInRect(e,this.rect,t))},e.prototype.isRectInViewport=function(e){return!(!this.rect||!e)&&(!!this.containsElement(document.elementFromPoint(e.x,e.y))&&Designable.Shared.isRectInRect(e,this.rect))},e.prototype.isPointInViewportArea=function(e,t){return!!this.rect&&Designable.Shared.isPointInRect(e,this.rect,t)},e.prototype.isOffsetPointInViewport=function(e,t){return!!this.innerRect&&(!!this.containsElement(document.elementFromPoint(e.x,e.y))&&Designable.Shared.isPointInRect(e,this.innerRect,t))},e.prototype.isOffsetRectInViewport=function(e){return!!this.innerRect&&(!!this.containsElement(document.elementFromPoint(e.x,e.y))&&Designable.Shared.isRectInRect(e,this.innerRect))},e.prototype.makeObservable=function(){Formily.Reactive.define(this,{scrollX:Formily.Reactive.observable.ref,scrollY:Formily.Reactive.observable.ref,width:Formily.Reactive.observable.ref,height:Formily.Reactive.observable.ref,digestViewport:Formily.Reactive.action,viewportElement:Formily.Reactive.observable.ref,contentWindow:Formily.Reactive.observable.ref})},e.prototype.findElementById=function(e){var t;if(e)return this.nodeElementsStore[e]?this.nodeElementsStore[e][0]:null===(t=this.viewportRoot)||void 0===t?void 0:t.querySelector("*[".concat(this.nodeIdAttrName,"='").concat(e,"']"))},e.prototype.findElementsById=function(e){var t,n;return e?this.nodeElementsStore[e]?this.nodeElementsStore[e]:Array.from(null!==(n=null===(t=this.viewportRoot)||void 0===t?void 0:t.querySelectorAll("*[".concat(this.nodeIdAttrName,"='").concat(e,"']")))&&void 0!==n?n:[]):[]},e.prototype.containsElement=function(e){var t=this.viewportElement;return t===e||(null==t?void 0:t.contains(e))},e.prototype.getOffsetPoint=function(e){var t=this.getCurrentData();return{x:e.x-this.offsetX+t.scrollX,y:e.y-this.offsetY+t.scrollY}},e.prototype.getElementRect=function(e){var t=e.getBoundingClientRect(),n=e.offsetWidth?e.offsetWidth:t.width,r=e.offsetHeight?e.offsetHeight:t.height;return new Designable.Shared.Rect(t.x,t.y,1!==this.scale?n:t.width,1!==this.scale?r:t.height)},e.prototype.getElementRectById=function(e){var t=this,n=this.findElementsById(e),r=Designable.Shared.calcBoundingRect(n.map((function(e){return t.getElementRect(e)})));if(r)return this.isIframe?new Designable.Shared.Rect(r.x+this.offsetX,r.y+this.offsetY,r.width,r.height):new Designable.Shared.Rect(r.x,r.y,r.width,r.height)},e.prototype.getElementOffsetRect=function(e){var t=e.getBoundingClientRect();if(t)return this.isIframe?new Designable.Shared.Rect(t.x+this.contentWindow.scrollX,t.y+this.contentWindow.scrollY,t.width,t.height):new Designable.Shared.Rect((t.x-this.offsetX+this.viewportElement.scrollLeft)/this.scale,(t.y-this.offsetY+this.viewportElement.scrollTop)/this.scale,t.width,t.height)},e.prototype.getElementOffsetRectById=function(e){var t=this,n=this.findElementsById(e);if(n.length){var r=Designable.Shared.calcBoundingRect(n.map((function(e){return t.getElementRect(e)})));return r?this.isIframe?new Designable.Shared.Rect(r.x+this.contentWindow.scrollX,r.y+this.contentWindow.scrollY,r.width,r.height):new Designable.Shared.Rect((r.x-this.offsetX+this.viewportElement.scrollLeft)/this.scale,(r.y-this.offsetY+this.viewportElement.scrollTop)/this.scale,r.width,r.height):void 0}},e.prototype.getValidNodeElement=function(e){var t=this,n=function(e){if(e){var r=t.findElementById(e.id);return r||n(e.parent)}};return n(e)},e.prototype.getChildrenRect=function(e){var t,n=this;if(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length)return Designable.Shared.calcBoundingRect(e.children.reduce((function(e,t){var r=n.getValidNodeRect(t);return r?e.concat(r):e}),[]))},e.prototype.getChildrenOffsetRect=function(e){var t,n=this;if(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length)return Designable.Shared.calcBoundingRect(e.children.reduce((function(e,t){var r=n.getValidNodeOffsetRect(t);return r?e.concat(r):e}),[]))},e.prototype.getValidNodeRect=function(e){if(e){var t=this.getElementRectById(e.id);return e&&e===e.root&&e.isInOperation?t?Designable.Shared.calcBoundingRect([this.rect,t]):this.rect:t||this.getChildrenRect(e)}},e.prototype.getValidNodeOffsetRect=function(e){if(e){var t=this.getElementOffsetRectById(e.id);return e&&e===e.root&&e.isInOperation?t?Designable.Shared.calcBoundingRect([this.innerRect,t]):this.innerRect:t||this.getChildrenOffsetRect(e)}},e.prototype.getValidNodeLayout=function(e){var t,n;return e?(null===(n=null===(t=e.parent)||void 0===t?void 0:t.designerProps)||void 0===n?void 0:n.inlineChildrenLayout)?"horizontal":Designable.Shared.calcElementLayout(this.findElementById(e.id)):"vertical"},e}(),st=function(){function e(e){this.selected=[],this.indexes={},e.selected&&(this.selected=e.selected),e.operation&&(this.operation=e.operation),this.makeObservable()}return e.prototype.makeObservable=function(){Formily.Reactive.define(this,{selected:Formily.Reactive.observable,select:Formily.Reactive.action,batchSelect:Formily.Reactive.action,add:Formily.Reactive.action,remove:Formily.Reactive.action,clear:Formily.Reactive.action,crossAddTo:Formily.Reactive.action})},e.prototype.trigger=function(e){return void 0===e&&(e=N),this.operation.dispatch(new e({target:this.operation.tree,source:this.selectedNodes}))},e.prototype.select=function(e){var t;if(Designable.Shared.isStr(e)){if(1===this.selected.length&&this.selected.includes(e))return void this.trigger(N);this.selected=[e],this.indexes=((t={})[e]=!0,t),this.trigger(N)}else this.select(null==e?void 0:e.id)},e.prototype.safeSelect=function(e){e&&this.select(e)},e.prototype.mapIds=function(e){return Designable.Shared.isArr(e)?e.map((function(e){return Designable.Shared.isStr(e)?e:null==e?void 0:e.id})):[]},e.prototype.batchSelect=function(e){this.selected=this.mapIds(e),this.indexes=this.selected.reduce((function(e,t){return e[t]=!0,e}),{}),this.trigger(N)},e.prototype.batchSafeSelect=function(e){(null==e?void 0:e.length)&&this.batchSelect(e)},Object.defineProperty(e.prototype,"selectedNodes",{get:function(){var e=this;return this.selected.map((function(t){return e.operation.tree.findById(t)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){if(this.selected&&this.selected.length)return this.selected[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){if(this.selected&&this.selected.length)return this.selected[this.selected.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.selected.length},enumerable:!1,configurable:!0}),e.prototype.add=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.mapIds(t).forEach((function(t){Designable.Shared.isStr(t)?e.selected.includes(t)||(e.selected.push(t),e.indexes[t]=!0):e.add(null==t?void 0:t.id)})),this.trigger()},e.prototype.crossAddTo=function(e){var t=this;if(e.parent){var n=this.selectedNodes;if(this.has(e))this.remove(e);else{var r=n.reduce((function(t,n){return n.distanceTo(e)<t.distanceTo(e)?n:t}),n[0]);if(r)e.crossSiblings(r).forEach((function(e){t.has(e.id)||(t.selected.push(e.id),t.indexes[e.id]=!0)}));this.has(e.id)||(this.selected.push(e.id),this.indexes[e.id]=!0)}}},e.prototype.remove=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.mapIds(t).forEach((function(t){Designable.Shared.isStr(t)?(e.selected=e.selected.filter((function(e){return e!==t})),delete e.indexes[t]):e.remove(null==t?void 0:t.id)})),this.trigger(P)},e.prototype.has=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.mapIds(t).some((function(t){return Designable.Shared.isStr(t)?e.indexes[t]:!!(null==t?void 0:t.id)&&e.has(null==t?void 0:t.id)}))},e.prototype.clear=function(){this.selected=[],this.indexes={},this.trigger(P)},e}(),ut=function(){function e(e){this.node=null,this.operation=null==e?void 0:e.operation,this.makeObservable()}return e.prototype.setHover=function(e){this.node=e||null,this.trigger()},e.prototype.clear=function(){this.node=null},e.prototype.trigger=function(){if(this.operation)return this.operation.dispatch(new S({target:this.operation.tree,source:this.node}))},e.prototype.makeObservable=function(){Formily.Reactive.define(this,{node:Formily.Reactive.observable.ref,setHover:Formily.Reactive.action,clear:Formily.Reactive.action})},e}(),ct=function(){function e(e,t){this.helper=e,this.type=t.type||"normal",this._id=t.id,this.refer=t.refer,this.start=r({},t.start),this.end=r({},t.end),this.distance=t.distance}return Object.defineProperty(e.prototype,"id",{get:function(){var e;return null!==(e=this._id)&&void 0!==e?e:"".concat(this.start.x,"-").concat(this.start.y,"-").concat(this.end.x,"-").concat(this.end.y)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"direction",{get:function(){var e,t;return(null===(e=this.start)||void 0===e?void 0:e.x)===(null===(t=this.end)||void 0===t?void 0:t.x)?"v":"h"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"closest",{get:function(){return this.distance<vt.threshold},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rect",{get:function(){return Designable.Shared.calcRectOfAxisLineSegment(this)},enumerable:!1,configurable:!0}),e.prototype.translate=function(e,t){if(e&&(null==e?void 0:e.parent)){var n=e.parent,r=e.getValidElementOffsetRect(),i=n.getValidElementOffsetRect(),o=Designable.Shared.calcOffsetOfSnapLineSegmentToEdge(this,r);"h"===this.direction?t.y=this.start.y-i.y-o.y:t.x=this.start.x-i.x-o.x}},e.prototype.resize=function(e,t){if(e&&(null==e?void 0:e.parent)){var n=e.parent,r=e.getValidElementOffsetRect(),i=n.getValidElementOffsetRect(),o=Designable.Shared.calcOffsetOfSnapLineSegmentToEdge(this,r),a=this.helper.cursorDragNodesRect,s=this.snapEdge(t);if("h"===this.direction){var u=this.start.y-i.y-o.y;switch(this.helper.direction){case"left-top":case"center-top":case"right-top":if("ht"!==s)return;t.y=u,t.height=a.bottom-u;break;case"left-bottom":case"center-bottom":case"right-bottom":if("hb"!==s)return;t.height=this.start.y-a.top}}else{var c=this.start.x-i.x-o.x;switch(this.helper.direction){case"left-top":case"left-bottom":case"left-center":if("vl"!==s)return;t.x=c,t.width=a.right-c;break;case"right-center":case"right-top":case"right-bottom":if("vr"!==s)return;t.width=this.start.x-a.left}}}},e.prototype.snapEdge=function(e){var t=vt.threshold;if("h"===this.direction){if(Math.abs(this.start.y-e.top)<t)return"ht";if(Math.abs(this.start.y-(e.top+e.height/2))<t)return"hc";if(Math.abs(this.start.y-e.bottom)<t)return"hb"}else{if(Math.abs(this.start.x-e.left)<t)return"vl";if(Math.abs(this.start.x-(e.left+e.width/2))<t)return"vc";if(Math.abs(this.start.x-e.right)<t)return"vr"}},e}(),lt=function(){function e(e,t){this.helper=e,this.distance=t.distance,this.refer=t.refer,this.rect=t.rect,this.type=t.type}return Object.defineProperty(e.prototype,"referRect",{get:function(){if(this.refer)return this.helper.getNodeRect(this.refer)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){var e;return null!==(e=this._id)&&void 0!==e?e:"".concat(this.rect.x,"-").concat(this.rect.y,"-").concat(this.rect.width,"-").concat(this.rect.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){return this.helper.calcAroundSpaceBlocks(this.referRect)[this.type]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extendsLine",{get:function(){if(this.needExtendsLine){var e=this.helper.dragNodesRect;return Designable.Shared.calcExtendsLineSegmentOfRect(e,this.referRect)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needExtendsLine",{get:function(){var e=this.crossDragNodesRect,t=this.crossReferRect;if("top"===this.type||"bottom"===this.type){var n=t.right-e.left,r=e.right-t.left;return n<e.width/2||r<e.width/2}var i=e.bottom-t.top,o=t.bottom-e.top;return i<e.height/2||o<e.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"crossReferRect",{get:function(){var e=this.referRect;return"top"===this.type||"bottom"===this.type?new Designable.Shared.Rect(e.x,this.rect.y,e.width,this.rect.height):new Designable.Shared.Rect(this.rect.x,e.y,this.rect.width,e.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"crossDragNodesRect",{get:function(){var e=this.helper.dragNodesRect;return"top"===this.type||"bottom"===this.type?new Designable.Shared.Rect(e.x,this.rect.y,e.width,this.rect.height):new Designable.Shared.Rect(this.rect.x,e.y,this.rect.width,e.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isometrics",{get:function(){for(var e=[],t=this;t=t.next;)if(Math.abs(t.distance-this.distance)<vt.threshold){if(e.some((function(e){return e.distance!==t.distance})))continue;e.push(t)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"snapLine",{get:function(){if(this.isometrics.length){var e,t=this.next.rect,n=this.referRect;e="top"===this.type?new Designable.Shared.LineSegment({x:t.left,y:n.bottom+t.height},{x:t.right,y:n.bottom+t.height}):"bottom"===this.type?new Designable.Shared.LineSegment({x:t.left,y:n.top-t.height},{x:t.right,y:n.top-t.height}):"left"===this.type?new Designable.Shared.LineSegment({x:n.right+t.width,y:t.top},{x:n.right+t.width,y:t.bottom}):new Designable.Shared.LineSegment({x:n.left-t.width,y:t.top},{x:n.left-t.width,y:t.bottom});var i=Designable.Shared.calcDistanceOfSnapLineToEdges(e,this.helper.dragNodesEdgeLines);return new ct(this.helper,r(r({},e),{distance:i,type:"space-block"}))}},enumerable:!1,configurable:!0}),e}();e.CursorStatus=void 0,(Me=e.CursorStatus||(e.CursorStatus={})).Normal="NORMAL",Me.DragStart="DRAG_START",Me.Dragging="DRAGGING",Me.DragStop="DRAG_STOP",e.CursorDragType=void 0,(ze=e.CursorDragType||(e.CursorDragType={})).Move="MOVE",ze.Resize="RESIZE",ze.Rotate="ROTATE",ze.Scale="SCALE",ze.Translate="TRANSLATE",ze.Round="ROUND",e.CursorType=void 0,(Xe=e.CursorType||(e.CursorType={})).Normal="NORMAL",Xe.Selection="SELECTION",Xe.Sketch="SKETCH";var ht,ft={pageX:0,pageY:0,clientX:0,clientY:0,topPageX:0,topPageY:0,topClientX:0,topClientY:0},pt=function(e,t){return Object.keys(e||{}).reduce((function(n,r){return Designable.Shared.isValidNumber(null==e?void 0:e[r])&&Designable.Shared.isValidNumber(null==t?void 0:t[r])?n[r]=e[r]-t[r]:n[r]=e[r],n}),{})},dt=function(){function t(t){this.type=e.CursorType.Normal,this.dragType=e.CursorDragType.Move,this.status=e.CursorStatus.Normal,this.position=ft,this.dragAtomDelta=ft,this.dragStartToCurrentDelta=ft,this.dragStartToEndDelta=ft,this.view=Designable.Shared.globalThisPolyfill,this.engine=t,this.makeObservable()}return t.prototype.makeObservable=function(){Formily.Reactive.define(this,{type:Formily.Reactive.observable.ref,dragType:Formily.Reactive.observable.ref,status:Formily.Reactive.observable.ref,position:Formily.Reactive.observable.ref,dragStartPosition:Formily.Reactive.observable.ref,dragEndPosition:Formily.Reactive.observable.ref,dragAtomDelta:Formily.Reactive.observable.ref,dragStartToCurrentDelta:Formily.Reactive.observable.ref,dragStartToEndDelta:Formily.Reactive.observable.ref,view:Formily.Reactive.observable.ref,setStyle:Formily.Reactive.action,setPosition:Formily.Reactive.action,setStatus:Formily.Reactive.action,setType:Formily.Reactive.action})},Object.defineProperty(t.prototype,"speed",{get:function(){return Math.sqrt(Math.pow(this.dragAtomDelta.clientX,2)+Math.pow(this.dragAtomDelta.clientY,2))},enumerable:!1,configurable:!0}),t.prototype.setStatus=function(e){this.status=e},t.prototype.setType=function(e){this.type=e},t.prototype.setDragType=function(e){this.dragType=e},t.prototype.setStyle=function(e){this.engine.workbench.eachWorkspace((function(t){!function(e,t){var n,r,i,o,a=null===(r=null===(n=null===document||void 0===document?void 0:document.getElementsByTagName)||void 0===n?void 0:n.call(document,"html"))||void 0===r?void 0:r[0],s=null===(o=null===(i=null==e?void 0:e.document)||void 0===i?void 0:i.getElementsByTagName("html"))||void 0===o?void 0:o[0];s&&s.style.cursor!==t&&(s.style.cursor=t),a&&a.style.cursor!==t&&(a.style.cursor=t)}(t.viewport.contentWindow,e)}))},t.prototype.setPosition=function(t){this.dragAtomDelta=pt(this.position,t),this.position=r({},t),this.status===e.CursorStatus.Dragging&&(this.dragStartToCurrentDelta=pt(this.position,this.dragStartPosition))},t.prototype.setDragStartPosition=function(e){e?this.dragStartPosition=r({},e):(this.dragStartPosition=null,this.dragStartToCurrentDelta=ft)},t.prototype.setDragEndPosition=function(e){this.dragStartPosition&&(e?(this.dragEndPosition=r({},e),this.dragStartToEndDelta=pt(this.dragStartPosition,this.dragEndPosition)):(this.dragEndPosition=null,this.dragStartToEndDelta=ft))},t}(),vt=function(){function t(e){this.dragNodes=[],this.rulerSnapLines=[],this.aroundSnapLines=[],this.aroundSpaceBlocks=null,this.viewportRectsStore={},this.dragStartTranslateStore={},this.dragStartSizeStore={},this.dragStartNodesRect=null,this.snapping=!1,this.dragging=!1,this.snapped=!1,this.operation=e.operation,this.makeObservable()}return Object.defineProperty(t.prototype,"tree",{get:function(){return this.operation.tree},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{get:function(){return this.operation.engine.cursor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewport",{get:function(){return this.operation.workspace.viewport},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deltaX",{get:function(){return this.cursor.dragStartToCurrentDelta.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deltaY",{get:function(){return this.cursor.dragStartToCurrentDelta.clientY},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorPosition",{get:function(){var e=this.cursor.position;return this.operation.workspace.viewport.getOffsetPoint(new Designable.Shared.Point(e.clientX,e.clientY))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorDragNodesRect",{get:function(){if("translate"===this.type)return new Designable.Shared.Rect(this.cursorPosition.x-this.dragStartCursorOffset.x,this.cursorPosition.y-this.dragStartCursorOffset.y,this.dragNodesRect.width,this.dragNodesRect.height);if("resize"===this.type){var e=this.dragStartNodesRect,t=this.cursor.dragStartToCurrentDelta.clientX,n=this.cursor.dragStartToCurrentDelta.clientY;switch(this.direction){case"left-top":return new Designable.Shared.Rect(this.cursorPosition.x-this.dragStartCursorOffset.x,this.cursorPosition.y-this.dragStartCursorOffset.y,e.width-t,e.height-n);case"left-center":return new Designable.Shared.Rect(this.cursorPosition.x-this.dragStartCursorOffset.x,e.y,e.width-t,e.height);case"left-bottom":return new Designable.Shared.Rect(this.cursorPosition.x-this.dragStartCursorOffset.x,e.y,e.width-t,e.height-n);case"center-top":return new Designable.Shared.Rect(e.x,this.cursorPosition.y-this.dragStartCursorOffset.y,e.width,e.height-n);case"center-bottom":return new Designable.Shared.Rect(e.x,e.y,e.width,e.height+n);case"right-top":return new Designable.Shared.Rect(e.x,this.cursorPosition.y-this.dragStartCursorOffset.y,e.width+t,e.height-n);case"right-center":return new Designable.Shared.Rect(e.x,e.y,e.width+t,e.height);case"right-bottom":return new Designable.Shared.Rect(e.x,e.y,e.width+t,e.height-n)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorDragNodesEdgeLines",{get:function(){return Designable.Shared.calcEdgeLinesOfRect(this.cursorDragNodesRect)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dragNodesRect",{get:function(){return this.draggingNodesRect?this.draggingNodesRect:Designable.Shared.calcBoundingRect(this.dragNodes.map((function(e){return e.getValidElementOffsetRect()})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dragNodesEdgeLines",{get:function(){return Designable.Shared.calcEdgeLinesOfRect(this.dragNodesRect)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorOffset",{get:function(){return new Designable.Shared.Point(this.cursorPosition.x-this.dragNodesRect.x,this.cursorPosition.y-this.dragNodesRect.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dragStartCursor",{get:function(){var e=this.operation.engine.cursor.dragStartPosition;return this.operation.workspace.viewport.getOffsetPoint(new Designable.Shared.Point(e.clientX,e.clientY))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dragStartCursorOffset",{get:function(){return new Designable.Shared.Point(this.dragStartCursor.x-this.dragStartNodesRect.x,this.dragStartCursor.y-this.dragStartNodesRect.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"closestSnapLines",{get:function(){if(!this.dragging)return[];var e=[],n=this.cursorDragNodesEdgeLines;return this.thresholdSnapLines.forEach((function(r){var i=Designable.Shared.calcDistanceOfSnapLineToEdges(r,n);if(i<t.threshold){var o=e.findIndex((function(e){return e.distance>i&&e.distance>0&&e.direction===r.direction}));o>-1&&e.splice(o,1),e.push(r)}})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"closestSpaceBlocks",{get:function(){if(!this.dragging)return[];var e=this.cursorDragNodesEdgeLines;return this.thresholdSpaceBlocks.filter((function(n){var r=n.snapLine;return!!r&&Designable.Shared.calcDistanceOfSnapLineToEdges(r,e)<t.threshold}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thresholdSnapLines",{get:function(){if(!this.dragging)return[];var e=[];for(var t in this.aroundSnapLines.forEach((function(t){e.push(t)})),this.rulerSnapLines.forEach((function(t){t.closest&&e.push(t)})),this.aroundSpaceBlocks){var n=this.aroundSpaceBlocks[t].snapLine;n&&e.push(n)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thresholdSpaceBlocks",{get:function(){var e=[];if(!this.dragging)return[];for(var t in this.aroundSpaceBlocks){var n=this.aroundSpaceBlocks[t];if(!n.snapLine)return[];if(0!==n.snapLine.distance)return[];n.isometrics.length&&(e.push(n),e.push.apply(e,a([],o(n.isometrics),!1)))}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"measurerSpaceBlocks",{get:function(){var e=[];if(!this.dragging||!this.snapped)return[];for(var t in this.aroundSpaceBlocks)this.aroundSpaceBlocks[t]&&e.push(this.aroundSpaceBlocks[t]);return e},enumerable:!1,configurable:!0}),t.prototype.calcBaseTranslate=function(e){var t,n=null!==(t=this.dragStartTranslateStore[e.id])&&void 0!==t?t:{x:0,y:0};return{x:n.x+this.deltaX,y:n.y+this.deltaY}},t.prototype.calcBaseResize=function(e){var t,n,r=this.deltaX,i=this.deltaY,o=null!==(t=this.dragStartTranslateStore[e.id])&&void 0!==t?t:{x:0,y:0},a=null!==(n=this.dragStartSizeStore[e.id])&&void 0!==n?n:{width:0,height:0};switch(this.direction){case"left-top":return new Designable.Shared.Rect(o.x+r,o.y+i,a.width-r,a.height-i);case"left-center":return new Designable.Shared.Rect(o.x+r,o.y,a.width-r,a.height);case"left-bottom":return new Designable.Shared.Rect(o.x+r,o.y,a.width-r,a.height+i);case"center-bottom":return new Designable.Shared.Rect(o.x,o.y,a.width,a.height+i);case"center-top":return new Designable.Shared.Rect(o.x,o.y+i,a.width,a.height-i);case"right-top":return new Designable.Shared.Rect(o.x,o.y+i,a.width+r,a.height-i);case"right-bottom":return new Designable.Shared.Rect(o.x,o.y,a.width+r,a.height+i);case"right-center":return new Designable.Shared.Rect(o.x,o.y,a.width+r,a.height)}},t.prototype.calcDragStartStore=function(e){var t=this;void 0===e&&(e=[]),this.dragStartNodesRect=this.dragNodesRect,e.forEach((function(e){var n=e.getElement(),r=e.getElementOffsetRect();t.dragStartTranslateStore[e.id]=Designable.Shared.calcElementTranslate(n),t.dragStartSizeStore[e.id]={width:r.width,height:r.height}}))},t.prototype.calcRulerSnapLines=function(e){var t=Designable.Shared.calcEdgeLinesOfRect(e);return this.rulerSnapLines.map((function(e){return e.distance=Designable.Shared.calcDistanceOfSnapLineToEdges(e,t),e}))},t.prototype.calcAroundSnapLines=function(e){var n=this,i=[],a=Designable.Shared.calcEdgeLinesOfRect(e);return this.eachViewportNodes((function(s,u){if(!n.dragNodes.includes(s)){var c=Designable.Shared.calcEdgeLinesOfRect(u),l=function(s){var u=o(Designable.Shared.calcClosestEdges(s,a),2),c=u[0],l=u[1],h=Designable.Shared.calcCombineSnapLineSegment(s,l);if(c<t.threshold){if(n.snapping&&0!==c)return;var f=new ct(n,r(r({},h),{distance:c})),p=f.snapEdge(e);("translate"===n.type||"hc"!==p&&"vc"!==p)&&i.push(f)}};c.h.forEach(l),c.v.forEach(l)}})),i},t.prototype.calcAroundSpaceBlocks=function(e){var t=this,n={};return this.eachViewportNodes((function(i,o){if(!Designable.Shared.isEqualRect(e,o)){var a=Designable.Shared.calcSpaceBlockOfRect(e,o);if(a){var s=new lt(t,r({refer:i},a));n[a.type]?s.distance<n[a.type].distance&&(n[a.type]=s):n[a.type]=s}}})),n},t.prototype.calcViewportNodes=function(){var e=this;this.tree.eachTree((function(t){var n=t.getValidElementRect(),r=t.getValidElementOffsetRect();e.dragNodes.includes(t)||e.viewport.isRectInViewport(n)&&(e.viewportRectsStore[t.id]=r)}))},t.prototype.getNodeRect=function(e){return this.viewportRectsStore[e.id]},t.prototype.eachViewportNodes=function(e){for(var t in this.viewportRectsStore)e(this.tree.findById(t),this.viewportRectsStore[t])},t.prototype.translate=function(e,t){var n,r;if(this.dragging){var o=this.calcBaseTranslate(e);this.snapped=!1,this.snapping=!1;try{for(var a=i(this.closestSnapLines),s=a.next();!s.done;s=a.next()){s.value.translate(e,o),this.snapping=!0,this.snapped=!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}t(o),this.snapping&&(this.dragMove(),this.snapping=!1)}},t.prototype.resize=function(e,t){var n,r;if(this.dragging){var o=this.calcBaseResize(e);this.snapping=!1,this.snapping=!1;try{for(var a=i(this.closestSnapLines),s=a.next();!s.done;s=a.next()){s.value.resize(e,o),this.snapping=!0,this.snapped=!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}t(o),this.snapping&&(this.dragMove(),this.snapping=!1)}},t.prototype.findRulerSnapLine=function(e){return this.rulerSnapLines.find((function(t){return t.id===e}))},t.prototype.addRulerSnapLine=function(e){Designable.Shared.isLineSegment(e)&&(this.findRulerSnapLine(e.id)||this.rulerSnapLines.push(new ct(this,r(r({},e),{type:"ruler"}))))},t.prototype.removeRulerSnapLine=function(e){var t=this.rulerSnapLines.findIndex((function(t){return t.id===e}));t>-1&&this.rulerSnapLines.splice(t,1)},t.prototype.dragStart=function(t){var n=null==t?void 0:t.dragNodes,r=null==t?void 0:t.type,i=null==t?void 0:t.direction;if("resize"===r)(o=ot.filterResizable(n)).length&&(this.dragging=!0,this.type=r,this.direction=i,this.dragNodes=o,this.calcDragStartStore(o),this.cursor.setDragType(e.CursorDragType.Resize));else if("translate"===r){(o=ot.filterTranslatable(n)).length&&(this.dragging=!0,this.type=r,this.direction=i,this.dragNodes=o,this.calcDragStartStore(o),this.cursor.setDragType(e.CursorDragType.Translate))}else if("rotate"===r){(o=ot.filterRotatable(n)).length&&(this.dragging=!0,this.type=r,this.dragNodes=o,this.calcDragStartStore(o),this.cursor.setDragType(e.CursorDragType.Rotate))}else if("scale"===r){(o=ot.filterScalable(n)).length&&(this.dragging=!0,this.type=r,this.dragNodes=o,this.calcDragStartStore(o),this.cursor.setDragType(e.CursorDragType.Scale))}else if("round"===r){var o;(o=ot.filterRoundable(n)).length&&(this.dragging=!0,this.type=r,this.dragNodes=o,this.calcDragStartStore(o),this.cursor.setDragType(e.CursorDragType.Round))}this.dragging&&this.calcViewportNodes()},t.prototype.dragMove=function(){this.dragging&&(this.draggingNodesRect=null,this.draggingNodesRect=this.dragNodesRect,this.rulerSnapLines=this.calcRulerSnapLines(this.dragNodesRect),this.aroundSnapLines=this.calcAroundSnapLines(this.dragNodesRect),this.aroundSpaceBlocks=this.calcAroundSpaceBlocks(this.dragNodesRect))},t.prototype.dragEnd=function(){this.dragging=!1,this.viewportRectsStore={},this.dragStartTranslateStore={},this.aroundSnapLines=[],this.draggingNodesRect=null,this.aroundSpaceBlocks=null,this.dragStartNodesRect=null,this.dragNodes=[],this.cursor.setDragType(e.CursorDragType.Move)},t.prototype.makeObservable=function(){Formily.Reactive.define(this,{snapped:Formily.Reactive.observable.ref,dragging:Formily.Reactive.observable.ref,snapping:Formily.Reactive.observable.ref,dragNodes:Formily.Reactive.observable.ref,aroundSnapLines:Formily.Reactive.observable.ref,aroundSpaceBlocks:Formily.Reactive.observable.ref,rulerSnapLines:Formily.Reactive.observable.shallow,closestSnapLines:Formily.Reactive.observable.computed,thresholdSnapLines:Formily.Reactive.observable.computed,thresholdSpaceBlocks:Formily.Reactive.observable.computed,measurerSpaceBlocks:Formily.Reactive.observable.computed,cursor:Formily.Reactive.observable.computed,cursorPosition:Formily.Reactive.observable.computed,cursorOffset:Formily.Reactive.observable.computed,dragStartCursor:Formily.Reactive.observable.computed,translate:Formily.Reactive.action,dragStart:Formily.Reactive.action,dragMove:Formily.Reactive.action,dragEnd:Formily.Reactive.action})},t.threshold=6,t}();e.ClosestPosition=void 0,(ht=e.ClosestPosition||(e.ClosestPosition={})).Before="BEFORE",ht.ForbidBefore="FORBID_BEFORE",ht.After="After",ht.ForbidAfter="FORBID_AFTER",ht.Upper="UPPER",ht.ForbidUpper="FORBID_UPPER",ht.Under="UNDER",ht.ForbidUnder="FORBID_UNDER",ht.Inner="INNER",ht.ForbidInner="FORBID_INNER",ht.InnerAfter="INNER_AFTER",ht.ForbidInnerAfter="FORBID_INNER_AFTER",ht.InnerBefore="INNER_BEFORE",ht.ForbidInnerBefore="FORBID_INNER_BEFORE",ht.Forbid="FORBID";var gt=function(){function t(e){this.dragNodes=[],this.touchNode=null,this.closestNode=null,this.activeViewport=null,this.viewportClosestRect=null,this.outlineClosestRect=null,this.viewportClosestOffsetRect=null,this.outlineClosestOffsetRect=null,this.viewportClosestDirection=null,this.outlineClosestDirection=null,this.dragging=!1,this.operation=e.operation,this.rootNode=this.operation.tree,this.makeObservable()}return Object.defineProperty(t.prototype,"cursor",{get:function(){return this.operation.engine.cursor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewport",{get:function(){return this.operation.workspace.viewport},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outline",{get:function(){return this.operation.workspace.outline},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasDragNodes",{get:function(){return this.dragNodes.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"closestDirection",{get:function(){return this.activeViewport===this.outline?this.outlineClosestDirection:this.viewportClosestDirection},enumerable:!1,configurable:!0}),t.prototype.getClosestLayout=function(e){return e.getValidNodeLayout(this.closestNode)},t.prototype.calcClosestPosition=function(t,n){var r=this,i=this.closestNode;if(!i||!n.isPointInViewport(t))return e.ClosestPosition.Forbid;var s=n.getValidNodeRect(i),u="horizontal"===this.getClosestLayout(n);if(s){var c,l=Designable.Shared.isNearAfter(t,s,"block"!==n.moveInsertionType&&u),h=function(e){var t;if(e)return(null===(t=e.parent)||void 0===t?void 0:t.allowSibling(r.dragNodes))?e.parent:h(e.parent)};return Designable.Shared.isPointInRect(t,s,n.moveSensitive)?i.allowAppend(this.dragNodes)?i.contains.apply(i,a([],o(this.dragNodes),!1))?l?e.ClosestPosition.InnerAfter:e.ClosestPosition.InnerBefore:e.ClosestPosition.Inner:i.allowSibling(this.dragNodes)?u?l?e.ClosestPosition.After:e.ClosestPosition.Before:l?e.ClosestPosition.Under:e.ClosestPosition.Upper:((c=h(i))&&(this.closestNode=c),u?c?l?e.ClosestPosition.After:e.ClosestPosition.Before:l?e.ClosestPosition.ForbidAfter:e.ClosestPosition.ForbidBefore:c?l?e.ClosestPosition.Under:e.ClosestPosition.Upper:l?e.ClosestPosition.ForbidUnder:e.ClosestPosition.ForbidUpper):i===i.root?l?e.ClosestPosition.InnerAfter:e.ClosestPosition.InnerBefore:i.allowSibling(this.dragNodes)?u?l?e.ClosestPosition.After:e.ClosestPosition.Before:l?e.ClosestPosition.Under:e.ClosestPosition.Upper:((c=h(i))&&(this.closestNode=c),u?c?l?e.ClosestPosition.After:e.ClosestPosition.Before:l?e.ClosestPosition.ForbidAfter:e.ClosestPosition.ForbidBefore:c?l?e.ClosestPosition.Under:e.ClosestPosition.Upper:l?e.ClosestPosition.ForbidUnder:e.ClosestPosition.ForbidUpper)}},t.prototype.calcClosestNode=function(e,t){var n,r;if(this.touchNode){var i=t.getValidNodeRect(this.touchNode);if(!i)return;if(null===(r=null===(n=this.touchNode)||void 0===n?void 0:n.children)||void 0===r?void 0:r.length){var o=Designable.Shared.calcDistancePointToEdge(e,i),a=this.touchNode;return this.touchNode.eachChildren((function(n){var r=t.getElementRectById(n.id);if(r){var i=Designable.Shared.isPointInRect(e,r,t.moveSensitive)?0:Designable.Shared.calcDistanceOfPointToRect(e,r);i<=o&&(o=i,a=n)}})),a}return this.touchNode}return this.operation.tree},t.prototype.calcClosestRect=function(t,n){var r=this.closestNode;if(r&&n){var i=t.getValidNodeRect(r);return n===e.ClosestPosition.InnerAfter||n===e.ClosestPosition.InnerBefore?t.getChildrenRect(r):i}},t.prototype.calcClosestOffsetRect=function(t,n){var r=this.closestNode;if(r&&n){var i=t.getValidNodeOffsetRect(r);return n===e.ClosestPosition.InnerAfter||n===e.ClosestPosition.InnerBefore?t.getChildrenOffsetRect(r):i}},t.prototype.dragStart=function(t){var n=ot.filterDraggable(null==t?void 0:t.dragNodes);n.length&&(this.dragNodes=n,this.trigger(new m({target:this.operation.tree,source:this.dragNodes})),this.viewport.cacheElements(),this.cursor.setDragType(e.CursorDragType.Move),this.dragging=!0)},t.prototype.dragMove=function(e){var t=e.point,n=e.touchNode;this.dragging&&(this.outline.isPointInViewport(t,!1)?(this.activeViewport=this.outline,this.touchNode=n,this.closestNode=this.calcClosestNode(t,this.outline)):this.viewport.isPointInViewport(t,!1)&&(this.activeViewport=this.viewport,this.touchNode=n,this.closestNode=this.calcClosestNode(t,this.viewport)),this.activeViewport&&(this.activeViewport===this.outline?(this.outlineClosestDirection=this.calcClosestPosition(t,this.outline),this.viewportClosestDirection=this.outlineClosestDirection):(this.viewportClosestDirection=this.calcClosestPosition(t,this.viewport),this.outlineClosestDirection=this.viewportClosestDirection),this.outline.mounted&&(this.outlineClosestRect=this.calcClosestRect(this.outline,this.outlineClosestDirection),this.outlineClosestOffsetRect=this.calcClosestOffsetRect(this.outline,this.outlineClosestDirection)),this.viewport.mounted&&(this.viewportClosestRect=this.calcClosestRect(this.viewport,this.viewportClosestDirection),this.viewportClosestOffsetRect=this.calcClosestOffsetRect(this.viewport,this.viewportClosestDirection))))},t.prototype.dragDrop=function(e){this.trigger(new w({target:this.operation.tree,source:null==e?void 0:e.dropNode}))},t.prototype.dragEnd=function(){this.dragging=!1,this.dragNodes=[],this.touchNode=null,this.closestNode=null,this.activeViewport=null,this.outlineClosestDirection=null,this.outlineClosestOffsetRect=null,this.outlineClosestRect=null,this.viewportClosestDirection=null,this.viewportClosestOffsetRect=null,this.viewportClosestRect=null,this.viewport.clearCache()},t.prototype.trigger=function(e){if(this.operation)return this.operation.dispatch(e)},t.prototype.makeObservable=function(){Formily.Reactive.define(this,{dragging:Formily.Reactive.observable.ref,dragNodes:Formily.Reactive.observable.ref,touchNode:Formily.Reactive.observable.ref,closestNode:Formily.Reactive.observable.ref,outlineClosestDirection:Formily.Reactive.observable.ref,outlineClosestOffsetRect:Formily.Reactive.observable.ref,outlineClosestRect:Formily.Reactive.observable.ref,viewportClosestDirection:Formily.Reactive.observable.ref,viewportClosestOffsetRect:Formily.Reactive.observable.ref,viewportClosestRect:Formily.Reactive.observable.ref,dragStart:Formily.Reactive.action,dragMove:Formily.Reactive.action,dragEnd:Formily.Reactive.action})},t}(),yt=function(){function e(e){this.requests={snapshot:null},this.engine=e.engine,this.workspace=e,this.tree=new ot(r(r({componentName:this.engine.props.rootComponentName},this.engine.props.defaultComponentTree),{operation:this})),this.hover=new ut({operation:this}),this.selection=new st({operation:this}),this.moveHelper=new gt({operation:this}),this.transformHelper=new vt({operation:this}),this.selection.select(this.tree)}return e.prototype.dispatch=function(e,t){if(!1!==this.workspace.dispatch(e))return Designable.Shared.isFn(t)?t():void 0},e.prototype.snapshot=function(e){var t=this;Designable.Shared.cancelIdle(this.requests.snapshot),this.workspace&&this.workspace.history&&!this.workspace.history.locking&&(this.requests.snapshot=Designable.Shared.requestIdle((function(){t.workspace.history.push(e)})))},e.prototype.from=function(e){e&&(e.tree&&this.tree.from(e.tree),e.selected&&(this.selection.selected=e.selected))},e.prototype.serialize=function(){return{tree:this.tree.serialize(),selected:[this.tree.id]}},e}(),bt=function(){function e(e,t){this.current=0,this.history=[],this.updateTimer=null,this.maxSize=100,this.locking=!1,this.context=e,this.props=t,this.push(),this.makeObservable()}return e.prototype.makeObservable=function(){Formily.Reactive.define(this,{current:Formily.Reactive.observable.ref,history:Formily.Reactive.observable.shallow,push:Formily.Reactive.action,undo:Formily.Reactive.action,redo:Formily.Reactive.action,goTo:Formily.Reactive.action,clear:Formily.Reactive.action})},e.prototype.list=function(){return this.history},e.prototype.push=function(e){var t;if(!this.locking){this.current<this.history.length-1&&(this.history=this.history.slice(0,this.current+1));var n={data:this.context.serialize(),timestamp:Date.now(),type:e};this.current=this.history.length,this.history.push(n);var r=this.history.length-this.maxSize;r>0&&(this.history.splice(0,r),this.current=this.history.length-1),(null===(t=this.props)||void 0===t?void 0:t.onPush)&&this.props.onPush(n)}},Object.defineProperty(e.prototype,"allowUndo",{get:function(){return this.history.length>0&&this.current-1>=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowRedo",{get:function(){return this.history.length>this.current+1},enumerable:!1,configurable:!0}),e.prototype.redo=function(){var e;if(this.allowRedo){var t=this.history[this.current+1];this.locking=!0,this.context.from(t.data),this.locking=!1,this.current++,(null===(e=this.props)||void 0===e?void 0:e.onRedo)&&this.props.onRedo(t)}},e.prototype.undo=function(){var e;if(this.allowUndo){var t=this.history[this.current-1];this.locking=!0,this.context.from(t.data),this.locking=!1,this.current--,(null===(e=this.props)||void 0===e?void 0:e.onUndo)&&this.props.onUndo(t)}},e.prototype.goTo=function(e){var t,n=this.history[e];n&&(this.locking=!0,this.context.from(n.data),this.locking=!1,this.current=e,(null===(t=this.props)||void 0===t?void 0:t.onGoto)&&this.props.onGoto(n))},e.prototype.clear=function(){this.history=[],this.current=0},e}(),mt=function(){function e(e,t){var n=this;this.engine=e,this.props=t,this.id=t.id||Designable.Shared.uid(),this.title=t.title,this.description=t.description,this.viewport=new at({engine:this.engine,workspace:this,viewportElement:t.viewportElement,contentWindow:t.contentWindow,nodeIdAttrName:this.engine.props.nodeIdAttrName,moveSensitive:!0,moveInsertionType:"all"}),this.outline=new at({engine:this.engine,workspace:this,viewportElement:t.viewportElement,contentWindow:t.contentWindow,nodeIdAttrName:this.engine.props.outlineNodeIdAttrName,moveSensitive:!1,moveInsertionType:"block"}),this.operation=new yt(this),this.history=new bt(this,{onPush:function(e){n.operation.dispatch(new q(e))},onRedo:function(e){n.operation.hover.clear(),n.operation.dispatch(new Y(e))},onUndo:function(e){n.operation.hover.clear(),n.operation.dispatch(new V(e))},onGoto:function(e){n.operation.hover.clear(),n.operation.dispatch(new U(e))}})}return e.prototype.getEventContext=function(){return{workbench:this.engine.workbench,workspace:this,engine:this.engine,viewport:this.viewport}},e.prototype.attachEvents=function(e,t){this.engine.attachEvents(e,t,this.getEventContext())},e.prototype.detachEvents=function(e){this.engine.detachEvents(e)},e.prototype.dispatch=function(e){return this.engine.dispatch(e,this.getEventContext())},e.prototype.serialize=function(){return{id:this.id,title:this.title,description:this.description,operation:this.operation.serialize()}},e.prototype.from=function(e){e&&(e.operation&&this.operation.from(e.operation),e.id&&(this.id=e.id),e.title&&(this.title=e.title),e.description&&(this.description=e.description))},e}(),wt=function(){function e(e){this.type="DESIGNABLE",this.engine=e,this.workspaces=[],this.currentWorkspace=null,this.activeWorkspace=null,this.makeObservable()}return e.prototype.makeObservable=function(){Formily.Reactive.define(this,{currentWorkspace:Formily.Reactive.observable.ref,workspaces:Formily.Reactive.observable.shallow,activeWorkspace:Formily.Reactive.observable.ref,type:Formily.Reactive.observable.ref,switchWorkspace:Formily.Reactive.action,addWorkspace:Formily.Reactive.action,removeWorkspace:Formily.Reactive.action,setActiveWorkspace:Formily.Reactive.action,setWorkbenchType:Formily.Reactive.action})},e.prototype.getEventContext=function(){return{engine:this.engine,workbench:this.engine.workbench,workspace:null,viewport:null}},e.prototype.switchWorkspace=function(e){var t=this.findWorkspaceById(e);return t&&(this.currentWorkspace=t,this.engine.dispatch(new z(t))),this.currentWorkspace},e.prototype.setActiveWorkspace=function(e){return this.activeWorkspace=e,e},e.prototype.setWorkbenchType=function(e){this.type=e},e.prototype.addWorkspace=function(e){var t=this.findWorkspaceById(e.id);return t||(this.currentWorkspace=new mt(this.engine,e),this.workspaces.push(this.currentWorkspace),this.engine.dispatch(new j(this.currentWorkspace)),this.currentWorkspace)},e.prototype.removeWorkspace=function(e){var t=this.findWorkspaceIndexById(e);if(t>-1&&t<this.workspaces.length){var n=this.workspaces[t];n.viewport.detachEvents(),this.workspaces.splice(t,1),n===this.currentWorkspace&&(this.workspaces.length&&this.workspaces[t]?this.currentWorkspace=this.workspaces[t]:this.currentWorkspace=this.workspaces[this.workspaces.length-1]),this.engine.dispatch(new M(n))}},e.prototype.ensureWorkspace=function(e){void 0===e&&(e={});var t=this.findWorkspaceById(e.id);return t||(this.addWorkspace(e),this.currentWorkspace)},e.prototype.findWorkspaceById=function(e){return this.workspaces.find((function(t){return t.id===e}))},e.prototype.findWorkspaceIndexById=function(e){return this.workspaces.findIndex((function(t){return t.id===e}))},e.prototype.mapWorkspace=function(e){return this.workspaces.map(e)},e.prototype.eachWorkspace=function(e){this.workspaces.forEach(e)},e}();const St=Designable.Shared.KeyCode;var _t,Rt,Et=function(){function e(e){this.codes=this.parseCodes(e.codes),this.handler=e.handler,this.matcher=e.matcher}return e.prototype.parseCodes=function(e){var t=[];return e.forEach((function(e){Array.isArray(e)?t.push(e):t.push([e])})),t},e.prototype.preventCodes=function(t){var n;if(this.codes.length){for(var r=0;r<t.length;r++)for(var i=null!==(n=this.codes[r])&&void 0!==n?n:[],o=0;o<i.length;o++)if(!e.matchCode(t[o],i[o]))return!1;return!0}return!1},e.prototype.matched=function(e,t){return Designable.Shared.isFn(this.handler)&&e&&this.handler(t),e},e.prototype.match=function(t,n){var r=this;return this.codes.some((function(i){var o=e.sortCodes(i),a=e.sortCodes(t);if(Designable.Shared.isFn(r.matcher))return r.matched(r.matcher(a),n);if(a.length!==o.length)return r.matched(!1,n);for(var s=0;s<o.length;s++)if(!e.matchCode(a[s],o[s]))return r.matched(!1,n);return r.matched(!0,n)}))},e.matchCode=function(e,t){var n,r;return(null===(n=null==e?void 0:e.toLocaleLowerCase)||void 0===n?void 0:n.call(e))===(null===(r=null==t?void 0:t.toLocaleLowerCase)||void 0===r?void 0:r.call(t))},e.sortCodes=function(e){return e.map((function(e){return e.toLocaleLowerCase()})).sort()},e}(),Dt=[["metaKey",Designable.Shared.KeyCode.Meta],["shiftKey",Designable.Shared.KeyCode.Shift],["ctrlKey",Designable.Shared.KeyCode.Control],["altKey",Designable.Shared.KeyCode.Alt]],Ct=function(){function e(e){var t;this.shortcuts=[],this.sequence=[],this.keyDown=null,this.modifiers={},this.requestTimer=null,this.engine=e,this.shortcuts=(null===(t=e.props)||void 0===t?void 0:t.shortcuts)||[],this.makeObservable()}return e.prototype.matchCodes=function(e){for(var t=0;t<this.shortcuts.length;t++){if(this.shortcuts[t].match(this.sequence,e))return!0}return!1},e.prototype.preventCodes=function(){var e=this;return this.shortcuts.some((function(t){return t.preventCodes(e.sequence)}))},e.prototype.includes=function(e){return this.sequence.some((function(t){return Et.matchCode(t,e)}))},e.prototype.excludes=function(e){this.sequence=this.sequence.filter((function(t){return!Et.matchCode(e,t)}))},e.prototype.addKeyCode=function(e){this.includes(e)||this.sequence.push(e)},e.prototype.removeKeyCode=function(e){this.includes(e)&&this.excludes(e)},e.prototype.isModifier=function(e){return Dt.some((function(t){return Et.matchCode(t[1],e)}))},e.prototype.handleModifiers=function(e){var t=this;Dt.forEach((function(n){var r=o(n,2),i=r[0],a=r[1];e[i]&&(t.includes(a)||(t.sequence=[a].concat(t.sequence)))}))},e.prototype.handleKeyboard=function(e,t){"keydown"===e.eventType?(this.keyDown=e.data,this.addKeyCode(this.keyDown),this.handleModifiers(e),this.matchCodes(t)&&(this.sequence=[]),this.requestClean(4e3),this.preventCodes()&&(e.preventDefault(),e.stopPropagation())):(this.isModifier(e.data)&&(this.sequence=[]),this.keyDown=null)},e.prototype.isKeyDown=function(e){return this.keyDown===e},e.prototype.requestClean=function(e){var t=this;void 0===e&&(e=320),clearTimeout(this.requestTimer),this.requestTimer=setTimeout((function(){t.keyDown=null,t.sequence=[],clearTimeout(t.requestTimer)}),e)},e.prototype.makeObservable=function(){Formily.Reactive.define(this,{sequence:Formily.Reactive.observable.shallow,keyDown:Formily.Reactive.observable.ref,handleKeyboard:Formily.Reactive.action})},e}();e.ScreenType=void 0,(_t=e.ScreenType||(e.ScreenType={})).PC="PC",_t.Responsive="Responsive",_t.Mobile="Mobile",_t.Sketch="Sketch",e.ScreenStatus=void 0,(Rt=e.ScreenStatus||(e.ScreenStatus={})).Normal="Normal",Rt.Resizing="Resizing",Rt.Zooming="Zooming";var Nt=function(){function t(t){this.scale=1,this.width="100%",this.height="100%",this.background="",this.flip=!1,this.status=e.ScreenStatus.Normal,this.engine=t,this.type=t.props.defaultScreenType,this.makeObservable()}return t.prototype.makeObservable=function(){Formily.Reactive.define(this,{type:Formily.Reactive.observable.ref,scale:Formily.Reactive.observable.ref,width:Formily.Reactive.observable.ref,height:Formily.Reactive.observable.ref,status:Formily.Reactive.observable.ref,flip:Formily.Reactive.observable.ref,background:Formily.Reactive.observable.ref,setType:Formily.Reactive.action,setScale:Formily.Reactive.action,setSize:Formily.Reactive.action,resetSize:Formily.Reactive.action,setBackground:Formily.Reactive.action,setFlip:Formily.Reactive.action})},t.prototype.setStatus=function(e){this.status=e},t.prototype.setType=function(e){this.type=e},t.prototype.setScale=function(e){this.scale=e},t.prototype.setSize=function(e,t){e&&(this.width=e),t&&(this.height=t)},t.prototype.resetSize=function(){this.width="100%",this.height="100%"},t.prototype.setBackground=function(e){this.background=e},t.prototype.setFlip=function(e){this.flip=e},t}(),Pt=function(t){function i(e){var n=t.call(this,e)||this;return n.props=r(r({},i.defaultProps),e),n.init(),n.id=Designable.Shared.uid(),n}return n(i,t),i.prototype.init=function(){this.workbench=new wt(this),this.screen=new Nt(this),this.cursor=new dt(this),this.keyboard=new Ct(this)},i.prototype.setCurrentTree=function(e){this.workbench.currentWorkspace&&this.workbench.currentWorkspace.operation.tree.from(e)},i.prototype.getCurrentTree=function(){var e,t,n;return null===(n=null===(t=null===(e=this.workbench)||void 0===e?void 0:e.currentWorkspace)||void 0===t?void 0:t.operation)||void 0===n?void 0:n.tree},i.prototype.getAllSelectedNodes=function(){for(var e=[],t=0;t<this.workbench.workspaces.length;t++){var n=this.workbench.workspaces[t];e=e.concat(n.operation.selection.selectedNodes)}return e},i.prototype.findNodeById=function(e){return ot.findById(e)},i.prototype.findMovingNodes=function(){var e=[];return this.workbench.eachWorkspace((function(t){var n;null===(n=t.operation.moveHelper.dragNodes)||void 0===n||n.forEach((function(t){e.includes(t)||e.push(t)}))})),e},i.prototype.createNode=function(e,t){return new ot(e,t)},i.prototype.mount=function(){this.attachEvents(Designable.Shared.globalThisPolyfill)},i.prototype.unmount=function(){this.detachEvents()},i.defaultProps={shortcuts:[],effects:[],drivers:[],rootComponentName:"Root",sourceIdAttrName:"data-designer-source-id",nodeIdAttrName:"data-designer-node-id",contentEditableAttrName:"data-content-editable",contentEditableNodeIdAttrName:"data-content-editable-node-id",clickStopPropagationAttrName:"data-click-stop-propagation",nodeSelectionIdAttrName:"data-designer-node-helpers-id",nodeDragHandlerAttrName:"data-designer-node-drag-handler",screenResizeHandlerAttrName:"data-designer-screen-resize-handler",nodeResizeHandlerAttrName:"data-designer-node-resize-handler",outlineNodeIdAttrName:"data-designer-outline-node-id",nodeTranslateAttrName:"data-designer-node-translate-handler",defaultScreenType:e.ScreenType.PC},i}(Designable.Shared.Event);function kt(e){var t=Designable.Shared.globalThisPolyfill.getSelection();if(!t.containsNode(e)){var n=function(e){for(var t=[],n=0;n<e.rangeCount;n++){var r=e.getRangeAt(n);t[n]={collapsed:r.collapsed,startOffset:r.startOffset,endOffset:r.endOffset}}return t}(t);return function(t){void 0===t&&(t=0);var r=Designable.Shared.globalThisPolyfill.getSelection(),i=e.childNodes[0];i&&(r.removeAllRanges(),n.forEach((function(e){var n=document.createRange();n.collapse(e.collapsed),n.setStart(i,e.startOffset+t),n.setEnd(i,e.endOffset+t),r.addRange(n)})))}}}var xt,Ot=new Et({codes:[[St.Meta],[St.Control]]}),Tt=new Et({codes:[St.Shift]}),At=new Et({codes:[[St.Meta,St.X],[St.Control,St.X]]}),It=new Et({codes:[[St.Meta,St.A],[St.Control,St.A]],handler:function(e){var t=null==e?void 0:e.workspace.operation;if(t){var n=t.tree;t.selection.batchSelect(n.descendants)}}}),Ft=new Et({codes:[[St.Backspace],[St.Delete]],handler:function(e){var t=null==e?void 0:e.workspace.operation;t&&ot.remove(t.selection.selectedNodes)}}),Bt={nodes:[]},Lt=new Et({codes:[[St.Meta,St.C],[St.Control,St.C]],handler:function(e){var t=null==e?void 0:e.workspace.operation;t&&(Bt.nodes=t.selection.selectedNodes)}}),Wt=new Et({codes:[[St.Meta,St.V],[St.Control,St.V]],handler:function(e){(null==e?void 0:e.workspace.operation)&&ot.clone(Bt.nodes)}}),jt=new Et({codes:[[St.Meta,St.Z],[St.Control,St.Z]],handler:function(e){var t=null==e?void 0:e.workspace;t&&t.history.undo(),t.operation.hover.clear()}}),Mt=new Et({codes:[[St.Meta,St.Shift,St.Z],[St.Control,St.Shift,St.Z]],handler:function(e){var t=null==e?void 0:e.workspace;t&&t.history.redo(),t.operation.hover.clear()}}),zt=new Et({codes:[St.Shift,St.S],handler:function(t){var n=null==t?void 0:t.engine;n&&n.cursor.setType(e.CursorType.Selection)}}),Xt=function(e){return e&&e.lastChild?Xt(e.lastChild):e},Vt=function(e){var t;return e.parent?(null===(t=e.parent)||void 0===t?void 0:t.next)?e.parent.next:Vt(e.parent):e},Yt=new Et({codes:[[St.Up],[St.PageUp],[St.ArrowUp],[St.Left],[St.LeftWindowKey],[St.ArrowLeft]],handler:function(e){var t=null==e?void 0:e.workspace.operation;if(t){var n=t.tree,r=t.selection,i=n.findById(r.last);if(i){var o=i.previous;if(o)(a=Xt(o))?r.select(a):r.select(o);else if(i.parent)r.select(i.parent);else{var a;(a=Xt(i.lastChild))&&r.select(a)}}}}}),Ut=new Et({codes:[[St.Down],[St.PageDown],[St.ArrowDown],[St.Right],[St.RightWindowKey],[St.ArrowRight]],handler:function(e){var t=null==e?void 0:e.workspace.operation;if(t){var n=t.tree,r=t.selection,i=n.findById(r.last);if(i){var o=i.firstChild?i.firstChild:i.next;o?r.select(o):r.select(Vt(i))}}}}),qt=[function(t){t.subscribeTo(h,(function(n){t.cursor.dragType===e.CursorDragType.Move&&(t.workbench.eachWorkspace((function(e){var r=e.viewport,i=new Designable.Shared.Point(n.data.topClientX,n.data.topClientY),a=r.getOffsetPoint(new Designable.Shared.Point(t.cursor.dragStartPosition.topClientX,t.cursor.dragStartPosition.topClientY)),s=r.getOffsetPoint(new Designable.Shared.Point(t.cursor.position.topClientX,t.cursor.position.topClientY));if(r.isPointInViewport(i,!1)){var u=e.operation.tree,c=Designable.Shared.calcRectByStartEndPoint(a,s,r.dragScrollXDelta,r.dragScrollYDelta),l=[];u.eachChildren((function(e){var t=r.getValidNodeOffsetRect(e);t&&Designable.Shared.isCrossRectInRect(c,t)&&l.push([e,t])}));var h=l.reduce((function(e,t){var n=o(t,2),r=n[0],i=n[1];return Designable.Shared.isRectInRect(i,c)&&l.some((function(e){return o(e,1)[0].isMyParents(r)}))?e:e.concat(r)}),[]);e.operation.selection.batchSafeSelect(h)}})),t.cursor.type===e.CursorType.Selection&&t.cursor.setType(e.CursorType.Normal))}))},function(t){t.subscribeTo(d,(function(n){t.cursor.setStatus(t.cursor.status===e.CursorStatus.Dragging||t.cursor.status===e.CursorStatus.DragStart?t.cursor.status:e.CursorStatus.Normal),t.cursor.status!==e.CursorStatus.Dragging&&t.cursor.setPosition(n.data)})),t.subscribeTo(l,(function(n){t.cursor.setStatus(e.CursorStatus.DragStart),t.cursor.setDragStartPosition(n.data)})),t.subscribeTo(c,(function(n){t.cursor.setStatus(e.CursorStatus.Dragging),t.cursor.setPosition(n.data)})),t.subscribeTo(h,(function(n){t.cursor.setStatus(e.CursorStatus.DragStop),t.cursor.setDragEndPosition(n.data),t.cursor.setDragStartPosition(null),Designable.Shared.requestIdle((function(){t.cursor.setStatus(e.CursorStatus.Normal)}))})),t.subscribeTo(d,(function(n){var r,i,o=null===(r=null==n?void 0:n.context)||void 0===r?void 0:r.workspace;if(o){var a=o.operation;if(t.cursor.status===e.CursorStatus.Normal){var s=n.data.target,u=null===(i=null==s?void 0:s.closest)||void 0===i?void 0:i.call(s,"\n *[".concat(t.props.nodeIdAttrName,"],\n *[").concat(t.props.outlineNodeIdAttrName,"]\n "));if(null==u?void 0:u.getAttribute){var c=u.getAttribute(t.props.nodeIdAttrName),l=u.getAttribute(t.props.outlineNodeIdAttrName),h=a.tree.findById(c||l);h?a.hover.setHover(h):a.hover.clear()}}else a.hover.clear()}}))},function(e){e.subscribeTo(B,(function(e){var t,n=null===(t=null==e?void 0:e.context)||void 0===t?void 0:t.workspace;if(n){var r=n.viewport,i=n.outline;r.matchViewport(e.data.target)&&r.digestViewport(),i.matchViewport(e.data.target)&&i.digestViewport()}})),e.subscribeTo(L,(function(e){var t,n=null===(t=null==e?void 0:e.context)||void 0===t?void 0:t.workspace;if(n){var r=n.viewport,i=n.outline;r.matchViewport(e.data.target)&&r.digestViewport(),i.matchViewport(e.data.target)&&i.digestViewport()}}))},function(t){t.subscribeTo(l,(function(n){if(t.cursor.type===e.CursorType.Normal){var r=n.data.target,i=null==r?void 0:r.closest("\n *[".concat(t.props.nodeIdAttrName,"],\n *[").concat(t.props.sourceIdAttrName,"],\n *[").concat(t.props.outlineNodeIdAttrName,"]\n ")),o=null==r?void 0:r.closest("*[".concat(t.props.nodeDragHandlerAttrName,"]")),a=null==o?void 0:o.closest("*[".concat(t.props.nodeSelectionIdAttrName,"]"));if((null==i?void 0:i.getAttribute)||o){var s=null==i?void 0:i.getAttribute(t.props.sourceIdAttrName),u=null==i?void 0:i.getAttribute(t.props.outlineNodeIdAttrName),c=null==a?void 0:a.getAttribute(t.props.nodeSelectionIdAttrName),l=null==i?void 0:i.getAttribute(t.props.nodeIdAttrName);t.workbench.eachWorkspace((function(e){var n=e.operation.moveHelper;if(l||u||c){var r=t.findNodeById(u||l||c);if(r){if(!r.allowDrag())return;if(r===r.root)return;var i=t.getAllSelectedNodes().filter((function(e){return e.allowDrag()}));i.some((function(e){return e===r}))?n.dragStart({dragNodes:ot.sort(i)}):n.dragStart({dragNodes:[r]})}}else if(s){var o=t.findNodeById(s);o&&n.dragStart({dragNodes:[o]})}})),t.cursor.setStyle("move")}}})),t.subscribeTo(c,(function(n){if(t.cursor.type===e.CursorType.Normal&&t.cursor.dragType===e.CursorDragType.Move){var r=n.data.target,i=null==r?void 0:r.closest("\n *[".concat(t.props.nodeIdAttrName,"],\n *[").concat(t.props.outlineNodeIdAttrName,"]\n ")),o=new Designable.Shared.Point(n.data.topClientX,n.data.topClientY),a=null==i?void 0:i.getAttribute(t.props.nodeIdAttrName),s=null==i?void 0:i.getAttribute(t.props.outlineNodeIdAttrName);t.workbench.eachWorkspace((function(e){var t=e.operation,n=t.moveHelper,r=n.dragNodes,i=t.tree;if(r.length){var u=i.findById(s||a);n.dragMove({point:o,touchNode:u})}}))}})),t.subscribeTo(L,(function(n){var r,i;if(t.cursor.type===e.CursorType.Normal&&t.cursor.dragType===e.CursorDragType.Move){var o=new Designable.Shared.Point(t.cursor.position.topClientX,t.cursor.position.topClientY),a=null!==(i=null===(r=null==n?void 0:n.context)||void 0===r?void 0:r.workspace)&&void 0!==i?i:t.workbench.activeWorkspace;if(a){var s=a.operation,u=s.moveHelper;if(u.dragNodes.length){var c=s.tree,l=a.viewport,h=a.outline,f=l.elementFromPoint(o),p=h.elementFromPoint(o),d=null==f?void 0:f.closest("\n *[".concat(t.props.nodeIdAttrName,"],\n *[").concat(t.props.outlineNodeIdAttrName,"]\n ")),v=null==p?void 0:p.closest("\n *[".concat(t.props.nodeIdAttrName,"],\n *[").concat(t.props.outlineNodeIdAttrName,"]\n ")),g=null==d?void 0:d.getAttribute(t.props.nodeIdAttrName),y=null==v?void 0:v.getAttribute(t.props.outlineNodeIdAttrName),b=c.findById(y||g);u.dragMove({point:o,touchNode:b})}}}})),t.subscribeTo(h,(function(){t.cursor.type===e.CursorType.Normal&&t.cursor.dragType===e.CursorDragType.Move&&(t.workbench.eachWorkspace((function(t){var n=t.operation,r=n.moveHelper,i=r.dragNodes,s=r.closestNode,u=r.closestDirection,c=n.selection;i.length&&(i.length&&s&&u&&(u===e.ClosestPosition.After||u===e.ClosestPosition.Under?s.allowSibling(i)&&c.batchSafeSelect(s.insertAfter.apply(s,a([],o(ot.filterDroppable(i,s.parent)),!1))):u===e.ClosestPosition.Before||u===e.ClosestPosition.Upper?s.allowSibling(i)&&c.batchSafeSelect(s.insertBefore.apply(s,a([],o(ot.filterDroppable(i,s.parent)),!1))):u===e.ClosestPosition.Inner||u===e.ClosestPosition.InnerAfter?s.allowAppend(i)&&(c.batchSafeSelect(s.append.apply(s,a([],o(ot.filterDroppable(i,s)),!1))),r.dragDrop({dropNode:s})):u===e.ClosestPosition.InnerBefore&&s.allowAppend(i)&&(c.batchSafeSelect(s.prepend.apply(s,a([],o(ot.filterDroppable(i,s)),!1))),r.dragDrop({dropNode:s}))),r.dragEnd())})),t.cursor.setStyle(""))}))},function(t){t.subscribeTo(f,(function(n){var r,i,o,a;if(t.cursor.status===e.CursorStatus.Normal){var s=n.data.target,u=null===(r=null==s?void 0:s.closest)||void 0===r?void 0:r.call(s,"\n *[".concat(t.props.nodeIdAttrName,"],\n *[").concat(t.props.outlineNodeIdAttrName,"]\n ")),c=null===(i=null==s?void 0:s.closest)||void 0===i?void 0:i.call(s,"*[".concat(t.props.nodeSelectionIdAttrName,"]")),l=null!==(a=null===(o=n.context)||void 0===o?void 0:o.workspace)&&void 0!==a?a:t.workbench.activeWorkspace;if(l)if(null==u?void 0:u.getAttribute){var h=u.getAttribute(t.props.nodeIdAttrName),f=u.getAttribute(t.props.outlineNodeIdAttrName),p=l.operation,d=p.selection,v=p.tree,g=v.findById(h||f);g?(t.keyboard.requestClean(),t.keyboard.isKeyDown(Designable.Shared.KeyCode.Meta)||t.keyboard.isKeyDown(Designable.Shared.KeyCode.Control)?d.has(g)?d.selected.length>1&&d.remove(g):d.add(g):t.keyboard.isKeyDown(Designable.Shared.KeyCode.Shift)?d.has(g)?d.selected.length>1&&d.remove(g):d.crossAddTo(g):d.select(g)):d.select(v)}else{var y=new Designable.Shared.Point(n.data.topClientX,n.data.topClientY),b=l.operation,m=l.viewport,w=l.outline,S=m.isPointInViewport(y,!1),_=w.isPointInViewport(y,!1);if(c)return;if(S||_){var R=b.selection,E=b.tree;R.select(E)}}}}))},function(e){e.subscribeTo(g,(function(t){var n=e.keyboard;if(n){var r=e.workbench.activeWorkspace||e.workbench.currentWorkspace;n.handleKeyboard(t,r.getEventContext())}})),e.subscribeTo(y,(function(t){var n=e.keyboard;if(n){var r=e.workbench.activeWorkspace||e.workbench.currentWorkspace;n.handleKeyboard(t,r.getEventContext())}}))},function(t){var n=null,r=null,i=null,o=null,a=function(a,s){t.cursor.status===e.CursorStatus.Dragging&&(n=Designable.Shared.calcAutoScrollBasicInfo(a,"x",s.rect),r=Designable.Shared.calcAutoScrollBasicInfo(a,"y",s.rect),n?(i&&i(),i=Designable.Shared.scrollAnimate(s.scrollContainer,"x",n.direction,n.speed)):i&&i(),r?(o&&o(),o=Designable.Shared.scrollAnimate(s.scrollContainer,"y",r.direction,r.speed)):o&&o())};t.subscribeTo(l,(function(){t.workbench.eachWorkspace((function(e){e.viewport.takeDragStartSnapshot()}))})),t.subscribeTo(c,(function(e){t.workbench.eachWorkspace((function(t){var n=t.viewport,r=t.outline,i=new Designable.Shared.Point(e.data.topClientX,e.data.topClientY);r.isPointInViewport(i)?a(i,r):n.isPointInViewport(i)&&a(i,n)}))})),t.subscribeTo(h,(function(){n=null,r=null,i&&i(),o&&o()}))},function(e){e.subscribeWith(["append:node","insert:after","insert:before","insert:children","drag:node","drop:node","prepend:node","remove:node","select:node","update:children","wrap:node","update:node:props"],(function(t){var n;(null===(n=t.context)||void 0===n?void 0:n.workbench)&&e.workbench.setActiveWorkspace(t.context.workspace)})),e.subscribeTo(N,(function(t){e.workbench.eachWorkspace((function(e){e!==t.context.workspace&&e.operation.selection.clear()}))}))},function(e){var t={activeElements:new Map,queue:[],requestTimer:null,isComposition:!1};function n(e){"Enter"===e.key&&(e.stopPropagation(),e.preventDefault())}function r(n){var r=this,i=t.activeElements.get(this);if(n.stopPropagation(),n.preventDefault(),i){var o=n.target,a=function(){if(t.queue.length=0,!t.isComposition){var n=kt(o);Formily.Path.Path.setIn(i.props,r.getAttribute(e.props.contentEditableAttrName),null==o?void 0:o.textContent),Designable.Shared.requestIdle((function(){i.takeSnapshot("update:node:props"),n()}))}};t.queue.push(a),clearTimeout(t.requestTimer),t.requestTimer=setTimeout(a,600)}}function i(){clearTimeout(t.requestTimer),t.requestTimer=setTimeout(t.queue[t.queue.length-1],600)}function o(e){"compositionend"===e.type?(t.isComposition=!1,r(e)):(clearTimeout(t.requestTimer),t.isComposition=!0)}function a(n){n.preventDefault();var r=t.activeElements.get(this),i=n.clipboardData.getData("text"),o=Designable.Shared.globalThisPolyfill.getSelection(),a=n.target,s=o.getRangeAt(0),u=kt(a);s.deleteContents(),s.insertNode(document.createTextNode(i)),Formily.Path.Path.setIn(r.props,this.getAttribute(e.props.contentEditableAttrName),a.textContent),u(i.length)}e.subscribeTo(f,(function(n){var s,u=n.data.target,c=null===(s=null==u?void 0:u.closest)||void 0===s?void 0:s.call(u,"*[".concat(e.props.contentEditableAttrName,"]"));c&&"true"===c.getAttribute("contenteditable")||t.activeElements.forEach((function(e,n){t.activeElements.delete(n),n.removeAttribute("contenteditable"),n.removeAttribute("spellcheck"),n.removeEventListener("input",r),n.removeEventListener("compositionstart",o),n.removeEventListener("compositionupdate",o),n.removeEventListener("compositionend",o),n.removeEventListener("past",a),document.removeEventListener("selectionchange",i)}))})),e.subscribeTo(p,(function(s){var u,c=s.data.target,l=null===(u=null==c?void 0:c.closest)||void 0===u?void 0:u.call(c,"*[".concat(e.props.contentEditableAttrName,"]")),h=e.workbench.activeWorkspace.operation.tree;if(l){var f=l.getAttribute("contenteditable");if("false"===f||!f){var p=function(t){if(t){var n=t.getAttribute(e.props.contentEditableNodeIdAttrName);if(n)return n;var r=t.closest("*[".concat(e.props.nodeIdAttrName,"]"));return r?r.getAttribute(e.props.nodeIdAttrName):void 0}}(l);if(p){var d=h.findById(p);d&&(t.activeElements.set(l,d),l.setAttribute("spellcheck","false"),l.setAttribute("contenteditable","true"),l.focus(),l.addEventListener("input",r),l.addEventListener("compositionstart",o),l.addEventListener("compositionupdate",o),l.addEventListener("compositionend",o),l.addEventListener("keydown",n),l.addEventListener("paste",a),document.addEventListener("selectionchange",i),function(e){var t=document.createRange();t.selectNodeContents(e),t.collapse(!1);var n=Designable.Shared.globalThisPolyfill.getSelection();n.removeAllRanges(),n.addRange(t)}(l))}}}}))},function(t){t.subscribeTo(l,(function(e){var n,r,i=e.data.target,o=null!==(r=null===(n=e.context)||void 0===n?void 0:n.workspace)&&void 0!==r?r:t.workbench.activeWorkspace,a=null==i?void 0:i.closest("*[".concat(t.props.nodeTranslateAttrName,"]"));if(o){var s=o.operation.transformHelper;if(a)if(a.getAttribute(t.props.nodeTranslateAttrName)){var u=a.closest("*[".concat(t.props.nodeSelectionIdAttrName,"]"));if(u){var c=u.getAttribute(t.props.nodeSelectionIdAttrName);if(c){var l=t.findNodeById(c);l&&s.dragStart({dragNodes:[l],type:"translate"})}}}}})),t.subscribeTo(c,(function(n){var r,i;if(t.cursor.dragType===e.CursorDragType.Translate){var o=null!==(i=null===(r=n.context)||void 0===r?void 0:r.workspace)&&void 0!==i?i:t.workbench.activeWorkspace,a=null==o?void 0:o.operation.transformHelper,s=a.dragNodes;s.length&&(a.dragMove(),s.forEach((function(e){var t=e.getElement();a.translate(e,(function(e){t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,0)")}))})))}})),t.subscribeTo(h,(function(n){var r,i;if(t.cursor.dragType===e.CursorDragType.Translate){var o=null!==(i=null===(r=n.context)||void 0===r?void 0:r.workspace)&&void 0!==i?i:t.workbench.activeWorkspace,a=null==o?void 0:o.operation.transformHelper;a&&a.dragEnd()}}))},function(t){t.subscribeTo(l,(function(e){var n,r,i=e.data.target,o=null!==(r=null===(n=e.context)||void 0===n?void 0:n.workspace)&&void 0!==r?r:t.workbench.activeWorkspace;if(o){var a=function(e){var n=null==e?void 0:e.closest("*[".concat(t.props.nodeResizeHandlerAttrName,"]"));if(n){var r=n.getAttribute(t.props.nodeResizeHandlerAttrName);if(r){var i=n.closest("*[".concat(t.props.nodeSelectionIdAttrName,"]"));if(i){var o=i.getAttribute(t.props.nodeSelectionIdAttrName);if(o){var a=t.findNodeById(o);if(a)return{direction:r,node:a,element:i}}}}}}(i),s=o.operation.transformHelper;if(a){var u=a.element.closest("*[".concat(t.props.nodeSelectionIdAttrName,"]"));if(u){var c=u.getAttribute(t.props.nodeSelectionIdAttrName);if(c){var l=t.findNodeById(c);l&&s.dragStart({dragNodes:[l],type:"resize",direction:a.direction})}}}}})),t.subscribeTo(c,(function(n){var r,i;if(t.cursor.dragType===e.CursorDragType.Resize){var o=null!==(i=null===(r=n.context)||void 0===r?void 0:r.workspace)&&void 0!==i?i:t.workbench.activeWorkspace,a=null==o?void 0:o.operation.transformHelper,s=a.dragNodes;s.length&&(a.dragMove(),s.forEach((function(e){var t=e.getElement();a.resize(e,(function(e){t.style.width=e.width+"px",t.style.height=e.height+"px",t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.transform="translate3d(".concat(e.x,"px,").concat(e.y,"px,0)")}))})))}})),t.subscribeTo(h,(function(n){var r,i;if(t.cursor.dragType===e.CursorDragType.Resize){var o=null!==(i=null===(r=n.context)||void 0===r?void 0:r.workspace)&&void 0!==i?i:t.workbench.activeWorkspace,a=null==o?void 0:o.operation.transformHelper;a&&a.dragEnd()}}))}],Ht=[G,K,$,We,je,Ve],Kt=[At,Ot,It,Tt,Ft,Lt,Wt,Yt,Ut,jt,Mt,zt],$t=function(e){return(null==e?void 0:e.Behavior)&&Gt(e.Behavior)},Gt=function(e){return Array.isArray(e)&&e.every(Zt)},Zt=function(e){return(null==e?void 0:e.name)||(null==e?void 0:e.selector)||(null==e?void 0:e.extends)||(null==e?void 0:e.designerProps)||(null==e?void 0:e.designerLocales)},Jt=function(e){return(null==e?void 0:e.Resource)&&Qt(e.Resource)},Qt=function(e){return Array.isArray(e)&&e.every(en)},en=function(e){return(null==e?void 0:e.node)&&!!e.node.isSourceNode&&e.node instanceof ot},tn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n={};return e.forEach((function(e){Ue(n,e)})),n},nn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){if(Designable.Shared.isArr(t))return e.concat(nn.apply(void 0,a([],o(t),!1)));var n=(t||{}).selector;return n?("string"==typeof n&&(t.selector=function(e){return e.componentName===n}),e.concat(t)):e}),[])},rn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return e.concat(r(r({},t),{node:new ot({componentName:"$$ResourceNode$$",isSourceNode:!0,children:t.elements||[]})}))}),[])},on=function(e){void 0===e&&(e={});var t=e.drivers||[],n=e.effects||[],i=e.shortcuts||[];return Formily.Reactive.untracked((function(){return new Pt(r(r({},e),{effects:a(a([],o(n),!1),o(qt),!1),drivers:a(a([],o(t),!1),o(Ht),!1),shortcuts:a(a([],o(i),!1),o(Kt),!1)}))}))},an=Object.freeze({__proto__:null,isBehaviorHost:$t,isBehaviorList:Gt,isBehavior:Zt,isResourceHost:Jt,isResourceList:Qt,isResource:en,createLocales:tn,createBehavior:nn,createResource:rn,createDesigner:on,GlobalRegistry:Qe,Engine:Pt,get ScreenType(){return e.ScreenType},get ScreenStatus(){return e.ScreenStatus},Screen:Nt,get CursorStatus(){return e.CursorStatus},get CursorDragType(){return e.CursorDragType},get CursorType(){return e.CursorType},Cursor:dt,Operation:yt,Viewport:at,TreeNode:ot,Workbench:wt,Workspace:mt,Selection:st,get ClosestPosition(){return e.ClosestPosition},MoveHelper:gt,Keyboard:Ct,KeyCode:St,Shortcut:Et,History:bt,DragMoveEvent:c,DragStartEvent:l,DragStopEvent:h,MouseClickEvent:f,MouseDoubleClickEvent:p,MouseMoveEvent:d,KeyDownEvent:g,KeyUpEvent:y,DragNodeEvent:m,DropNodeEvent:w,HoverNodeEvent:S,InsertAfterEvent:_,InsertBeforeEvent:R,InsertChildrenEvent:E,PrependNodeEvent:D,RemoveNodeEvent:C,SelectNodeEvent:N,UnSelectNodeEvent:P,UpdateChildrenEvent:k,UpdateNodePropsEvent:x,WrapNodeEvent:O,CloneNodeEvent:T,AppendNodeEvent:A,FromNodeEvent:I,ViewportResizeEvent:B,ViewportScrollEvent:L,AddWorkspaceEvent:j,RemoveWorkspaceEvent:M,SwitchWorkspaceEvent:z,HistoryUndoEvent:V,HistoryRedoEvent:Y,HistoryGotoEvent:U,HistoryPushEvent:q});(null===(xt=null===Designable.Shared.globalThisPolyfill||void 0===Designable.Shared.globalThisPolyfill?void 0:Designable.Shared.globalThisPolyfill.Designable)||void 0===xt?void 0:xt.Core)?module.exports&&(module.exports=r({__esModule:!0},Designable.Shared.globalThisPolyfill.Designable.Core)):(Designable.Shared.globalThisPolyfill.Designable=Designable.Shared.globalThisPolyfill.Designable||{},Designable.Shared.globalThisPolyfill.Designable.Core=an),e.AddWorkspaceEvent=j,e.AppendNodeEvent=A,e.CloneNodeEvent=T,e.Cursor=dt,e.DragMoveEvent=c,e.DragNodeEvent=m,e.DragStartEvent=l,e.DragStopEvent=h,e.DropNodeEvent=w,e.Engine=Pt,e.FromNodeEvent=I,e.GlobalRegistry=Qe,e.History=bt,e.HistoryGotoEvent=U,e.HistoryPushEvent=q,e.HistoryRedoEvent=Y,e.HistoryUndoEvent=V,e.HoverNodeEvent=S,e.InsertAfterEvent=_,e.InsertBeforeEvent=R,e.InsertChildrenEvent=E,e.KeyCode=St,e.KeyDownEvent=g,e.KeyUpEvent=y,e.Keyboard=Ct,e.MouseClickEvent=f,e.MouseDoubleClickEvent=p,e.MouseMoveEvent=d,e.MoveHelper=gt,e.Operation=yt,e.PrependNodeEvent=D,e.RemoveNodeEvent=C,e.RemoveWorkspaceEvent=M,e.Screen=Nt,e.SelectNodeEvent=N,e.Selection=st,e.Shortcut=Et,e.SwitchWorkspaceEvent=z,e.TreeNode=ot,e.UnSelectNodeEvent=P,e.UpdateChildrenEvent=k,e.UpdateNodePropsEvent=x,e.Viewport=at,e.ViewportResizeEvent=B,e.ViewportScrollEvent=L,e.Workbench=wt,e.Workspace=mt,e.WrapNodeEvent=O,e.createBehavior=nn,e.createDesigner=on,e.createLocales=tn,e.createResource=rn,e.isBehavior=Zt,e.isBehaviorHost=$t,e.isBehaviorList=Gt,e.isResource=en,e.isResourceHost=Jt,e.isResourceList=Qt,Object.defineProperty(e,"__esModule",{value:!0})}));
|